Documentation ¶
Overview ¶
Package openstack snapshots provides an implementation of Cinder Snapshot features cinder functions using Gophercloud.
Index ¶
- Constants
- func AddExtraFlags(fs *pflag.FlagSet)
- func InitOpenStackProvider(cfgFiles []string)
- type BlockStorageOpts
- type Config
- type IOpenStack
- type OpenStack
- func (os *OpenStack) AttachVolume(volumeID string, mountPoint string) error
- func (os *OpenStack) CheckBlockStorageAPI() error
- func (os *OpenStack) CreateSnapshot(name, volID string, tags *map[string]string) (*snapshots.Snapshot, error)
- func (os *OpenStack) CreateVolume(name string, size int, vtype, availability string, snapshotID string, ...) (*volumes.Volume, error)
- func (os *OpenStack) DeleteSnapshot(snapID string) error
- func (os *OpenStack) DeleteVolume(volumeID string) error
- func (os *OpenStack) DetachVolume(volumeID string) error
- func (os *OpenStack) ExpandVolume(volumeID string, status string, newSize int) error
- func (os *OpenStack) GetAttachmentDiskPath(instanceID, volumeID string) (string, error)
- func (os *OpenStack) GetAvailabilityZone() (string, error)
- func (os *OpenStack) GetBlockStorageOpts() BlockStorageOpts
- func (os *OpenStack) GetInitializeConnection(volumeID string) (map[string]interface{}, error)
- func (os *OpenStack) GetMaxVolLimit() int64
- func (os *OpenStack) GetSnapshotByID(snapshotID string) (*snapshots.Snapshot, error)
- func (os *OpenStack) GetVolume(volumeID string) (*volumes.Volume, error)
- func (os *OpenStack) GetVolumesByName(n string) ([]volumes.Volume, error)
- func (os *OpenStack) ListSnapshots(filters map[string]string) ([]snapshots.Snapshot, string, error)
- func (os *OpenStack) ListVolumes(limit int, startingToken string) ([]volumes.Volume, string, error)
- func (os *OpenStack) WaitSnapshotReady(snapshotID string) error
- func (os *OpenStack) WaitVolumeTargetStatus(volumeID string, tStatus []string) error
Constants ¶
const ( VolumeAvailableStatus = "available" VolumeInUseStatus = "in-use" )
Variables ¶
This section is empty.
Functions ¶
func AddExtraFlags ¶
AddExtraFlags is called by the main package to add component specific command line flags
func InitOpenStackProvider ¶
func InitOpenStackProvider(cfgFiles []string)
Types ¶
type BlockStorageOpts ¶
type Config ¶
type Config struct { Global client.AuthOpts BlockStorage BlockStorageOpts }
func GetConfigFromFiles ¶
GetConfigFromFiles retrieves config options from file
type IOpenStack ¶
type IOpenStack interface { CheckBlockStorageAPI() error CreateVolume(name string, size int, vtype, availability string, snapshotID string, sourcevolID string, tags *map[string]string) (*volumes.Volume, error) DeleteVolume(volumeID string) error AttachVolume(volumeID string, mountPoint string) error DetachVolume(volumeID string) error ListVolumes(limit int, startingToken string) ([]volumes.Volume, string, error) WaitVolumeTargetStatus(volumeID string, tStatus []string) error GetVolume(volumeID string) (*volumes.Volume, error) GetVolumesByName(name string) ([]volumes.Volume, error) CreateSnapshot(name, volID string, tags *map[string]string) (*snapshots.Snapshot, error) ListSnapshots(filters map[string]string) ([]snapshots.Snapshot, string, error) DeleteSnapshot(snapID string) error GetSnapshotByID(snapshotID string) (*snapshots.Snapshot, error) WaitSnapshotReady(snapshotID string) error ExpandVolume(volumeID string, status string, size int) error GetMaxVolLimit() int64 GetBlockStorageOpts() BlockStorageOpts GetAvailabilityZone() (string, error) GetInitializeConnection(volumeID string) (map[string]interface{}, error) }
var OsInstance IOpenStack = nil
func CreateOpenStackProvider ¶
func CreateOpenStackProvider() (IOpenStack, error)
CreateOpenStackProvider creates Openstack Instance
func GetOpenStackProvider ¶
func GetOpenStackProvider() (IOpenStack, error)
GetOpenStackProvider returns Openstack Instance
type OpenStack ¶
type OpenStack struct {
// contains filtered or unexported fields
}
func (*OpenStack) AttachVolume ¶
func (*OpenStack) CheckBlockStorageAPI ¶
func (*OpenStack) CreateSnapshot ¶
func (os *OpenStack) CreateSnapshot(name, volID string, tags *map[string]string) (*snapshots.Snapshot, error)
CreateSnapshot issues a request to take a Snapshot of the specified Volume with the corresponding ID and returns the resultant gophercloud Snapshot Item upon success
func (*OpenStack) CreateVolume ¶
func (os *OpenStack) CreateVolume(name string, size int, vtype, availability string, snapshotID string, sourcevolID string, tags *map[string]string) (*volumes.Volume, error)
CreateVolume creates a volume of given size
func (*OpenStack) DeleteSnapshot ¶
DeleteSnapshot issues a request to delete the Snapshot with the specified ID from the Cinder backend
func (*OpenStack) DeleteVolume ¶
DeleteVolume delete a volume
func (*OpenStack) DetachVolume ¶
func (*OpenStack) ExpandVolume ¶
ExpandVolume expands the volume to new size
func (*OpenStack) GetAttachmentDiskPath ¶
GetAttachmentDiskPath gets device path of attached volume to the compute
func (*OpenStack) GetAvailabilityZone ¶
func (*OpenStack) GetBlockStorageOpts ¶
func (os *OpenStack) GetBlockStorageOpts() BlockStorageOpts
GetBlockStorageOpts returns OpenStack block storage options
func (*OpenStack) GetInitializeConnection ¶
func (*OpenStack) GetMaxVolLimit ¶
GetMaxVolLimit returns max vol limit
func (*OpenStack) GetSnapshotByID ¶
GetSnapshotByID returns snapshot details by id
func (*OpenStack) GetVolumesByName ¶
GetVolumesByName is a wrapper around ListVolumes that creates a Name filter to act as a GetByName Returns a list of Volume references with the specified name
func (*OpenStack) ListSnapshots ¶
ListSnapshots retrieves a list of active snapshots from Cinder for the corresponding Tenant. We also provide the ability to provide limit and offset to enable the consumer to provide accurate pagination. In addition the filters argument provides a mechanism for passing in valid filter strings to the list operation. Valid filter keys are: Name, Status, VolumeID, Limit, Marker (TenantID has no effect)
func (*OpenStack) ListVolumes ¶
ListVolumes list all the volumes
func (*OpenStack) WaitSnapshotReady ¶
WaitSnapshotReady waits till snapshot is ready