Documentation ΒΆ
Overview ΒΆ
Package hazelcastcloud is the Hazelcast Cloud API client for Go.
Index ΒΆ
- func AugmentResponse(response *http.Response) ([]byte, error)
- func DoRequestWithClient(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error)
- func New(options ...Option) (*Client, *Response, error)
- func NewFromCredentials(apiKey string, apiSecret string, options ...Option) (*Client, *Response, error)
- func OptionEndpoint(e string) func(*Client)
- type AuthService
- type AwsPeeringService
- type AzurePeeringService
- type Client
- func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error)
- func (c *Client) NewRequest(body *models.GraphqlRequest) (*http.Request, error)
- func (c *Client) NewUploadFileRequest(request *models.GraphqlRequest) (*http.Request, error)
- func (c *Client) OnRequestCompleted(rc RequestCompletionCallback)
- type CloudProviderService
- type EnterpriseClusterService
- type ErrorResponse
- type GcpPeeringService
- type GraphQLQuery
- type HazelcastVersionService
- type InstanceTypeService
- type Option
- type Rate
- type RegionService
- type RequestCompletionCallback
- type Response
- type ServerlessClusterService
- func (svc ServerlessClusterService) Create(ctx context.Context, input *models.CreateServerlessClusterInput) (*models.Cluster, *Response, error)
- func (svc ServerlessClusterService) Delete(ctx context.Context, input *models.ClusterDeleteInput) (*models.ClusterId, *Response, error)
- func (svc ServerlessClusterService) DeleteArtifact(ctx context.Context, request *models.DeleteArtifactInput) (*models.UploadedArtifact, *Response, error)
- func (svc ServerlessClusterService) DownloadArtifact(ctx context.Context, request *models.DownloadArtifactInput) (*models.UploadedArtifactLink, *Response, error)
- func (svc ServerlessClusterService) Get(ctx context.Context, input *models.GetServerlessClusterInput) (*models.Cluster, *Response, error)
- func (svc ServerlessClusterService) List(ctx context.Context) (*[]models.Cluster, *Response, error)
- func (svc ServerlessClusterService) ListUploadedArtifacts(ctx context.Context, request *models.ListUploadedArtifactsInput) (*[]models.UploadedArtifact, *Response, error)
- func (svc ServerlessClusterService) Resume(ctx context.Context, input *models.ClusterResumeInput) (*models.ClusterId, *Response, error)
- func (svc ServerlessClusterService) Stop(ctx context.Context, input *models.ClusterStopInput) (*models.ClusterId, *Response, error)
- func (svc ServerlessClusterService) UploadArtifact(ctx context.Context, request *models.UploadArtifactInput) (*models.UploadedArtifact, *Response, error)
- type StarterClusterService
Examples ΒΆ
- CloudProviderService (List)
- EnterpriseClusterService (Create)
- EnterpriseClusterService (Delete)
- EnterpriseClusterService (Get)
- EnterpriseClusterService (List)
- HazelcastVersionService (List)
- InstanceTypeService (List)
- RegionService (List)
- ServerlessClusterService (Create)
- ServerlessClusterService (Delete)
- ServerlessClusterService (Get)
- ServerlessClusterService (List)
- ServerlessClusterService (Resume)
- ServerlessClusterService (Stop)
- StarterClusterService (Create)
- StarterClusterService (Delete)
- StarterClusterService (Get)
- StarterClusterService (List)
- StarterClusterService (Resume)
- StarterClusterService (Stop)
Constants ΒΆ
This section is empty.
Variables ΒΆ
This section is empty.
Functions ΒΆ
func AugmentResponse ΒΆ
This function augments the response and returns and error if response has
func DoRequestWithClient ΒΆ
func DoRequestWithClient( ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error)
This function does request with the request and client provided.
func NewFromCredentials ΒΆ
func NewFromCredentials(apiKey string, apiSecret string, options ...Option) (*Client, *Response, error)
This function create new client with ApiKey and ApiSecret.
func OptionEndpoint ΒΆ
Types ΒΆ
type AuthService ΒΆ
type AuthService interface {
Login(ctx context.Context, input *models.LoginInput) (*models.Login, *Response, error)
}
This AuthService is used to make authorization operations
func NewAuthService ΒΆ
func NewAuthService(client *Client) AuthService
type AwsPeeringService ΒΆ added in v1.1.0
type AwsPeeringService interface { List(ctx context.Context, input *models.ListAwsPeeringsInput) (*[]models.AwsPeering, *Response, error) Accept(ctx context.Context, input *models.AcceptAwsPeeringInput) (*models.Result, *Response, error) Delete(ctx context.Context, input *models.DeleteAwsPeeringInput) (*models.Result, *Response, error) GetProperties(ctx context.Context, input *models.GetAwsPeeringPropertiesInput) (*models.AwsPeeringProperties, *Response, error) }
func NewAwsPeeringService ΒΆ added in v1.1.0
func NewAwsPeeringService(client *Client) AwsPeeringService
type AzurePeeringService ΒΆ added in v1.1.0
type AzurePeeringService interface { List(ctx context.Context, input *models.ListAzurePeeringsInput) (*[]models.AzurePeering, *Response, error) Delete(ctx context.Context, input *models.DeleteAzurePeeringInput) (*models.Result, *Response, error) GetProperties(ctx context.Context, input *models.GetAzurePeeringPropertiesInput) (*models.AzurePeeringProperties, *Response, error) }
func NewAzurePeeringService ΒΆ added in v1.1.0
func NewAzurePeeringService(client *Client) AzurePeeringService
type Client ΒΆ
type Client struct { BaseURL *url.URL UserAgent string Rate Rate Token string ServerlessCluster ServerlessClusterService StarterCluster StarterClusterService EnterpriseCluster EnterpriseClusterService CloudProvider CloudProviderService Region RegionService InstanceType InstanceTypeService HazelcastVersion HazelcastVersionService Auth AuthService GcpPeering GcpPeeringService AzurePeering AzurePeeringService AwsPeering AwsPeeringService // contains filtered or unexported fields }
This is the main Client.
func (*Client) Do ΒΆ
This function sends http request to the server. Then it creates a response according to type interface provided as v. It returns error if response is not successful.
func (*Client) NewRequest ΒΆ
This function creates a new http request from graphql request. It returns an error if it can not build request.
func (*Client) NewUploadFileRequest ΒΆ added in v1.3.1
func (*Client) OnRequestCompleted ΒΆ
func (c *Client) OnRequestCompleted(rc RequestCompletionCallback)
This is the OnRequestCompleted method to assign callback.
type CloudProviderService ΒΆ
type CloudProviderService interface {
List(ctx context.Context) (*[]models.CloudProvider, *Response, error)
}
This CloudProviderService is used to make operations related with cloud providers
Example (List) ΒΆ
client, _, _ := New() cloudProviders, _, _ := client.CloudProvider.List(context.Background()) fmt.Printf("Result: %#v", cloudProviders)
Output: Result: &[]models.CloudProvider{models.CloudProvider{Name:"aws", IsEnabledForStarter:true, IsEnabledForEnterprise:true}, models.CloudProvider{Name:"azure", IsEnabledForStarter:false, IsEnabledForEnterprise:true}, models.CloudProvider{Name:"google", IsEnabledForStarter:false, IsEnabledForEnterprise:false}}
func NewCloudProviderService ΒΆ
func NewCloudProviderService(client *Client) CloudProviderService
type EnterpriseClusterService ΒΆ
type EnterpriseClusterService interface { Get(ctx context.Context, input *models.GetEnterpriseClusterInput) (*models.Cluster, *Response, error) Create(ctx context.Context, input *models.CreateEnterpriseClusterInput) (*models.Cluster, *Response, error) List(ctx context.Context) (*[]models.Cluster, *Response, error) Delete(ctx context.Context, input *models.ClusterDeleteInput) (*models.ClusterId, *Response, error) ListUploadedArtifacts(ctx context.Context, request *models.ListUploadedArtifactsInput) (*[]models.UploadedArtifact, *Response, error) UploadArtifact(ctx context.Context, request *models.UploadArtifactInput) (*models.UploadedArtifact, *Response, error) DeleteArtifact(ctx context.Context, request *models.DeleteArtifactInput) (*models.UploadedArtifact, *Response, error) DownloadArtifact(ctx context.Context, request *models.DownloadArtifactInput) (*models.UploadedArtifactLink, *Response, error) }
This EnterpriseClusterService is used to make operations related with enterprise clusters
Example (Create) ΒΆ
client, _, _ := New() cluster, _, _ := client.EnterpriseCluster.Create(context.Background(), &models.CreateEnterpriseClusterInput{ Name: "enterprise-cluster", CloudProvider: "aws", Region: "us-east-2", ZoneType: models.ZoneTypeSingle, InstanceType: "m5.large", InstancePerZone: 1, HazelcastVersion: "3.12.6", IsPublicAccessEnabled: true, CidrBlock: "10.18.0.0/16", NativeMemory: 3, IsAutoScalingEnabled: false, IsHotRestartEnabled: false, IsHotBackupEnabled: false, IsTLSEnabled: false, DataStructure: models.DataStructureInput{}, }) fmt.Printf("Result: #%v ", cluster)
Output: Result: &models.Cluster{Id:"53807", CustomerId:10090, Name:"enterprise-cluster", Password:"e75140b884db4e488ecfb77fca92988c", Port:34023, HazelcastVersion:"3.12.6", IsAutoScalingEnabled:false, IsHotBackupEnabled:false, IsHotRestartEnabled:false, IsIpWhitelistEnabled:false, IsTlsEnabled:false, ProductType:struct { Name models.ProductTypeName "json:\"name\""; IsFree bool "json:\"isFree\"" }{Name:"Enterprise", IsFree:false}, State:"PENDING", CreatedAt:"2020-09-08T07:39:38.000Z", StartedAt:"2020-09-08T07:39:38.000Z", StoppedAt:"", Progress:struct { Status string "json:\"status\""; TotalItemCount int "json:\"totalItemCount\""; CompletedItemCount int "json:\"completedItemCount\"" }{Status:"Preparing", TotalItemCount:4, CompletedItemCount:0}, CloudProvider:struct { Name string "json:\"name\""; Region string "json:\"region\""; AvailabilityZones []string "json:\"availabilityZones\"" }{Name:"aws", Region:"us-east-2", AvailabilityZones:[]string{"us-east-2c", "us-east-2a", "us-east-2b"}}, DiscoveryTokens:[]models.DiscoveryToken{models.DiscoveryToken{Source:"public", Token:"RA6aaSPU9B0PouzK9VRYAISRYBFPCmqVl9E5lU737pyCat0NWQ"}}, Specs:struct { TotalMemory float64 "json:\"totalMemory\""; HeapMemory int "json:\"heapMemory\""; NativeMemory int "json:\"nativeMemory\""; Cpu int "json:\"cpu\""; InstanceType string "json:\"instanceType\""; InstancePerZone int "json:\"instancePerZone\"" }{TotalMemory:21, HeapMemory:4, NativeMemory:3, Cpu:1500, InstanceType:"m5.large", InstancePerZone:1}, Networking:struct { Type string "json:\"type\""; CidrBlock string "json:\"cidrBlock\""; Peering struct { IsEnabled bool "json:\"is_enabled\"" } "json:\"peering\""; PrivateLink struct { Url string "json:\"url\""; State string "json:\"state\"" } "json:\"privateLink\"" }{Type:"PUBLIC", CidrBlock:"10.18.0.0/16", Peering:struct { IsEnabled bool "json:\"is_enabled\"" }{IsEnabled:false}, PrivateLink:struct { Url string "json:\"url\""; State string "json:\"state\"" }{Url:"", State:"NOT_ACTIVE"}}, DataStructures:models.DataStructureResponse{MapConfigs:[]models.MapConfigResponse{}, JCacheConfigs:[]models.JCacheConfigResponse{}, ReplicatedMapConfigs:[]models.ReplicatedMapConfigResponse{}, QueueConfigs:[]models.QueueConfigResponse{}, SetConfigs:[]models.SetConfigResponse{}, ListConfigs:[]models.ListConfigResponse{}, TopicConfigs:[]models.TopicConfigResponse{}, MultiMapConfigs:[]models.MultiMapConfigResponse{}, RingBufferConfigs:[]models.RingBufferConfigResponse{}, ReliableTopicConfigs:[]models.ReliableTopicConfigResponse{}}}
Example (Delete) ΒΆ
client, _, _ := New() cluster, _, _ := client.EnterpriseCluster.Delete(context.Background(), &models.ClusterDeleteInput{ClusterId: "53807"}) fmt.Printf("Result: #%v ", cluster)
Output: Result: &models.ClusterId{ClusterId:53805}}
Example (Get) ΒΆ
client, _, _ := New() cluster, _, _ := client.EnterpriseCluster.Get(context.Background(), &models.GetEnterpriseClusterInput{ClusterId: "53807"}) fmt.Printf("Result: #%v ", cluster)
Output: Result: &models.Cluster{Id:"53807", CustomerId:10090, Name:"enterprise-cluster", Password:"e75140b884db4e488ecfb77fca92988c", Port:34023, HazelcastVersion:"3.12.6", IsAutoScalingEnabled:false, IsHotBackupEnabled:false, IsHotRestartEnabled:false, IsIpWhitelistEnabled:false, IsTlsEnabled:false, ProductType:struct { Name models.ProductTypeName "json:\"name\""; IsFree bool "json:\"isFree\"" }{Name:"Enterprise", IsFree:false}, State:"RUNNING", CreatedAt:"2020-09-08T07:39:38.000Z", StartedAt:"2020-09-08T07:50:59.000Z", StoppedAt:"", Progress:struct { Status string "json:\"status\""; TotalItemCount int "json:\"totalItemCount\""; CompletedItemCount int "json:\"completedItemCount\"" }{Status:"Installing Hazelcast", TotalItemCount:0, CompletedItemCount:4}, CloudProvider:struct { Name string "json:\"name\""; Region string "json:\"region\""; AvailabilityZones []string "json:\"availabilityZones\"" }{Name:"aws", Region:"us-east-2", AvailabilityZones:[]string{"us-east-2c", "us-east-2a", "us-east-2b"}}, DiscoveryTokens:[]models.DiscoveryToken{models.DiscoveryToken{Source:"public", Token:"RA6aaSPU9B0PouzK9VRYAISRYBFPCmqVl9E5lU737pyCat0NWQ"}}, Specs:struct { TotalMemory float64 "json:\"totalMemory\""; HeapMemory int "json:\"heapMemory\""; NativeMemory int "json:\"nativeMemory\""; Cpu int "json:\"cpu\""; InstanceType string "json:\"instanceType\""; InstancePerZone int "json:\"instancePerZone\"" }{TotalMemory:21, HeapMemory:4, NativeMemory:3, Cpu:1500, InstanceType:"m5.large", InstancePerZone:1}, Networking:struct { Type string "json:\"type\""; CidrBlock string "json:\"cidrBlock\""; Peering struct { IsEnabled bool "json:\"is_enabled\"" } "json:\"peering\""; PrivateLink struct { Url string "json:\"url\""; State string "json:\"state\"" } "json:\"privateLink\"" }{Type:"PUBLIC", CidrBlock:"10.18.0.0/16", Peering:struct { IsEnabled bool "json:\"is_enabled\"" }{IsEnabled:false}, PrivateLink:struct { Url string "json:\"url\""; State string "json:\"state\"" }{Url:"", State:"NOT_ACTIVE"}}, DataStructures:models.DataStructureResponse{MapConfigs:[]models.MapConfigResponse{}, JCacheConfigs:[]models.JCacheConfigResponse{}, ReplicatedMapConfigs:[]models.ReplicatedMapConfigResponse{}, QueueConfigs:[]models.QueueConfigResponse{}, SetConfigs:[]models.SetConfigResponse{}, ListConfigs:[]models.ListConfigResponse{}, TopicConfigs:[]models.TopicConfigResponse{}, MultiMapConfigs:[]models.MultiMapConfigResponse{}, RingBufferConfigs:[]models.RingBufferConfigResponse{}, ReliableTopicConfigs:[]models.ReliableTopicConfigResponse{}}}
Example (List) ΒΆ
client, _, _ := New() clusters, _, _ := client.EnterpriseCluster.List(context.Background()) fmt.Printf("Result: #%v ", clusters)
Output: Result: &[]models.Cluster{models.Cluster{Id:"53807", CustomerId:10090, Name:"enterprise-cluster", Password:"", Port:34023, HazelcastVersion:"3.12.6", IsAutoScalingEnabled:false, IsHotBackupEnabled:false, IsHotRestartEnabled:false, IsIpWhitelistEnabled:false, IsTlsEnabled:false, ProductType:struct { Name models.ProductTypeName "json:\"name\""; IsFree bool "json:\"isFree\"" }{Name:"Enterprise", IsFree:false}, State:"PENDING", CreatedAt:"2020-09-08T07:39:38.000Z", StartedAt:"2020-09-08T07:39:38.000Z", StoppedAt:"", Progress:struct { Status string "json:\"status\""; TotalItemCount int "json:\"totalItemCount\""; CompletedItemCount int "json:\"completedItemCount\"" }{Status:"Validating Environment", TotalItemCount:4, CompletedItemCount:2}, CloudProvider:struct { Name string "json:\"name\""; Region string "json:\"region\""; AvailabilityZones []string "json:\"availabilityZones\"" }{Name:"aws", Region:"us-east-2", AvailabilityZones:[]string(nil)}, DiscoveryTokens:[]models.DiscoveryToken{}, Specs:struct { TotalMemory float64 "json:\"totalMemory\""; HeapMemory int "json:\"heapMemory\""; NativeMemory int "json:\"nativeMemory\""; Cpu int "json:\"cpu\""; InstanceType string "json:\"instanceType\""; InstancePerZone int "json:\"instancePerZone\"" }{TotalMemory:21, HeapMemory:4, NativeMemory:3, Cpu:1500, InstanceType:"m5.large", InstancePerZone:1}, Networking:struct { Type string "json:\"type\""; CidrBlock string "json:\"cidrBlock\""; Peering struct { IsEnabled bool "json:\"is_enabled\"" } "json:\"peering\""; PrivateLink struct { Url string "json:\"url\""; State string "json:\"state\"" } "json:\"privateLink\"" }{Type:"PUBLIC", CidrBlock:"10.18.0.0/16", Peering:struct { IsEnabled bool "json:\"is_enabled\"" }{IsEnabled:false}, PrivateLink:struct { Url string "json:\"url\""; State string "json:\"state\"" }{Url:"", State:"NOT_ACTIVE"}}, DataStructures:models.DataStructureResponse{MapConfigs:[]models.MapConfigResponse{}, JCacheConfigs:[]models.JCacheConfigResponse{}, ReplicatedMapConfigs:[]models.ReplicatedMapConfigResponse{}, QueueConfigs:[]models.QueueConfigResponse{}, SetConfigs:[]models.SetConfigResponse{}, ListConfigs:[]models.ListConfigResponse{}, TopicConfigs:[]models.TopicConfigResponse{}, MultiMapConfigs:[]models.MultiMapConfigResponse{}, RingBufferConfigs:[]models.RingBufferConfigResponse(nil), ReliableTopicConfigs:[]models.ReliableTopicConfigResponse{}}}}
func NewEnterpriseClusterService ΒΆ
func NewEnterpriseClusterService(client *Client) EnterpriseClusterService
type ErrorResponse ΒΆ
type ErrorResponse struct { CorrelationId string `json:"correlation_id,omitempty"` Message string `json:"message"` Response *http.Response }
Error response is the main type of response for the errors this library handles
func (*ErrorResponse) Error ΒΆ
func (r *ErrorResponse) Error() string
This method returns an Error string of ErrorResponse.
type GcpPeeringService ΒΆ added in v1.1.0
type GcpPeeringService interface { List(ctx context.Context, input *models.ListGcpPeeringsInput) (*[]models.GcpPeering, *Response, error) Accept(ctx context.Context, input *models.AcceptGcpPeeringInput) (*models.Result, *Response, error) Delete(ctx context.Context, input *models.DeleteGcpPeeringInput) (*models.Result, *Response, error) GetProperties(ctx context.Context, input *models.GetGcpPeeringPropertiesInput) (*models.GcpPeeringProperties, *Response, error) }
func NewGcpPeeringService ΒΆ added in v1.1.0
func NewGcpPeeringService(client *Client) GcpPeeringService
type GraphQLQuery ΒΆ
type GraphQLQuery struct { OperationName string `json:"operationName,omitempty"` Query string `json:"query"` Variables map[string]interface{} `json:"variables"` }
Type of graphql query
type HazelcastVersionService ΒΆ
type HazelcastVersionService interface {
List(ctx context.Context) (*[]models.EnterpriseHazelcastVersion, *Response, error)
}
This HazelcastVersionService is used to make operations related with enterprise clusters
Example (List) ΒΆ
client, _, _ := New() hazelcastVersions, _, _ := client.HazelcastVersion.List(context.Background()) fmt.Printf("Result: %#v", hazelcastVersions)
Output: Result: &[]models.EnterpriseHazelcastVersion{models.EnterpriseHazelcastVersion{Version:"4.0", UpgradeableVersions:[]string{}}, models.EnterpriseHazelcastVersion{Version:"3.12.6", UpgradeableVersions:[]string{}}, models.EnterpriseHazelcastVersion{Version:"3.12.5", UpgradeableVersions:[]string{"3.12.6"}}, models.EnterpriseHazelcastVersion{Version:"3.12.4", UpgradeableVersions:[]string{"3.12.6", "3.12.5"}}, models.EnterpriseHazelcastVersion{Version:"3.12.3", UpgradeableVersions:[]string{"3.12.6", "3.12.5", "3.12.4"}}, models.EnterpriseHazelcastVersion{Version:"3.12.2", UpgradeableVersions:[]string{"3.12.6", "3.12.5", "3.12.4", "3.12.3"}}, models.EnterpriseHazelcastVersion{Version:"3.12.1", UpgradeableVersions:[]string{"3.12.6", "3.12.5", "3.12.4", "3.12.3", "3.12.2"}}, models.EnterpriseHazelcastVersion{Version:"3.12", UpgradeableVersions:[]string{"3.12.6", "3.12.5", "3.12.4", "3.12.3", "3.12.2", "3.12.1"}}}
func NewHazelcastVersionService ΒΆ
func NewHazelcastVersionService(client *Client) HazelcastVersionService
type InstanceTypeService ΒΆ
type InstanceTypeService interface {
List(ctx context.Context, input *models.InstanceTypeInput) (*[]models.InstanceType, *Response, error)
}
This InstanceTypeService is used to make operations related with instance types
Example (List) ΒΆ
client, _, _ := New() instanceTypes, _, _ := client.InstanceType.List(context.Background(), &models.InstanceTypeInput{CloudProvider: "aws"}) fmt.Printf("Result: %#v", instanceTypes)
Output: Result: &[]models.InstanceType{models.InstanceType{Name:"r5.4xlarge", TotalMemory:127}, models.InstanceType{Name:"r5.2xlarge", TotalMemory:63}, models.InstanceType{Name:"r5a.2xlarge", TotalMemory:63}, models.InstanceType{Name:"m5.large", TotalMemory:7}, models.InstanceType{Name:"m5.xlarge", TotalMemory:15}, models.InstanceType{Name:"r5a.xlarge", TotalMemory:31}, models.InstanceType{Name:"m5.4xlarge", TotalMemory:63}, models.InstanceType{Name:"r5.xlarge", TotalMemory:31}, models.InstanceType{Name:"r5a.4xlarge", TotalMemory:127}, models.InstanceType{Name:"r5.large", TotalMemory:15}, models.InstanceType{Name:"m5.2xlarge", TotalMemory:31}}
func NewInstanceTypeService ΒΆ
func NewInstanceTypeService(client *Client) InstanceTypeService
type Rate ΒΆ
type Rate struct { Limit int `json:"limit"` Remaining int `json:"remaining"` Reset int64 `json:"reset"` }
Type of the rate limiting params we follow
type RegionService ΒΆ
type RegionService interface {
List(ctx context.Context, input *models.RegionInput) (*[]models.Region, *Response, error)
}
This RegionService is used to make operations related with regions
Example (List) ΒΆ
client, _, _ := New() regions, _, _ := client.Region.List(context.Background(), &models.RegionInput{CloudProvider: "aws"}) fmt.Printf("Result: %#v", regions)
Output: Result: &[]models.Region{models.Region{Name:"us-east-1", IsEnabledForStarter:false, IsEnabledForEnterprise:true}, models.Region{Name:"us-east-2", IsEnabledForStarter:false, IsEnabledForEnterprise:true}, models.Region{Name:"us-west-1", IsEnabledForStarter:false, IsEnabledForEnterprise:true}, models.Region{Name:"us-west-2", IsEnabledForStarter:true, IsEnabledForEnterprise:true}, models.Region{Name:"ap-south-1", IsEnabledForStarter:false, IsEnabledForEnterprise:true}, models.Region{Name:"ap-northeast-2", IsEnabledForStarter:false, IsEnabledForEnterprise:true}, models.Region{Name:"ap-southeast-1", IsEnabledForStarter:false, IsEnabledForEnterprise:true}, models.Region{Name:"ap-southeast-2", IsEnabledForStarter:false, IsEnabledForEnterprise:true}, models.Region{Name:"ap-northeast-1", IsEnabledForStarter:false, IsEnabledForEnterprise:true}, models.Region{Name:"ca-central-1", IsEnabledForStarter:false, IsEnabledForEnterprise:true}, models.Region{Name:"eu-central-1", IsEnabledForStarter:false, IsEnabledForEnterprise:true}, models.Region{Name:"eu-west-1", IsEnabledForStarter:false, IsEnabledForEnterprise:true}, models.Region{Name:"eu-west-2", IsEnabledForStarter:false, IsEnabledForEnterprise:true}, models.Region{Name:"eu-west-3", IsEnabledForStarter:false, IsEnabledForEnterprise:true}, models.Region{Name:"sa-east-1", IsEnabledForStarter:false, IsEnabledForEnterprise:true}}
func NewRegionService ΒΆ
func NewRegionService(client *Client) RegionService
type RequestCompletionCallback ΒΆ
This is the RequestCompletionCallback to intercept response when request complete.
type ServerlessClusterService ΒΆ added in v1.3.0
type ServerlessClusterService struct {
// contains filtered or unexported fields
}
ServerlessClusterService is used to interact with serverless clusters.
Example (Create) ΒΆ
server := exampleTestMockServer() defer server.Close() client, _, _ := NewFromCredentials("apiKey", "apiSecret", OptionEndpoint(server.URL)) cluster, _, _ := client.ServerlessCluster.Create(context.Background(), &createServerlessClusterRequest) fmt.Printf("Result: %#v", cluster)
Output: Result: &models.Cluster{Id:"1", CustomerId:10, Name:"test-cluster", ReleaseName:"pr-1", Password:"hidden", Port:30000, HazelcastVersion:"5.1.1", IsAutoScalingEnabled:true, IsHotBackupEnabled:true, IsHotRestartEnabled:true, IsIpWhitelistEnabled:false, IsTlsEnabled:true, ProductType:struct { Name models.ProductTypeName "json:\"name\""; IsFree bool "json:\"isFree\"" }{Name:"STARTER", IsFree:false}, ClusterType:struct { Name models.ClusterType "json:\"name\"" }{Name:"SERVERLESS"}, State:"PENDING", CreatedAt:"2022-04-21T11:49:02.000Z", StartedAt:"2022-04-21T11:49:02.000Z", StoppedAt:"", Progress:struct { Status string "json:\"status\""; TotalItemCount int "json:\"totalItemCount\""; CompletedItemCount int "json:\"completedItemCount\"" }{Status:"Preparing", TotalItemCount:4, CompletedItemCount:0}, CloudProvider:struct { Name string "json:\"name\""; Region string "json:\"region\""; AvailabilityZones []string "json:\"availabilityZones\"" }{Name:"aws", Region:"us-west-2", AvailabilityZones:[]string{"us-west-2a"}}, DiscoveryTokens:[]models.DiscoveryToken{models.DiscoveryToken{Source:"default", Token:"hidden"}}, Specs:struct { TotalMemory float64 "json:\"totalMemory\""; HeapMemory int "json:\"heapMemory\""; NativeMemory int "json:\"nativeMemory\""; Cpu int "json:\"cpu\""; InstanceType string "json:\"instanceType\""; InstancePerZone int "json:\"instancePerZone\"" }{TotalMemory:10, HeapMemory:0, NativeMemory:0, Cpu:0, InstanceType:"", InstancePerZone:0}, Networking:struct { Type string "json:\"type\""; CidrBlock string "json:\"cidrBlock\""; Peering struct { IsEnabled bool "json:\"is_enabled\"" } "json:\"peering\""; PrivateLink struct { Url string "json:\"url\""; State string "json:\"state\"" } "json:\"privateLink\"" }{Type:"", CidrBlock:"", Peering:struct { IsEnabled bool "json:\"is_enabled\"" }{IsEnabled:false}, PrivateLink:struct { Url string "json:\"url\""; State string "json:\"state\"" }{Url:"", State:""}}, DataStructures:models.DataStructureResponse{MapConfigs:[]models.MapConfigResponse{}, JCacheConfigs:[]models.JCacheConfigResponse{}, ReplicatedMapConfigs:[]models.ReplicatedMapConfigResponse{}, QueueConfigs:[]models.QueueConfigResponse{}, SetConfigs:[]models.SetConfigResponse{}, ListConfigs:[]models.ListConfigResponse{}, TopicConfigs:[]models.TopicConfigResponse{}, MultiMapConfigs:[]models.MultiMapConfigResponse{}, RingBufferConfigs:[]models.RingBufferConfigResponse{}, ReliableTopicConfigs:[]models.ReliableTopicConfigResponse{}}}
Example (Delete) ΒΆ
server := exampleTestMockServer() defer server.Close() client, _, _ := NewFromCredentials("apiKey", "apiSecret", OptionEndpoint(server.URL)) cluster, _, _ := client.ServerlessCluster.Delete(context.Background(), &models.ClusterDeleteInput{ClusterId: testClusterId}) fmt.Printf("Result: %#v", cluster)
Output: Result: &models.ClusterId{ClusterId:1}
Example (Get) ΒΆ
server := exampleTestMockServer() defer server.Close() client, _, _ := NewFromCredentials("apiKey", "apiSecret", OptionEndpoint(server.URL)) cluster, _, _ := client.ServerlessCluster.Get(context.Background(), &models.GetServerlessClusterInput{ClusterId: testClusterId}) fmt.Printf("Result: %#v", cluster)
Output: Result: &models.Cluster{Id:"1", CustomerId:10, Name:"test-cluster", ReleaseName:"pr-1", Password:"hidden", Port:30000, HazelcastVersion:"5.1.1", IsAutoScalingEnabled:true, IsHotBackupEnabled:true, IsHotRestartEnabled:true, IsIpWhitelistEnabled:false, IsTlsEnabled:true, ProductType:struct { Name models.ProductTypeName "json:\"name\""; IsFree bool "json:\"isFree\"" }{Name:"STARTER", IsFree:false}, ClusterType:struct { Name models.ClusterType "json:\"name\"" }{Name:"SERVERLESS"}, State:"RUNNING", CreatedAt:"2022-04-21T11:49:02.000Z", StartedAt:"2022-04-21T11:49:02.000Z", StoppedAt:"", Progress:struct { Status string "json:\"status\""; TotalItemCount int "json:\"totalItemCount\""; CompletedItemCount int "json:\"completedItemCount\"" }{Status:"Running", TotalItemCount:4, CompletedItemCount:4}, CloudProvider:struct { Name string "json:\"name\""; Region string "json:\"region\""; AvailabilityZones []string "json:\"availabilityZones\"" }{Name:"aws", Region:"us-west-2", AvailabilityZones:[]string{"us-west-2a"}}, DiscoveryTokens:[]models.DiscoveryToken{models.DiscoveryToken{Source:"default", Token:"hidden"}}, Specs:struct { TotalMemory float64 "json:\"totalMemory\""; HeapMemory int "json:\"heapMemory\""; NativeMemory int "json:\"nativeMemory\""; Cpu int "json:\"cpu\""; InstanceType string "json:\"instanceType\""; InstancePerZone int "json:\"instancePerZone\"" }{TotalMemory:10, HeapMemory:0, NativeMemory:0, Cpu:0, InstanceType:"", InstancePerZone:0}, Networking:struct { Type string "json:\"type\""; CidrBlock string "json:\"cidrBlock\""; Peering struct { IsEnabled bool "json:\"is_enabled\"" } "json:\"peering\""; PrivateLink struct { Url string "json:\"url\""; State string "json:\"state\"" } "json:\"privateLink\"" }{Type:"", CidrBlock:"", Peering:struct { IsEnabled bool "json:\"is_enabled\"" }{IsEnabled:false}, PrivateLink:struct { Url string "json:\"url\""; State string "json:\"state\"" }{Url:"", State:""}}, DataStructures:models.DataStructureResponse{MapConfigs:[]models.MapConfigResponse{}, JCacheConfigs:[]models.JCacheConfigResponse{}, ReplicatedMapConfigs:[]models.ReplicatedMapConfigResponse{}, QueueConfigs:[]models.QueueConfigResponse{}, SetConfigs:[]models.SetConfigResponse{}, ListConfigs:[]models.ListConfigResponse{}, TopicConfigs:[]models.TopicConfigResponse{}, MultiMapConfigs:[]models.MultiMapConfigResponse{}, RingBufferConfigs:[]models.RingBufferConfigResponse{}, ReliableTopicConfigs:[]models.ReliableTopicConfigResponse{}}}
Example (List) ΒΆ
server := exampleTestMockServer() defer server.Close() client, _, _ := NewFromCredentials("apiKey", "apiSecret", OptionEndpoint(server.URL)) clusters, _, _ := client.ServerlessCluster.List(context.Background()) fmt.Printf("Result: %#v", clusters)
Output: Result: &[]models.Cluster{models.Cluster{Id:"1", CustomerId:10, Name:"test-cluster1", ReleaseName:"pr-1", Password:"hidden", Port:30000, HazelcastVersion:"5.1.1", IsAutoScalingEnabled:true, IsHotBackupEnabled:true, IsHotRestartEnabled:true, IsIpWhitelistEnabled:false, IsTlsEnabled:true, ProductType:struct { Name models.ProductTypeName "json:\"name\""; IsFree bool "json:\"isFree\"" }{Name:"STARTER", IsFree:false}, ClusterType:struct { Name models.ClusterType "json:\"name\"" }{Name:"SERVERLESS"}, State:"RUNNING", CreatedAt:"2022-04-21T11:49:02.000Z", StartedAt:"2022-04-21T11:49:02.000Z", StoppedAt:"", Progress:struct { Status string "json:\"status\""; TotalItemCount int "json:\"totalItemCount\""; CompletedItemCount int "json:\"completedItemCount\"" }{Status:"Running", TotalItemCount:4, CompletedItemCount:4}, CloudProvider:struct { Name string "json:\"name\""; Region string "json:\"region\""; AvailabilityZones []string "json:\"availabilityZones\"" }{Name:"aws", Region:"us-west-2", AvailabilityZones:[]string{"us-west-2a"}}, DiscoveryTokens:[]models.DiscoveryToken{models.DiscoveryToken{Source:"default", Token:"hidden"}}, Specs:struct { TotalMemory float64 "json:\"totalMemory\""; HeapMemory int "json:\"heapMemory\""; NativeMemory int "json:\"nativeMemory\""; Cpu int "json:\"cpu\""; InstanceType string "json:\"instanceType\""; InstancePerZone int "json:\"instancePerZone\"" }{TotalMemory:10, HeapMemory:0, NativeMemory:0, Cpu:0, InstanceType:"", InstancePerZone:0}, Networking:struct { Type string "json:\"type\""; CidrBlock string "json:\"cidrBlock\""; Peering struct { IsEnabled bool "json:\"is_enabled\"" } "json:\"peering\""; PrivateLink struct { Url string "json:\"url\""; State string "json:\"state\"" } "json:\"privateLink\"" }{Type:"", CidrBlock:"", Peering:struct { IsEnabled bool "json:\"is_enabled\"" }{IsEnabled:false}, PrivateLink:struct { Url string "json:\"url\""; State string "json:\"state\"" }{Url:"", State:""}}, DataStructures:models.DataStructureResponse{MapConfigs:[]models.MapConfigResponse{}, JCacheConfigs:[]models.JCacheConfigResponse{}, ReplicatedMapConfigs:[]models.ReplicatedMapConfigResponse{}, QueueConfigs:[]models.QueueConfigResponse{}, SetConfigs:[]models.SetConfigResponse{}, ListConfigs:[]models.ListConfigResponse{}, TopicConfigs:[]models.TopicConfigResponse{}, MultiMapConfigs:[]models.MultiMapConfigResponse{}, RingBufferConfigs:[]models.RingBufferConfigResponse{}, ReliableTopicConfigs:[]models.ReliableTopicConfigResponse{}}}, models.Cluster{Id:"2", CustomerId:10, Name:"test-cluster2", ReleaseName:"pr-2", Password:"hidden", Port:30000, HazelcastVersion:"5.1.1", IsAutoScalingEnabled:true, IsHotBackupEnabled:true, IsHotRestartEnabled:true, IsIpWhitelistEnabled:false, IsTlsEnabled:true, ProductType:struct { Name models.ProductTypeName "json:\"name\""; IsFree bool "json:\"isFree\"" }{Name:"STARTER", IsFree:false}, ClusterType:struct { Name models.ClusterType "json:\"name\"" }{Name:"SERVERLESS"}, State:"PENDING", CreatedAt:"2022-04-26T13:05:06.000Z", StartedAt:"2022-04-26T13:05:06.000Z", StoppedAt:"", Progress:struct { Status string "json:\"status\""; TotalItemCount int "json:\"totalItemCount\""; CompletedItemCount int "json:\"completedItemCount\"" }{Status:"Preparing", TotalItemCount:4, CompletedItemCount:0}, CloudProvider:struct { Name string "json:\"name\""; Region string "json:\"region\""; AvailabilityZones []string "json:\"availabilityZones\"" }{Name:"aws", Region:"us-west-2", AvailabilityZones:[]string{"us-west-2a"}}, DiscoveryTokens:[]models.DiscoveryToken{models.DiscoveryToken{Source:"default", Token:"hidden"}}, Specs:struct { TotalMemory float64 "json:\"totalMemory\""; HeapMemory int "json:\"heapMemory\""; NativeMemory int "json:\"nativeMemory\""; Cpu int "json:\"cpu\""; InstanceType string "json:\"instanceType\""; InstancePerZone int "json:\"instancePerZone\"" }{TotalMemory:10, HeapMemory:0, NativeMemory:0, Cpu:0, InstanceType:"", InstancePerZone:0}, Networking:struct { Type string "json:\"type\""; CidrBlock string "json:\"cidrBlock\""; Peering struct { IsEnabled bool "json:\"is_enabled\"" } "json:\"peering\""; PrivateLink struct { Url string "json:\"url\""; State string "json:\"state\"" } "json:\"privateLink\"" }{Type:"", CidrBlock:"", Peering:struct { IsEnabled bool "json:\"is_enabled\"" }{IsEnabled:false}, PrivateLink:struct { Url string "json:\"url\""; State string "json:\"state\"" }{Url:"", State:""}}, DataStructures:models.DataStructureResponse{MapConfigs:[]models.MapConfigResponse{}, JCacheConfigs:[]models.JCacheConfigResponse{}, ReplicatedMapConfigs:[]models.ReplicatedMapConfigResponse{}, QueueConfigs:[]models.QueueConfigResponse{}, SetConfigs:[]models.SetConfigResponse{}, ListConfigs:[]models.ListConfigResponse{}, TopicConfigs:[]models.TopicConfigResponse{}, MultiMapConfigs:[]models.MultiMapConfigResponse{}, RingBufferConfigs:[]models.RingBufferConfigResponse{}, ReliableTopicConfigs:[]models.ReliableTopicConfigResponse{}}}}
Example (Resume) ΒΆ
server := exampleTestMockServer() defer server.Close() client, _, _ := NewFromCredentials("apiKey", "apiSecret", OptionEndpoint(server.URL)) cluster, _, _ := client.ServerlessCluster.Resume(context.Background(), &models.ClusterResumeInput{ClusterId: testClusterId}) fmt.Printf("Result: %#v", cluster)
Output: Result: &models.ClusterId{ClusterId:1}
Example (Stop) ΒΆ
server := exampleTestMockServer() defer server.Close() client, _, _ := NewFromCredentials("apiKey", "apiSecret", OptionEndpoint(server.URL)) cluster, _, _ := client.ServerlessCluster.Stop(context.Background(), &models.ClusterStopInput{ClusterId: testClusterId}) fmt.Printf("Result: %#v", cluster)
Output: Result: &models.ClusterId{ClusterId:1}
func NewServerlessClusterService ΒΆ added in v1.3.0
func NewServerlessClusterService(client *Client) ServerlessClusterService
NewServerlessClusterService returns a new instance of the service.
func (ServerlessClusterService) Create ΒΆ added in v1.3.0
func (svc ServerlessClusterService) Create(ctx context.Context, input *models.CreateServerlessClusterInput) (*models.Cluster, *Response, error)
Create creates a serverless cluster according to configuration provided in the request.
func (ServerlessClusterService) Delete ΒΆ added in v1.3.0
func (svc ServerlessClusterService) Delete(ctx context.Context, input *models.ClusterDeleteInput) (*models.ClusterId, *Response, error)
Delete deletes a serverless cluster by its ID.
func (ServerlessClusterService) DeleteArtifact ΒΆ added in v1.3.1
func (svc ServerlessClusterService) DeleteArtifact(ctx context.Context, request *models.DeleteArtifactInput) (*models.UploadedArtifact, *Response, error)
func (ServerlessClusterService) DownloadArtifact ΒΆ added in v1.3.2
func (svc ServerlessClusterService) DownloadArtifact(ctx context.Context, request *models.DownloadArtifactInput) (*models.UploadedArtifactLink, *Response, error)
func (ServerlessClusterService) Get ΒΆ added in v1.3.0
func (svc ServerlessClusterService) Get(ctx context.Context, input *models.GetServerlessClusterInput) (*models.Cluster, *Response, error)
Get retrieves a serverless cluster by its ID.
func (ServerlessClusterService) List ΒΆ added in v1.3.0
List provides the ability to get a list of serverless clusters.
func (ServerlessClusterService) ListUploadedArtifacts ΒΆ added in v1.3.1
func (svc ServerlessClusterService) ListUploadedArtifacts(ctx context.Context, request *models.ListUploadedArtifactsInput) (*[]models.UploadedArtifact, *Response, error)
func (ServerlessClusterService) Resume ΒΆ added in v1.3.0
func (svc ServerlessClusterService) Resume(ctx context.Context, input *models.ClusterResumeInput) (*models.ClusterId, *Response, error)
Resume provides the ability to resume a serverless cluster by its ID.
func (ServerlessClusterService) Stop ΒΆ added in v1.3.0
func (svc ServerlessClusterService) Stop(ctx context.Context, input *models.ClusterStopInput) (*models.ClusterId, *Response, error)
Stop provides the ability to stop a serverless cluster by its ID.
func (ServerlessClusterService) UploadArtifact ΒΆ added in v1.3.1
func (svc ServerlessClusterService) UploadArtifact(ctx context.Context, request *models.UploadArtifactInput) (*models.UploadedArtifact, *Response, error)
type StarterClusterService ΒΆ
type StarterClusterService interface { Get(ctx context.Context, request *models.GetStarterClusterInput) (*models.Cluster, *Response, error) Create(ctx context.Context, request *models.CreateStarterClusterInput) (*models.Cluster, *Response, error) List(ctx context.Context) (*[]models.Cluster, *Response, error) Resume(ctx context.Context, request *models.ClusterResumeInput) (*models.ClusterId, *Response, error) Stop(ctx context.Context, request *models.ClusterStopInput) (*models.ClusterId, *Response, error) Delete(ctx context.Context, request *models.ClusterDeleteInput) (*models.ClusterId, *Response, error) }
This StarterClusterService is used to interact with Starter Clusters.
Example (Create) ΒΆ
client, _, _ := New() create, _, _ := client.StarterCluster.Create(context.Background(), &models.CreateStarterClusterInput{ Name: "example-cluster", CloudProvider: "aws", Region: "us-west-2", ClusterType: models.Free, HazelcastVersion: "3.12", TotalMemory: 0.2, IsAutoScalingEnabled: false, IsHotBackupEnabled: false, IsHotRestartEnabled: false, IsIPWhitelistEnabled: false, IsTLSEnabled: false, }) fmt.Printf("Result: %#v", create)
Output: Result: &models.Cluster{Id:"53805", CustomerId:10090, Name:"example-cluster", Password:"2d2a9e5088a94893a1b27fc060efc2e4", Port:31002, HazelcastVersion:"3.12.9", IsAutoScalingEnabled:false, IsHotBackupEnabled:false, IsHotRestartEnabled:false, IsIpWhitelistEnabled:false, IsTlsEnabled:false, ProductType:struct { Name models.ProductTypeName "json:\"name\""; IsFree bool "json:\"isFree\"" }{Name:"Starter", IsFree:true}, State:"PENDING", CreatedAt:"2020-09-08T07:15:13.000Z", StartedAt:"2020-09-08T07:15:13.000Z", StoppedAt:"", Progress:struct { Status string "json:\"status\""; TotalItemCount int "json:\"totalItemCount\""; CompletedItemCount int "json:\"completedItemCount\"" }{Status:"Preparing", TotalItemCount:4, CompletedItemCount:0}, CloudProvider:struct { Name string "json:\"name\""; Region string "json:\"region\""; AvailabilityZones []string "json:\"availabilityZones\"" }{Name:"aws", Region:"us-west-2", AvailabilityZones:[]string{"us-west-2a"}}, DiscoveryTokens:[]models.DiscoveryToken{models.DiscoveryToken{Source:"default", Token:"fd7Zzw2xbxQ692nHqyPUh7Bq9bSLxm2u8tvflzZQ8eqzD1TmUx"}}, Specs:struct { TotalMemory float64 "json:\"totalMemory\""; HeapMemory int "json:\"heapMemory\""; NativeMemory int "json:\"nativeMemory\""; Cpu int "json:\"cpu\""; InstanceType string "json:\"instanceType\""; InstancePerZone int "json:\"instancePerZone\"" }{TotalMemory:0.2, HeapMemory:0, NativeMemory:0, Cpu:0, InstanceType:"", InstancePerZone:0}, Networking:struct { Type string "json:\"type\""; CidrBlock string "json:\"cidrBlock\""; Peering struct { IsEnabled bool "json:\"is_enabled\"" } "json:\"peering\""; PrivateLink struct { Url string "json:\"url\""; State string "json:\"state\"" } "json:\"privateLink\"" }{Type:"", CidrBlock:"", Peering:struct { IsEnabled bool "json:\"is_enabled\"" }{IsEnabled:false}, PrivateLink:struct { Url string "json:\"url\""; State string "json:\"state\"" }{Url:"", State:""}}, DataStructures:models.DataStructureResponse{MapConfigs:[]models.MapConfigResponse{}, JCacheConfigs:[]models.JCacheConfigResponse{}, ReplicatedMapConfigs:[]models.ReplicatedMapConfigResponse{}, QueueConfigs:[]models.QueueConfigResponse{}, SetConfigs:[]models.SetConfigResponse{}, ListConfigs:[]models.ListConfigResponse{}, TopicConfigs:[]models.TopicConfigResponse{}, MultiMapConfigs:[]models.MultiMapConfigResponse{}, RingBufferConfigs:[]models.RingBufferConfigResponse{}, ReliableTopicConfigs:[]models.ReliableTopicConfigResponse{}}}
Example (Delete) ΒΆ
client, _, _ := New() cluster, _, _ := client.StarterCluster.Delete(context.Background(), &models.ClusterDeleteInput{ClusterId: "53805"}) fmt.Printf("Result: %#v", cluster)
Output: Result: &models.ClusterId{ClusterId:53805}
Example (Get) ΒΆ
client, _, _ := New() cluster, _, _ := client.StarterCluster.Get(context.Background(), &models.GetStarterClusterInput{ClusterId: "53805"}) fmt.Printf("Result: %#v", cluster)
Output: Result: &models.Cluster{Id:"53805", CustomerId:10090, Name:"example-cluster", Password:"2d2a9e5088a94893a1b27fc060efc2e4", Port:31002, HazelcastVersion:"3.12.9", IsAutoScalingEnabled:false, IsHotBackupEnabled:false, IsHotRestartEnabled:false, IsIpWhitelistEnabled:false, IsTlsEnabled:false, ProductType:struct { Name models.ProductTypeName "json:\"name\""; IsFree bool "json:\"isFree\"" }{Name:"Starter", IsFree:true}, State:"RUNNING", CreatedAt:"2020-09-08T07:15:13.000Z", StartedAt:"2020-09-08T07:16:37.000Z", StoppedAt:"", Progress:struct { Status string "json:\"status\""; TotalItemCount int "json:\"totalItemCount\""; CompletedItemCount int "json:\"completedItemCount\"" }{Status:"Preparing", TotalItemCount:0, CompletedItemCount:0}, CloudProvider:struct { Name string "json:\"name\""; Region string "json:\"region\""; AvailabilityZones []string "json:\"availabilityZones\"" }{Name:"aws", Region:"us-west-2", AvailabilityZones:[]string{"us-west-2a"}}, DiscoveryTokens:[]models.DiscoveryToken{models.DiscoveryToken{Source:"default", Token:"fd7Zzw2xbxQ692nHqyPUh7Bq9bSLxm2u8tvflzZQ8eqzD1TmUx"}}, Specs:struct { TotalMemory float64 "json:\"totalMemory\""; HeapMemory int "json:\"heapMemory\""; NativeMemory int "json:\"nativeMemory\""; Cpu int "json:\"cpu\""; InstanceType string "json:\"instanceType\""; InstancePerZone int "json:\"instancePerZone\"" }{TotalMemory:0.2, HeapMemory:0, NativeMemory:0, Cpu:0, InstanceType:"", InstancePerZone:0}, Networking:struct { Type string "json:\"type\""; CidrBlock string "json:\"cidrBlock\""; Peering struct { IsEnabled bool "json:\"is_enabled\"" } "json:\"peering\""; PrivateLink struct { Url string "json:\"url\""; State string "json:\"state\"" } "json:\"privateLink\"" }{Type:"", CidrBlock:"", Peering:struct { IsEnabled bool "json:\"is_enabled\"" }{IsEnabled:false}, PrivateLink:struct { Url string "json:\"url\""; State string "json:\"state\"" }{Url:"", State:""}}, DataStructures:models.DataStructureResponse{MapConfigs:[]models.MapConfigResponse{}, JCacheConfigs:[]models.JCacheConfigResponse{}, ReplicatedMapConfigs:[]models.ReplicatedMapConfigResponse{}, QueueConfigs:[]models.QueueConfigResponse{}, SetConfigs:[]models.SetConfigResponse{}, ListConfigs:[]models.ListConfigResponse{}, TopicConfigs:[]models.TopicConfigResponse{}, MultiMapConfigs:[]models.MultiMapConfigResponse{}, RingBufferConfigs:[]models.RingBufferConfigResponse{}, ReliableTopicConfigs:[]models.ReliableTopicConfigResponse{}}}
Example (List) ΒΆ
client, _, _ := New() clusters, _, _ := client.StarterCluster.List(context.Background()) fmt.Printf("Result: %#v", clusters)
Output: Result: &[]models.Cluster{models.Cluster{Id:"53805", CustomerId:10090, Name:"example-cluster", Password:"", Port:31002, HazelcastVersion:"3.12.9", IsAutoScalingEnabled:false, IsHotBackupEnabled:false, IsHotRestartEnabled:false, IsIpWhitelistEnabled:false, IsTlsEnabled:false, ProductType:struct { Name models.ProductTypeName "json:\"name\""; IsFree bool "json:\"isFree\"" }{Name:"Starter", IsFree:true}, State:"STOPPED", CreatedAt:"2020-09-08T07:25:40.000Z", StartedAt:"2020-09-08T07:26:48.000Z", StoppedAt:"", Progress:struct { Status string "json:\"status\""; TotalItemCount int "json:\"totalItemCount\""; CompletedItemCount int "json:\"completedItemCount\"" }{Status:"Preparing", TotalItemCount:0, CompletedItemCount:0}, CloudProvider:struct { Name string "json:\"name\""; Region string "json:\"region\""; AvailabilityZones []string "json:\"availabilityZones\"" }{Name:"aws", Region:"us-west-2", AvailabilityZones:[]string{"us-west-2a"}}, DiscoveryTokens:[]models.DiscoveryToken{}, Specs:struct { TotalMemory float64 "json:\"totalMemory\""; HeapMemory int "json:\"heapMemory\""; NativeMemory int "json:\"nativeMemory\""; Cpu int "json:\"cpu\""; InstanceType string "json:\"instanceType\""; InstancePerZone int "json:\"instancePerZone\"" }{TotalMemory:0.2, HeapMemory:0, NativeMemory:0, Cpu:0, InstanceType:"", InstancePerZone:0}, Networking:struct { Type string "json:\"type\""; CidrBlock string "json:\"cidrBlock\""; Peering struct { IsEnabled bool "json:\"is_enabled\"" } "json:\"peering\""; PrivateLink struct { Url string "json:\"url\""; State string "json:\"state\"" } "json:\"privateLink\"" }{Type:"", CidrBlock:"", Peering:struct { IsEnabled bool "json:\"is_enabled\"" }{IsEnabled:false}, PrivateLink:struct { Url string "json:\"url\""; State string "json:\"state\"" }{Url:"", State:""}}, DataStructures:models.DataStructureResponse{MapConfigs:[]models.MapConfigResponse{}, JCacheConfigs:[]models.JCacheConfigResponse{}, ReplicatedMapConfigs:[]models.ReplicatedMapConfigResponse{}, QueueConfigs:[]models.QueueConfigResponse{}, SetConfigs:[]models.SetConfigResponse{}, ListConfigs:[]models.ListConfigResponse{}, TopicConfigs:[]models.TopicConfigResponse{}, MultiMapConfigs:[]models.MultiMapConfigResponse{}, RingBufferConfigs:[]models.RingBufferConfigResponse{}, ReliableTopicConfigs:[]models.ReliableTopicConfigResponse{}}}}
Example (Resume) ΒΆ
client, _, _ := New() cluster, _, _ := client.StarterCluster.Resume(context.Background(), &models.ClusterResumeInput{ClusterId: "53805"}) fmt.Printf("Result: %#v", cluster)
Output: Result: &models.ClusterId{ClusterId:53805}
Example (Stop) ΒΆ
client, _, _ := New() cluster, _, _ := client.StarterCluster.Stop(context.Background(), &models.ClusterStopInput{ClusterId: "53805"}) fmt.Printf("Result: %#v", cluster)
Output: Result: &models.ClusterId{ClusterId:53805}
func NewStarterClusterService ΒΆ
func NewStarterClusterService(client *Client) StarterClusterService