Help us shape the future of Go! Take the 2026 Go Developer Survey

volumeactions

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 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 {
	gophercloud.ErrResult
}

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

func Attach

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

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 {
	gophercloud.ErrResult
}

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.

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 {
	gophercloud.ErrResult
}

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.

type TerminateConnectionResult

type TerminateConnectionResult struct {
	gophercloud.ErrResult
}

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.

type UnreserveResult

type UnreserveResult struct {
	gophercloud.ErrResult
}

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.

Jump to

Keyboard shortcuts

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