as

package
v0.9.166 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GROUP_NAME      = "groupName"
	GROUP_ID        = "groupId"
	MARKER          = "marker"
	MAX_KEYS        = "maxKeys"
	MANNER          = "manner"
	AS_SCALING_DOWN = "scalingDown"
	AS_SCALING_UP   = "scalingUp"
	AS_ADJUST_NODE  = "adjustNode"
)
View Source
const (
	ProductName        = "as"
	DefaultBcmEndpoint = ProductName + "." + bce.DEFAULT_REGION + "." + bce.DEFAULT_DOMAIN
	VERSION_1_URL      = "v1"
	VERSION_2_URL      = "v2"
	AS_GROUP_URL       = "group"
	AS_NODE_URL        = "node"
	AS_DETAIL_URL      = "detail"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdjustAsGroupRequest

type AdjustAsGroupRequest struct {
	ClientToken string `json:"-"`
	GroupId     string `json:"groupId,omitempty"`
	AdjustNum   int    `json:"adjustNum,omitempty"`
}

type AsEipModel

type AsEipModel struct {
	BandwidthInMbps int    `json:"bandwidthInMbps,omitempty"`
	EipId           string `json:"eipId,omitempty"`
	Address         string `json:"address,omitempty"`
	EipStatus       string `json:"eipStatus,omitempty"`
	EipAllocationId string `json:"eipAllocationId,omitempty"`
}

type AsGroupStatus

type AsGroupStatus string
const (
	CREATING       AsGroupStatus = "CREATING"
	RUNNING        AsGroupStatus = "RUNNING"
	SCALING_UP     AsGroupStatus = "SCALING_UP"
	SCALING_DOWN   AsGroupStatus = "SCALING_DOWN"
	ATTACHING_NODE AsGroupStatus = "ATTACHING_NODE"
	DETACHING_NODE AsGroupStatus = "DETACHING_NODE"
	DELETING       AsGroupStatus = "DELETING"
	BINDING_BLB    AsGroupStatus = "BINDING_BLB"
	UNBINDING_BLB  AsGroupStatus = "UNBINDING_BLB"
	COOLDOWN       AsGroupStatus = "COOLDOWN"
	PAUSE          AsGroupStatus = "PAUSE"
	DELETED        AsGroupStatus = "DELETED"
)

type Client

type Client struct {
	*bce.BceClient
}

Client of BCM service is a kind of BceClient, so derived from BceClient

func NewClient

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

NewClient make the as service client with default configuration. Use `cli.Config.xxx` to access the config or change it to non-default value.

func (*Client) AdjustAsGroup

func (c *Client) AdjustAsGroup(req *AdjustAsGroupRequest) error

AdjustAsGroup 将伸缩组节点调整到指定值。

func (*Client) DecreaseAsGroup

func (c *Client) DecreaseAsGroup(req *DecreaseAsGroupRequest) error

DecreaseAsGroup 伸缩组缩容,用于伸缩组下节点的缩容

func (*Client) GetAsGroup

func (c *Client) GetAsGroup(req *GetAsGroupRequest) (*GetAsGroupResponse, error)

GetAsGroup 根据groupId获取AsGroup信息

func (*Client) IncreaseAsGroup

func (c *Client) IncreaseAsGroup(req *IncreaseAsGroupRequest) error

IncreaseAsGroup 伸缩组扩容,用于在指定伸缩组下添加节点

func (*Client) ListAsGroup

func (c *Client) ListAsGroup(req *ListAsGroupRequest) (*ListAsGroupResponse, error)

ListAsGroup 方法用于获取指定用户下的As组列表

func (*Client) ListAsNode

func (c *Client) ListAsNode(req *ListAsNodeRequest) (*ListAsNodeResponse, error)

ListAsNode 方法用于获取节点列表

type DecreaseAsGroupRequest

type DecreaseAsGroupRequest struct {
	ClientToken string   `json:"-"`
	GroupId     string   `json:"groupId,omitempty"`
	Nodes       []string `json:"nodes,omitempty"`
}

type GetAsGroupRequest

type GetAsGroupRequest struct {
	GroupId string `json:"groupId,omitempty"`
}

type GetAsGroupResponse

type GetAsGroupResponse struct {
	GroupID           string      `json:"groupId,omitempty"`
	GroupName         string      `json:"groupName,omitempty"`
	Region            string      `json:"region,omitempty"`
	Status            string      `json:"status,omitempty"`
	VpcInfo           VpcInfo     `json:"vpcInfo,omitempty"`
	ZoneInfo          []ZoneInfo  `json:"zoneInfo,omitempty"`
	Config            GroupConfig `json:"config,omitempty"`
	BlbID             string      `json:"blbId,omitempty"`
	NodeNum           int         `json:"nodeNum,omitempty"`
	CreateTime        string      `json:"createTime,omitempty"`
	RdsIDs            string      `json:"rdsIds,omitempty"`
	ScsIDs            string      `json:"scsIds,omitempty"`
	ExpansionStrategy string      `json:"expansionStrategy,omitempty"`
	ShrinkageStrategy string      `json:"shrinkageStrategy,omitempty"`
}

type GroupConfig

type GroupConfig struct {
	MinNodeNum    int `json:"minNodeNum,omitempty"`
	MaxNodeNum    int `json:"maxNodeNum,omitempty"`
	CooldownInSec int `json:"cooldownInSec,omitempty"`
	ExpectNum     int `json:"expectNum,omitempty"`
}

type GroupInfo

type GroupInfo struct {
	GroupId    string        `json:"groupId,omitempty"`
	GroupName  string        `json:"groupName,omitempty"`
	Region     string        `json:"region,omitempty"`
	Status     AsGroupStatus `json:"status,omitempty"`
	VpcId      string        `json:"vpcId,omitempty"`
	NodeNum    int           `json:"nodeNum,omitempty"`
	CreateTime string        `json:"createTime,omitempty"`
	ZoneInfo   []ZoneInfo    `json:"zoneInfo,omitempty"`
	Config     GroupConfig   `json:"config,omitempty"`
	BlbId      string        `json:"blbId,omitempty"`
}

type IncreaseAsGroupRequest

type IncreaseAsGroupRequest struct {
	ClientToken       string   `json:"-"`
	GroupId           string   `json:"groupId,omitempty"`
	NodeCount         int      `json:"nodeCount,omitempty"`
	Zone              []string `json:"zone,omitempty"`
	ExpansionStrategy string   `json:"expansionStrategy,omitempty"`
}

type ListAsGroupRequest

type ListAsGroupRequest struct {
	GroupName string `json:"groupName,omitempty"`
	Marker    string `json:"marker,omitempty"`
	MaxKeys   int    `json:"maxKeys,omitempty"`
}

type ListAsGroupResponse

type ListAsGroupResponse struct {
	Marker      string      `json:"marker"`
	IsTruncated bool        `json:"isTruncated"`
	NextMarker  string      `json:"nextMarker"`
	MaxKeys     int         `json:"maxKeys"`
	Result      []GroupInfo `json:"result"`
}

type ListAsNodeRequest

type ListAsNodeRequest struct {
	GroupId string `json:"groupId,omitempty"`
	Marker  string `json:"marker,omitempty"`
	MaxKeys int    `json:"maxKeys,omitempty"`
}

type ListAsNodeResponse

type ListAsNodeResponse struct {
	Marker      string      `json:"marker"`
	IsTruncated bool        `json:"isTruncated"`
	NextMarker  string      `json:"nextMarker"`
	MaxKeys     int         `json:"maxKeys"`
	Result      []NodeModel `json:"result,omitempty"`
}

type NodeModel

type NodeModel struct {
	InstanceId         string           `json:"instanceId,omitempty"`
	InstanceUuid       string           `json:"instanceUuid,omitempty"`
	InstanceName       string           `json:"instanceName,omitempty"`
	FloatingIp         string           `json:"floatingIp,omitempty"`
	InternalIp         string           `json:"internalIp,omitempty"`
	Status             string           `json:"status,omitempty"`
	Payment            string           `json:"payment,omitempty"`
	CpuCount           int64            `json:"cpuCount,omitempty"`
	MemoryCapacityInGB int64            `json:"memoryCapacityInGB,omitempty"`
	InstanceType       string           `json:"instanceType,omitempty"`
	SysDiskInGB        int              `json:"sysDiskInGB,omitempty"`
	CreateTime         string           `json:"createTime,omitempty"`
	Eip                AsEipModel       `json:"eip,omitempty"`
	SubnetType         string           `json:"subnetType,omitempty"`
	IsProtected        bool             `json:"isProtected,omitempty"`
	NodeType           string           `json:"nodeType,omitempty"`
	Tags               []model.TagModel `json:"tags,omitempty"`
	GroupId            string           `json:"groupId,omitempty"`
}

type VpcInfo

type VpcInfo struct {
	VpcId   string `json:"vpcId,omitempty"`
	VpcName string `json:"vpcName,omitempty"`
	VpcUUID string `json:"vpcUuid,omitempty"`
}

type ZoneInfo

type ZoneInfo struct {
	Zone       string `json:"zone,omitempty"`
	SubnetID   string `json:"subnetId,omitempty"`
	SubnetUUID string `json:"subnetUuid,omitempty"`
	SubnetName string `json:"subnetName,omitempty"`
	SubnetType int16  `json:"subnetType,omitempty"`
	NodeCount  int    `json:"nodeCount,omitempty"`
}

Jump to

Keyboard shortcuts

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