v2

package
v0.9.22 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	URI_PREFIX = bce.URI_PREFIX + "api/cce/service/v2"

	DEFAULT_ENDPOINT = "cce." + bce.DEFAULT_REGION + ".baidubce.com"

	REQUEST_CLUSTER_URL = "/cluster"

	REQUEST_CLUSTER_LIST_URL = "/clusters"

	REQUEST_INSTANCE_URL = "/instance"

	REQUEST_INSTANCE_LIST_URL = "/instances"

	REQUEST_INSTANCEGROUP_URL = "/instancegroup"

	REQUEST_INSTANCEGROUP_LIST_URL = "/instancegroups"

	REQUEST_INSTANCEGROUP_AUTOSCALER_URL = "/autoscaler"

	REQUEST_INSTANCEGROUP_REPLICAS_URL = "/replicas"

	REQUEST_QUOTA_URL = "/quota"

	REQUEST_NODE_URL = "/node"

	REQUEST_NET_URL = "/net"

	REQUEST_NET_CHECK_CONTAINER_NETWORK_CIDR_URL = "/check_container_network_cidr"

	REQUEST_NET_CHECK_CLUSTERIP_CIDR_URL = "/check_clusterip_cidr"

	REQUEST_NET_RECOMMEND_CLSUTERIP_CIDR_URL = "/recommend_clusterip_cidr"

	REQUEST_NET_RECOMMEND_CONTAINER_CIDR_URL = "/recommend_container_cidr"
)
View Source
const (
	// PageNoDefault 分页查询默认页码
	PageNoDefault int = 1
	// PageSizeDefault 分页查询默认页面元素数目
	PageSizeDefault int = 10
)
View Source
const (
	// MaxClusterIPServiceNum 集群最大的 ClusterIP Service 数量
	MaxClusterIPServiceNum = 65536
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Autoscaler

type Autoscaler struct {
	ClusterID   string                  `json:"clusterID"`
	ClusterName string                  `json:"clusterName"`
	CAConfig    ClusterAutoscalerConfig `json:"caConfig,omitempty"`
}

type BLB

type BLB struct {
	ID    string `json:"id"`
	VPCIP string `json:"vpcIP"`
	EIP   string `json:"eip"`
}

BLB 定义 BLB 类型

type CheckClusterIPCIDRArgs

type CheckClusterIPCIDRArgs struct {
	VPCID             string                       `json:"vpcID"`
	VPCCIDR           string                       `json:"vpcCIDR"`
	VPCCIDRIPv6       string                       `json:"vpcCIDRIPv6"`
	ClusterIPCIDR     string                       `json:"clusterIPCIDR"`
	ClusterIPCIDRIPv6 string                       `json:"clusterIPCIDRIPv6"`
	IPVersion         types.ContainerNetworkIPType `json:"ipVersion"` // if not set, set ipv4
}

CheckClusterIPCIDRequest - 检查 ClusterIP CIDR 请求

type CheckClusterIPCIDRResponse

type CheckClusterIPCIDRResponse struct {
	IsConflict bool   `json:"isConflict"`
	ErrMsg     string `json:"errMsg"`
	RequestID  string `json:"requestID"`
}

CheckClusterIPCIDRResponse - 检查 ClusterIP CIDR 返回

type CheckContainerNetworkCIDRArgs

type CheckContainerNetworkCIDRArgs struct {
	VPCID             string                       `json:"vpcID"`
	VPCCIDR           string                       `json:"vpcCIDR"`
	VPCCIDRIPv6       string                       `json:"vpcCIDRIPv6"`
	ContainerCIDR     string                       `json:"containerCIDR"`
	ContainerCIDRIPv6 string                       `json:"containerCIDRIPv6"`
	ClusterIPCIDR     string                       `json:"clusterIPCIDR"`
	ClusterIPCIDRIPv6 string                       `json:"clusterIPCIDRIPv6"`
	MaxPodsPerNode    int                          `json:"maxPodsPerNode"`
	IPVersion         types.ContainerNetworkIPType `json:"ipVersion"` // if not set, set ipv4
}

CheckContainerNetworkCIDRRequest 包含检查容器网络网段冲突的请求参数

type CheckContainerNetworkCIDRResponse

type CheckContainerNetworkCIDRResponse struct {
	MaxNodeNum int `json:"maxNodeNum"`
	NetworkConflictInfo
	RequestID string `json:"requestID"`
}

CheckContainerNetworkCIDRResponse 检查容器网络网段冲突的响应

type CleanPolicy

type CleanPolicy string

type Client

type Client struct {
	*bce.BceClient
}

Client 实现 ccev2.Interface

func NewClient

func NewClient(ak, sk, endPoint string) (*Client, error)

func (*Client) CheckClusterIPCIDR

func (c *Client) CheckClusterIPCIDR(args *CheckClusterIPCIDRArgs) (*CheckClusterIPCIDRResponse, error)

检查集群网络网段

func (*Client) CheckContainerNetworkCIDR

func (c *Client) CheckContainerNetworkCIDR(args *CheckContainerNetworkCIDRArgs) (*CheckContainerNetworkCIDRResponse, error)

检查容器网络网段

func (*Client) CreateCluster

func (c *Client) CreateCluster(args *CreateClusterArgs) (*CreateClusterResponse, error)

创建集群

func (*Client) CreateInstanceGroup

func (c *Client) CreateInstanceGroup(args *CreateInstanceGroupArgs) (*CreateInstanceGroupResponse, error)

创建节点组

func (*Client) CreateInstances

func (c *Client) CreateInstances(args *CreateInstancesArgs) (*CreateInstancesResponse, error)

创建节点(扩容)

func (*Client) DeleteCluster

func (c *Client) DeleteCluster(args *DeleteClusterArgs) (*DeleteClusterResponse, error)

删除集群

func (*Client) DeleteInstanceGroup

func (c *Client) DeleteInstanceGroup(args *DeleteInstanceGroupArgs) (*DeleteInstanceGroupResponse, error)

删除节点组

func (*Client) DeleteInstances

func (c *Client) DeleteInstances(args *DeleteInstancesArgs) (*DeleteInstancesResponse, error)

删除节点(缩容)

func (*Client) GetCluster

func (c *Client) GetCluster(clusterID string) (*GetClusterResponse, error)

获得集群详情

func (*Client) GetClusterNodeQuota

func (c *Client) GetClusterNodeQuota(clusterID string) (*GetQuotaResponse, error)

用户集群 Node Quota

func (*Client) GetClusterQuota

func (c *Client) GetClusterQuota() (*GetQuotaResponse, error)

用户集群 Quota

func (*Client) GetInstance

func (c *Client) GetInstance(args *GetInstanceArgs) (*GetInstanceResponse, error)

查询节点

func (*Client) GetInstanceGroup

func (c *Client) GetInstanceGroup(args *GetInstanceGroupArgs) (*GetInstanceGroupResponse, error)

获取节点组详情

func (*Client) ListClusters

func (c *Client) ListClusters(args *ListClustersArgs) (*ListClustersResponse, error)

集群列表

func (*Client) ListInstanceGroups

func (c *Client) ListInstanceGroups(args *ListInstanceGroupsArgs) (*ListInstanceGroupResponse, error)

获取节点组列表

func (*Client) ListInstancesByPage

func (c *Client) ListInstancesByPage(args *ListInstancesByPageArgs) (*ListInstancesResponse, error)

集群内节点列表

func (*Client) RecommendClusterIPCIDR

func (c *Client) RecommendClusterIPCIDR(args *RecommendClusterIPCIDRArgs) (*RecommendClusterIPCIDRResponse, error)

推荐集群CIDR

func (*Client) RecommendContainerCIDR

func (c *Client) RecommendContainerCIDR(args *RecommendContainerCIDRArgs) (*RecommendContainerCIDRResponse, error)

推荐容器CIDR

func (*Client) UpdateInstanceGroupReplicas

func (c *Client) UpdateInstanceGroupReplicas(args *UpdateInstanceGroupReplicasArgs) (*UpdateInstanceGroupReplicasResponse, error)

更新节点组副本数

type Cluster

type Cluster struct {
	Spec   *ClusterSpec   `json:"spec"`
	Status *ClusterStatus `json:"status"`

	CreatedAt time.Time `json:"createdAt,omitempty"`
	UpdatedAt time.Time `json:"updatedAt,omitempty"`
}

Cluster - Cluster 返回

type ClusterAutoscalerConfig

type ClusterAutoscalerConfig struct {
	KubeVersion    string                           `json:"kubeVersion,omitempty"`
	ReplicaCount   int                              `json:"replicaCount"`
	InstanceGroups []ClusterAutoscalerInstanceGroup `json:"instanceGroups,omitempty"`
	// default: false
	ScaleDownEnabled bool `json:"scaleDownEnabled"`
	// 可选,缩容阈值百分比,范围(0, 100)
	ScaleDownUtilizationThreshold *int `json:"scaleDownUtilizationThreshold,omitempty"`
	// 可选,GPU缩容阈值百分比,范围(0, 100)
	ScaleDownGPUUtilizationThreshold *int `json:"scaleDownGPUUtilizationThreshold,omitempty"`
	// 可选,缩容触发时延,单位:m
	ScaleDownUnneededTime *int `json:"scaleDownUnneededTime,omitempty"`
	// 可选,扩容后缩容启动时延,单位:m
	ScaleDownDelayAfterAdd *int `json:"scaleDownDelayAfterAdd,omitempty"`
	// 可选,最大并发缩容数
	MaxEmptyBulkDelete *int `json:"maxEmptyBulkDelete,omitempty"`
	// 可选,
	SkipNodesWithLocalStorage *bool `json:"skipNodesWithLocalStorage,omitempty"`
	// 可选,
	SkipNodesWithSystemPods *bool `json:"skipNodesWithSystemPods,omitempty"`
	// supported: random, most-pods, least-waste, priority; default: random
	Expander string `json:"expander"`
}

type ClusterAutoscalerInstanceGroup

type ClusterAutoscalerInstanceGroup struct {
	InstanceGroupID string
	MinReplicas     int
	MaxReplicas     int
	Priority        int
}

type ClusterAutoscalerSpec

type ClusterAutoscalerSpec struct {
	Enabled              bool `json:"enabled"`
	MinReplicas          int  `json:"minReplicas"`
	MaxReplicas          int  `json:"maxReplicas"`
	ScalingGroupPriority int  `json:"scalingGroupPriority"`
}

type ClusterIPCIDRConflict

type ClusterIPCIDRConflict struct {
	// NetworkConflictType 冲突类型,可取的值: ClusterIPCIDRAndNodeCIDRConflict、ClusterIPCIDRAndContainerCIDRConflict
	ConflictType NetworkConflictType `json:"conflictType"`
	// ConflictNodeCIDR 与 ClusterIP 网段冲突的节点网段,当且仅当 NetworkConflictType 为 ClusterIPCIDRAndNodeCIDRConflict 不为 nil
	ConflictNodeCIDR *ConflictNodeCIDR `json:"conflictNodeCIDR"`
	// ConflictContainerCIDR 与 ClusterIP 网段冲突的节点网段,当且仅当 NetworkConflictType 为 ClusterIPCIDRAndContainerCIDRConflict 不为 nil
	ConflictContainerCIDR *ConflictContainerCIDR `json:"conflictContainerCIDR"`
}

ClusterIPCIDRConflict ClusterIP 网段冲突信息

type ClusterKeywordType

type ClusterKeywordType string

ClusterKeywordType 集群模糊查询字段

const (
	// ClusterKeywordTypeClusterName 集群模糊查询字段: ClusterName
	ClusterKeywordTypeClusterName ClusterKeywordType = "clusterName"
	// ClusterKeywordTypeClusterID 集群模糊查询字段: ClusterID
	ClusterKeywordTypeClusterID ClusterKeywordType = "clusterID"
)

type ClusterOrderBy

type ClusterOrderBy string

ClusterOrderBy 集群查询排序字段

const (
	// ClusterOrderByClusterName 集群查询排序字段: ClusterName
	ClusterOrderByClusterName ClusterOrderBy = "clusterName"
	// ClusterOrderByClusterID 集群查询排序字段: ClusterID
	ClusterOrderByClusterID ClusterOrderBy = "clusterID"
	// ClusterOrderByCreatedAt 集群查询排序字段: CreatedAt
	ClusterOrderByCreatedAt ClusterOrderBy = "createdAt"
)

type ClusterPage

type ClusterPage struct {
	KeywordType ClusterKeywordType `json:"keywordType"`
	Keyword     string             `json:"keyword"`
	OrderBy     ClusterOrderBy     `json:"orderBy"`
	Order       Order              `json:"order"`
	PageNo      int                `json:"pageNo"`
	PageSize    int                `json:"pageSize"`
	TotalCount  int                `json:"totalCount"`
	ClusterList []*Cluster         `json:"clusterList"`
}

ClusterPage - 集群分页查询返回

type ClusterSpec

type ClusterSpec struct {
	ClusterID   string            `json:"clusterID"`
	ClusterName string            `json:"clusterName"`
	ClusterType types.ClusterType `json:"clusterType"`

	Description string `json:"description"`

	K8SVersion types.K8SVersion `json:"k8sVersion"`

	VPCID   string `json:"vpcID"`
	VPCCIDR string `json:"vpcCIDR"`

	Plugins []string `json:"plugins"`

	MasterConfig           types.MasterConfig           `json:"masterConfig"`
	ContainerNetworkConfig types.ContainerNetworkConfig `json:"containerNetworkConfig"`
}

作为返回值的ClusterSpec

type ClusterStatus

type ClusterStatus struct {
	ClusterBLB BLB `json:"clusterBLB"`

	ClusterPhase types.ClusterPhase `json:"clusterPhase"`

	NodeNum int `json:"nodeNum"`
}

ClusterStatus - Cluster Status

type CommonResponse

type CommonResponse struct {
	RequestID string `json:"requestID"`
}

type ConflictCluster

type ConflictCluster struct {
	ClusterID     string `json:"clusterID"`
	ContainerCIDR string `json:"containerCIDR"`
}

ConflictCluster 同一 VPC 内容器网段冲突的集群信息

type ConflictContainerCIDR

type ConflictContainerCIDR struct {
	ContainerCIDR string `json:"containerCIDR"`
}

ConflictContainerCIDR 容器网段冲突信息

type ConflictNodeCIDR

type ConflictNodeCIDR struct {
	NodeCIDR string `json:"nodeCIDR"`
}

ConflictNodeCIDR 节点网段冲突信息

type ConflictVPCRoute

type ConflictVPCRoute struct {
	RouteRule vpc.RouteRule `json:"routeRule"`
}

ConflictVPCRoute 冲突的 VPC 路由

type ContainerCIDRConflict

type ContainerCIDRConflict struct {
	// NetworkConflictType 冲突类型,可取的值: ContainerCIDRAndNodeCIDRConflict、ContainerCIDRAndExistedClusterContainerCIDRConflict、ContainerCIDRAndVPCRouteConflict
	ConflictType NetworkConflictType `json:"conflictType"`
	// ConflictNodeCIDR 与容器网段冲突的节点网段,当且仅当 NetworkConflictType 为 ContainerCIDRAndNodeCIDRConflict 不为 nil
	ConflictNodeCIDR *ConflictNodeCIDR `json:"conflictNodeCIDR"`
	// ConflictCluster 与容器网段冲突的VPC内集群,当且仅当 NetworkConflictType 为 ContainerCIDRAndExistedClusterContainerCIDRConflict 不为 nil
	ConflictCluster *ConflictCluster `json:"conflictCluster"`
	// ConflictVPCRoute 与容器网段冲突的VPC路由,当且仅当 NetworkConflictType 为 ContainerCIDRAndVPCRouteConflict 不为 nil
	ConflictVPCRoute *ConflictVPCRoute `json:"conflictVPCRoute"`
}

ContainerCIDRConflict 容器网段冲突信息

type CreateClusterArgs

type CreateClusterArgs struct {
	CreateClusterRequest *CreateClusterRequest
}

CreateCluterArgs为后续支持clientToken预留空间

type CreateClusterRequest

type CreateClusterRequest struct {
	ClusterSpec *types.ClusterSpec `json:"cluster"`
	MasterSpecs []*InstanceSet     `json:"masters,omitempty"`
	NodeSpecs   []*InstanceSet     `json:"nodes,omitempty"`
}

CreateClusterRequest - 创建 Cluster 参数

type CreateClusterResponse

type CreateClusterResponse struct {
	ClusterID string `json:"clusterID"`
	RequestID string `json:"requestID"`
}

CreateClusterResponse - 创建 Cluster 返回

type CreateInstanceGroupArgs

type CreateInstanceGroupArgs struct {
	ClusterID string
	Request   *CreateInstanceGroupRequest
}

type CreateInstanceGroupRequest

type CreateInstanceGroupRequest struct {
	types.InstanceGroupSpec
}

CreateInstanceGroupRequest - 创建InstanceGroup request

type CreateInstanceGroupResponse

type CreateInstanceGroupResponse struct {
	CommonResponse
	InstanceGroupID string `json:"instanceGroupID"`
}

CreateInstanceGroupResponse - 创建InstanceGroup response

type CreateInstancesArgs

type CreateInstancesArgs struct {
	ClusterID string
	Instances []*InstanceSet
}

type CreateInstancesResponse

type CreateInstancesResponse struct {
	CCEInstanceIDs []string `json:"cceInstanceIDs"`
	RequestID      string   `json:"requestID"`
}

CreateInstancesResponse - 创建 Instances 返回

type DeleteClusterArgs

type DeleteClusterArgs struct {
	ClusterID         string
	DeleteResource    bool
	DeleteCDSSnapshot bool
}

type DeleteClusterResponse

type DeleteClusterResponse struct {
	RequestID string `json:"requestID"`
}

DeleteClusterResponse - 删除 Cluster 返回

type DeleteInstanceGroupArgs

type DeleteInstanceGroupArgs struct {
	ClusterID       string
	InstanceGroupID string
	DeleteInstances bool
}

type DeleteInstanceGroupResponse

type DeleteInstanceGroupResponse struct {
	CommonResponse
}

type DeleteInstancesArgs

type DeleteInstancesArgs struct {
	ClusterID              string
	DeleteInstancesRequest *DeleteInstancesRequest
}

type DeleteInstancesRequest

type DeleteInstancesRequest struct {
	InstanceIDs  []string            `json:"instanceIDs,omitempty"`
	DeleteOption *types.DeleteOption `json:"deleteOption,omitempty"`
}

DeleteInstancesRequest - 删除节点请求

type DeleteInstancesResponse

type DeleteInstancesResponse struct {
	RequestID string `json:"requestID"`
}

DeleteInstancesResponse - 删除 Instances 返回

type GetAutoscalerResponse

type GetAutoscalerResponse struct {
	Autoscaler *Autoscaler `json:"autoscaler"`
	RequestID  string      `json:"requestID"`
}

type GetClusterResponse

type GetClusterResponse struct {
	Cluster   *Cluster `json:"cluster"`
	RequestID string   `json:"requestID"`
}

GetClusterResponse - 查询 Cluster 返回

type GetInstanceArgs

type GetInstanceArgs struct {
	ClusterID  string
	InstanceID string
}

type GetInstanceGroupArgs

type GetInstanceGroupArgs struct {
	ClusterID       string
	InstanceGroupID string
}

type GetInstanceGroupResponse

type GetInstanceGroupResponse struct {
	CommonResponse
	InstanceGroup *InstanceGroup `json:"instanceGroup"`
}

type GetInstanceResponse

type GetInstanceResponse struct {
	Instance  *Instance `json:"instance"`
	RequestID string    `json:"requestID"`
}

GetInstanceResponse - 查询 Instances 返回

type GetQuotaResponse

type GetQuotaResponse struct {
	types.Quota
	RequestID string `json:"requestID"`
}

GetQuotaResponse - 查询 Quota 返回

type Instance

type Instance struct {
	Spec   *InstanceSpec   `json:"spec"`
	Status *InstanceStatus `json:"status"`

	CreatedAt time.Time `json:"createdAt,omitempty"`
	UpdatedAt time.Time `json:"updatedAt,omitempty"`
}

Instance - 节点详情 作为sdk返回结果的Instance

type InstanceGroup

type InstanceGroup struct {
	Spec      *InstanceGroupSpec   `json:"spec"`
	Status    *InstanceGroupStatus `json:"status"`
	CreatedAt time.Time            `json:"createdAt"`
}

type InstanceGroupListOption

type InstanceGroupListOption struct {
	PageNo   int
	PageSize int
}

type InstanceGroupSpec

type InstanceGroupSpec struct {
	CCEInstanceGroupID string `json:"cceInstanceGroupID,omitempty"`
	InstanceGroupName  string `json:"instanceGroupName"`

	ClusterID    string            `json:"clusterID,omitempty"`
	ClusterRole  types.ClusterRole `json:"clusterRole,omitempty"`
	ShrinkPolicy ShrinkPolicy      `json:"shrinkPolicy,omitempty"`
	UpdatePolicy UpdatePolicy      `json:"updatePolicy,omitempty"`
	CleanPolicy  CleanPolicy       `json:"cleanPolicy,omitempty"`

	InstanceTemplate InstanceTemplate `json:"instanceTemplate"`
	Replicas         int              `json:"replicas"`

	ClusterAutoscalerSpec *ClusterAutoscalerSpec `json:"clusterAutoscalerSpec,omitempty"`
}

type InstanceGroupStatus

type InstanceGroupStatus struct {
	ReadyReplicas int          `json:"readyReplicas"`
	Pause         *PauseDetail `json:"pause,omitempty"`
}

InstanceGroupStatus -

type InstanceKeyType

type InstanceKeyType string

InstanceKeyType - ListInstanceByPage 参数

type InstanceKeywordType

type InstanceKeywordType string

InstanceKeywordType 节点模糊查询字段

const (
	// InstanceKeywordTypeInstanceName 节点模糊查询字段: InstanceName
	InstanceKeywordTypeInstanceName InstanceKeywordType = "instanceName"
	// InstanceKeywordTypeInstanceID 节点模糊查询字段: InstanceID
	InstanceKeywordTypeInstanceID InstanceKeywordType = "instanceID"
)

type InstanceOrderBy

type InstanceOrderBy string

InstanceOrderBy 节点查询排序字段

const (
	// InstanceOrderByInstanceName 节点查询排序字段: InstanceName
	InstanceOrderByInstanceName InstanceOrderBy = "instanceName"
	// InstanceOrderByInstanceID 节点查询排序字段: InstanceID
	InstanceOrderByInstanceID InstanceOrderBy = "instanceID"
	// InstanceOrderByCreatedAt 节点查询排序字段: CreatedAt
	InstanceOrderByCreatedAt InstanceOrderBy = "createdAt"
)

type InstancePage

type InstancePage struct {
	ClusterID    string              `json:"clusterID"`
	KeywordType  InstanceKeywordType `json:"keywordType"`
	Keyword      string              `json:"keyword"`
	OrderBy      InstanceOrderBy     `json:"orderBy"`
	Order        Order               `json:"order"`
	PageNo       int                 `json:"pageNo"`
	PageSize     int                 `json:"pageSize"`
	TotalCount   int                 `json:"totalCount"`
	InstanceList []*Instance         `json:"instanceList"`
}

InstancePage - 节点分页查询返回

type InstanceSet

type InstanceSet struct {
	InstanceSpec types.InstanceSpec `json:"instanceSpec"`
	Count        int                `json:"count"`
}

type InstanceSpec

type InstanceSpec struct {
	CCEInstanceID string `json:"cceInstanceID"`
	InstanceName  string `json:"instanceName"`

	RuntimeType    types.RuntimeType `json:"runtimeType"`
	RuntimeVersion string            `json:"runtimeVersion"`

	// 由 cluster-service 生成并更新
	ClusterID   string            `json:"clusterID"`
	ClusterRole types.ClusterRole `json:"clusterRole"`
	UserID      string            `json:"userID"`

	InstanceGroupID   string `json:"instanceGroupID"`
	InstanceGroupName string `json:"instanceGroupName"`

	// BCC, BBC, 裸金属
	MachineType types.MachineType `json:"machineType"`
	// 机器规格: 普通一, 普通二 ...
	InstanceType bccapi.InstanceType `json:"instanceType"`
	// BBC 选项
	BBCOption *types.BBCOption `json:"bbcOption,omitempty"`

	// VPC 相关配置
	types.VPCConfig `json:"vpcConfig"`

	// 集群规格相关配置
	InstanceResource types.InstanceResource `json:"instanceResource"`

	// 部署相关高级配置
	DeployCustomConfig types.DeployCustomConfig `json:"deployCustomConfig,omitempty"`

	ImageID    string           `json:"imageID"`
	InstanceOS types.InstanceOS `json:"instanceOS"`

	// EIP
	NeedEIP   bool             `json:"needEIP"`
	EIPOption *types.EIPOption `json:"eipOption"`

	SSHKeyID string `json:"sshKeyID"`

	InstanceChargingType bccapi.PaymentTimingType `json:"instanceChargingType"`

	DeleteOption *types.DeleteOption `json:"deleteOption"`

	Tags   types.TagList        `json:"tags,omitempty"`
	Labels types.InstanceLabels `json:"labels,omitempty"`
	Taints types.InstanceTaints `json:"taints,omitempty"`
}

作为sdk返回结果的InstanceSpec InstanceSpec - Instance Spec

type InstanceStatus

type InstanceStatus struct {
	Machine Machine `json:"machine"`

	InstancePhase types.InstancePhase `json:"instancePhase"`
	MachineStatus types.ServerStatus  `json:"machineStatus"`
}

InstanceStatus - Instance Status

type InstanceTemplate

type InstanceTemplate struct {
	InstanceSpec `json:",inline"`
}

type Interface

type Interface interface {
	CreateCluster(args *CreateClusterArgs) (*CreateClusterResponse, error)
	GetCluster(clusterID string) (*GetClusterResponse, error)
	DeleteCluster(args *DeleteClusterArgs) (*DeleteClusterResponse, error)
	ListClusters(args *ListClustersArgs) (*ListClustersResponse, error)

	CreateInstances(args *CreateInstancesArgs) (*CreateInstancesResponse, error)
	GetInstance(args *GetInstanceArgs) (*GetInstanceResponse, error)
	DeleteInstances(args *DeleteInstancesArgs) (*DeleteInstancesResponse, error)
	ListInstancesByPage(args *ListInstancesByPageArgs) (*ListInstancesResponse, error)

	GetClusterQuota() (*GetQuotaResponse, error)
	GetClusterNodeQuota(clusterID string) (*GetQuotaResponse, error)

	CheckContainerNetworkCIDR(args *CheckContainerNetworkCIDRArgs) (*CheckContainerNetworkCIDRResponse, error)
	CheckClusterIPCIDR(args *CheckClusterIPCIDRArgs) (*CheckClusterIPCIDRResponse, error)
	RecommendContainerCIDR(args *RecommendContainerCIDRArgs) (*RecommendContainerCIDRResponse, error)
	RecommendClusterIPCIDR(args *RecommendClusterIPCIDRArgs) (*RecommendClusterIPCIDRResponse, error)
}

Interface 定义 CCE V2 SDK

type ListClustersArgs

type ListClustersArgs struct {
	KeywordType ClusterKeywordType
	Keyword     string
	OrderBy     ClusterOrderBy
	Order       Order
	PageNum     int
	PageSize    int
}

type ListClustersResponse

type ListClustersResponse struct {
	ClusterPage *ClusterPage `json:"clusterPage"`
	RequestID   string       `json:"requestID"`
}

ListClustersResponse - List 用户 Cluster 返回

type ListInstanceByInstanceGroupIDArgs

type ListInstanceByInstanceGroupIDArgs struct {
	ClusterID       string
	InstanceGroupID string
	PageNo          int
	PageSize        int
}

type ListInstanceGroupPage

type ListInstanceGroupPage struct {
	PageNo     int              `json:"pageNo"`
	PageSize   int              `json:"pageSize"`
	TotalCount int              `json:"totalCount"`
	List       []*InstanceGroup `json:"list"`
}

type ListInstanceGroupResponse

type ListInstanceGroupResponse struct {
	CommonResponse
	Page ListInstanceGroupPage `json:"page"`
}

type ListInstanceGroupsArgs

type ListInstanceGroupsArgs struct {
	ClusterID  string
	ListOption *InstanceGroupListOption
}

type ListInstancesByInstanceGroupIDPage

type ListInstancesByInstanceGroupIDPage struct {
	PageNo     int         `json:"pageNo"`
	PageSize   int         `json:"pageSize"`
	TotalCount int         `json:"totalCount"`
	List       []*Instance `json:"list"`
}

type ListInstancesByInstanceGroupIDResponse

type ListInstancesByInstanceGroupIDResponse struct {
	CommonResponse
	Page ListInstancesByInstanceGroupIDPage `json:"page"`
}

type ListInstancesByPageArgs

type ListInstancesByPageArgs struct {
	ClusterID string
	Params    *ListInstancesByPageParams
}

type ListInstancesByPageParams

type ListInstancesByPageParams struct {
	KeywordType InstanceKeywordType `json:"keywordType"`
	Keyword     string              `json:"keyword"`
	OrderBy     InstanceOrderBy     `json:"orderBy"`
	Order       Order               `json:"order"`
	PageNo      int                 `json:"pageNo"`
	PageSize    int                 `json:"pageSize"`
}

ListInstancesByPageParams - 分页查询集群实例列表参数

type ListInstancesResponse

type ListInstancesResponse struct {
	InstancePage *InstancePage `json:"instancePage"`
	RequestID    string        `json:"requestID"`
}

ListInstancesResponse - List Instances 返回

type Machine

type Machine struct {
	InstanceID string `json:"instanceID"`

	OrderID string `json:"orderID,omitempty"`

	MountList []types.MountConfig `json:"mountList,omitempty"`

	VPCIP     string `json:"vpcIP,omitempty"`
	VPCIPIPv6 string `json:"vpcIPIPv6,omitempty"`

	EIP string `json:"eip,omitempty"`
}

Machine - 定义机器相关信息

type NetworkConflictInfo

type NetworkConflictInfo struct {
	IsConflict            bool                   `json:"isConflict"`
	ErrMsg                string                 `json:"errMsg"`
	ContainerCIDRConflict *ContainerCIDRConflict `json:"containerCIDRConflict"` // 容器网段冲突信息
	ClusterIPCIDRConflict *ClusterIPCIDRConflict `json:"clusterIPCIDRConflict"` // ClusterIP 网段冲突信息
}

NetworkConflictInfo 容器网络整体配置冲突信息

type NetworkConflictType

type NetworkConflictType string

NetworkConflictType 冲突类型

const (
	// ContainerCIDRAndNodeCIDRConflict 容器网段和本集群的节点网段冲突
	ContainerCIDRAndNodeCIDRConflict NetworkConflictType = "ContainerCIDRAndNodeCIDR"
	// ContainerCIDRAndExistedClusterContainerCIDRConflict 容器网段和 VPC 内已有集群的容器网段冲突
	ContainerCIDRAndExistedClusterContainerCIDRConflict NetworkConflictType = "ContainerCIDRAndExistedClusterContainerCIDR"
	// ContainerCIDRAndVPCRouteConflict 容器网段与 VPC 路由冲突
	ContainerCIDRAndVPCRouteConflict NetworkConflictType = "ContainerCIDRAndVPCRoute"
	// ClusterIPCIDRAndNodeCIDRConflict ClusterIP 网段与本集群节点网段冲突
	ClusterIPCIDRAndNodeCIDRConflict NetworkConflictType = "ClusterIPCIDRAndNodeCIDR"
	// ClusterIPCIDRAndContainerCIDRConflict ClusterIP 网段与本集群容器网段冲突
	ClusterIPCIDRAndContainerCIDRConflict NetworkConflictType = "ClusterIPCIDRAndContainerCIDR"
)

type Order

type Order string

Order 集群查询排序

const (
	// OrderASC 集群查询排序: 升序
	OrderASC Order = "ASC"
	// OrderDESC 集群查询排序: 降序
	OrderDESC Order = "DESC"
)

type PauseDetail

type PauseDetail struct {
	Paused bool   `json:"paused"`
	Reason string `json:"reason"`
}

type PrivateNetString

type PrivateNetString string

PrivateNetString IPv4/IPv6 私有网络地址类型

const (
	// PrivateIPv4Net10 - IPv4 10 段
	PrivateIPv4Net10 PrivateNetString = "10.0.0.0/8"

	// PrivateIPv4Net172 - IPv4 172 段
	PrivateIPv4Net172 PrivateNetString = "172.16.0.0/12"

	// PrivateIPv4Net192 - IPv4 192 段
	PrivateIPv4Net192 PrivateNetString = "192.168.0.0/16"

	// PrivateIPv6Net - IPv6 段
	PrivateIPv6Net PrivateNetString = "fc00::/7"
)

type RecommendClusterIPCIDRArgs

type RecommendClusterIPCIDRArgs struct {
	VPCCIDR           string `json:"vpcCIDR"`
	VPCCIDRIPv6       string `json:"vpcCIDRIPv6"`
	ContainerCIDR     string `json:"containerCIDR"`
	ContainerCIDRIPv6 string `json:"containerCIDRIPv6"`
	// ClusterMaxServiceNum 集群 Service 最大规模
	ClusterMaxServiceNum int `json:"clusterMaxServiceNum"`
	// PrivateNetCIDRs 候选的 ClusterIP 网段列表,只能从 [10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16] 里选择
	PrivateNetCIDRs     []PrivateNetString           `json:"privateNetCIDRs"`
	PrivateNetCIDRIPv6s []PrivateNetString           `json:"privateNetCIDRIPv6s"`
	IPVersion           types.ContainerNetworkIPType `json:"ipVersion"` // if not set, set ipv4
}

RecommendClusterIPCIDRRequest 推荐 ClusterIP 网段的请求参数

type RecommendClusterIPCIDRResponse

type RecommendClusterIPCIDRResponse struct {
	RecommendedClusterIPCIDRs     []string `json:"recommendedClusterIPCIDRs"`
	RecommendedClusterIPCIDRIPv6s []string `json:"recommendedClusterIPCIDRIPv6s"`
	IsSuccess                     bool     `json:"isSuccess"`
	ErrMsg                        string   `json:"errMsg"`
	RequestID                     string   `json:"requestID"`
}

RecommendClusterIPCIDRResponse 推荐 ClusterIP 网段的响应

type RecommendContainerCIDRArgs

type RecommendContainerCIDRArgs struct {
	VPCID       string `json:"vpcID"`
	VPCCIDR     string `json:"vpcCIDR"`
	VPCCIDRIPv6 string `json:"vpcCIDRIPv6"`
	// ClusterMaxNodeNum 集群节点的最大规模
	ClusterMaxNodeNum int `json:"clusterMaxNodeNum"`
	MaxPodsPerNode    int `json:"maxPodsPerNode"`
	// PrivateNetCIDRs 候选的容器网段列表,只能从 [10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16] 里选择
	PrivateNetCIDRs     []PrivateNetString           `json:"privateNetCIDRs"`
	PrivateNetCIDRIPv6s []PrivateNetString           `json:"privateNetCIDRIPv6s"`
	K8SVersion          types.K8SVersion             `json:"k8sVersion"`
	IPVersion           types.ContainerNetworkIPType `json:"ipVersion"` // if not set, set ipv4
}

RecommendContainerCIDRRequest 推荐容器网段的请求参数

type RecommendContainerCIDRResponse

type RecommendContainerCIDRResponse struct {
	RecommendedContainerCIDRs     []string `json:"recommendedContainerCIDRs"`
	RecommendedContainerCIDRIPv6s []string `json:"recommendedContainerCIDRIPv6s"`
	IsSuccess                     bool     `json:"isSuccess"`
	ErrMsg                        string   `json:"errMsg"`
	RequestID                     string   `json:"requestID"`
}

RecommendContainerCIDRResponse 推荐容器网段的响应

type ShrinkPolicy

type ShrinkPolicy string

type UpdateClusterResponse

type UpdateClusterResponse struct {
	Cluster   *Cluster `json:"cluster"`
	RequestID string   `json:"requestID"`
}

UpdateClusterResponse - 更新 Cluster 返回

type UpdateInstanceGroupClusterAutoscalerSpecArgs

type UpdateInstanceGroupClusterAutoscalerSpecArgs struct {
	ClusterID       string
	InstanceGroupID string
	Request         *ClusterAutoscalerSpec
}

type UpdateInstanceGroupClusterAutoscalerSpecResponse

type UpdateInstanceGroupClusterAutoscalerSpecResponse struct {
	CommonResponse
}

type UpdateInstanceGroupReplicasArgs

type UpdateInstanceGroupReplicasArgs struct {
	ClusterID       string
	InstanceGroupID string
	Request         *UpdateInstanceGroupReplicasRequest
}

type UpdateInstanceGroupReplicasRequest

type UpdateInstanceGroupReplicasRequest struct {
	Replicas       int                 `json:"replicas"`
	InstanceIDs    []string            `json:"instanceIDs"`
	DeleteInstance bool                `json:"deleteInstance"`
	DeleteOption   *types.DeleteOption `json:"deleteOption,omitempty"`
}

type UpdateInstanceGroupReplicasResponse

type UpdateInstanceGroupReplicasResponse struct {
	CommonResponse
}

type UpdateInstancesResponse

type UpdateInstancesResponse struct {
	Instance  *Instance `json:"instance"`
	RequestID string    `json:"requestID"`
}

UpdateInstancesResponse - 更新 Instances 返回

type UpdatePolicy

type UpdatePolicy string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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