volume

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CNSVolumeResourceInUseFaultMessage = "The resource 'volume' is in use."
)

version and namespace constants for task client

Variables

This section is empty.

Functions

func ClearTaskInfoObjects added in v1.0.3

func ClearTaskInfoObjects()

ClearTaskInfoObjects is a go routine which runs in the background to clean up expired taskInfo objects from volumeTaskMap

func GetDiskAttachedToVM

func GetDiskAttachedToVM(ctx context.Context, vm *cnsvsphere.VirtualMachine, volumeID string) (string, error)

GetDiskAttachedToVM checks if the volume is attached to the VM. If the volume is attached to the VM, return disk uuid of the volume, else return empty string

Types

type Manager

type Manager interface {
	// CreateVolume creates a new volume given its spec.
	CreateVolume(spec *cnstypes.CnsVolumeCreateSpec) (*cnstypes.CnsVolumeId, error)
	// AttachVolume attaches a volume to a virtual machine given the spec.
	AttachVolume(vm *cnsvsphere.VirtualMachine, volumeID string) (string, error)
	// DetachVolume detaches a volume from the virtual machine given the spec.
	DetachVolume(vm *cnsvsphere.VirtualMachine, volumeID string) error
	// DeleteVolume deletes a volume given its spec.
	DeleteVolume(volumeID string, deleteDisk bool) error
	// UpdateVolumeMetadata updates a volume metadata given its spec.
	UpdateVolumeMetadata(spec *cnstypes.CnsVolumeMetadataUpdateSpec) error
	// QueryVolume returns volumes matching the given filter.
	QueryVolume(queryFilter cnstypes.CnsQueryFilter) (*cnstypes.CnsQueryResult, error)
	// QueryAllVolume returns all volumes matching the given filter and selection.
	QueryAllVolume(queryFilter cnstypes.CnsQueryFilter, querySelection cnstypes.CnsQuerySelection) (*cnstypes.CnsQueryResult, error)
}

Manager provides functionality to manage volumes.

func GetManager

func GetManager(vc *cnsvsphere.VirtualCenter) Manager

GetManager returns the Manager singleton.

Jump to

Keyboard shortcuts

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