Documentation
¶
Index ¶
- Variables
- type AttachVolumeArgs
- type AttachVolumeResponse
- type CdsPreMountInfo
- type Client
- func (c *Client) AttachVolume(args *AttachVolumeArgs, option *bce.SignOption) (*VolumeAttachment, error)
- func (c *Client) CreateVolumes(args *CreateVolumeArgs, option *bce.SignOption) ([]string, error)
- func (c *Client) DeleteVolume(volumeId string, option *bce.SignOption) error
- func (c *Client) DescribeVolume(id string, option *bce.SignOption) (*Volume, error)
- func (c *Client) DetachVolume(args *AttachVolumeArgs, option *bce.SignOption) error
- func (c *Client) GetURL(objectKey string, params map[string]string) string
- func (c *Client) GetVolumeList(args *GetVolumeListArgs, option *bce.SignOption) ([]Volume, error)
- func (c *Client) PurchaseReservedVolume()
- func (c *Client) RollbackVolume()
- type CreateVolumeArgs
- type CreateVolumeResponse
- type DescribeVolumeResponse
- type DiskSizeConfig
- type GetVolumeListArgs
- type GetVolumeListResponse
- type StorageType
- type Volume
- type VolumeAttachment
- type VolumeStatus
- type VolumeType
Constants ¶
This section is empty.
Variables ¶
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 AttachVolumeArgs ¶
AttachCDSVolumeArgs describe attachcds args
type AttachVolumeResponse ¶
type AttachVolumeResponse 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 CDS client implemention for Baidu Cloud CDS API.
func (*Client) AttachVolume ¶
func (c *Client) AttachVolume(args *AttachVolumeArgs, option *bce.SignOption) (*VolumeAttachment, error)
AttachCDSVolume attach a cds to vm
func (*Client) CreateVolumes ¶
func (c *Client) CreateVolumes(args *CreateVolumeArgs, option *bce.SignOption) ([]string, error)
CreateVolumes create a volume
func (*Client) DeleteVolume ¶
func (c *Client) DeleteVolume(volumeId string, option *bce.SignOption) error
DeleteVolume Delete a volume
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) DetachVolume ¶
func (c *Client) DetachVolume(args *AttachVolumeArgs, option *bce.SignOption) error
DetachCDSVolume detach a cds TODO: if a volume is detaching, need to wait
func (*Client) GetVolumeList ¶
func (c *Client) GetVolumeList(args *GetVolumeListArgs, option *bce.SignOption) ([]Volume, error)
GetVolumeList get all volumes
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 GetVolumeListArgs ¶
type GetVolumeListResponse ¶
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" )