cs

package
v0.0.0-...-ba7e8e4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

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"

	ClusterTypeServerlessKubernetes = "Ask"
)
View Source
const (
	ClassicNetwork = NetworkModeType("classic")
	VPCNetwork     = NetworkModeType("vpc")
)
View Source
const (
	// task status
	Task_Status_Running = "running"
	Task_Status_Success = "Success"
	Task_Status_Failed  = "Failed"

	// upgrade state
	UpgradeStep_NotStart    = "not_start"
	UpgradeStep_Prechecking = "prechecking"
	UpgradeStep_Upgrading   = "upgrading"
	UpgradeStep_Pause       = "pause"
	UpgradeStep_Success     = "success"
)
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 (
	DelicatedKubernetes  = KubernetesClusterType("Kubernetes")
	ManagedKubernetes    = KubernetesClusterType("ManagedKubernetes")
	ServerlessKubernetes = KubernetesClusterType("Ask")
)
View Source
var (
	IPTables = "iptables"
	IPVS     = "ipvs"
)
View Source
var (
	TaintNoExecute        = "NoExecute"
	TaintNoSchedule       = "NoSchedule"
	TaintPreferNoSchedule = "PreferNoSchedule"
)
View Source
var NodeUnstableClusterState = []ClusterState{Initial, Scaling, Deleting}

Functions

This section is empty.

Types

type Addon

type Addon struct {
	Name     string `json:"name"`
	Version  string `json:"version"`
	Config   string `json:"config"`
	Disabled bool   `json:"disabled"` // 是否禁止默认安装
}

addon

type AutoScaling

type AutoScaling struct {
	Enable       bool   `json:"enable"`
	MaxInstances int64  `json:"max_instances"`
	MinInstances int64  `json:"min_instances"`
	Type         string `json:"type"`
	// eip
	IsBindEip *bool `json:"is_bond_eip"`
	// value: PayByBandwidth / PayByTraffic
	EipInternetChargeType string `json:"eip_internet_charge_type"`
	// default 5
	EipBandWidth int64 `json:"eip_bandwidth"`
}

type BasicNodePool

type BasicNodePool struct {
	NodePoolInfo   `json:"nodepool_info"`
	NodePoolStatus `json:"status"`
}

type CRAuthorizationToken

type CRAuthorizationToken struct {
	Data struct {
		AuthorizationToken string `json:"authorizationToken"`
		TempUserName       string `json:"tempUserName"`
		ExpireDate         int64  `json:"expireDate"`
	} `json:"data"`
	RequestId string `json:"requestId"`
}

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 NewCRClientWithSecurityToken

func NewCRClientWithSecurityToken(region, accessKeyId, accessKeySecret, securityToken string) *Client

func NewClient

func NewClient(accessKeyId, accessKeySecret string) *Client

NewClient creates a new instance of CRM client

func NewClientForAussumeRole

func NewClientForAussumeRole(accessKeyId, accessKeySecret, securityToken string) *Client

func (*Client) CancelUpgradeCluster

func (client *Client) CancelUpgradeCluster(clusterId string) error

cancel upgrade cluster

func (*Client) CreateCluster

func (client *Client) CreateCluster(region common.Region, args *ClusterCreationArgs) (cluster ClusterCommonResponse, err error)

Deprecated

func (*Client) CreateClusterToken

func (client *Client) CreateClusterToken(clusterId string, request *ClusterTokenReqeust) (*ClusterTokenResponse, error)

func (*Client) CreateDelicatedKubernetesCluster

func (client *Client) CreateDelicatedKubernetesCluster(request *DelicatedKubernetesClusterCreationRequest) (*ClusterCommonResponse, error)

Create DelicatedKubernetes Cluster

func (*Client) CreateKubernetesCluster

func (client *Client) CreateKubernetesCluster(region common.Region, args *KubernetesCreationArgs) (cluster ClusterCommonResponse, err error)

Deprecated

func (*Client) CreateKubernetesMultiAZCluster

func (client *Client) CreateKubernetesMultiAZCluster(region common.Region, args *KubernetesMultiAZCreationArgs) (cluster ClusterCommonResponse, err error)

Deprecated

func (*Client) CreateManagedKubernetesCluster

func (client *Client) CreateManagedKubernetesCluster(request *ManagedKubernetesClusterCreationRequest) (*ClusterCommonResponse, error)

Create ManagedKubernetes Cluster

func (*Client) CreateNodePool

func (client *Client) CreateNodePool(request *CreateNodePoolRequest, clusterId string) (*CreateNodePoolResponse, error)

func (*Client) CreateServerlessKubernetesCluster

func (client *Client) CreateServerlessKubernetesCluster(args *ServerlessCreationArgs) (*ClusterCommonResponse, error)

create Serverless cluster

func (*Client) DeleteCluster

func (client *Client) DeleteCluster(clusterID string) error

Deprecated

func (*Client) DeleteKubernetesCluster

func (client *Client) DeleteKubernetesCluster(clusterId string) error

DeleteKubernetesCluster

func (*Client) DeleteKubernetesClusterNodes

func (client *Client) DeleteKubernetesClusterNodes(clusterId string, request *DeleteKubernetesClusterNodesRequest) (*common.Response, error)

DeleteClusterNodes

func (*Client) DeleteNodePool

func (client *Client) DeleteNodePool(clusterId, nodePoolId string) error

func (*Client) DescribeCluster

func (client *Client) DescribeCluster(id string) (cluster ClusterType, err error)

func (*Client) DescribeClusterNodePools

func (client *Client) DescribeClusterNodePools(clusterId string) (*[]NodePoolDetail, error)

func (*Client) DescribeClusterToken

func (client *Client) DescribeClusterToken(clusterId, token string) (*ClusterTokenResponse, error)

func (*Client) DescribeClusterTokens

func (client *Client) DescribeClusterTokens(clusterId string) ([]*ClusterTokenResponse, error)

func (*Client) DescribeClusterUserConfig

func (client *Client) DescribeClusterUserConfig(clusterId string, privateIpAddress bool) (*ClusterConfig, error)

new api for get cluster kube user config

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)

Deprecated

func (*Client) DescribeKubernetesClusterDetail

func (client *Client) DescribeKubernetesClusterDetail(clusterId string) (*KubernetesClusterDetail, error)

查询集群详情

func (*Client) DescribeNodePoolDetail

func (client *Client) DescribeNodePoolDetail(clusterId, nodePoolId string) (*NodePoolDetail, error)

func (*Client) DescribeServerlessKubernetesCluster

func (client *Client) DescribeServerlessKubernetesCluster(clusterId string) (*ServerlessClusterResponse, error)

describe Serverless cluster

func (*Client) DescribeServerlessKubernetesClusters

func (client *Client) DescribeServerlessKubernetesClusters() ([]*ServerlessClusterResponse, error)

describe Serverless clsuters

func (*Client) GetCRAuthorizationToken

func (client *Client) GetCRAuthorizationToken() (crtoken CRAuthorizationToken, err error)

func (*Client) GetCRRepoInfo

func (client *Client) GetCRRepoInfo(repoNamespace, repoName string) (str string, err error)

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)

deprecated Please use new api DescribeClusterUserConfig

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, nodepoolId string) (nodes []KubernetesNodeType, paginationResult *PaginationResult, err error)

GetKubernetesClusterNodes is used to get cluster nodes or node pool nodes

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) ModifyCluster

func (client *Client) ModifyCluster(clusterId string, args *ModifyClusterArgs) error

modify cluster

func (*Client) ModifyClusterName

func (client *Client) ModifyClusterName(clusterID, clusterName string) error

Deprecated

func (*Client) QueryUpgradeClusterResult

func (client *Client) QueryUpgradeClusterResult(clusterId string) (*UpgradeClusterResult, error)

func (*Client) ResizeCluster

func (client *Client) ResizeCluster(clusterID string, args *ClusterResizeArgs) error

Deprecated

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 *Client) RevokeToken(token string) error

func (*Client) ScaleKubernetesCluster

func (client *Client) ScaleKubernetesCluster(clusterID string, args *KubernetesClusterScaleArgs) error

Deprecated

func (*Client) ScaleOutKubernetesCluster

func (client *Client) ScaleOutKubernetesCluster(clusterId string, request *ScaleOutKubernetesClusterRequest) (*ClusterCommonResponse, error)

ScaleKubernetesCluster

func (*Client) SetDebug

func (client *Client) SetDebug(debug bool)

SetDebug sets debug mode to log the request/response message

func (*Client) SetEndpoint

func (client *Client) SetEndpoint(endpoint string)

SetEndpoint sets customer endpoint

func (*Client) SetTransport

func (client *Client) SetTransport(transport http.RoundTripper)

SetTransport sets transport to the http client

func (*Client) SetUserAgent

func (client *Client) SetUserAgent(userAgent string)

SetUserAgent sets user agent to log the request/response message

func (*Client) UpdateNodePool

func (client *Client) UpdateNodePool(clusterId string, nodePoolId string, request *UpdateNodePoolRequest) (*Response, error)

func (*Client) UpgradeCluster

func (client *Client) UpgradeCluster(clusterId string, args *UpgradeClusterArgs) error

upgrade cluster

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 ClusterArgs

type ClusterArgs struct {
	DisableRollback bool `json:"disable_rollback"`
	TimeoutMins     int  `json:"timeout_mins"`

	Name               string                `json:"name"`
	ClusterType        KubernetesClusterType `json:"cluster_type"`
	Profile            string                `json:"profile"`
	KubernetesVersion  string                `json:"kubernetes_version"`
	DeletionProtection bool                  `json:"deletion_protection"`

	NodeCidrMask string `json:"node_cidr_mask"`
	UserCa       string `json:"user_ca"`

	OsType   string `json:"os_type"`
	Platform string `json:"platform"`

	UserData string `json:"user_data"`

	NodePortRange string `json:"node_port_range"`
	NodeNameMode  string `json:"node_name_mode"`

	//ImageId
	ImageId string `json:"image_id"`

	PodVswitchIds []string `json:"pod_vswitch_ids"` // eni多网卡模式下,需要传额外的vswitchid给addon

	LoginPassword string `json:"login_password"` //和KeyPair 二选一
	KeyPair       string `json:"key_pair"`       ////LoginPassword 二选一

	RegionId      common.Region `json:"region_id"`
	VpcId         string        `json:"vpcid"`
	ContainerCidr string        `json:"container_cidr"`
	ServiceCidr   string        `json:"service_cidr"`

	CloudMonitorFlags bool `json:"cloud_monitor_flags"`

	SecurityGroupId           string    `json:"security_group_id"`
	IsEnterpriseSecurityGroup bool      `json:"is_enterprise_security_group"`
	EndpointPublicAccess      bool      `json:"endpoint_public_access"`
	LoadBalancerSpec          string    `json:"load_balancer_spec"` //api server slb实例规格
	ProxyMode                 ProxyMode `json:"proxy_mode"`
	SnatEntry                 bool      `json:"snat_entry"`
	ResourceGroupId           string    `json:"resource_group_id"`

	Addons []Addon `json:"addons"`
	Tags   []Tag   `json:"tags"`

	Taints []Taint `json:"taints"`

	ApiAudiences          string            `json:"api_audiences,omitempty"`
	ServiceAccountIssuer  string            `json:"service_account_issuer,omitempty"`
	CustomSAN             string            `json:"custom_san,omitempty"`
	ClusterSpec           string            `json:"cluster_spec"`
	Timezone              string            `json:"timezone"`
	ClusterDomain         string            `json:"cluster_domain"`
	RdsInstances          []string          `json:"rds_instances"`
	EncryptionProviderKey string            `json:"encryption_provider_key"`
	MaintenanceWindow     MaintenanceWindow `json:"maintenance_window"`
}

type ClusterCerts

type ClusterCerts struct {
	CA   string `json:"ca,omitempty"`
	Key  string `json:"key,omitempty"`
	Cert string `json:"cert,omitempty"`
}

type ClusterCommonResponse

type ClusterCommonResponse struct {
	Response
	ClusterID  string `json:"cluster_id"`
	Token      string `json:"token,omitempty"`
	TaskId     string `json:"task_id,omitempty"`
	InstanceId string `json:"instanceId"`
}

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 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"`
}

Deprecated

type ClusterState

type ClusterState string

type ClusterTokenReqeust

type ClusterTokenReqeust struct {
	//token 过期时间,如果不填写,则默认24小时过期
	Expired       int64 `json:"expired"`
	IsPermanently bool  `json:"is_permanently"`
}

type ClusterTokenResponse

type ClusterTokenResponse struct {
	Created int64 ` json:"created"`
	Updated int64 `json:"updated"`
	Expired int64 ` json:"expired"`

	ClusterID string ` json:"cluster_id"`

	Token    string ` json:"token"`
	IsActive int    ` json:"is_active"`
}

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"`
	Profile                string          `json:"profile"`
}

https://help.aliyun.com/document_detail/26053.html

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 CreateNodePoolRequest

type CreateNodePoolRequest struct {
	RegionId         common.Region `json:"region_id"`
	Count            int64         `json:"count"`
	NodePoolInfo     `json:"nodepool_info"`
	ScalingGroup     `json:"scaling_group"`
	KubernetesConfig `json:"kubernetes_config"`
	AutoScaling      `json:"auto_scaling"`
	TEEConfig        `json:"tee_config"`
	Management       `json:"management"`
}

type CreateNodePoolResponse

type CreateNodePoolResponse struct {
	Response
	NodePoolID string `json:"nodepool_id"`
	Message    string `json:"Message"`
	TaskID     string `json:"task_id"`
}

type DataDisk

type DataDisk struct {
	Category             string `json:"category"`
	KMSKeyId             string `json:"kms_key_id"`
	Encrypted            string `json:"encrypted"` // true|false
	Device               string `json:"device"`    //  could be /dev/xvd[a-z]. If not specification, will use default value.
	Size                 string `json:"size"`
	DiskName             string `json:"name"`
	AutoSnapshotPolicyId string `json:"auto_snapshot_policy_id"`
	PerformanceLevel     string `json:"performance_Level"`
}

datadiks

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 DeleteKubernetesClusterNodesRequest

type DeleteKubernetesClusterNodesRequest struct {
	ReleaseNode bool     `json:"release_node"` //if set to true, the ecs instance will be released
	Nodes       []string `json:"nodes"`        //the format is regionId.instanceId|Ip ,for example  cn-hangzhou.192.168.1.2 or cn-hangzhou.i-abc
	DrainNode   bool     `json:"drain_node"`   //same as Nodes
}

DeleteClusterNodes

type DelicatedKubernetesClusterCreationRequest

type DelicatedKubernetesClusterCreationRequest struct {
	ClusterArgs
	MasterArgs
	WorkerArgs
}

DelicatedKubernetes

type DriverOptions

type DriverOptions interface {
	// contains filtered or unexported methods
}

type Effect

type Effect string

type Event

type Event struct {
	Timestamp time.Time
	Type      string
	Reason    string
	Message   string
	Source    string
}

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 GetVolumeResponse struct {
	Name       string            `json:"Name"`
	Driver     string            `json:"Driver"`
	Mountpoint string            `json:"Mountpoint"`
	Labels     map[string]string `json:"Labels"`
	Scope      string            `json:"Scope"`
	Node       string            `json:"Node"`
	Refs       []VolumeRef       `json:"Refs"`
}

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"`
}

Deprecated

type KubernetesClusterDetail

type KubernetesClusterDetail struct {
	RegionId common.Region `json:"region_id"`

	Name        string                `json:"name"`
	ClusterId   string                `json:"cluster_id"`
	Size        int64                 `json:"size"`
	ClusterType KubernetesClusterType `json:"cluster_type"`
	Profile     string                `json:"profile"`

	VpcId                 string `json:"vpc_id"`
	VSwitchIds            string `json:"vswitch_id"`
	SecurityGroupId       string `json:"security_group_id"`
	IngressLoadbalancerId string `json:"external_loadbalancer_id"`
	ResourceGroupId       string `json:"resource_group_id"`
	NetworkMode           string `json:"network_mode"`
	ContainerCIDR         string `json:"subnet_cidr"`

	Tags  []Tag  `json:"tags"`
	State string `json:"state"`

	InitVersion        string `json:"init_version"`
	CurrentVersion     string `json:"current_version"`
	PrivateZone        bool   `json:"private_zone"`
	DeletionProtection bool   `json:"deletion_protection"`
	MetaData           string `json:"meta_data"`

	Created time.Time `json:"created"`
	Updated time.Time `json:"updated"`

	WorkerRamRoleName string            `json:"worker_ram_role_name"`
	ClusterSpec       string            `json:"cluster_spec"`
	OSType            string            `json:"os_type"`
	MasterURL         string            `json:"master_url"`
	MaintenanceWindow MaintenanceWindow `json:"maintenance_window"`
}

Cluster definition

func (*KubernetesClusterDetail) GetMetaData

func (c *KubernetesClusterDetail) GetMetaData() map[string]interface{}

GetMetaData

type KubernetesClusterMetaData

type KubernetesClusterMetaData struct {
	DockerVersion     string `json:"DockerVersion"`
	EtcdVersion       string `json:"EtcdVersion"`
	KubernetesVersion string `json:"KubernetesVersion"`
	MultiAZ           bool   `json:"MultiAZ"`
	SubClass          string `json:"SubClass"`
}

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 ecs.DiskCategory `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 ecs.DiskCategory `json:"WorkerSystemDiskCategory"`
	WorkerSystemDiskSize     string           `json:"WorkerSystemDiskSize"`
	WorkerImageId            string           `json:"WorkerImageId"`
	WorkerDataDisk           *bool
	RawWorkerDataDisk        string           `json:"WorkerDataDisk"`
	WorkerDataDiskCategory   ecs.DiskCategory `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"`
}

Deprecated

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"`

	// Edge worker related args
	IsEdgeWorker          bool   `json:"is_edge_worker"`
	EnsRegionId           string `json:"ens_region_id"`
	EnsInternetChargeType string `json:"ens_internet_charge_type"`

	//data disk
	WorkerDataDiskCategory  ecs.DiskCategory `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"`
}

Deprecated

type KubernetesClusterType

type KubernetesClusterType string

Cluster Info

type KubernetesConfig

type KubernetesConfig struct {
	NodeNameMode string  `json:"node_name_mode"`
	Taints       []Taint `json:"taints"`
	Labels       []Label `json:"labels"`
	CpuPolicy    string  `json:"cpu_policy"`
	UserData     string  `json:"user_data"`

	Runtime           string `json:"runtime,omitempty"`
	RuntimeVersion    string `json:"runtime_version"`
	CmsEnabled        bool   `json:"cms_enabled"`
	OverwriteHostname bool   `json:"overwrite_hostname"`
	Unschedulable     bool   `json:"unschedulable"`
}

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   ecs.DiskCategory `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"`
}

Deprecated

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   ecs.DiskCategory `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"`
}

Deprecated

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"`
	NodeName           string   `json:"node_name"`
}

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 Label

type Label struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Labels

type Labels map[string]string

type MaintenanceTime

type MaintenanceTime string

type MaintenanceWindow

type MaintenanceWindow struct {
	Enable          bool            `json:"enable"`
	MaintenanceTime MaintenanceTime `json:"maintenance_time"`
	Duration        string          `json:"duration"`
	Recurrence      string          `json:"recurrence,omitempty"`
	WeeklyPeriod    WeeklyPeriod    `json:"weekly_period"`
}

maintenance window

type ManagedKubernetesClusterCreationRequest

type ManagedKubernetesClusterCreationRequest struct {
	ClusterArgs
	WorkerArgs
}

ManagedKubernetes

type Management

type Management struct {
	Enable      bool        `json:"enable"`
	AutoRepair  bool        `json:"auto_repair"`
	UpgradeConf UpgradeConf `json:"upgrade_config"`
}

托管节点池配置

type MasterArgs

type MasterArgs struct {
	MasterCount         int      `json:"master_count"`
	MasterVSwitchIds    []string `json:"master_vswitch_ids"`
	MasterInstanceTypes []string `json:"master_instance_types"`

	MasterInstanceChargeType string `json:"master_instance_charge_type"`
	MasterPeriod             int    `json:"master_period"`
	MasterPeriodUnit         string `json:"master_period_unit"`

	MasterAutoRenew       bool `json:"master_auto_renew"`
	MasterAutoRenewPeriod int  `json:"master_auto_renew_period"`

	MasterSystemDiskCategory         ecs.DiskCategory `json:"master_system_disk_category"`
	MasterSystemDiskSize             int64            `json:"master_system_disk_size"`
	MasterSystemDiskPerformanceLevel string           `json:"master_system_disk_performance_level"`

	MasterDataDisks []DataDisk `json:"master_data_disks"` //支持多个数据盘

	//support hpc/scc
	MasterHpcClusterId    string `json:"master_hpc_cluster_id"`
	MasterDeploymentSetId string `json:"master_deploymentset_id"`

	//master node deletion protection
	MasterDeletionProtection *bool `json:"master_deletion_protection"`

	// disk snapshot policy
	MasterSnapshotPolicyId string `json:"master_system_disk_snapshot_policy_id"`
}

type ModifyClusterArgs

type ModifyClusterArgs struct {
	DeletionProtection bool              `json:"deletion_protection"`
	ResourceGroupId    string            `json:"resource_group_id"`
	MaintenanceWindow  MaintenanceWindow `json:"maintenance_window"`
}

modify cluster,include DeletionProtection and so on

type ModifyClusterNameArgs

type ModifyClusterNameArgs struct {
	Name string `json:"name"`
}

type NASOpts

type NASOpts struct {
	DiskId string `json:"disk_id"`
	Host   string `json:"host"`
	Path   string `json:"path"`
	Mode   string `json:"mode"`
}

type NetworkModeType

type NetworkModeType string

type NodePoolDataDisk

type NodePoolDataDisk struct {
	Category             string `json:"category"`
	KMSKeyId             string `json:"kms_key_id"`
	Encrypted            string `json:"encrypted"` // true|false
	Device               string `json:"device"`    //  could be /dev/xvd[a-z]. If not specification, will use default value.
	Size                 int    `json:"size"`
	DiskName             string `json:"name"`
	AutoSnapshotPolicyId string `json:"auto_snapshot_policy_id"`
	PerformanceLevel     string `json:"performance_Level"`
}

type NodePoolDetail

type NodePoolDetail struct {
	BasicNodePool
	KubernetesConfig `json:"kubernetes_config"`
	ScalingGroup     `json:"scaling_group"`
	AutoScaling      `json:"auto_scaling"`
	TEEConfig        `json:"tee_config"`
	Management       `json:"management"`
}

type NodePoolInfo

type NodePoolInfo struct {
	NodePoolId      string        `json:"nodepool_id"`
	RegionId        common.Region `json:"region_id"`
	Name            string        `json:"name"`
	Created         time.Time     `json:"created"`
	Updated         time.Time     `json:"updated"`
	IsDefault       bool          `json:"is_default"`
	NodePoolType    string        `json:"type"`
	ResourceGroupId string        `json:"resource_group_id"`
}

type NodePoolStatus

type NodePoolStatus struct {
	TotalNodes   int `json:"total_nodes"`
	OfflineNodes int `json:"offline_nodes"`
	ServingNodes int `json:"serving_nodes"`
	//DesiredNodes int  `json:"desired_nodes"`
	RemovingNodes int    `json:"removing_nodes"`
	FailedNodes   int    `json:"failed_nodes"`
	InitialNodes  int    `json:"initial_nodes"`
	HealthyNodes  int    `json:"healthy_nodes"`
	State         string `json:"state"`
}

type NodePoolsDetail

type NodePoolsDetail struct {
	Response
	NodePools []NodePoolDetail `json:"nodepools"`
}

type NodeStatus

type NodeStatus struct {
	Health   int64 `json:"health"`
	Unhealth int64 `json:"unhealth"`
}

type OSSOpts

type OSSOpts struct {
	Bucket          string `json:"bucket"`
	AccessKeyId     string `json:"ak_id"`
	AccessKeySecret string `json:"ak_secret"`
	URL             string `json:"url"`
	NoStatCache     string `json:"no_stat_cache"`
	OtherOpts       string `json:"other_opts"`
}

type PaginationResult

type PaginationResult struct {
	TotalCount int `json:"total_count"`
	PageNumber int `json:"page_number"`
	PageSize   int `json:"page_size"`
}

type Port

type Port struct {
	HostIP   string `json:"host_ip"`
	HostPort string `json:"host_port"`
}

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) Invoke

func (client *ProjectClient) Invoke(method string, path string, query url.Values, args interface{}, response interface{}) 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) SetTransport

func (client *ProjectClient) SetTransport(transport http.RoundTripper)

SetTransport sets transport to the http client

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 ProjectCreationArgs struct {
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Template    string            `json:"template"`
	Version     string            `json:"version"`
	Environment map[string]string `json:"environment"`
	LatestImage bool              `json:"latest_image"`
}

type ProjectUpdationArgs

type ProjectUpdationArgs struct {
	Name         string            `json:"-"`
	Description  string            `json:"description"`
	Template     string            `json:"template"`
	Version      string            `json:"version"`
	Environment  map[string]string `json:"environment"`
	LatestImage  bool              `json:"latest_image"`
	UpdateMethod string            `json:"update_method"`
}

type ProxyMode

type ProxyMode string

type Request

type Request struct {
	Method          string
	URL             string
	Version         string
	Region          common.Region
	Signature       string
	SignatureMethod string
	SignatureNonce  string
	Timestamp       util.ISO6801Time
	Body            []byte
}

type Response

type Response struct {
	RequestId string `json:"request_id"`
}

type Runtime

type Runtime struct {
	Name                       string   `json:"name"`
	Version                    string   `json:"version"`
	RuntimeClass               []string `json:"runtimeClass,omitempty"`
	Exist                      bool     `json:"exist"`
	AvailableNetworkComponents []string `json:"availableNetworkComponents,omitempty"`
}

runtime

type ScaleOutKubernetesClusterRequest

type ScaleOutKubernetesClusterRequest struct {
	LoginPassword string `json:"login_password"` //和KeyPair 二选一
	KeyPair       string `json:"key_pair"`       ////LoginPassword 二选一

	WorkerVSwitchIds    []string `json:"worker_vswitch_ids"`
	WorkerInstanceTypes []string `json:"worker_instance_types"`

	WorkerInstanceChargeType string `json:"worker_instance_charge_type"`
	WorkerPeriod             int    `json:"worker_period"`
	WorkerPeriodUnit         string `json:"worker_period_unit"`

	WorkerAutoRenew       bool `json:"worker_auto_renew"`
	WorkerAutoRenewPeriod int  `json:"worker_auto_renew_period"`

	WorkerSystemDiskCategory         ecs.DiskCategory `json:"worker_system_disk_category"`
	WorkerSystemDiskSize             int64            `json:"worker_system_disk_size"`
	WorkerSnapshotPolicyId           string           `json:"worker_system_disk_snapshot_policy_id"`
	WorkerSystemDiskPerformanceLevel string           `json:"worker_system_disk_performance_level"`

	WorkerDataDisk  bool       `json:"worker_data_disk"`
	WorkerDataDisks []DataDisk `json:"worker_data_disks"` //支持多个数据盘

	Tags    []Tag   `json:"tags"`
	Taints  []Taint `json:"taints"`
	ImageId string  `json:"image_id"`

	UserData string `json:"user_data"`

	Count             int64    `json:"count"`
	CpuPolicy         string   `json:"cpu_policy"`
	Runtime           Runtime  `json:"runtime"`
	CloudMonitorFlags bool     `json:"cloud_monitor_flags"`
	RdsInstances      []string ` json:"rds_instances"`
}

type ScaleServiceArgs

type ScaleServiceArgs struct {
	ServiceId string    `json:"-"`
	Type      ScaleType `json:"type"`
	Value     int       `json:"value"`
}

type ScaleType

type ScaleType string
const (
	ScaleTo ScaleType = "scale_to"
)

type ScalingGroup

type ScalingGroup struct {
	VpcId                      string             `json:"vpc_id"`
	VswitchIds                 []string           `json:"vswitch_ids"`
	InstanceTypes              []string           `json:"instance_types"`
	LoginPassword              string             `json:"login_password"`
	KeyPair                    string             `json:"key_pair"`
	SecurityGroupId            string             `json:"security_group_id"`
	SystemDiskCategory         ecs.DiskCategory   `json:"system_disk_category"`
	SystemDiskSize             int64              `json:"system_disk_size"`
	SystemDiskPerformanceLevel string             `json:"system_disk_performance_level"`
	DataDisks                  []NodePoolDataDisk `json:"data_disks"` //支持多个数据盘
	Tags                       []Tag              `json:"tags"`
	ImageId                    string             `json:"image_id"`
	Platform                   string             `json:"platform"`
	// 支持包年包月
	InstanceChargeType string `json:"instance_charge_type"`
	Period             int    `json:"period"`
	PeriodUnit         string `json:"period_unit"`
	AutoRenew          bool   `json:"auto_renew"`
	AutoRenewPeriod    int    `json:"auto_renew_period"`
	// spot实例
	SpotStrategy   string      `json:"spot_strategy"`
	SpotPriceLimit []SpotPrice `json:"spot_price_limit"`

	RdsInstances   []string `json:"rds_instances"`
	ScalingPolicy  string   `json:"scaling_policy"`
	ScalingGroupId string   `json:"scaling_group_id"`

	WorkerSnapshotPolicyId string `json:"worker_system_disk_snapshot_policy_id"`
	// 公网ip
	InternetChargeType      string `json:"internet_charge_type"`
	InternetMaxBandwidthOut int    `json:"internet_max_bandwidth_out"`
}

type ServerlessClusterResponse

type ServerlessClusterResponse struct {
	ClusterId          string                `json:"cluster_id"`
	Name               string                `json:"name"`
	ClusterType        KubernetesClusterType `json:"cluster_type"`
	RegionId           string                `json:"region_id"`
	State              ClusterState          `json:"state"`
	VpcId              string                `json:"vpc_id"`
	VSwitchId          string                `json:"vswitch_id"`
	SecurityGroupId    string                `json:"security_group_id"`
	Tags               []Tag                 `json:"tags"`
	Created            time.Time             `json:"created"`
	Updated            time.Time             `json:"updated"`
	InitVersion        string                `json:"init_version"`
	CurrentVersion     string                `json:"current_version"`
	PrivateZone        bool                  `json:"private_zone"`
	DeletionProtection bool                  `json:"deletion_protection"`
	ResourceGroupId    string                `json:"resource_group_id"`
	ClusterSpec        string                `json:"cluster_spec"`
}

type ServerlessCreationArgs

type ServerlessCreationArgs struct {
	ClusterType           KubernetesClusterType `json:"cluster_type"`
	Name                  string                `json:"name"`
	RegionId              string                `json:"region_id"`
	VpcId                 string                `json:"vpc_id"`
	VSwitchId             string                `json:"vswitch_id"`
	VswitchIds            []string              `json:"vswitch_ids"`
	EndpointPublicAccess  bool                  `json:"public_slb"`
	PrivateZone           bool                  `json:"private_zone"`
	NatGateway            bool                  `json:"nat_gateway"`
	KubernetesVersion     string                `json:"kubernetes_version"`
	DeletionProtection    bool                  `json:"deletion_protection"`
	SecurityGroupId       string                `json:"security_group_id"`
	Tags                  []Tag                 `json:"tags"`
	Addons                []Addon               `json:"addons"`
	ResourceGroupId       string                `json:"resource_group_id"`
	ClusterSpec           string                `json:"cluster_spec"`
	LoadBalancerSpec      string                `json:"load_balancer_spec"` //api server slb实例规格
	ServiceCIDR           string                `json:"service_cidr"`
	TimeZone              string                `json:"timezone"`
	ServiceDiscoveryTypes []string              `json:"service_discovery_types"`
	ZoneID                string                `json:"zone_id"`
	LoggingType           string                `json:"logging_type"`
	SLSProjectName        string                `json:"sls_project_name"`
}

func (*ServerlessCreationArgs) Validate

func (this *ServerlessCreationArgs) Validate() error

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 SpotPrice

type SpotPrice struct {
	InstanceType string `json:"instance_type"`
	PriceLimit   string `json:"price_limit"`
}

type SwarmNodeType

type SwarmNodeType struct {
	IP                string
	Healthy           bool
	InstanceId        string
	ZoneId            string
	RegionId          string
	Status            string
	CreationTime      string `json:"created"`
	UpdatedTime       string `json:"updated"`
	Containers        int
	ContainersRunning int
	ContainersPaused  int
	ContainersStopped int
	AgentVersion      string
	Name              string
}

type TEEConfig

type TEEConfig struct {
	TEEType   string `json:"tee_type"`
	TEEEnable bool   `json:"tee_enable"`
}

加密计算节点池

type Tag

type Tag struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Taint

type Taint struct {
	Key    string `json:"key"`
	Value  string `json:"value"`
	Effect Effect `json:"effect"`
}

taint

type TaskState

type TaskState string

type UpdateNodePoolRequest

type UpdateNodePoolRequest struct {
	RegionId         common.Region `json:"region_id"`
	Count            int64         `json:"count"`
	NodePoolInfo     `json:"nodepool_info"`
	ScalingGroup     `json:"scaling_group"`
	KubernetesConfig `json:"kubernetes_config"`
	AutoScaling      `json:"auto_scaling"`
	Management       `json:"management"`
}

type UpgradeClusterArgs

type UpgradeClusterArgs struct {
	Version string `json:"version"`
}

type UpgradeClusterResult

type UpgradeClusterResult struct {
	Status           TaskState `json:"status"`
	PrecheckReportId string    `json:"precheck_report_id"`
	UpgradeStep      string    `json:"upgrade_step"`
	ErrorMessage     string    `json:"error_message"`
	*UpgradeTask     `json:"upgrade_task,omitempty"`
}

type UpgradeConf

type UpgradeConf struct {
	AutoUpgrade       bool  `json:"auto_upgrade"`
	Surge             int64 `json:"surge"`
	SurgePercentage   int64 `json:"surge_percentage,omitempty"`
	MaxUnavailable    int64 `json:"max_unavailable"`
	KeepSurgeOnFailed bool  `json:"keep_surge_on_failed"`
}

type UpgradeStatus

type UpgradeStatus struct {
	State      string  `json:"state"`
	Phase      string  `json:"phase"` // {Master1, Master2, Master3, Nodes}
	Total      int     `json:"total"`
	Succeeded  int     `json:"succeeded"`
	Failed     string  `json:"failed"`
	Events     []Event `json:"events"`
	IsCanceled bool    `json:"is_canceled"`
}

type UpgradeTask

type UpgradeTask struct {
	FieldRetries    int           `json:"retries,omitempty"`
	FieldCreatedAt  time.Time     `json:"created_at"`
	FieldMessage    string        `json:"message,omitempty"`
	FieldStatus     string        `json:"status"` // empty|running|success|failed
	FieldFinishedAt time.Time     `json:"finished_at,omitempty"`
	UpgradeStatus   UpgradeStatus `json:"upgrade_status"`
}

type VolumeCreationArgs

type VolumeCreationArgs struct {
	Name       string           `json:"name"`
	Driver     VolumeDriverType `json:"driver"`
	DriverOpts DriverOptions    `json:"driverOpts"`
}

type VolumeCreationResponse

type VolumeCreationResponse struct {
	Name       string            `json:"Name"`
	Driver     string            `json:"Driver"`
	Mountpoint string            `json:"Mountpoint"`
	Labels     map[string]string `json:"Labels"`
	Scope      string            `json:"Scope"`
}

type VolumeDriverType

type VolumeDriverType string
const (
	OSSFSDriver VolumeDriverType = "ossfs"
	NASDriver   VolumeDriverType = "nas"
)

type VolumeRef

type VolumeRef struct {
	Name string `json:"Name"`
	ID   string `json:"ID"`
}

type WeeklyPeriod

type WeeklyPeriod string

type WorkerArgs

type WorkerArgs struct {
	WorkerVSwitchIds    []string `json:"worker_vswitch_ids"`
	WorkerInstanceTypes []string `json:"worker_instance_types"`

	NumOfNodes int64 `json:"num_of_nodes"`

	WorkerInstanceChargeType string `json:"worker_instance_charge_type"`
	WorkerPeriod             int    `json:"worker_period"`
	WorkerPeriodUnit         string `json:"worker_period_unit"`

	WorkerAutoRenew       bool `json:"worker_auto_renew"`
	WorkerAutoRenewPeriod int  `json:"worker_auto_renew_period"`

	WorkerSystemDiskCategory         ecs.DiskCategory `json:"worker_system_disk_category"`
	WorkerSystemDiskSize             int64            `json:"worker_system_disk_size"`
	WorkerSystemDiskPerformanceLevel string           `json:"worker_system_disk_performance_level"`

	WorkerDataDisk  bool       `json:"worker_data_disk"`
	WorkerDataDisks []DataDisk `json:"worker_data_disks"` //支持多个数据盘

	WorkerHpcClusterId    string `json:"worker_hpc_cluster_id"`
	WorkerDeploymentSetId string `json:"worker_deploymentset_id"`

	//worker node deletion protection
	WorkerDeletionProtection *bool `json:"worker_deletion_protection"`

	//Runtime only for worker nodes
	Runtime Runtime `json:"runtime"`

	// disk snapshot policy
	WorkerSnapshotPolicyId string `json:"worker_system_disk_snapshot_policy_id"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL