volumeactions

package
v1.0.1-0...-99c3580 Latest Latest
Warning

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

Go to latest
Published: May 12, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package volumeactions provides information and interaction with volumes in the OpenStack Block Storage service. A volume is a detachable block storage device, akin to a USB hard drive. It can only be attached to one instance at a time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockAttachResponse

func MockAttachResponse(t *testing.T)

func MockDetachResponse

func MockDetachResponse(t *testing.T)

func MockInitializeConnectionResponse

func MockInitializeConnectionResponse(t *testing.T)

func MockReserveResponse

func MockReserveResponse(t *testing.T)

func MockTerminateConnectionResponse

func MockTerminateConnectionResponse(t *testing.T)

func MockUnreserveResponse

func MockUnreserveResponse(t *testing.T)

Types

type AttachMode

type AttachMode string

AttachMode describes the attachment mode for volumes.

const (
	ReadOnly  AttachMode = "ro"
	ReadWrite AttachMode = "rw"
)

These constants determine how a volume is attached

type AttachOpts

type AttachOpts struct {
	// The mountpoint of this volume
	MountPoint string
	// The nova instance ID, can't set simultaneously with HostName
	InstanceUUID string
	// The hostname of baremetal host, can't set simultaneously with InstanceUUID
	HostName string
	// Mount mode of this volume
	Mode AttachMode
}

AttachOpts contains options for attaching a Volume.

func (AttachOpts) ToVolumeAttachMap

func (opts AttachOpts) ToVolumeAttachMap() (map[string]interface{}, error)

ToVolumeAttachMap assembles a request body based on the contents of a AttachOpts.

type AttachOptsBuilder

type AttachOptsBuilder interface {
	ToVolumeAttachMap() (map[string]interface{}, error)
}

AttachOptsBuilder allows extensions to add additional parameters to the Attach request.

type AttachResult

type AttachResult struct {
	// contains filtered or unexported fields
}

AttachResult contains the response body and error from a Get request.

func Attach

Attach will attach a volume based on the values in AttachOpts.

func (AttachResult) Extract

func (r AttachResult) Extract() (map[string]interface{}, error)

Extract will get the Volume object out of the commonResult object.

type ConnectorOpts

type ConnectorOpts struct {
	IP        string
	Host      string
	Initiator string
	Wwpns     []string
	Wwnns     string
	Multipath bool
	Platform  string
	OSType    string
}

ConnectorOpts hosts options for InitializeConnection.

func (ConnectorOpts) ToConnectorMap

func (opts ConnectorOpts) ToConnectorMap() (map[string]interface{}, error)

ToConnectorMap assembles a request body based on the contents of a ConnectorOpts.

type ConnectorOptsBuilder

type ConnectorOptsBuilder interface {
	ToConnectorMap() (map[string]interface{}, error)
}

ConnectorOptsBuilder allows extensions to add additional parameters to the InitializeConnection request.

type DetachResult

type DetachResult struct {
	// contains filtered or unexported fields
}

DetachResult contains the response body and error from a Get request.

func Detach

func Detach(client *gophercloud.ServiceClient, id string) DetachResult

Attach will detach a volume based on volume id.

func (DetachResult) Extract

func (r DetachResult) Extract() (map[string]interface{}, error)

Extract will get the Volume object out of the commonResult object.

type InitializeConnectionResult

type InitializeConnectionResult struct {
	// contains filtered or unexported fields
}

InitializeConnectionResult contains the response body and error from a Get request.

func InitializeConnection

func InitializeConnection(client *gophercloud.ServiceClient, id string, opts *ConnectorOpts) InitializeConnectionResult

InitializeConnection initializes iscsi connection.

func (InitializeConnectionResult) Extract

func (r InitializeConnectionResult) Extract() (map[string]interface{}, error)

Extract will get the Volume object out of the commonResult object.

type ReserveResult

type ReserveResult struct {
	// contains filtered or unexported fields
}

ReserveResult contains the response body and error from a Get request.

func Reserve

func Reserve(client *gophercloud.ServiceClient, id string) ReserveResult

Reserve will reserve a volume based on volume id.

func (ReserveResult) Extract

func (r ReserveResult) Extract() (map[string]interface{}, error)

Extract will get the Volume object out of the commonResult object.

type TerminateConnectionResult

type TerminateConnectionResult struct {
	// contains filtered or unexported fields
}

TerminateConnectionResult contains the response body and error from a Get request.

func TerminateConnection

func TerminateConnection(client *gophercloud.ServiceClient, id string, opts *ConnectorOpts) TerminateConnectionResult

TerminateConnection terminates iscsi connection.

func (TerminateConnectionResult) Extract

func (r TerminateConnectionResult) Extract() (map[string]interface{}, error)

Extract will get the Volume object out of the commonResult object.

type UnreserveResult

type UnreserveResult struct {
	// contains filtered or unexported fields
}

UnreserveResult contains the response body and error from a Get request.

func Unreserve

func Unreserve(client *gophercloud.ServiceClient, id string) UnreserveResult

Unreserve will unreserve a volume based on volume id.

func (UnreserveResult) Extract

func (r UnreserveResult) Extract() (map[string]interface{}, error)

Extract will get the Volume object out of the commonResult object.

Jump to

Keyboard shortcuts

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