volumeservice

package
v0.0.0-...-fd19465 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCinderVolume

func CreateCinderVolume(vs *gophercloud.ServiceClient, options volumes_v2.CreateOpts) (string, error)

CreateCinderVolume creates a new volume in cinder according to the PVC specifications

func DeleteCinderVolume

func DeleteCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error

DeleteCinderVolume removes a volume from cinder which will cause it to be deleted on the storage server.

func DisconnectCinderVolume

func DisconnectCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error

DisconnectCinderVolume removes a connection to a cinder volume. Depending on the volume type, this may cause cinder to clean up the connection at a storage server (i.e. remove a LUN mapping).

func GetCinderVolumeStatus

func GetCinderVolumeStatus(vs *gophercloud.ServiceClient, volumeID string) (string, error)

GetCinderVolumeStatus get the given cinder volume status.

func GetVolumeService

func GetVolumeService(configFilePath string) (*gophercloud.ServiceClient, error)

GetVolumeService returns a connected cinder client based on configuration specified in configFilePath or the environment.

func ReserveCinderVolume

func ReserveCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error

ReserveCinderVolume marks the volume as 'Attaching' in cinder. This prevents the volume from being used for another purpose.

func UnreserveCinderVolume

func UnreserveCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error

UnreserveCinderVolume marks a cinder volume in 'Attaching' state as 'Available'.

func WaitForAvailableCinderVolume

func WaitForAvailableCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error

WaitForAvailableCinderVolume waits for a newly created cinder volume to become available. The connection information cannot be retrieved from cinder until the volume is available.

Types

type VolumeConnection

type VolumeConnection struct {
	DriverVolumeType string                  `json:"driver_volume_type"`
	Data             VolumeConnectionDetails `json:"data"`
}

VolumeConnection represents the connection information returned from the cinder os-initialize_connection API call

func ConnectCinderVolume

func ConnectCinderVolume(vs *gophercloud.ServiceClient, volumeID string) (VolumeConnection, error)

ConnectCinderVolume retrieves connection information for a cinder volume. Depending on the type of volume, cinder may perform setup on a storage server such as mapping a LUN to a particular ISCSI initiator.

type VolumeConnectionDetails

type VolumeConnectionDetails struct {
	VolumeID string `json:"volume_id"`
	Name     string `json:"name"`

	AuthMethod   string `json:"auth_method"`
	AuthUsername string `json:"auth_username"`
	AuthPassword string `json:"auth_password"`
	SecretType   string `json:"secret_type"`

	TargetPortal string `json:"target_portal"`
	TargetIqn    string `json:"target_iqn"`
	TargetLun    int32  `json:"target_lun"`

	ClusterName string   `json:"cluster_name"`
	Hosts       []string `json:"hosts"`
	Ports       []string `json:"ports"`
}

VolumeConnectionDetails represent the type-specific values for a given DriverVolumeType. Depending on the volume type, fields may be absent or have a semantically different meaning.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL