Documentation
¶
Index ¶
- Constants
- type AttachBlockVolumeRequest
- type BlockVolume
- type Config
- type ConfigureVolumeRestore
- type CreateBlockVolumeRequest
- type CreateBlockVolumeResponse
- type CreateSnapshotByBlockVolumeIDRequest
- type CreateSnapshotByBlockVolumeIDResponse
- type CreateVolumeFrom
- type DeleteBlockVolumeByIDRequest
- type DeleteSnapshotByIDRequest
- type EncryptType
- type GetBlockVolumeByIDRequest
- type GetBlockVolumeByIDResponse
- type GetUnderBlockVolumeIDRequest
- type GetUnderBlockVolumeIDResponse
- type ListBlockVolumesRequest
- type ListBlockVolumesResponse
- type ListSnapshots
- type ListSnapshotsByBlockVolumeIDRequest
- type ListSnapshotsByBlockVolumeIDResponse
- type ListVolumes
- type MigrateAction
- type MigrateBlockVolumeByIDRequest
- type ResizeBlockVolumeByIDRequest
- type ResizeBlockVolumeByIDResponse
- type Snapshot
- type Volume
- type VolumeServiceV2
- func (s *VolumeServiceV2) CreateBlockVolume(ctx context.Context, opts *CreateBlockVolumeRequest) (*Volume, error)
- func (s *VolumeServiceV2) CreateSnapshotByBlockVolumeID(ctx context.Context, opts *CreateSnapshotByBlockVolumeIDRequest) (*Snapshot, error)
- func (s *VolumeServiceV2) DeleteBlockVolumeByID(ctx context.Context, opts *DeleteBlockVolumeByIDRequest) error
- func (s *VolumeServiceV2) DeleteSnapshotByID(ctx context.Context, opts *DeleteSnapshotByIDRequest) error
- func (s *VolumeServiceV2) GetBlockVolumeByID(ctx context.Context, opts *GetBlockVolumeByIDRequest) (*Volume, error)
- func (s *VolumeServiceV2) GetUnderBlockVolumeID(ctx context.Context, opts *GetUnderBlockVolumeIDRequest) (*Volume, error)
- func (s *VolumeServiceV2) ListBlockVolumes(ctx context.Context, opts *ListBlockVolumesRequest) (*ListVolumes, error)
- func (s *VolumeServiceV2) ListSnapshotsByBlockVolumeID(ctx context.Context, opts *ListSnapshotsByBlockVolumeIDRequest) (*ListSnapshots, error)
- func (s *VolumeServiceV2) MigrateBlockVolumeByID(ctx context.Context, opts *MigrateBlockVolumeByIDRequest) error
- func (s *VolumeServiceV2) ResizeBlockVolumeByID(ctx context.Context, opts *ResizeBlockVolumeByIDRequest) (*Volume, error)
- type VolumeSnapshot
- type VolumeTag
- type Zone
Constants ¶
View Source
const ( CreateFromNew = CreateVolumeFrom("NEW") CreateFromSnapshot = CreateVolumeFrom("SNAPSHOT") AesXtsPlain64_128 = EncryptType("aes-xts-plain64_128") AesXtsPlain64_256 = EncryptType("aes-xts-plain64_256") InitMigrateAction = MigrateAction("INIT-MIGRATE") ProcessMigrateAction = MigrateAction("MIGRATE") ConfirmMigrateAction = MigrateAction("CONFIRM-MIGRATE") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockVolume ¶
type BlockVolume struct {
UUID string `json:"uuid"`
ProjectID string `json:"projectId"`
Name string `json:"name"`
Size uint64 `json:"size"`
Status string `json:"status"`
VolumeTypeID string `json:"volumeTypeId"`
VolumeTypeZoneName string `json:"volumeTypeZoneName"`
IOPS string `json:"iops"`
ServerID string `json:"serverId,omitempty"`
CreatedAt string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
Bootable bool `json:"bootable"`
EncryptionType *string `json:"encryptionType"`
BootIndex int `json:"bootIndex"`
MultiAttach bool `json:"multiAttach"`
ServerIDList []string `json:"serverIdList"`
Location *string `json:"location"`
Product string `json:"product"`
PersistentVolume bool `json:"persistentVolume"`
MigrateState string `json:"migrateState,omitempty"`
Zone Zone `json:"zone"`
}
type ConfigureVolumeRestore ¶
type CreateBlockVolumeRequest ¶
type CreateBlockVolumeRequest struct {
BackupVolumePointID string `json:"backupVolumePointId,omitempty"`
CreatedFrom CreateVolumeFrom `json:"createdFrom,omitempty"`
EncryptionType EncryptType `json:"encryptionType,omitempty"`
MultiAttach bool `json:"multiAttach,omitempty"`
Name string `json:"name"`
Size int64 `json:"size"`
VolumeTypeID string `json:"volumeTypeId"`
Tags []VolumeTag `json:"tags,omitempty"`
IsPoc bool `json:"isPoc,omitempty"`
IsEnableAutoRenew bool `json:"isEnableAutoRenew,omitempty"`
ConfigureVolumeRestore *ConfigureVolumeRestore `json:"configVolumeRestore,omitempty"`
Zone string `json:"zoneId,omitempty"`
PoolName string `json:"poolName,omitempty"`
}
func NewCreateBlockVolumeRequest ¶
func NewCreateBlockVolumeRequest(volumeName, volumeType string, size int64) *CreateBlockVolumeRequest
type CreateBlockVolumeResponse ¶
type CreateBlockVolumeResponse struct {
Data BlockVolume `json:"data"`
}
func (*CreateBlockVolumeResponse) ToEntityVolume ¶
func (r *CreateBlockVolumeResponse) ToEntityVolume() *Volume
type CreateSnapshotByBlockVolumeIDRequest ¶
type CreateSnapshotByBlockVolumeIDRequest struct {
Name string `json:"name"`
Description string `json:"description"`
Permanently bool `json:"isPermanently"`
RetainedDay uint64 `json:"retainedDay"`
BlockVolumeID string
}
func NewCreateSnapshotByBlockVolumeIDRequest ¶
func NewCreateSnapshotByBlockVolumeIDRequest(name, blockVolumeID string) *CreateSnapshotByBlockVolumeIDRequest
type CreateSnapshotByBlockVolumeIDResponse ¶
type CreateSnapshotByBlockVolumeIDResponse struct {
// contains filtered or unexported fields
}
func (*CreateSnapshotByBlockVolumeIDResponse) ToEntitySnapshot ¶
func (r *CreateSnapshotByBlockVolumeIDResponse) ToEntitySnapshot() *Snapshot
type CreateVolumeFrom ¶
type CreateVolumeFrom string
type DeleteBlockVolumeByIDRequest ¶
type DeleteBlockVolumeByIDRequest struct {
BlockVolumeID string
}
func NewDeleteBlockVolumeByIDRequest ¶
func NewDeleteBlockVolumeByIDRequest(volumeID string) *DeleteBlockVolumeByIDRequest
type DeleteSnapshotByIDRequest ¶
func NewDeleteSnapshotByIDRequest ¶
func NewDeleteSnapshotByIDRequest(snapshotID string) *DeleteSnapshotByIDRequest
type EncryptType ¶
type EncryptType string
type GetBlockVolumeByIDRequest ¶
type GetBlockVolumeByIDRequest struct {
BlockVolumeID string
}
func NewGetBlockVolumeByIDRequest ¶
func NewGetBlockVolumeByIDRequest(volumeID string) *GetBlockVolumeByIDRequest
type GetBlockVolumeByIDResponse ¶
type GetBlockVolumeByIDResponse struct {
Data BlockVolume `json:"data"`
}
func (*GetBlockVolumeByIDResponse) ToEntityVolume ¶
func (r *GetBlockVolumeByIDResponse) ToEntityVolume() *Volume
type GetUnderBlockVolumeIDRequest ¶
type GetUnderBlockVolumeIDRequest struct {
BlockVolumeID string
}
func NewGetUnderVolumeIDRequest ¶
func NewGetUnderVolumeIDRequest(volumeID string) *GetUnderBlockVolumeIDRequest
type GetUnderBlockVolumeIDResponse ¶
type GetUnderBlockVolumeIDResponse struct {
Uuid string `json:"uuid"`
}
func (*GetUnderBlockVolumeIDResponse) ToEntityVolume ¶
func (r *GetUnderBlockVolumeIDResponse) ToEntityVolume() *Volume
type ListBlockVolumesRequest ¶
func NewListBlockVolumesRequest ¶
func NewListBlockVolumesRequest(page, size int) *ListBlockVolumesRequest
func (*ListBlockVolumesRequest) ToQuery ¶
func (r *ListBlockVolumesRequest) ToQuery() (string, error)
type ListBlockVolumesResponse ¶
type ListBlockVolumesResponse struct {
Page int64 `json:"page"`
PageSize int64 `json:"pageSize"`
TotalPage int64 `json:"totalPage"`
TotalItem int64 `json:"totalItem"`
ListData []BlockVolume `json:"listData"`
}
func (*ListBlockVolumesResponse) ToEntityListVolumes ¶
func (r *ListBlockVolumesResponse) ToEntityListVolumes() *ListVolumes
type ListSnapshots ¶
type ListSnapshotsByBlockVolumeIDRequest ¶
func NewListSnapshotsByBlockVolumeIDRequest ¶
func NewListSnapshotsByBlockVolumeIDRequest(page, size int, blockVolumeID string) *ListSnapshotsByBlockVolumeIDRequest
func (*ListSnapshotsByBlockVolumeIDRequest) ToQuery ¶
func (r *ListSnapshotsByBlockVolumeIDRequest) ToQuery() (string, error)
type ListSnapshotsByBlockVolumeIDResponse ¶
type ListSnapshotsByBlockVolumeIDResponse struct {
Items []snapshotResp `json:"items"`
Page int `json:"page"`
PageSize int `json:"pageSize"`
TotalPages int `json:"totalPages"`
TotalItems int `json:"totalItems"`
}
func (*ListSnapshotsByBlockVolumeIDResponse) ToEntityListSnapshots ¶
func (r *ListSnapshotsByBlockVolumeIDResponse) ToEntityListSnapshots() *ListSnapshots
type ListVolumes ¶
func (ListVolumes) Len ¶
func (l ListVolumes) Len() int
type MigrateAction ¶
type MigrateAction string
type MigrateBlockVolumeByIDRequest ¶
type MigrateBlockVolumeByIDRequest struct {
Action MigrateAction `json:"action"`
ConfirmMigrate bool
Tags []common.Tag `json:"tags"`
VolumeTypeID string `json:"volumeTypeId"`
Auto bool
BlockVolumeID string
}
func NewMigrateBlockVolumeByIDRequest ¶
func NewMigrateBlockVolumeByIDRequest(volumeID, volumeType string) *MigrateBlockVolumeByIDRequest
type ResizeBlockVolumeByIDRequest ¶
type ResizeBlockVolumeByIDRequest struct {
NewSize int `json:"newSize"` // NewSize is the new size of the volume, in GB
VolumeTypeID string `json:"newVolumeTypeId"` // VolumeTypeID is the type of the volume
BlockVolumeID string
}
func NewResizeBlockVolumeByIDRequest ¶
func NewResizeBlockVolumeByIDRequest(volumeID, volumeType string, size int) *ResizeBlockVolumeByIDRequest
type ResizeBlockVolumeByIDResponse ¶
type ResizeBlockVolumeByIDResponse struct {
Data BlockVolume `json:"data"`
}
func (*ResizeBlockVolumeByIDResponse) ToEntityVolume ¶
func (r *ResizeBlockVolumeByIDResponse) ToEntityVolume() *Volume
type Volume ¶
type Volume struct {
Name string `json:"name"`
ID string `json:"uuid"`
VolumeTypeID string `json:"volumeTypeId"`
ClusterID *string `json:"clusterId"`
VmID string `json:"serverId"`
Size uint64 `json:"size"`
IopsID uint64 `json:"iopsId"`
Status string `json:"status"`
CreatedAt string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
PersistentVolume bool `json:"persistentVolume"`
AttachedMachine []string `json:"serverIdList"`
UnderID string `json:"underId"`
MigrateState string `json:"migrateState"`
MultiAttach bool `json:"multiAttach"`
ZoneID string `json:"zoneId"`
}
func (Volume) AttachedTheInstance ¶
func (Volume) IsAvailable ¶
type VolumeServiceV2 ¶
type VolumeServiceV2 struct {
Client *client.ServiceClient
}
func (*VolumeServiceV2) CreateBlockVolume ¶
func (s *VolumeServiceV2) CreateBlockVolume(ctx context.Context, opts *CreateBlockVolumeRequest) (*Volume, error)
func (*VolumeServiceV2) CreateSnapshotByBlockVolumeID ¶
func (s *VolumeServiceV2) CreateSnapshotByBlockVolumeID(ctx context.Context, opts *CreateSnapshotByBlockVolumeIDRequest) (*Snapshot, error)
func (*VolumeServiceV2) DeleteBlockVolumeByID ¶
func (s *VolumeServiceV2) DeleteBlockVolumeByID(ctx context.Context, opts *DeleteBlockVolumeByIDRequest) error
func (*VolumeServiceV2) DeleteSnapshotByID ¶
func (s *VolumeServiceV2) DeleteSnapshotByID(ctx context.Context, opts *DeleteSnapshotByIDRequest) error
func (*VolumeServiceV2) GetBlockVolumeByID ¶
func (s *VolumeServiceV2) GetBlockVolumeByID(ctx context.Context, opts *GetBlockVolumeByIDRequest) (*Volume, error)
func (*VolumeServiceV2) GetUnderBlockVolumeID ¶
func (s *VolumeServiceV2) GetUnderBlockVolumeID(ctx context.Context, opts *GetUnderBlockVolumeIDRequest) (*Volume, error)
func (*VolumeServiceV2) ListBlockVolumes ¶
func (s *VolumeServiceV2) ListBlockVolumes(ctx context.Context, opts *ListBlockVolumesRequest) (*ListVolumes, error)
func (*VolumeServiceV2) ListSnapshotsByBlockVolumeID ¶
func (s *VolumeServiceV2) ListSnapshotsByBlockVolumeID(ctx context.Context, opts *ListSnapshotsByBlockVolumeIDRequest) (*ListSnapshots, error)
func (*VolumeServiceV2) MigrateBlockVolumeByID ¶
func (s *VolumeServiceV2) MigrateBlockVolumeByID(ctx context.Context, opts *MigrateBlockVolumeByIDRequest) error
func (*VolumeServiceV2) ResizeBlockVolumeByID ¶
func (s *VolumeServiceV2) ResizeBlockVolumeByID(ctx context.Context, opts *ResizeBlockVolumeByIDRequest) (*Volume, error)
type VolumeSnapshot ¶
type VolumeSnapshot struct {
BackendPool string `json:"backendPool"`
BackendPrefix string `json:"backendPrefix"`
BackendStatus string `json:"backendStatus"`
BackendUuid string `json:"backendUuid"`
BootIndex int `json:"bootIndex"`
Bootable bool `json:"bootable"`
CreatedAt string `json:"createdAt"`
ID string `json:"id"`
MultiAttach bool `json:"multiAttach"`
Name string `json:"name"`
Product string `json:"product"`
ProjectID string `json:"projectId"`
Size int64 `json:"size"`
Status string `json:"status"`
Type string `json:"type"`
UpdatedAt string `json:"updatedAt"`
Uuid string `json:"uuid"`
VolumeID int64 `json:"volumeId"`
VolumeTypeID string `json:"volumeTypeId"`
VolumeTypeZoneID string `json:"volumeTypeZoneId"`
EncryptionType *string `json:"encryptionType"`
}
type VolumeTag ¶
func NewVolumeTags ¶
NewVolumeTags creates a []VolumeTag from variadic key-value string pairs. If an odd number of strings is provided, the last value defaults to "none".
Click to show internal directories.
Click to hide internal directories.