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

aws

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2017 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name of the driver
	Name = "aws"
	// Type of the driver
	Type = api.DriverType_DRIVER_TYPE_BLOCK
	// AwsDBKey for openstorage
	AwsDBKey = "OpenStorageAWSKey"
)
View Source
const (
	ErrVolDetached
	ErrVolInval
	ErrVolAttachedOnRemoteNode
)

Custom AWS volume error codes.

View Source
const (
	SetIdentifierNone = "None"
)

Variables

This section is empty.

Functions

func Init

func Init(params map[string]string) (volume.VolumeDriver, error)

Init aws volume driver metadata.

func NewStorageError

func NewStorageError(code int, msg string, instance string) error

Types

type Driver

type Driver struct {
	volume.StatsDriver
	volume.StoreEnumerator
	volume.IODriver
	// contains filtered or unexported fields
}

Driver implements VolumeDriver interface

func (*Driver) Attach

func (d *Driver) Attach(
	volumeID string,
	attachOptions map[string]string,
) (string, error)

func (*Driver) Create

func (d *Driver) Create(
	locator *api.VolumeLocator,
	source *api.Source,
	spec *api.VolumeSpec,
) (string, error)

Create creates a new volume

func (*Driver) Delete

func (d *Driver) Delete(volumeID string) error

func (*Driver) Detach

func (d *Driver) Detach(volumeID string, unmountBeforeDetach bool) error

func (*Driver) Format

func (d *Driver) Format(volumeID string) error

func (*Driver) Inspect

func (d *Driver) Inspect(volumeIDs []string) ([]*api.Volume, error)

Inspect insepcts a volume

func (*Driver) Mount

func (d *Driver) Mount(volumeID string, mountpath string) error

func (*Driver) MountedAt

func (d *Driver) MountedAt(mountpath string) string

func (*Driver) Name

func (d *Driver) Name() string

Name returns the name of the driver

func (*Driver) Restore

func (d *Driver) Restore(volumeID string, snapID string) error

func (*Driver) Set

func (d *Driver) Set(volumeID string, locator *api.VolumeLocator, spec *api.VolumeSpec) error

func (*Driver) Shutdown

func (d *Driver) Shutdown()

func (*Driver) Snapshot

func (d *Driver) Snapshot(
	volumeID string,
	readonly bool,
	locator *api.VolumeLocator,
) (string, error)

func (*Driver) Status

func (d *Driver) Status() [][2]string

Status returns the current status

func (*Driver) Type

func (d *Driver) Type() api.DriverType

Type returns the type of the driver

func (*Driver) Unmount

func (d *Driver) Unmount(volumeID string, mountpath string) error

type Metadata

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

Metadata for the driver

type StorageError

type StorageError struct {
	// Code is one of AWS volume error codes.
	Code int
	// Msg is human understandable error message.
	Msg string
	// Instance provides more information on the error.
	Instance string
}

StorageError error returned for AWS volumes

func (*StorageError) Error

func (e *StorageError) Error() string

type StorageOps

type StorageOps interface {
	// Create volume based on input template volume.
	// Apply labels as tags on EBS volumes
	Create(template *ec2.Volume, labels map[string]string) (*ec2.Volume, error)
	// Attach volumeID.
	// Return attach path.
	Attach(volumeID string) (string, error)
	// Detach volumeID.
	Detach(volumeID string) error
	// Delete volumeID.
	Delete(volumeID string) error
	// Inspect volumes specified by volumeID
	Inspect(volumeIds []*string) ([]*ec2.Volume, error)
	// DeviceMappings returns map[local_volume_path]->aws volume ID
	DeviceMappings() (map[string]string, error)
	// Enumerate EBS volumes that match given filters.  Organize them into
	// sets identified by setIdentifier.
	// labels can be nil, setIdentifier can be empty string.
	Enumerate(volumeIds []*string,
		labels map[string]string,
		setIdentifier string,
	) (map[string][]*ec2.Volume, error)
	// DevicePath for attached EBS volume.
	DevicePath(volume *ec2.Volume) (string, error)
	// Snapshot EBS volume
	Snapshot(volumeID string, readonly bool) (*ec2.Snapshot, error)
	// ApplyTags
	ApplyTags(v *ec2.Volume, labels map[string]string) error
	// Tags
	Tags(v *ec2.Volume) map[string]string
}

StorageOps interface to perform basic operations on aws.

func NewEc2Storage

func NewEc2Storage(instance string, ec2 *ec2.EC2) StorageOps

Jump to

Keyboard shortcuts

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