Documentation ¶
Index ¶
- Constants
- func GetConfigFromEnv() (gophercloud.AuthOptions, gophercloud.EndpointOpts, error)
- func GetConfigFromFile(configFilePath string) (gophercloud.AuthOptions, gophercloud.EndpointOpts, error)
- func InitOpenStackProvider(cfg string)
- type Config
- type IOpenStack
- type OpenStack
- func (os *OpenStack) AttachVolume(instanceID, volumeID string) (string, error)
- func (os *OpenStack) CreateVolume(name string, size int, vtype, availability string, tags *map[string]string) (string, string, error)
- func (os *OpenStack) DeleteVolume(volumeID string) error
- func (os *OpenStack) DetachVolume(instanceID, volumeID string) error
- func (os *OpenStack) GetAttachmentDiskPath(instanceID, volumeID string) (string, error)
- func (os *OpenStack) GetVolume(volumeID string) (Volume, error)
- func (os *OpenStack) WaitDiskAttached(instanceID string, volumeID string) error
- func (os *OpenStack) WaitDiskDetached(instanceID string, volumeID string) error
- type OpenStackMock
- func (_m *OpenStackMock) AttachVolume(instanceID string, volumeID string) (string, error)
- func (_m *OpenStackMock) CreateVolume(name string, size int, vtype string, availability string, ...) (string, string, error)
- func (_m *OpenStackMock) DeleteVolume(volumeID string) error
- func (_m *OpenStackMock) DetachVolume(instanceID string, volumeID string) error
- func (_m *OpenStackMock) GetAttachmentDiskPath(instanceID string, volumeID string) (string, error)
- func (_m *OpenStackMock) WaitDiskAttached(instanceID string, volumeID string) error
- func (_m *OpenStackMock) WaitDiskDetached(instanceID string, volumeID string) error
- type Volume
Constants ¶
const ( VolumeAvailableStatus = "available" VolumeInUseStatus = "in-use" VolumeDeletedStatus = "deleted" VolumeErrorStatus = "error" )
Variables ¶
This section is empty.
Functions ¶
func GetConfigFromEnv ¶
func GetConfigFromEnv() (gophercloud.AuthOptions, gophercloud.EndpointOpts, error)
func GetConfigFromFile ¶
func GetConfigFromFile(configFilePath string) (gophercloud.AuthOptions, gophercloud.EndpointOpts, error)
func InitOpenStackProvider ¶
func InitOpenStackProvider(cfg string)
Types ¶
type IOpenStack ¶
type IOpenStack interface { CreateVolume(name string, size int, vtype, availability string, tags *map[string]string) (string, string, error) DeleteVolume(volumeID string) error AttachVolume(instanceID, volumeID string) (string, error) WaitDiskAttached(instanceID string, volumeID string) error DetachVolume(instanceID, volumeID string) error WaitDiskDetached(instanceID string, volumeID string) error GetAttachmentDiskPath(instanceID, volumeID string) (string, error) }
var OsInstance IOpenStack = nil
func GetOpenStackProvider ¶
func GetOpenStackProvider() (IOpenStack, error)
type OpenStack ¶
type OpenStack struct {
// contains filtered or unexported fields
}
func (*OpenStack) AttachVolume ¶
AttachVolume attaches given cinder volume to the compute
func (*OpenStack) CreateVolume ¶
func (os *OpenStack) CreateVolume(name string, size int, vtype, availability string, tags *map[string]string) (string, string, error)
CreateVolume creates a volume of given size
func (*OpenStack) DeleteVolume ¶
DeleteVolume delete a volume
func (*OpenStack) DetachVolume ¶
DetachVolume detaches given cinder volume from the compute
func (*OpenStack) GetAttachmentDiskPath ¶
GetAttachmentDiskPath gets device path of attached volume to the compute
func (*OpenStack) WaitDiskAttached ¶
WaitDiskAttached waits for attched
type OpenStackMock ¶
OpenStackMock is an autogenerated mock type for the IOpenStack type ORIGINALLY GENERATED BY mockery with hand edits
func (*OpenStackMock) AttachVolume ¶
func (_m *OpenStackMock) AttachVolume(instanceID string, volumeID string) (string, error)
AttachVolume provides a mock function with given fields: instanceID, volumeID
func (*OpenStackMock) CreateVolume ¶
func (_m *OpenStackMock) CreateVolume(name string, size int, vtype string, availability string, tags *map[string]string) (string, string, error)
CreateVolume provides a mock function with given fields: name, size, vtype, availability, tags
func (*OpenStackMock) DeleteVolume ¶
func (_m *OpenStackMock) DeleteVolume(volumeID string) error
DeleteVolume provides a mock function with given fields: volumeID
func (*OpenStackMock) DetachVolume ¶
func (_m *OpenStackMock) DetachVolume(instanceID string, volumeID string) error
DetachVolume provides a mock function with given fields: instanceID, volumeID
func (*OpenStackMock) GetAttachmentDiskPath ¶
func (_m *OpenStackMock) GetAttachmentDiskPath(instanceID string, volumeID string) (string, error)
GetAttachmentDiskPath provides a mock function with given fields: instanceID, volumeID
func (*OpenStackMock) WaitDiskAttached ¶
func (_m *OpenStackMock) WaitDiskAttached(instanceID string, volumeID string) error
WaitDiskAttached provides a mock function with given fields: instanceID, volumeID
func (*OpenStackMock) WaitDiskDetached ¶
func (_m *OpenStackMock) WaitDiskDetached(instanceID string, volumeID string) error
WaitDiskDetached provides a mock function with given fields: instanceID, volumeID
type Volume ¶
type Volume struct { // ID of the instance, to which this volume is attached. "" if not attached AttachedServerId string // Device file path AttachedDevice string // Unique identifier for the volume. ID string // Human-readable display name for the volume. Name string // Current status of the volume. Status string // Volume size in GB Size int }