Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) CreateInstances(args *CreateInstanceArgs, option *bce.SignOption) ([]string, error)
- func (c *Client) DeleteInstance(instanceID string, option *bce.SignOption) error
- func (c *Client) DescribeInstance(instanceID string, option *bce.SignOption) (*Instance, error)
- func (c *Client) GetURL(objectKey string, params map[string]string) string
- func (c *Client) ListInstances(option *bce.SignOption) ([]Instance, error)
- type CreateCdsModel
- type CreateInstanceArgs
- type CreateInstanceResponse
- type EphemeralDisk
- type GetInstanceResponse
- type Instance
- type ListInstancesResponse
- type StorageType
Constants ¶
View Source
const ( // InstanceStatusRunning status InstanceStatusRunning string = "Running" // InstanceStatusStarting status InstanceStatusStarting string = "Starting" // InstanceStatusStopping status InstanceStatusStopping string = "Stopping" // InstanceStatusStopped status InstanceStatusStopped string = "Stopped" // InstanceStatusDeleted status InstanceStatusDeleted string = "Deleted" // InstanceStatusScaling status InstanceStatusScaling string = "Scaling" // InstanceStatusExpired status InstanceStatusExpired string = "Expired" // InstanceStatusError status InstanceStatusError string = "Error" // InstanceStatusSnapshotProcessing status InstanceStatusSnapshotProcessing string = "SnapshotProcessing" // InstanceStatusImageProcessing statu InstanceStatusImageProcessing string = "ImageProcessing" )
Variables ¶
View Source
var Endpoint = map[string]string{
"bj": "bcc.bj.baidubce.com",
"gz": "bcc.gz.baidubce.com",
"su": "bcc.su.baidubce.com",
"bd": "bcc.bd.baidubce.com",
"hk": "bcc.hkg.baidubce.com",
}
Endpoint contains all endpoints of Baidu Cloud BCC.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is the BCC client implemention for Baidu Cloud BCC API.
func (*Client) CreateInstances ¶
func (c *Client) CreateInstances(args *CreateInstanceArgs, option *bce.SignOption) ([]string, error)
CreateInstances create instances according to args
func (*Client) DeleteInstance ¶
func (c *Client) DeleteInstance(instanceID string, option *bce.SignOption) error
DeleteInstance delete a instance
func (*Client) DescribeInstance ¶
DescribeInstance describe a instance
func (*Client) ListInstances ¶
func (c *Client) ListInstances(option *bce.SignOption) ([]Instance, error)
ListInstances gets all Instances.
type CreateCdsModel ¶
type CreateCdsModel struct { StorageType StorageType `json:"storageType,storageType"` SnapshotID string `json:"snapshotId,omitempty"` CdsSizeInGB int `json:"cdsSizeInGB,omitempty"` }
CreateCdsModel json
type CreateInstanceArgs ¶
type CreateInstanceArgs struct { ImageID string `json:"imageId"` Billing billing.Billing `json:"billing"` InstanceType string `json:"instanceType,omitempty"` CPUCount int `json:"cpuCount"` MemoryCapacityInGB int `json:"memoryCapacityInGB"` RootDiskSizeInGB int `json:"rootDiskSizeInGb,omitempty"` RootDiskStorageType int `json:"rootDiskStorageType,omitempty"` LocalDiskSizeInGB int `json:"localDiskSizeInGB,omitempty"` // deprecated now EphemeralDisks []EphemeralDisk `json:"ephemeralDisks,omitempty"` CreateCdsList []CreateCdsModel `json:"createCdsList,omitempty"` NetworkCapacityInMbps int `json:"networkCapacityInMbps,omitempty"` DedicatedHostID int `json:"dedicatedHostId,omitempty"` PurchaseCount int `json:"purchaseCount,omitempty"` Name string `json:"name,omitempty"` AdminPass string `json:"adminPass,omitempty"` ZoneName string `json:"zoneName,omitempty"` SubnetID string `json:"subnetId,omitempty"` SecurityGroupID string `json:"securityGroupId,omitempty"` GPUCard string `json:"gpuCard,omitempty"` FPGACard string `json:"fpgaCard,omitempty"` CardCount string `json:"cardCount,omitempty"` }
CreateInstanceArgs is args to create instances refers to https://cloud.baidu.com/doc/BCC/API.html#.E5.88.9B.E5.BB.BA.E5.AE.9E.E4.BE.8B
type CreateInstanceResponse ¶
type CreateInstanceResponse struct {
InstanceIDs []string `json:"instanceIds"`
}
CreateInstanceResponse is response of create instances
type EphemeralDisk ¶
type EphemeralDisk struct { StorageType StorageType `json:"storageType,storageType"` SizeInGB int `json:"sizeInGB,omitempty"` FreeSizeInGB int `json:"freeSizeInGB,omitempty"` }
EphemeralDisk json
type GetInstanceResponse ¶
type GetInstanceResponse struct {
Ins Instance `json:"instance"`
}
GetInstanceResponse json
type Instance ¶
type Instance struct { InstanceID string `json:"id"` InstanceName string `json:"name"` Description string `json:"desc"` Status string `json:"status"` PaymentTiming string `json:"paymentTiming"` CreationTime string `json:"createTime"` ExpireTime string `json:"expireTime"` PublicIP string `json:"publicIp"` InternalIP string `json:"internalIp"` CPUCount int `json:"cpuCount"` GPUCount int `json:"gpuCount"` MemoryCapacityInGB int `json:"memoryCapacityInGB"` LocalDiskSizeInGB int `json:"localDiskSizeInGB"` ImageID string `json:"imageId"` NetworkCapacityInMbps int `json:"networkCapacityInMbps"` PlacementPolicy string `json:"placementPolicy"` ZoneName string `json:"zoneName"` SubnetID string `json:"subnetId"` VpcID string `json:"vpcId"` }
Instance define instance model
Click to show internal directories.
Click to hide internal directories.