Documentation
¶
Index ¶
- Constants
- func Init(params map[string]string) (volume.VolumeDriver, error)
- func NewStorageError(code int, msg string, instance string) error
- type Driver
- func (d *Driver) Attach(volumeID string, attachOptions map[string]string) (string, error)
- func (d *Driver) Create(locator *api.VolumeLocator, source *api.Source, spec *api.VolumeSpec) (string, error)
- func (d *Driver) Delete(volumeID string) error
- func (d *Driver) Detach(volumeID string, unmountBeforeDetach bool) error
- func (d *Driver) Format(volumeID string) error
- func (d *Driver) Inspect(volumeIDs []string) ([]*api.Volume, error)
- func (d *Driver) Mount(volumeID string, mountpath string) error
- func (d *Driver) MountedAt(mountpath string) string
- func (d *Driver) Name() string
- func (d *Driver) Restore(volumeID string, snapID string) error
- func (d *Driver) Set(volumeID string, locator *api.VolumeLocator, spec *api.VolumeSpec) error
- func (d *Driver) Shutdown()
- func (d *Driver) Snapshot(volumeID string, readonly bool, locator *api.VolumeLocator) (string, error)
- func (d *Driver) Status() [][2]string
- func (d *Driver) Type() api.DriverType
- func (d *Driver) Unmount(volumeID string, mountpath string) error
- type Metadata
- type StorageError
- type StorageOps
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 ¶
Types ¶
type Driver ¶
type Driver struct {
volume.StatsDriver
volume.StoreEnumerator
volume.IODriver
// contains filtered or unexported fields
}
Driver implements VolumeDriver interface
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) Set ¶
func (d *Driver) Set(volumeID string, locator *api.VolumeLocator, spec *api.VolumeSpec) 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
Click to show internal directories.
Click to hide internal directories.