cs

package
v0.0.0-...-f8f9ceb Latest Latest
Warning

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

Go to latest
Published: May 17, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CRMDefaultEndpoint is the default API endpoint of CRM services
	CSDefaultEndpoint = "https://cs.aliyuncs.com"
	CSAPIVersion      = "2015-12-15"
)
View Source
const (
	Initial      = ClusterState("Initial")
	Running      = ClusterState("Running")
	Updating     = ClusterState("Updating")
	Scaling      = ClusterState("Scaling")
	Failed       = ClusterState("Failed")
	Deleting     = ClusterState("Deleting")
	DeleteFailed = ClusterState("DeleteFailed")
	Deleted      = ClusterState("Deleted")
)
View Source
const (
	ClassicNetwork = NetworkModeType("classic")
	VPCNetwork     = NetworkModeType("vpc")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	AccessKeyId     string
	AccessKeySecret string

	Version string
	// contains filtered or unexported fields
}

The Client type encapsulates operations with an OSS region.

func NewClient

func NewClient(accessKeyId, accessKeySecret string) *Client

NewClient creates a new instance of CRM client

func (*Client) CreateCluster

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

func (*Client) DeleteCluster

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

func (*Client) DescribeCluster

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

func (*Client) DescribeClusters

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

func (*Client) GetClusterCerts

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

func (*Client) Invoke

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

Invoke sends the raw HTTP request for ECS services

func (*Client) SetDebug

func (client *Client) SetDebug(debug bool)

SetDebug sets debug mode to log the request/response message

type ClusterCerts

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

type ClusterCreationArgs

type ClusterCreationArgs struct {
	Name             string           `json:"name"`
	Size             int64            `json:"size"`
	NetworkMode      NetworkModeType  `json:"network_mode"`
	SubnetCIDR       string           `json:"subnet_cidr,omitempty"`
	InstanceType     string           `json:"instance_type"`
	VPCID            string           `json:"vpc_id,omitempty"`
	VSwitchID        string           `json:"vswitch_id,omitempty"`
	Password         string           `json:"password"`
	DataDiskSize     int64            `json:"data_disk_size"`
	DataDiskCategory ecs.DiskCategory `json:"data_disk_category"`
	ECSImageID       string           `json:"ecs_image_id,omitempty"`
	IOOptimized      ecs.IoOptimized  `json:"io_optimized"`
}

type ClusterCreationResponse

type ClusterCreationResponse struct {
	Response
	ClusterID string `json:"cluster_id"`
}

type ClusterState

type ClusterState string

type ClusterType

type ClusterType struct {
	AgentVersion           string           `json:"agent_version"`
	ClusterID              string           `json:"cluster_id"`
	Name                   string           `json:"name"`
	Created                util.ISO6801Time `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                util.ISO6801Time `json:"updated"`
	VPCID                  string           `json:"vpc_id"`
	VSwitchID              string           `json:"vswitch_id"`
	NodeStatus             NodeStatus       `json:"node_status"`
	DockerVersion          string           `json:"docker_version"`
}

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

type NetworkModeType

type NetworkModeType string

type NodeStatus

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

type Request

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

type Response

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

Jump to

Keyboard shortcuts

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