Documentation
¶
Index ¶
- Constants
- Variables
- type AttachCDSVolumeArgs
- type AttachCDSVolumeResponse
- type CdsPreMountInfo
- type Client
- func (c *Client) AttachCDSVolume(args *AttachCDSVolumeArgs) (*VolumeAttachment, error)
- func (c *Client) CreateVolumes(args *CreateVolumeArgs) ([]string, error)
- func (c *Client) DeleteCDS(volumeID string) error
- func (c *Client) DeleteVolume(volumeId string) error
- func (c *Client) DescribeInstance(instanceID string, option *bce.SignOption) (*Instance, error)
- func (c *Client) DescribeVolume(id string) (*Volume, error)
- func (c *Client) DetachCDSVolume(args *AttachCDSVolumeArgs) error
- func (c *Client) GetURL(objectKey string, params map[string]string) string
- func (c *Client) GetVolumeList(args *GetVolumeListArgs) ([]Volume, error)
- func (c *Client) ListInstances(option *bce.SignOption) ([]Instance, error)
- func (c *Client) PurchaseReservedVolume()
- func (c *Client) RollbackVolume()
- type Config
- type CreateVolumeArgs
- type CreateVolumeResponse
- type DescribeVolumeResponse
- type DiskSizeConfig
- type GetInstanceResponse
- type GetVolumeListArgs
- type GetVolumeListResponse
- type Instance
- type ListInstancesResponse
- type StorageType
- type Volume
- type VolumeAttachment
- type VolumeStatus
- type VolumeType
Constants ¶
const ( InstanceStatusRunning string = "Running" InstanceStatusStarting string = "Starting" InstanceStatusStopping string = "Stopping" InstanceStatusStopped string = "Stopped" InstanceStatusDeleted string = "Deleted" InstanceStatusScaling string = "Scaling" InstanceStatusExpired string = "Expired" InstanceStatusError string = "Error" InstanceStatusSnapshotProcessing string = "SnapshotProcessing" InstanceStatusImageProcessing string = "ImageProcessing" )
Variables ¶
var Endpoint = map[string]string{
"bj": "bcc.bj.baidubce.com",
"gz": "bcc.gz.baidubce.com",
"su": "bcc.su.baidubce.com",
}
Endpoint contains all endpoints of Baidu Cloud BCC.
Functions ¶
This section is empty.
Types ¶
type AttachCDSVolumeArgs ¶
type AttachCDSVolumeArgs struct { VolumeId string `json:"-"` InstanceId string `json:"instanceId"` }
AttachCDSVolumeArgs describe attachcds args
type AttachCDSVolumeResponse ¶
type AttachCDSVolumeResponse struct {
VolumeAttachment *VolumeAttachment `json:"volumeAttachment"`
}
type CdsPreMountInfo ¶
type CdsPreMountInfo struct { MountPath string `json:"mountPath"` CdsConfig []DiskSizeConfig `json:"cdsConfig"` }
CdsPreMountInfo define premount
type Client ¶
Client is the bos client implemention for Baidu Cloud BOS API.
func (*Client) AttachCDSVolume ¶
func (c *Client) AttachCDSVolume(args *AttachCDSVolumeArgs) (*VolumeAttachment, error)
AttachCDSVolume attach a cds to vm
func (*Client) CreateVolumes ¶
func (c *Client) CreateVolumes(args *CreateVolumeArgs) ([]string, error)
CreateVolumes create a volume
func (*Client) DeleteVolume ¶
DeleteVolume Delete a volume
func (*Client) DescribeInstance ¶
DescribeInstance describe a instance
func (*Client) DescribeVolume ¶
DescribeVolume describe a volume More info see https://cloud.baidu.com/doc/BCC/API.html#.E6.9F.A5.E8.AF.A2.E7.A3.81.E7.9B.98.E8.AF.A6.E6.83.85
func (*Client) DetachCDSVolume ¶
func (c *Client) DetachCDSVolume(args *AttachCDSVolumeArgs) error
DetachCDSVolume detach a cds TODO: if a volume is ddetaching, need to wait
func (*Client) GetVolumeList ¶
func (c *Client) GetVolumeList(args *GetVolumeListArgs) ([]Volume, error)
GetVolumeList get all volumes
func (*Client) ListInstances ¶
func (c *Client) ListInstances(option *bce.SignOption) ([]Instance, error)
ListInstances gets all Instances.
func (*Client) PurchaseReservedVolume ¶
func (c *Client) PurchaseReservedVolume()
PurchaseReservedVolume purchaseReserved a volume TODO
func (*Client) RollbackVolume ¶
func (c *Client) RollbackVolume()
RollbackVolume rollback a volume TODO
type CreateVolumeArgs ¶
type CreateVolumeResponse ¶
type CreateVolumeResponse struct {
VolumeIds []string `json:"volumeIds,omitempty"`
}
type DescribeVolumeResponse ¶
type DescribeVolumeResponse struct {
Volume *Volume `json:"volume"`
}
type DiskSizeConfig ¶
type DiskSizeConfig struct { Size string `json:"size"` SnapshotID string `json:"snapshotID"` SnapshotName string `json:"snapshotName"` VolumeType string `json:"volumeType"` StorageType string `json:"storageType"` LogicalZone string `json:"logicalZone"` }
DiskSizeConfig define distsize config
type GetInstanceResponse ¶
type GetInstanceResponse struct {
Ins Instance `json:"instance"`
}
type GetVolumeListArgs ¶
type GetVolumeListResponse ¶
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
type ListInstancesResponse ¶
type StorageType ¶
type StorageType string
const ( STORAGE_TYPE_STD1 StorageType = "std1" STORAGE_TYPE_HP1 StorageType = "hp1" STORAGE_TYPE_SATA StorageType = "sata" STORAGE_TYPE_SSD StorageType = "ssd" )
type Volume ¶
type Volume struct { Id string `json:"id"` Name string `json:"name"` DiskSizeInGB int `json:"diskSizeInGB"` PaymentTiming string `json:"paymentTiming"` CreateTime string `json:"createTime"` ExpireTime string `json:"expireTime"` Status VolumeStatus `json:"status"` VolumeType VolumeType `json:"type"` StorageType StorageType `json:"storageType"` Desc string `json:"desc"` Attachments []VolumeAttachment `json:"attachments"` ZoneName string `json:"zoneName"` IsSystemVolume bool `json:"isSystemVolume"` }
type VolumeAttachment ¶
type VolumeAttachment struct { VolumeId string `json:"volumeId"` InstanceId string `json:"instanceId"` // mount path Device string `json:"device"` }
VolumeAttachment define attach info
type VolumeStatus ¶
type VolumeStatus string
const ( VOLUMESTATUS_CREATE VolumeStatus = "Creating" VOLUMESTATUS_AVAILABLE VolumeStatus = "Available" VOLUMESTATUS_ATTACHING VolumeStatus = "Attaching" VOLUMESTATUS_NOTAVALIABLE VolumeStatus = "NotAvailable" VOLUMESTATUS_INUSE VolumeStatus = "InUse" VOLUMESTATUS_DETACHING VolumeStatus = "Detaching" VOLUMESTATUS_DELETING VolumeStatus = "Deleting" VOLUMESTATUS_DELETED VolumeStatus = "Deleted" VOLUMESTATUS_SCALING VolumeStatus = "Scaling" VOLUMESTATUS_EXPIRED VolumeStatus = "Expired" VOLUMESTATUS_ERROR VolumeStatus = "Error" VOLUMESTATUS_SNAPSHOTPROCESSING VolumeStatus = "SnapshotProcessing" VOLUMESTATUS_IMAGEPROCESSING VolumeStatus = "ImageProcessing" )
type VolumeType ¶
type VolumeType string
const ( VOLUME_TYPE_SYSTEM VolumeType = "System" VOLUME_TYPE_EPHEMERAL VolumeType = "Ephemeral" VOLUME_TYPE_CDS VolumeType = "Cds" )