aliyungo: github.com/denverdino/aliyungo/cs Index | Files

package cs

import "github.com/denverdino/aliyungo/cs"

Index

Package Files

client.go clusters.go kubernets_cluster.go node_pool.go projects.go projects_client.go registry.go serverless.go services.go signature.go token.go volumes.go

Constants

const (
    // CRMDefaultEndpoint is the default API endpoint of CRM services
    CSDefaultEndpoint = "https://cs.aliyuncs.com"
    CSAPIVersion      = "2015-12-15"
)
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"
)
const (
    ClassicNetwork = NetworkModeType("classic")
    VPCNetwork     = NetworkModeType("vpc")
)
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"
)
const (
    CRDefaultEndpoint = "https://cr.cn-hangzhou.aliyuncs.com"
    CRAPIVersion      = "2016-06-07"
)
const ClusterDefaultTimeout = 300
const DefaultPreCheckSleepTime = 20
const DefaultPreSleepTime = 220
const DefaultWaitForInterval = 10

Variables

var (
    DelicatedKubernetes  = KubernetesClusterType("Kubernetes")
    ManagedKubernetes    = KubernetesClusterType("ManagedKubernetes")
    ServerlessKubernetes = KubernetesClusterType("Ask")
)
var (
    IPTables = "iptables"
    IPVS     = "ipvs"
)
var (
    TaintNoExecute        = "NoExecute"
    TaintNoSchedule       = "NoSchedule"
    TaintPreferNoSchedule = "PreferNoSchedule"
)
var NodeStableClusterState = []ClusterState{Running, Updating, Failed, DeleteFailed, Deleted, InActive}
var NodeUnstableClusterState = []ClusterState{Initial, Scaling, Deleting}

type Addon Uses

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

addon

type AutoScaling Uses

type AutoScaling struct {
    Enable      bool   `json:"enable"`
    MaxInstance int64  `json:"max_instance"`
    MinInstance int64  `json:"min_instance"`
    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 Uses

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

type CRAuthorizationToken Uses

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 Uses

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 Uses

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

func NewClient Uses

func NewClient(accessKeyId, accessKeySecret string) *Client

NewClient creates a new instance of CRM client

func NewClientForAussumeRole Uses

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

func (*Client) CancelUpgradeCluster Uses

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

cancel upgrade cluster

func (*Client) CreateCluster Uses

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

Deprecated

func (*Client) CreateClusterToken Uses

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

func (*Client) CreateDelicatedKubernetesCluster Uses

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

Create DelicatedKubernetes Cluster

func (*Client) CreateKubernetesCluster Uses

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

Deprecated

func (*Client) CreateKubernetesMultiAZCluster Uses

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

Deprecated

func (*Client) CreateManagedKubernetesCluster Uses

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

Create ManagedKubernetes Cluster

func (*Client) CreateNodePool Uses

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

func (*Client) CreateServerlessKubernetesCluster Uses

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

create Serverless cluster

func (*Client) DeleteCluster Uses

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

Deprecated

func (*Client) DeleteKubernetesCluster Uses

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

DeleteKubernetesCluster

func (*Client) DeleteKubernetesClusterNodes Uses

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

DeleteClusterNodes

func (*Client) DeleteNodePool Uses

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

func (*Client) DescribeCluster Uses

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

func (*Client) DescribeClusterNodePools Uses

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

func (*Client) DescribeClusterToken Uses

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

func (*Client) DescribeClusterTokens Uses

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

func (*Client) DescribeClusterUserConfig Uses

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

new api for get cluster kube user config

func (*Client) DescribeClusters Uses

func (client *Client) DescribeClusters(nameFilter string) (clusters []ClusterType, err error)

func (*Client) DescribeKubernetesCluster Uses

func (client *Client) DescribeKubernetesCluster(id string) (cluster KubernetesCluster, err error)

Deprecated

func (*Client) DescribeKubernetesClusterDetail Uses

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

查询集群详情

func (*Client) DescribeNodePoolDetail Uses

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

func (*Client) DescribeServerlessKubernetesCluster Uses

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

describe Serverless cluster

func (*Client) DescribeServerlessKubernetesClusters Uses

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

describe Serverless clsuters

func (*Client) GetCRAuthorizationToken Uses

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

func (*Client) GetCRRepoInfo Uses

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

func (*Client) GetClusterCerts Uses

func (client *Client) GetClusterCerts(id string) (certs ClusterCerts, err error)

func (*Client) GetClusterConfig Uses

func (client *Client) GetClusterConfig(id string) (config ClusterConfig, err error)

deprecated Please use new api DescribeClusterUserConfig

func (*Client) GetClusterEndpoints Uses

func (client *Client) GetClusterEndpoints(id string) (clusterEndpoints ClusterEndpoints, err error)

func (*Client) GetKubernetesClusterNodes Uses

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 Uses

func (client *Client) GetProjectClient(clusterId string) (projectClient *ProjectClient, err error)

func (*Client) Invoke Uses

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 Uses

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

modify cluster

func (*Client) ModifyClusterName Uses

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

Deprecated

func (*Client) QueryUpgradeClusterResult Uses

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

func (*Client) ResizeCluster Uses

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

Deprecated

func (*Client) ResizeKubernetes Uses

func (client *Client) ResizeKubernetes(clusterID string, args *KubernetesCreationArgs) error

deprecated use ScaleKubernetesCluster instead

func (*Client) ResizeKubernetesCluster Uses

func (client *Client) ResizeKubernetesCluster(clusterID string, args *KubernetesClusterResizeArgs) error

deprecated use ScaleKubernetesCluster instead

func (*Client) RevokeToken Uses

func (client *Client) RevokeToken(token string) error

func (*Client) ScaleKubernetesCluster Uses

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

Deprecated

func (*Client) ScaleOutKubernetesCluster Uses

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

ScaleKubernetesCluster

func (*Client) SetDebug Uses

func (client *Client) SetDebug(debug bool)

SetDebug sets debug mode to log the request/response message

func (*Client) SetEndpoint Uses

func (client *Client) SetEndpoint(endpoint string)

SetEndpoint sets customer endpoint

func (*Client) SetTransport Uses

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

SetTransport sets transport to the http client

func (*Client) SetUserAgent Uses

func (client *Client) SetUserAgent(userAgent string)

SetUserAgent sets user agent to log the request/response message

func (*Client) UpdateNodePool Uses

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

func (*Client) UpgradeCluster Uses

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

upgrade cluster

func (*Client) WaitForClusterAsyn Uses

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 Uses

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

type ClusterCerts Uses

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

type ClusterCommonResponse Uses

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 Uses

type ClusterConfig struct {
    Config string `json:"config"`
}

type ClusterCreationArgs Uses

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 Uses

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 Uses

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 Uses

type ClusterState string

type ClusterTokenReqeust Uses

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

type ClusterTokenResponse Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

type DataDisk Uses

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

datadiks

type Definition Uses

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 Uses

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 Uses

type DelicatedKubernetesClusterCreationRequest struct {
    ClusterArgs
    MasterArgs
    WorkerArgs
}

DelicatedKubernetes

type DriverOptions Uses

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

type Effect Uses

type Effect string

type Event Uses

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

type GetKubernetesClusterNodesResponse Uses

type GetKubernetesClusterNodesResponse struct {
    Response
    Page  PaginationResult     `json:"page"`
    Nodes []KubernetesNodeType `json:"nodes"`
}

type GetProjectResponse Uses

type GetProjectResponse Project

type GetProjectsResponse Uses

type GetProjectsResponse []Project

type GetServiceResponse Uses

type GetServiceResponse Service

type GetServicesResponse Uses

type GetServicesResponse []Service

type GetSwarmClusterNodesResponse Uses

type GetSwarmClusterNodesResponse []SwarmNodeType

type GetVolumeResponse Uses

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 Uses

type GetVolumesResponse struct {
    Volumes []GetVolumeResponse `json:"Volumes"`
}

type KubernetesCluster Uses

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 Uses

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

Cluster definition

func (*KubernetesClusterDetail) GetMetaData Uses

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

GetMetaData

type KubernetesClusterMetaData Uses

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 Uses

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 Uses

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 Uses

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 Uses

type KubernetesClusterType string

Cluster Info

type KubernetesConfig Uses

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

type KubernetesCreationArgs Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

type Labels Uses

type Labels map[string]string

type MaintenanceTime Uses

type MaintenanceTime string

type MaintenanceWindow Uses

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 Uses

type ManagedKubernetesClusterCreationRequest struct {
    ClusterArgs
    WorkerArgs
}

ManagedKubernetes

type Management Uses

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

托管节点池配置

type MasterArgs Uses

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

    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 Uses

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 Uses

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

type NASOpts Uses

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

type NetworkModeType Uses

type NetworkModeType string

type NodePoolDataDisk Uses

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

type NodePoolDetail Uses

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 Uses

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 Uses

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 Uses

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

type NodeStatus Uses

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

type OSSOpts Uses

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 Uses

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

type Port Uses

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

type Project Uses

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 Uses

type ProjectClient struct {
    // contains filtered or unexported fields
}

func NewProjectClient Uses

func NewProjectClient(clusterId, endpoint string, clusterCerts ClusterCerts) (client *ProjectClient, err error)

func (*ProjectClient) ClusterId Uses

func (client *ProjectClient) ClusterId() string

func (*ProjectClient) ConfirmBlueGreenProject Uses

func (client *ProjectClient) ConfirmBlueGreenProject(name string, force bool) (err error)

func (*ProjectClient) CreateProject Uses

func (client *ProjectClient) CreateProject(args *ProjectCreationArgs) (err error)

func (*ProjectClient) CreateVolume Uses

func (client *ProjectClient) CreateVolume(args *VolumeCreationArgs) (err error)

func (*ProjectClient) DeleteProject Uses

func (client *ProjectClient) DeleteProject(name string, forceDelete, deleteVolume bool) (err error)

func (*ProjectClient) DeleteVolume Uses

func (client *ProjectClient) DeleteVolume(name string) (err error)

func (*ProjectClient) Endpoint Uses

func (client *ProjectClient) Endpoint() string

func (*ProjectClient) GetProject Uses

func (client *ProjectClient) GetProject(name string) (project GetProjectResponse, err error)

func (*ProjectClient) GetProjects Uses

func (client *ProjectClient) GetProjects(q string, services, containers bool) (projects GetProjectsResponse, err error)

func (*ProjectClient) GetService Uses

func (client *ProjectClient) GetService(serviceId string) (service GetServiceResponse, err error)

func (*ProjectClient) GetServices Uses

func (client *ProjectClient) GetServices(q string, containers bool) (services GetServicesResponse, err error)

func (*ProjectClient) GetSwarmClusterNodes Uses

func (client *ProjectClient) GetSwarmClusterNodes() (project GetSwarmClusterNodesResponse, err error)

func (*ProjectClient) GetVolume Uses

func (client *ProjectClient) GetVolume(name string) (volume GetVolumeResponse, err error)

func (*ProjectClient) GetVolumes Uses

func (client *ProjectClient) GetVolumes() (volumes GetVolumesResponse, err error)

func (*ProjectClient) Invoke Uses

func (client *ProjectClient) Invoke(method string, path string, query url.Values, args interface{}, response interface{}) error

func (*ProjectClient) KillProject Uses

func (client *ProjectClient) KillProject(name string, signal ...string) (err error)

func (*ProjectClient) KillService Uses

func (client *ProjectClient) KillService(serviceId string, signal ...string) (err error)

func (*ProjectClient) RollBackBlueGreenProject Uses

func (client *ProjectClient) RollBackBlueGreenProject(name string, force bool) (err error)

func (*ProjectClient) ScaleService Uses

func (client *ProjectClient) ScaleService(args *ScaleServiceArgs) (err error)

func (*ProjectClient) SetDebug Uses

func (client *ProjectClient) SetDebug(debug bool)

SetDebug sets debug mode to log the request/response message

func (*ProjectClient) SetTransport Uses

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

SetTransport sets transport to the http client

func (*ProjectClient) SetUserAgent Uses

func (client *ProjectClient) SetUserAgent(userAgent string)

SetUserAgent sets user agent to log the request/response message

func (*ProjectClient) StartProject Uses

func (client *ProjectClient) StartProject(name string) (err error)

func (*ProjectClient) StartService Uses

func (client *ProjectClient) StartService(serviceId string) (err error)

func (*ProjectClient) StopProject Uses

func (client *ProjectClient) StopProject(name string, timeout ...time.Duration) (err error)

func (*ProjectClient) StopService Uses

func (client *ProjectClient) StopService(serviceId string, timeout ...time.Duration) (err error)

func (*ProjectClient) UpdateProject Uses

func (client *ProjectClient) UpdateProject(args *ProjectUpdationArgs) (err error)

type ProjectCreationArgs Uses

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 Uses

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 Uses

type ProxyMode string

type Request Uses

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 Uses

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

type Runtime Uses

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 Uses

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

    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 Uses

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

type ScaleType Uses

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

type ScalingGroup Uses

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"`
    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"`
    RdsInstances       []string ` json:"rds_instances"`
    ScalingPolicy      string   `json:"scaling_policy"`
    ScalingGroupId     string   `json:"scaling_group_id"`
}

type ServerlessClusterResponse Uses

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 Uses

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

func (*ServerlessCreationArgs) Validate Uses

func (this *ServerlessCreationArgs) Validate() error

type Service Uses

type Service struct {
    ID             string                 `json:"id"`
    Name           string                 `json:"name"`
    Project        string                 `json:"project"`
    ComposeVersion string                 `json:"compose_version"`
    Containers     map[string]Container   `json:"containers"`
    Created        time.Time              `json:"created"`
    CurrentState   string                 `json:"current_state"`
    Definition     Definition             `json:"definition"`
    DesiredState   string                 `json:"desired_state"`
    Extensions     map[string]interface{} `json:"extensions"`
    Hash           string                 `json:"hash"`
    Updated        time.Time              `json:"updated"`
    Version        string                 `json:"version"`
}

type SwarmNodeType Uses

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 Uses

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

加密计算节点池

type Tag Uses

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

type Taint Uses

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

taint

type TaskState Uses

type TaskState string

type UpdateNodePoolRequest Uses

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 Uses

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

type UpgradeClusterResult Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

type VolumeCreationResponse Uses

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 Uses

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

type VolumeRef Uses

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

type WeeklyPeriod Uses

type WeeklyPeriod string

type WorkerArgs Uses

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

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

Package cs imports 21 packages (graph) and is imported by 6 packages. Updated 2020-12-03. Refresh now. Tools for package owners.