Documentation ¶
Index ¶
- Constants
- Variables
- type CRAuthorizationToken
- type Client
- func (client *Client) CreateCluster(region common.Region, args *ClusterCreationArgs) (cluster ClusterCreationResponse, err error)
- func (client *Client) CreateClusterToken(clusterId string, request *ClusterTokenReqeust) (*ClusterTokenResponse, error)
- func (client *Client) CreateKubernetesCluster(region common.Region, args *KubernetesCreationArgs) (cluster ClusterCreationResponse, err error)
- func (client *Client) CreateKubernetesMultiAZCluster(region common.Region, args *KubernetesMultiAZCreationArgs) (cluster ClusterCreationResponse, err error)
- func (client *Client) DeleteCluster(clusterID string) error
- func (client *Client) DescribeCluster(id string) (cluster ClusterType, err error)
- func (client *Client) DescribeClusterTokens(clusterId string) ([]*ClusterTokenResponse, error)
- func (client *Client) DescribeClusters(nameFilter string) (clusters []ClusterType, err error)
- func (client *Client) DescribeKubernetesCluster(id string) (cluster KubernetesCluster, err error)
- func (client *Client) GetCRAuthorizationToken() (crtoken CRAuthorizationToken, err error)
- func (client *Client) GetCRRepoInfo(repoNamespace, repoName string) (str string, err error)
- func (client *Client) GetClusterCerts(id string) (certs ClusterCerts, err error)
- func (client *Client) GetClusterConfig(id string) (config ClusterConfig, err error)
- func (client *Client) GetClusterEndpoints(id string) (clusterEndpoints ClusterEndpoints, err error)
- func (client *Client) GetKubernetesClusterNodes(id string, pagination common.Pagination) (nodes []KubernetesNodeType, paginationResult *PaginationResult, err error)
- func (client *Client) GetProjectClient(clusterId string) (projectClient *ProjectClient, err error)
- func (client *Client) Invoke(region common.Region, method string, path string, query url.Values, ...) error
- func (client *Client) ModifyClusterName(clusterID, clusterName string) error
- func (client *Client) ResizeCluster(clusterID string, args *ClusterResizeArgs) error
- func (client *Client) ResizeKubernetes(clusterID string, args *KubernetesCreationArgs) error
- func (client *Client) ResizeKubernetesCluster(clusterID string, args *KubernetesClusterResizeArgs) error
- func (client *Client) RevokeToken(token string) error
- func (client *Client) ScaleKubernetesCluster(clusterID string, args *KubernetesClusterScaleArgs) error
- func (client *Client) SetDebug(debug bool)
- func (client *Client) SetEndpoint(endpoint string)
- func (client *Client) SetUserAgent(userAgent string)
- func (client *Client) WaitForClusterAsyn(clusterId string, status ClusterState, timeout int) error
- type ClusterCerts
- type ClusterConfig
- type ClusterCreationArgs
- type ClusterCreationResponse
- type ClusterEndpoints
- type ClusterResizeArgs
- type ClusterState
- type ClusterTokenReqeust
- type ClusterTokenResponse
- type ClusterType
- type Container
- type Definition
- type DriverOptions
- type GetKubernetesClusterNodesResponse
- type GetProjectResponse
- type GetProjectsResponse
- type GetServiceResponse
- type GetServicesResponse
- type GetSwarmClusterNodesResponse
- type GetVolumeResponse
- type GetVolumesResponse
- type KubernetesCluster
- type KubernetesClusterMetaData
- type KubernetesClusterParameter
- type KubernetesClusterResizeArgs
- type KubernetesClusterScaleArgs
- type KubernetesCreationArgs
- type KubernetesMultiAZCreationArgs
- type KubernetesNodeType
- type KubernetesStackArgs
- type Labels
- type ModifyClusterNameArgs
- type NASOpts
- type NetworkModeType
- type NodeStatus
- type OSSOpts
- type PaginationResult
- type Port
- type Project
- type ProjectClient
- func (client *ProjectClient) ClusterId() string
- func (client *ProjectClient) ConfirmBlueGreenProject(name string, force bool) (err error)
- func (client *ProjectClient) CreateProject(args *ProjectCreationArgs) (err error)
- func (client *ProjectClient) CreateVolume(args *VolumeCreationArgs) (err error)
- func (client *ProjectClient) DeleteProject(name string, forceDelete, deleteVolume bool) (err error)
- func (client *ProjectClient) DeleteVolume(name string) (err error)
- func (client *ProjectClient) Endpoint() string
- func (client *ProjectClient) GetProject(name string) (project GetProjectResponse, err error)
- func (client *ProjectClient) GetProjects(q string, services, containers bool) (projects GetProjectsResponse, err error)
- func (client *ProjectClient) GetService(serviceId string) (service GetServiceResponse, err error)
- func (client *ProjectClient) GetServices(q string, containers bool) (services GetServicesResponse, err error)
- func (client *ProjectClient) GetSwarmClusterNodes() (project GetSwarmClusterNodesResponse, err error)
- func (client *ProjectClient) GetVolume(name string) (volume GetVolumeResponse, err error)
- func (client *ProjectClient) GetVolumes() (volumes GetVolumesResponse, err error)
- func (client *ProjectClient) Invoke(method string, path string, query url.Values, args interface{}, ...) error
- func (client *ProjectClient) KillProject(name string, signal ...string) (err error)
- func (client *ProjectClient) KillService(serviceId string, signal ...string) (err error)
- func (client *ProjectClient) RollBackBlueGreenProject(name string, force bool) (err error)
- func (client *ProjectClient) ScaleService(args *ScaleServiceArgs) (err error)
- func (client *ProjectClient) SetDebug(debug bool)
- func (client *ProjectClient) SetUserAgent(userAgent string)
- func (client *ProjectClient) StartProject(name string) (err error)
- func (client *ProjectClient) StartService(serviceId string) (err error)
- func (client *ProjectClient) StopProject(name string, timeout ...time.Duration) (err error)
- func (client *ProjectClient) StopService(serviceId string, timeout ...time.Duration) (err error)
- func (client *ProjectClient) UpdateProject(args *ProjectUpdationArgs) (err error)
- type ProjectCreationArgs
- type ProjectUpdationArgs
- type Request
- type Response
- type ScaleServiceArgs
- type ScaleType
- type Service
- type SwarmNodeType
- type VolumeCreationArgs
- type VolumeCreationResponse
- type VolumeDriverType
- type VolumeRef
Constants ¶
View Source
const ( // CRMDefaultEndpoint is the default API endpoint of CRM services CSDefaultEndpoint = "https://cs.aliyuncs.com" CSAPIVersion = "2015-12-15" )
View Source
const ( Initial = ClusterState("initial") Running = ClusterState("running") Updating = ClusterState("updating") Scaling = ClusterState("scaling") Failed = ClusterState("failed") Deleting = ClusterState("deleting") DeleteFailed = ClusterState("deleteFailed") Deleted = ClusterState("deleted") InActive = ClusterState("inactive") ClusterTypeKubernetes = "Kubernetes" ClusterTypeManagedKubernetes = "ManagedKubernetes" )
View Source
const ( ClassicNetwork = NetworkModeType("classic") VPCNetwork = NetworkModeType("vpc") )
View Source
const ( CRDefaultEndpoint = "https://cr.cn-hangzhou.aliyuncs.com" CRAPIVersion = "2016-06-07" )
View Source
const ClusterDefaultTimeout = 300
View Source
const DefaultPreCheckSleepTime = 20
View Source
const DefaultPreSleepTime = 220
View Source
const DefaultWaitForInterval = 10
Variables ¶
View Source
var NodeStableClusterState = []ClusterState{Running, Updating, Failed, DeleteFailed, Deleted, InActive}
View Source
var NodeUnstableClusterState = []ClusterState{Initial, Scaling, Deleting}
Functions ¶
This section is empty.
Types ¶
type CRAuthorizationToken ¶
type Client ¶
type Client struct { AccessKeyId string AccessKeySecret string SecurityToken string Version string // contains filtered or unexported fields }
The Client type encapsulates operations with an OSS region.
func NewClientForAussumeRole ¶
func (*Client) CreateCluster ¶
func (client *Client) CreateCluster(region common.Region, args *ClusterCreationArgs) (cluster ClusterCreationResponse, err error)
func (*Client) CreateClusterToken ¶
func (client *Client) CreateClusterToken(clusterId string, request *ClusterTokenReqeust) (*ClusterTokenResponse, error)
func (*Client) CreateKubernetesCluster ¶
func (client *Client) CreateKubernetesCluster(region common.Region, args *KubernetesCreationArgs) (cluster ClusterCreationResponse, err error)
func (*Client) CreateKubernetesMultiAZCluster ¶
func (client *Client) CreateKubernetesMultiAZCluster(region common.Region, args *KubernetesMultiAZCreationArgs) (cluster ClusterCreationResponse, err error)
func (*Client) DeleteCluster ¶
func (*Client) DescribeCluster ¶
func (client *Client) DescribeCluster(id string) (cluster ClusterType, err error)
func (*Client) DescribeClusterTokens ¶
func (client *Client) DescribeClusterTokens(clusterId string) ([]*ClusterTokenResponse, error)
func (*Client) DescribeClusters ¶
func (client *Client) DescribeClusters(nameFilter string) (clusters []ClusterType, err error)
func (*Client) DescribeKubernetesCluster ¶
func (client *Client) DescribeKubernetesCluster(id string) (cluster KubernetesCluster, err error)
func (*Client) GetCRAuthorizationToken ¶
func (client *Client) GetCRAuthorizationToken() (crtoken CRAuthorizationToken, err error)
func (*Client) GetCRRepoInfo ¶
func (*Client) GetClusterCerts ¶
func (client *Client) GetClusterCerts(id string) (certs ClusterCerts, err error)
func (*Client) GetClusterConfig ¶
func (client *Client) GetClusterConfig(id string) (config ClusterConfig, err error)
func (*Client) GetClusterEndpoints ¶
func (client *Client) GetClusterEndpoints(id string) (clusterEndpoints ClusterEndpoints, err error)
func (*Client) GetKubernetesClusterNodes ¶
func (client *Client) GetKubernetesClusterNodes(id string, pagination common.Pagination) (nodes []KubernetesNodeType, paginationResult *PaginationResult, err error)
func (*Client) GetProjectClient ¶
func (client *Client) GetProjectClient(clusterId string) (projectClient *ProjectClient, err error)
func (*Client) Invoke ¶
func (client *Client) Invoke(region common.Region, method string, path string, query url.Values, args interface{}, response interface{}) error
Invoke sends the raw HTTP request for ECS services
func (*Client) ModifyClusterName ¶
func (*Client) ResizeCluster ¶
func (client *Client) ResizeCluster(clusterID string, args *ClusterResizeArgs) error
func (*Client) ResizeKubernetes ¶
func (client *Client) ResizeKubernetes(clusterID string, args *KubernetesCreationArgs) error
deprecated use ScaleKubernetesCluster instead
func (*Client) ResizeKubernetesCluster ¶
func (client *Client) ResizeKubernetesCluster(clusterID string, args *KubernetesClusterResizeArgs) error
deprecated use ScaleKubernetesCluster instead
func (*Client) RevokeToken ¶
func (*Client) ScaleKubernetesCluster ¶
func (client *Client) ScaleKubernetesCluster(clusterID string, args *KubernetesClusterScaleArgs) error
func (*Client) SetEndpoint ¶
SetEndpoint sets customer endpoint
func (*Client) SetUserAgent ¶
SetUserAgent sets user agent to log the request/response message
func (*Client) WaitForClusterAsyn ¶
func (client *Client) WaitForClusterAsyn(clusterId string, status ClusterState, timeout int) error
WaitForCluster waits for instance to given status when instance.NotFound wait until timeout
type ClusterCerts ¶
type ClusterConfig ¶
type ClusterConfig struct {
Config string `json:"config"`
}
type ClusterCreationArgs ¶
type ClusterCreationArgs struct { Name string `json:"name"` Size int64 `json:"size"` NetworkMode NetworkModeType `json:"network_mode"` SubnetCIDR string `json:"subnet_cidr,omitempty"` InstanceType string `json:"instance_type"` VPCID string `json:"vpc_id,omitempty"` VSwitchID string `json:"vswitch_id,omitempty"` Password string `json:"password"` DataDiskSize int64 `json:"data_disk_size"` DataDiskCategory ecs.DiskCategory `json:"data_disk_category"` ECSImageID string `json:"ecs_image_id,omitempty"` IOOptimized ecs.IoOptimized `json:"io_optimized"` ReleaseEipFlag bool `json:"release_eip_flag"` NeedSLB bool `json:"need_slb"` }
type ClusterCreationResponse ¶
type ClusterEndpoints ¶
type ClusterEndpoints struct { ApiServerEndpoint string `json:"api_server_endpoint"` DashboardEndpoint string `json:"dashboard_endpoint"` MiranaEndpoint string `json:"mirana_endpoint"` ReverseTunnelEndpoint string `json:"reverse_tunnel_endpoint"` IntranetApiServerEndpoint string `json:"intranet_api_server_endpoint"` }
type ClusterResizeArgs ¶
type ClusterResizeArgs struct { Size int64 `json:"size"` InstanceType string `json:"instance_type"` Password string `json:"password"` DataDiskSize int64 `json:"data_disk_size"` DataDiskCategory ecs.DiskCategory `json:"data_disk_category"` ECSImageID string `json:"ecs_image_id,omitempty"` IOOptimized ecs.IoOptimized `json:"io_optimized"` }
type ClusterState ¶
type ClusterState string
type ClusterTokenReqeust ¶
type ClusterTokenResponse ¶
type ClusterType ¶
type ClusterType struct { AgentVersion string `json:"agent_version"` ClusterID string `json:"cluster_id"` Name string `json:"name"` Created time.Time `json:"created"` ExternalLoadbalancerID string `json:"external_loadbalancer_id"` MasterURL string `json:"master_url"` NetworkMode NetworkModeType `json:"network_mode"` RegionID common.Region `json:"region_id"` SecurityGroupID string `json:"security_group_id"` Size int64 `json:"size"` State ClusterState `json:"state"` Updated time.Time `json:"updated"` VPCID string `json:"vpc_id"` VSwitchID string `json:"vswitch_id"` NodeStatus string `json:"node_status"` DockerVersion string `json:"docker_version"` ClusterType string `json:"cluster_type"` }
type Container ¶
type Container struct { Name string `json:"name"` Node string `json:"node"` VMID string `json:"vm_id"` IP string `json:"ip"` Running bool `json:"running"` Status string `json:"status"` Health string `json:"health"` StatusExt string `json:"status_ext"` FailCount int `json:"fail_count"` Ports map[string][]Port `json:"ports"` }
type Definition ¶
type Definition struct { Environment []string `json:"environment"` Image string `json:"image"` KernelMemory int `json:"kernel_memory"` Labels Labels `json:"labels"` MemLimit int `json:"mem_limit"` MemswapLimit int `json:"memswap_limit"` MemswapReservation int `json:"memswap_reservation"` OomKillDisable bool `json:"oom_kill_disable"` Restart string `json:"restart"` ShmSize int `json:"shm_size"` Volumes []string `json:"volumes"` }
type DriverOptions ¶
type DriverOptions interface {
// contains filtered or unexported methods
}
type GetKubernetesClusterNodesResponse ¶
type GetKubernetesClusterNodesResponse struct { Response Page PaginationResult `json:"page"` Nodes []KubernetesNodeType `json:"nodes"` }
type GetProjectResponse ¶
type GetProjectResponse Project
type GetProjectsResponse ¶
type GetProjectsResponse []Project
type GetServiceResponse ¶
type GetServiceResponse Service
type GetServicesResponse ¶
type GetServicesResponse []Service
type GetSwarmClusterNodesResponse ¶
type GetSwarmClusterNodesResponse []SwarmNodeType
type GetVolumeResponse ¶
type GetVolumesResponse ¶
type GetVolumesResponse struct {
Volumes []GetVolumeResponse `json:"Volumes"`
}
type KubernetesCluster ¶
type KubernetesCluster struct { ClusterType AgentVersion string `json:"agent_version"` ClusterID string `json:"cluster_id"` Name string `json:"name"` Created time.Time `json:"created"` MasterURL string `json:"master_url"` NetworkMode NetworkModeType `json:"network_mode"` RegionID common.Region `json:"region_id"` SecurityGroupID string `json:"security_group_id"` Size int64 `json:"size"` State ClusterState `json:"state"` Updated time.Time `json:"updated"` VPCID string `json:"vpc_id"` VSwitchID string `json:"vswitch_id"` NodeStatus string `json:"node_status"` DockerVersion string `json:"docker_version"` ZoneId string `json:"zone_id"` RawMetaData string `json:"meta_data,omitempty"` MetaData KubernetesClusterMetaData InitVersion string `json:"init_version"` CurrentVersion string `json:"current_version"` ExternalLoadbalancerId string `json:"external_loadbalancer_id"` Parameters KubernetesClusterParameter `json:"parameters"` }
type KubernetesClusterParameter ¶
type KubernetesClusterParameter struct { ServiceCidr string `json:"ServiceCIDR"` ContainerCidr string `json:"ContainerCIDR"` DockerVersion string `json:"DockerVersion"` EtcdVersion string `json:"EtcdVersion"` KubernetesVersion string `json:"KubernetesVersion"` VPCID string `json:"VpcId"` ImageId string `json:"ImageId"` KeyPair string `json:"KeyPair"` MasterSystemDiskCategory string `json:"MasterSystemDiskCategory"` MasterSystemDiskSize string `json:"MasterSystemDiskSize"` MasterImageId string `json:"MasterImageId"` MasterInstanceChargeType string `json:"MasterInstanceChargeType"` MasterPeriodUnit string `json:"MasterPeriodUnit"` MasterPeriod string `json:"MasterPeriod"` MasterAutoRenew *bool RawMasterAutoRenew string `json:"MasterAutoRenew"` MasterAutoRenewPeriod string `json:"MasterAutoRenewPeriod"` WorkerSystemDiskCategory string `json:"WorkerSystemDiskCategory"` WorkerSystemDiskSize string `json:"WorkerSystemDiskSize"` WorkerImageId string `json:"WorkerImageId"` WorkerDataDisk *bool RawWorkerDataDisk string `json:"WorkerDataDisk"` WorkerDataDiskCategory string `json:"WorkerDataDiskCategory"` WorkerDataDiskSize string `json:"WorkerDataDiskSize"` WorkerInstanceChargeType string `json:"WorkerInstanceChargeType"` WorkerPeriodUnit string `json:"WorkerPeriodUnit"` WorkerPeriod string `json:"WorkerPeriod"` WorkerAutoRenew *bool RawWorkerAutoRenew string `json:"WorkerAutoRenew"` WorkerAutoRenewPeriod string `json:"WorkerAutoRenewPeriod"` ZoneId string `json:"ZoneId"` NodeCIDRMask string `json:"NodeCIDRMask"` LoggingType string `json:"LoggingType"` SLSProjectName string `json:"SLSProjectName"` PublicSLB *bool RawPublicSLB string `json:"PublicSLB"` // Single AZ MasterInstanceType string `json:"MasterInstanceType"` WorkerInstanceType string `json:"WorkerInstanceType"` NumOfNodes string `json:"NumOfNodes"` VSwitchID string `json:"VSwitchId"` // Multi AZ MasterInstanceTypeA string `json:"MasterInstanceTypeA"` MasterInstanceTypeB string `json:"MasterInstanceTypeB"` MasterInstanceTypeC string `json:"MasterInstanceTypeC"` WorkerInstanceTypeA string `json:"WorkerInstanceTypeA"` WorkerInstanceTypeB string `json:"WorkerInstanceTypeB"` WorkerInstanceTypeC string `json:"WorkerInstanceTypeC"` NumOfNodesA string `json:"NumOfNodesA"` NumOfNodesB string `json:"NumOfNodesB"` NumOfNodesC string `json:"NumOfNodesC"` VSwitchIdA string `json:"VSwitchIdA"` VSwitchIdB string `json:"VSwitchIdB"` VSwitchIdC string `json:"VSwitchIdC"` }
deprecated
type KubernetesClusterResizeArgs ¶
type KubernetesClusterResizeArgs struct { DisableRollback bool `json:"disable_rollback"` TimeoutMins int64 `json:"timeout_mins"` LoginPassword string `json:"login_password,omitempty"` // Single AZ WorkerInstanceType string `json:"worker_instance_type"` WorkerInstanceTypes []string `json:"worker_instance_types"` NumOfNodes int64 `json:"num_of_nodes"` // Multi AZ WorkerInstanceTypeA string `json:"worker_instance_type_a"` WorkerInstanceTypeB string `json:"worker_instance_type_b"` WorkerInstanceTypeC string `json:"worker_instance_type_c"` NumOfNodesA int64 `json:"num_of_nodes_a"` NumOfNodesB int64 `json:"num_of_nodes_b"` NumOfNodesC int64 `json:"num_of_nodes_c"` }
type KubernetesClusterScaleArgs ¶
type KubernetesClusterScaleArgs struct { LoginPassword string `json:"login_password,omitempty"` KeyPair string `json:"key_pair,omitempty"` WorkerInstanceTypes []string `json:"worker_instance_types"` WorkerSystemDiskSize int64 `json:"worker_system_disk_size"` WorkerSystemDiskCategory ecs.DiskCategory `json:"worker_system_disk_category"` WorkerDataDisk bool `json:"worker_data_disk"` Count int `json:"count"` //data disk WorkerDataDiskCategory string `json:"worker_data_disk_category"` WorkerDataDiskSize int64 `json:"worker_data_disk_size"` WorkerDataDiskEncrypted string `json:"worker_data_disk_encrypted"` WorkerDataDiskKMSKeyId string `json:"worker_data_disk_kms_key_id"` }
type KubernetesCreationArgs ¶
type KubernetesCreationArgs struct { DisableRollback bool `json:"disable_rollback"` Name string `json:"name"` TimeoutMins int64 `json:"timeout_mins"` ZoneId string `json:"zoneid,omitempty"` VPCID string `json:"vpcid,omitempty"` RegionId string `json:"region_id,omitempty"` VSwitchId string `json:"vswitchid,omitempty"` VSwitchIds []string `json:"vswitch_ids,omitempty"` ImageId string `json:"image_id"` ContainerCIDR string `json:"container_cidr,omitempty"` ServiceCIDR string `json:"service_cidr,omitempty"` MasterInstanceType string `json:"master_instance_type,omitempty"` MasterSystemDiskSize int64 `json:"master_system_disk_size,omitempty"` MasterSystemDiskCategory ecs.DiskCategory `json:"master_system_disk_category,omitempty"` MasterInstanceChargeType string `json:"master_instance_charge_type"` MasterPeriodUnit string `json:"master_period_unit"` MasterPeriod int `json:"master_period"` MasterAutoRenew bool `json:"master_auto_renew"` MasterAutoRenewPeriod int `json:"master_auto_renew_period"` WorkerInstanceType string `json:"worker_instance_type,omitempty"` WorkerInstanceTypes []string `json:"worker_instance_types,omitempty"` WorkerSystemDiskSize int64 `json:"worker_system_disk_size,omitempty"` WorkerSystemDiskCategory ecs.DiskCategory `json:"worker_system_disk_category,omitempty"` WorkerDataDisk bool `json:"worker_data_disk"` WorkerDataDiskCategory string `json:"worker_data_disk_category,omitempty"` WorkerDataDiskSize int64 `json:"worker_data_disk_size,omitempty"` WorkerInstanceChargeType string `json:"worker_instance_charge_type"` WorkerPeriodUnit string `json:"worker_period_unit"` WorkerPeriod int `json:"worker_period"` WorkerAutoRenew bool `json:"worker_auto_renew"` WorkerAutoRenewPeriod int `json:"worker_auto_renew_period"` LoginPassword string `json:"login_password,omitempty"` KeyPair string `json:"key_pair,omitempty"` UserCA string `json:"user_ca,omitempty"` NumOfNodes int64 `json:"num_of_nodes,omitempty"` SNatEntry bool `json:"snat_entry"` SSHFlags bool `json:"ssh_flags"` CloudMonitorFlags bool `json:"cloud_monitor_flags"` NodeCIDRMask string `json:"node_cidr_mask,omitempty"` LoggingType string `json:"logging_type,omitempty"` SLSProjectName string `json:"sls_project_name,omitempty"` PublicSLB bool `json:"public_slb"` ClusterType string `json:"cluster_type"` Network string `json:"network,omitempty"` KubernetesVersion string `json:"kubernetes_version,omitempty"` StackParams KubernetesStackArgs `json:"stack_params,omitempty"` }
type KubernetesMultiAZCreationArgs ¶
type KubernetesMultiAZCreationArgs struct { DisableRollback bool `json:"disable_rollback"` Name string `json:"name"` TimeoutMins int64 `json:"timeout_mins"` ClusterType string `json:"cluster_type"` MultiAZ bool `json:"multi_az"` VPCID string `json:"vpcid,omitempty"` ImageId string `json:"image_id"` ContainerCIDR string `json:"container_cidr"` ServiceCIDR string `json:"service_cidr"` VSwitchIdA string `json:"vswitch_id_a,omitempty"` VSwitchIdB string `json:"vswitch_id_b,omitempty"` VSwitchIdC string `json:"vswitch_id_c,omitempty"` MasterInstanceTypeA string `json:"master_instance_type_a,omitempty"` MasterInstanceTypeB string `json:"master_instance_type_b,omitempty"` MasterInstanceTypeC string `json:"master_instance_type_c,omitempty"` MasterSystemDiskCategory ecs.DiskCategory `json:"master_system_disk_category"` MasterSystemDiskSize int64 `json:"master_system_disk_size"` MasterInstanceChargeType string `json:"master_instance_charge_type"` MasterPeriodUnit string `json:"master_period_unit"` MasterPeriod int `json:"master_period"` MasterAutoRenew bool `json:"master_auto_renew"` MasterAutoRenewPeriod int `json:"master_auto_renew_period"` WorkerInstanceTypeA string `json:"worker_instance_type_a,omitempty"` WorkerInstanceTypeB string `json:"worker_instance_type_b,omitempty"` WorkerInstanceTypeC string `json:"worker_instance_type_c,omitempty"` WorkerSystemDiskCategory ecs.DiskCategory `json:"worker_system_disk_category"` WorkerSystemDiskSize int64 `json:"worker_system_disk_size"` WorkerDataDisk bool `json:"worker_data_disk"` WorkerDataDiskCategory string `json:"worker_data_disk_category"` WorkerDataDiskSize int64 `json:"worker_data_disk_size"` WorkerInstanceChargeType string `json:"worker_instance_charge_type"` WorkerPeriodUnit string `json:"worker_period_unit"` WorkerPeriod int `json:"worker_period"` WorkerAutoRenew bool `json:"worker_auto_renew"` WorkerAutoRenewPeriod int `json:"worker_auto_renew_period"` NumOfNodesA int64 `json:"num_of_nodes_a"` NumOfNodesB int64 `json:"num_of_nodes_b"` NumOfNodesC int64 `json:"num_of_nodes_c"` LoginPassword string `json:"login_password,omitempty"` KeyPair string `json:"key_pair,omitempty"` UserCA string `json:"user_ca,omitempty"` SSHFlags bool `json:"ssh_flags"` CloudMonitorFlags bool `json:"cloud_monitor_flags"` NodeCIDRMask string `json:"node_cidr_mask,omitempty"` LoggingType string `json:"logging_type,omitempty"` SLSProjectName string `json:"sls_project_name,omitempty"` PublicSLB bool `json:"public_slb"` KubernetesVersion string `json:"kubernetes_version,omitempty"` Network string `json:"network,omitempty"` }
type KubernetesNodeType ¶
type KubernetesNodeType struct { InstanceType string `json:"instance_type"` IpAddress []string `json:"ip_address"` InstanceChargeType string `json:"instance_charge_type"` InstanceRole string `json:"instance_role"` CreationTime string `json:"creation_time"` InstanceName string `json:"instance_name"` InstanceTypeFamily string `json:"instance_type_family"` HostName string `json:"host_name"` ImageId string `json:"image_id"` InstanceId string `json:"instance_id"` }
type KubernetesStackArgs ¶
type KubernetesStackArgs struct { VPCID string `json:"VpcId,omitempty"` VSwitchID string `json:"VSwitchId,omitempty"` MasterInstanceType string `json:"MasterInstanceType,omitempty"` WorkerInstanceType string `json:"WorkerInstanceType,omitempty"` NumOfNodes int64 `json:"NumOfNodes,omitempty"` Password string `json:"LoginPassword,omitempty"` DockerVersion string `json:"DockerVersion,omitempty"` KubernetesVersion string `json:"KubernetesVersion,omitempty"` ZoneId string `json:"ZoneId,omitempty"` ContainerCIDR string `json:"ContainerCIDR,omitempty"` ServiceCIDR string `json:"ServiceCIDR,omitempty"` SSHFlags bool `json:"SSHFlags,omitempty"` MasterSystemDiskSize int64 `json:"MasterSystemDiskSize,omitempty"` MasterSystemDiskCategory ecs.DiskCategory `json:"MasterSystemDiskCategory,omitempty"` WorkerSystemDiskSize int64 `json:"WorkerSystemDiskSize,omitempty"` WorkerSystemDiskCategory ecs.DiskCategory `json:"WorkerSystemDiskCategory,omitempty"` ImageID string `json:"ImageId,omitempty"` CloudMonitorFlags bool `json:"CloudMonitorFlags,omitempty"` SNatEntry bool `json:"SNatEntry,omitempty"` }
Deprecated
type ModifyClusterNameArgs ¶
type ModifyClusterNameArgs struct {
Name string `json:"name"`
}
type NetworkModeType ¶
type NetworkModeType string
type NodeStatus ¶
type PaginationResult ¶
type Project ¶
type Project struct { Name string `json:"name"` Description string `json:"description"` Template string `json:"template"` Version string `json:"version"` Created string `json:"created"` Updated string `json:"updated"` DesiredState string `json:"desired_state"` CurrentState string `json:"current_state"` Environment map[string]string `json:"environment"` Services []Service `json:"services"` }
type ProjectClient ¶
type ProjectClient struct {
// contains filtered or unexported fields
}
func NewProjectClient ¶
func NewProjectClient(clusterId, endpoint string, clusterCerts ClusterCerts) (client *ProjectClient, err error)
func (*ProjectClient) ClusterId ¶
func (client *ProjectClient) ClusterId() string
func (*ProjectClient) ConfirmBlueGreenProject ¶
func (client *ProjectClient) ConfirmBlueGreenProject(name string, force bool) (err error)
func (*ProjectClient) CreateProject ¶
func (client *ProjectClient) CreateProject(args *ProjectCreationArgs) (err error)
func (*ProjectClient) CreateVolume ¶
func (client *ProjectClient) CreateVolume(args *VolumeCreationArgs) (err error)
func (*ProjectClient) DeleteProject ¶
func (client *ProjectClient) DeleteProject(name string, forceDelete, deleteVolume bool) (err error)
func (*ProjectClient) DeleteVolume ¶
func (client *ProjectClient) DeleteVolume(name string) (err error)
func (*ProjectClient) Endpoint ¶
func (client *ProjectClient) Endpoint() string
func (*ProjectClient) GetProject ¶
func (client *ProjectClient) GetProject(name string) (project GetProjectResponse, err error)
func (*ProjectClient) GetProjects ¶
func (client *ProjectClient) GetProjects(q string, services, containers bool) (projects GetProjectsResponse, err error)
func (*ProjectClient) GetService ¶
func (client *ProjectClient) GetService(serviceId string) (service GetServiceResponse, err error)
func (*ProjectClient) GetServices ¶
func (client *ProjectClient) GetServices(q string, containers bool) (services GetServicesResponse, err error)
func (*ProjectClient) GetSwarmClusterNodes ¶
func (client *ProjectClient) GetSwarmClusterNodes() (project GetSwarmClusterNodesResponse, err error)
func (*ProjectClient) GetVolume ¶
func (client *ProjectClient) GetVolume(name string) (volume GetVolumeResponse, err error)
func (*ProjectClient) GetVolumes ¶
func (client *ProjectClient) GetVolumes() (volumes GetVolumesResponse, err error)
func (*ProjectClient) KillProject ¶
func (client *ProjectClient) KillProject(name string, signal ...string) (err error)
func (*ProjectClient) KillService ¶
func (client *ProjectClient) KillService(serviceId string, signal ...string) (err error)
func (*ProjectClient) RollBackBlueGreenProject ¶
func (client *ProjectClient) RollBackBlueGreenProject(name string, force bool) (err error)
func (*ProjectClient) ScaleService ¶
func (client *ProjectClient) ScaleService(args *ScaleServiceArgs) (err error)
func (*ProjectClient) SetDebug ¶
func (client *ProjectClient) SetDebug(debug bool)
SetDebug sets debug mode to log the request/response message
func (*ProjectClient) SetUserAgent ¶
func (client *ProjectClient) SetUserAgent(userAgent string)
SetUserAgent sets user agent to log the request/response message
func (*ProjectClient) StartProject ¶
func (client *ProjectClient) StartProject(name string) (err error)
func (*ProjectClient) StartService ¶
func (client *ProjectClient) StartService(serviceId string) (err error)
func (*ProjectClient) StopProject ¶
func (client *ProjectClient) StopProject(name string, timeout ...time.Duration) (err error)
func (*ProjectClient) StopService ¶
func (client *ProjectClient) StopService(serviceId string, timeout ...time.Duration) (err error)
func (*ProjectClient) UpdateProject ¶
func (client *ProjectClient) UpdateProject(args *ProjectUpdationArgs) (err error)
type ProjectCreationArgs ¶
type ProjectUpdationArgs ¶
type ScaleServiceArgs ¶
type Service ¶
type Service struct { ID string `json:"id"` Name string `json:"name"` Project string `json:"project"` ComposeVersion string `json:"compose_version"` Containers map[string]Container `json:"containers"` Created time.Time `json:"created"` CurrentState string `json:"current_state"` Definition Definition `json:"definition"` DesiredState string `json:"desired_state"` Extensions map[string]interface{} `json:"extensions"` Hash string `json:"hash"` Updated time.Time `json:"updated"` Version string `json:"version"` }
type SwarmNodeType ¶
type VolumeCreationArgs ¶
type VolumeCreationArgs struct { Name string `json:"name"` Driver VolumeDriverType `json:"driver"` DriverOpts DriverOptions `json:"driverOpts"` }
type VolumeCreationResponse ¶
type VolumeDriverType ¶
type VolumeDriverType string
const ( OSSFSDriver VolumeDriverType = "ossfs" NASDriver VolumeDriverType = "nas" )
Click to show internal directories.
Click to hide internal directories.