Documentation ¶
Index ¶
- Constants
- type AdvancedOptions
- type BaseCreateOrderRequestVo
- type BccConfig
- type CceNodeInfo
- type CdsConfig
- type CdsPreMountInfo
- type Client
- func (c *Client) CreateCluster(args *CreateClusterArgs) (*CreateClusterResult, error)
- func (c *Client) DeleteCluster(args *DeleteClusterArgs) error
- func (c *Client) GetCluster(clusterUuid string) (*GetClusterResult, error)
- func (c *Client) GetContainerNet(args *GetContainerNetArgs) (*GetContainerNetResult, error)
- func (c *Client) GetKubeConfig(args *GetKubeConfigArgs) (*GetKubeConfigResult, error)
- func (c *Client) ListClusters(args *ListClusterArgs) (*ListClusterResult, error)
- func (c *Client) ListExistedBccNode(args *ListExistedNodeArgs) (*ListExistedNodeResult, error)
- func (c *Client) ListNodes(args *ListNodeArgs) (*ListNodeResult, error)
- func (c *Client) ListVersions() (*ListVersionsResult, error)
- func (c *Client) ScalingDown(args *ScalingDownArgs) error
- func (c *Client) ScalingUp(args *ScalingUpArgs) (*ScalingUpResult, error)
- func (c *Client) ShiftInNode(args *ShiftInNodeArgs) error
- func (c *Client) ShiftOutNode(args *ShiftOutNodeArgs) error
- type Cluster
- type ClusterStatus
- type CniMode
- type CniType
- type CreateClusterArgs
- type CreateClusterResult
- type DNSMode
- type DeleteClusterArgs
- type DeployMode
- type DiskSizeConfig
- type EipConfig
- type EipType
- type GetClusterResult
- type GetContainerNetArgs
- type GetContainerNetResult
- type GetKubeConfigArgs
- type GetKubeConfigResult
- type ImageType
- type InstanceType
- type Item
- type KeywordType
- type KubeConfigType
- type KubeProxyMode
- type ListClusterArgs
- type ListClusterResult
- type ListExistedNodeArgs
- type ListExistedNodeResult
- type ListNodeArgs
- type ListNodeResult
- type ListVersionsResult
- type Node
- type NodeInfo
- type Order
- type ProductType
- type ScalingDownArgs
- type ScalingUpArgs
- type ScalingUpResult
- type ServerForDisplay
- type ServiceType
- type ShiftInNodeArgs
- type ShiftInstanceType
- type ShiftOutNodeArgs
- type SimpleNode
- type VolumeType
Constants ¶
const ( URI_PREFIX = bce.URI_PREFIX + "v1" DEFAULT_ENDPOINT = "cce." + bce.DEFAULT_REGION + ".baidubce.com" REQUEST_CLUSTER_URL = "/cluster" REQUEST_NODE_URL = "/node" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdvancedOptions ¶
type AdvancedOptions struct { KubeProxyMode KubeProxyMode `json:"kubeProxyMode,omitempty"` SecureContainerEnable bool `json:"secureContainerEnable,omitempty"` SetOSSecurity bool `json:"setOSSecurity,omitempty"` CniMode CniMode `json:"cniMode,omitempty"` CniType CniType `json:"cniType,omitempty"` DnsMode DNSMode `json:"dnsMode,omitempty"` MaxPodNum int `json:"maxPodNum,omitempty"` }
type BaseCreateOrderRequestVo ¶
type BaseCreateOrderRequestVo struct {
Items []Item `json:"items"`
}
type BccConfig ¶
type BccConfig struct { Name string `json:"name,omitempty"` KeypairId string `json:"keypairId,omitempty"` ProductType ProductType `json:"productType"` LogicalZone string `json:"logicalZone,omitempty"` InstanceType InstanceType `json:"instanceType"` GpuCard string `json:"gpuCard,omitempty"` GpuCount int `json:"gpuCount"` Cpu int `json:"cpu"` Memory int `json:"memory"` ImageType ImageType `json:"imageType"` SubnetUuid string `json:"subnetUuid"` SecurityGroupId string `json:"securityGroupId"` AdminPass string `json:"adminPass,omitempty"` PurchaseLength int `json:"purchaseLength,omitempty"` PurchaseNum int `json:"purchaseNum"` RootDiskSizeInGb int `json:"rootDiskSizeInGb,omitempty"` RootDiskStorageType VolumeType `json:"rootDiskStorageType,omitempty"` AutoRenewTimeUnit string `json:"autoRenewTimeUnit,omitempty"` AutoRenewTime int `json:"autoRenewTime,omitempty"` AutoRenew bool `json:"autoRenew,omitempty"` ImageId string `json:"imageId"` ServiceType ServiceType `json:"serviceType"` }
type CceNodeInfo ¶
type CdsConfig ¶
type CdsConfig struct { ProductType ProductType `json:"productType"` LogicalZone string `json:"logicalZone"` PurchaseNum int `json:"purchaseNum"` PurchaseLength int `json:"purchaseLength,omitempty"` AutoRenewTimeUnit string `json:"autoRenewTimeUnit,omitempty"` AutoRenewTime int `json:"autoRenewTime,omitempty"` CdsDiskSize []DiskSizeConfig `json:"cdsDiskSize"` ServiceType ServiceType `json:"serviceType"` }
type CdsPreMountInfo ¶
type CdsPreMountInfo struct { MountPath string `json:"mountPath"` CdsConfig []DiskSizeConfig `json:"cdsConfig"` }
type Client ¶
Client of EIP service is a kind of BceClient, so derived from BceClient
func (*Client) CreateCluster ¶
func (c *Client) CreateCluster(args *CreateClusterArgs) (*CreateClusterResult, error)
CreateCluster - create an CCE Cluster with the specific parameters
PARAMS:
- args: the arguments to create a cce cluster
RETURNS:
- *CreateClusterResult: the result of create cluster, contains new Cluster's uuid and order id
func (*Client) DeleteCluster ¶
func (c *Client) DeleteCluster(args *DeleteClusterArgs) error
DeleteCluster - delete a CCE Cluster
PARAMS:
- args: the arguments to delete a cce cluster
func (*Client) GetCluster ¶
func (c *Client) GetCluster(clusterUuid string) (*GetClusterResult, error)
GetCluster - get a CCE Cluster with the specific cluster uuid
PARAMS:
- args: the specific cluster uuid
RETURNS:
- *GetClusterResult: the detail information about the CCE Cluster
func (*Client) GetContainerNet ¶
func (c *Client) GetContainerNet(args *GetContainerNetArgs) (*GetContainerNetResult, error)
GetContainerNet - get container net in vpc
PARAMS:
- args: the arguments to get args
RETURNS:
- *GetContainerNetResult: the result of container net
func (*Client) GetKubeConfig ¶
func (c *Client) GetKubeConfig(args *GetKubeConfigArgs) (*GetKubeConfigResult, error)
GetKubeConfig - get config file of CCE Cluster
PARAMS:
- args: the arguments to get config file of a cce cluster
RETURNS:
- *GetKubeConfigResult: the kubeconfig file data
func (*Client) ListClusters ¶
func (c *Client) ListClusters(args *ListClusterArgs) (*ListClusterResult, error)
ListClusters - list CCE Clusters with the specific parameters
PARAMS:
- args: the arguments to list cce cluster
RETURNS:
- *ListClusterResult: the result of list cluster
func (*Client) ListExistedBccNode ¶
func (c *Client) ListExistedBccNode(args *ListExistedNodeArgs) (*ListExistedNodeResult, error)
ListExistedBccNode - list all bcc nodes which can shifted into CCE cluster
PARAMS:
- args: the arguments to list bcc nodes
RETURNS:
- *ListExistedNodeResult: the result of list nodes
func (*Client) ListNodes ¶
func (c *Client) ListNodes(args *ListNodeArgs) (*ListNodeResult, error)
ListNodes - list all nodes in CCE Cluster
PARAMS:
- args: the arguments to list all nodes
RETURNS:
- *ListNodeResult: the result of list nodes, contains a Cluster's nodes
func (*Client) ListVersions ¶
func (c *Client) ListVersions() (*ListVersionsResult, error)
ListVersions - list all support kubernetes version
RETURNS:
- *ListVersionsResult: all support kubernetes version list
func (*Client) ScalingDown ¶
func (c *Client) ScalingDown(args *ScalingDownArgs) error
ScalingDown - scaling down a CCE Cluster
PARAMS:
- args: the arguments to scaling down a cce cluster
func (*Client) ScalingUp ¶
func (c *Client) ScalingUp(args *ScalingUpArgs) (*ScalingUpResult, error)
ScalingUp - scaling up a CCE Cluster
PARAMS:
- args: the arguments to create a cce cluster
RETURNS:
- *ScalingUpResult: the result of scaling up cluster, contains new Cluster's uuid and order id
func (*Client) ShiftInNode ¶
func (c *Client) ShiftInNode(args *ShiftInNodeArgs) error
ShiftInNode - shift nodes into cluster
PARAMS:
- args: the arguments about shift nodes into cce cluster
func (*Client) ShiftOutNode ¶
func (c *Client) ShiftOutNode(args *ShiftOutNodeArgs) error
ShiftOutNode - shift nodes out from CCE Cluster
PARAMS:
- args: the arguments about shift nodes out from cce cluster
type Cluster ¶
type Cluster struct { ClusterUuid string `json:"clusterUuid"` ClusterName string `json:"clusterName"` SlaveVmCount int `json:"slaveVmCount"` MasterVmCount int `json:"masterVmCount"` ContainerNet string `json:"containerNet"` Status ClusterStatus `json:"status"` Region string `json:"region"` CreateTime time.Time `json:"createTime"` DeleteTime time.Time `json:"deleteTime"` AllInstanceNormal bool `json:"allInstanceNormal"` InstanceList []SimpleNode `json:"instanceList"` DccUuid string `json:"dccUuid"` HasPrepay bool `json:"hasPrepay"` VpcId string `json:"vpcId"` InstanceMode string `json:"instanceMode"` MasterExposed bool `json:"masterExposed"` }
type ClusterStatus ¶
type ClusterStatus string
const ( ClusterStatusRunning ClusterStatus = "RUNNING" ClusterStatusCreating ClusterStatus = "CREATING" ClusterStatusCreateFailed ClusterStatus = "CREATE_FAILED" ClusterStatusDeleting ClusterStatus = "DELETING" ClusterStatusDeletingFailed ClusterStatus = "DELETE_FAILED" ClusterStatusMasterUpgrading ClusterStatus = "MASTER_UPGRADING" ClusterStatusMasterUpgradeFailed ClusterStatus = "MASTER_UPGRADE_FAILED" ClusterStatusError ClusterStatus = "ERROR" ClusterStatusDeleted ClusterStatus = "DELETED" )
type CniType ¶
type CniType string
const ( CniTypeEmpty CniType = "" CniTypeRouteVeth CniType = "VPC_ROUTE_VETH" CniTypeRouteIpvlan CniType = "VPC_ROUTE_IPVLAN" CniTypeRouteAutoDetect CniType = "VPC_ROUTE_AUTODETECT" CniTypeSecondaryIpVeth CniType = "VPC_SECONDARY_IP_VETH" CniTypeSecondaryIpIpvlan CniType = "VPC_SECONDARY_IP_IPVLAN" CniTypeSecondaryIpAutoDetect CniType = "VPC_SECONDARY_IP_AUTODETECT" )
type CreateClusterArgs ¶
type CreateClusterArgs struct { ClusterName string `json:"clusterName"` Version string `json:"version"` MainAvailableZone string `json:"mainAvailableZone"` ContainerNet string `json:"containerNet"` AdvancedOptions *AdvancedOptions `json:"advancedOptions,omitempty"` CdsPreMountInfo *CdsPreMountInfo `json:"cdsPreMountInfo,omitempty"` Comment string `json:"comment,omitempty"` DeployMode DeployMode `json:"deployMode"` DccUuid string `json:"dccUuid,omitempty"` MasterExposed bool `json:"masterExposed,omitempty"` OrderContent *BaseCreateOrderRequestVo `json:"orderContent"` MasterOrderContent *BaseCreateOrderRequestVo `json:"masterOrderContent,omitempty"` }
type CreateClusterResult ¶
type DeleteClusterArgs ¶
type DeployMode ¶
type DeployMode string
const ( DeployModeBcc DeployMode = "BCC" DeployModeDcc DeployMode = "DCC" )
type DiskSizeConfig ¶
type DiskSizeConfig struct { Size string `json:"size"` VolumeType VolumeType `json:"volumeType"` SnapshotId string `json:"snapshotId,omitempty"` }
type EipConfig ¶
type EipConfig struct { ProductType ProductType `json:"productType"` BandwidthInMbps int `json:"bandwidthInMbps"` SubProductType EipType `json:"subProductType"` PurchaseNum int `json:"purchaseNum"` PurchaseLength int `json:"purchaseLength,omitempty"` AutoRenewTime int `json:"autoRenewTime,omitempty"` AutoRenewTimeUnit string `json:"autoRenewTimeUnit,omitempty"` Name string `json:"name,omitempty"` ServiceType ServiceType `json:"serviceType"` }
type GetClusterResult ¶
type GetClusterResult struct { ClusterUuid string `json:"clusterUuid"` ClusterName string `json:"clusterName"` Version string `json:"version"` Region string `json:"region"` SlaveVmCount int `json:"slaveVmCount"` MasterVmCount int `json:"masterVmCount"` VpcId string `json:"vpcId"` VpcUuid string `json:"vpcUuid"` VpcCidr string `json:"vpcCidr"` ZoneSubnetMap map[string]string `json:"zoneSubnetMap"` ContainerNet string `json:"containerNet"` AdvancedOptions *AdvancedOptions `json:"advancedOptions"` Status ClusterStatus `json:"status"` CreateStartTime time.Time `json:"createStartTime"` DeleteTime time.Time `json:"deleteTime"` Comment string `json:"comment"` InstanceMode string `json:"instanceMode"` HasPrepay bool `json:"hasPrepay"` VpcName string `json:"vpcName"` SecureContainerEnable bool `json:"secureContainerEnable"` MasterZoneSubnetMap map[string]string `json:"masterZoneSubnetMap"` MasterExposed bool `json:"masterExposed"` }
type GetContainerNetArgs ¶
type GetContainerNetResult ¶
type GetKubeConfigArgs ¶
type GetKubeConfigArgs struct { ClusterUuid string Type KubeConfigType }
type GetKubeConfigResult ¶
type GetKubeConfigResult struct {
Data string `json:"data"`
}
type InstanceType ¶
type InstanceType string
const ( InstanceTypeG1 InstanceType = "0" InstanceTypeDCC InstanceType = "1" InstanceTypeBCC InstanceType = "2" InstanceTypeC1 InstanceType = "4" InstanceTypeG2 InstanceType = "7" InstanceTypeGPU InstanceType = "9" InstanceTypeG3 InstanceType = "10" InstanceTypeC2 InstanceType = "11" InstanceTypeG4 InstanceType = "13" InstanceTypeVGPU InstanceType = "15" InstanceTypeKunlun InstanceType = "25" )
type KeywordType ¶
type KeywordType string
const ( KeywordTypeName KeywordType = "name" KeywordTypeInstanceId KeywordType = "instanceId" )
type KubeConfigType ¶
type KubeConfigType string
const ( KubeConfigTypeDefault KubeConfigType = "default" KubeConfigTypeInternal KubeConfigType = "internal" KubeConfigTypeIntraVpc KubeConfigType = "intraVpc" )
type KubeProxyMode ¶
type KubeProxyMode string
const ( KubeProxyModeIptables KubeProxyMode = "iptables" KubeProxyModeIpvs KubeProxyMode = "ipvs" )
type ListClusterArgs ¶
type ListClusterArgs struct { Status ClusterStatus Marker string MaxKeys int }
type ListClusterResult ¶
type ListExistedNodeArgs ¶
type ListExistedNodeArgs struct { ClusterUuid string `json:"clusterUuid"` VpcId string `json:"vpcId,omitempty"` VpcCidr string `json:"vpcCidr,omitempty"` InstanceType ShiftInstanceType `json:"instanceType,omitempty"` BBCFlavorId string `json:"bbcFlavorId,omitempty"` KeywordType KeywordType `json:"keywordType,omitempty"` Keyword string `json:"keyword,omitempty"` OrderBy string `json:"orderBy,omitempty"` Order Order `json:"order,omitempty"` PageNo int `json:"pageNo,omitempty"` PageSize int `json:"pageSize,omitempty"` }
type ListExistedNodeResult ¶
type ListNodeArgs ¶
type ListNodeResult ¶
type ListVersionsResult ¶
type ListVersionsResult struct {
Data []string `json:"data"`
}
type Node ¶
type Node struct { InstanceShortId string `json:"instanceShortId"` InstanceUuid string `json:"instanceUuid"` InstanceName string `json:"instanceName"` ClusterUuid string `json:"clusterUuid"` AvailableZone string `json:"availableZone"` VpcId string `json:"vpcId"` VpcCidr string `json:"vpcCidr"` SubnetId string `json:"subnetId"` SubnetType string `json:"subnetType"` Eip string `json:"eip"` EipBandwidth int `json:"eipBandwidth"` Cpu int `json:"cpu"` Memory int `json:"memory"` DiskSize int `json:"diskSize"` SysDisk int `json:"sysDisk"` InstanceType string `json:"instanceType"` Blb string `json:"blb"` FloatingIp string `json:"floatingIp"` FixIp string `json:"fixIp"` CreateTime time.Time `json:"createTime"` DeleteTime time.Time `json:"deleteTime"` Status string `json:"status"` ExpireTime time.Time `json:"expireTime"` PaymentMethod string `json:"paymentMethod"` RuntimeVersion string `json:"runtimeVersion"` }
type ProductType ¶
type ProductType string
const ( ProductTypePostpay ProductType = "postpay" ProductTypePrepay ProductType = "prepay" )
type ScalingDownArgs ¶
type ScalingUpArgs ¶
type ScalingUpArgs struct { ClusterUuid string `json:"clusterUuid"` DccUuid string `json:"dccUuid,omitempty"` CdsPreMountInfo *CdsPreMountInfo `json:"cdsPreMountInfo,omitempty"` OrderContent *BaseCreateOrderRequestVo `json:"orderContent"` }
type ScalingUpResult ¶
type ServerForDisplay ¶
type ServiceType ¶
type ServiceType string
const ( ServiceTypeBCC ServiceType = "BCC" ServiceTypeCDS ServiceType = "CDS" ServiceTypeEIP ServiceType = "EIP" )
type ShiftInNodeArgs ¶
type ShiftInNodeArgs struct { ClusterUuid string `json:"clusterUuid"` NeedRebuild bool `json:"needRebuild"` ImageId string `json:"imageId,omitempty"` AdminPass string `json:"adminPass"` InstanceType ShiftInstanceType `json:"instanceType"` NodeInfoList []CceNodeInfo `json:"nodeInfoList"` }
type ShiftInstanceType ¶
type ShiftInstanceType string
const ( ShiftInstanceTypeBcc ShiftInstanceType = "BCC" ShiftInstanceTypeBBC ShiftInstanceType = "BBC" )
type ShiftOutNodeArgs ¶
type ShiftOutNodeArgs struct { ClusterUuid string `json:"clusterUuid"` NodeInfoList []CceNodeInfo `json:"nodeInfoList"` }
type SimpleNode ¶
type SimpleNode struct { InstanceShortId string `json:"instanceShortId"` InstanceUuid string `json:"instanceUuid"` InstanceName string `json:"instanceName"` ClusterUuid string `json:"clusterUuid"` Status ClusterStatus `json:"status"` }
type VolumeType ¶
type VolumeType string
const ( VolumeTypeSata VolumeType = "sata" VolumeTypeSsd VolumeType = "ssd" VolumeTypePremiumSsd VolumeType = "premium_ssd" )