Documentation
¶
Index ¶
Constants ¶
View Source
const ( VolumeAvailableStatus = "AVAILABLE" VolumeInUseStatus = "IN-USE" )
Variables ¶
This section is empty.
Functions ¶
func InitProvider ¶
Types ¶
type BlockStorageOpts ¶
type BlockStorageOpts struct {
NodeVolumeAttachLimit int64 `gcfg:"node-volume-attach-limit"`
RescanOnResize bool `gcfg:"rescan-on-resize"`
IgnoreVolumeAZ bool `gcfg:"ignore-volume-az"` // ignore volume AZ (available zones) when attaching to node
IgnoreVolumeMicroversion bool `gcfg:"ignore-volume-microversion"`
}
type Config ¶
type Config struct {
Global client.AuthOpts
Metadata metadata.Opts
BlockStorage BlockStorageOpts
}
type IVContainer ¶
type IVContainer interface {
GetMetadataOpts() metadata.Opts
SetupPortalInfo(metadata metadata.IMetadata) error
ListVolumes(limit int, startingToken string) ([]*bstgObj.Volume, string, error)
GetVolumesByName(n string) ([]*bstgObj.Volume, error)
GetVolume(volumeID string) (*bstgObj.Volume, error)
CreateVolume(name string, size uint64, vtype, availability string, snapshotID string, sourcevolID string, tags *map[string]string) (*bstgObj.Volume, error)
DeleteVolume(volID string) error
GetInstanceByID(instanceID string) (*comObj.Server, error)
AttachVolume(instanceID, volumeID string) (string, error)
GetAttachmentDiskPath(instanceID, volumeID string) (string, error)
WaitDiskAttached(instanceID string, volumeID string) error
DetachVolume(instanceID, volumeID string) error
WaitDiskDetached(instanceID string, volumeID string) error
ExpandVolume(volumeTypeID, volumeID string, newSize uint64) error
WaitVolumeTargetStatus(volumeID string, tStatus []string) error
GetMaxVolLimit() int64
GetBlockStorageOpts() BlockStorageOpts
ListSnapshots(page string, size int, volumeID, status, name string) ([]*snapV1Obj.Snapshot, string, error)
GetSnapshotByID(snapshotID string) (*snapV1Obj.Snapshot, error)
CreateSnapshot(name, volID string) (*snapV2Obj.Snapshot, error)
WaitSnapshotReady(snapshotID string) error
DeleteSnapshot(volumeID, snapshotID string) error
GetMappingVolume(volumeID string) (string, error)
}
func GetProvider ¶
func GetProvider() (IVContainer, error)
func NewVContainer ¶
func NewVContainer(compute, blockstorage, portal *vclient.ServiceClient, bsOpts BlockStorageOpts, metadataOpts metadata.Opts) IVContainer
Click to show internal directories.
Click to hide internal directories.