storage

package
v0.0.0-...-6cf1bc9 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2016 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

The storage command provides a storage management interface, for manipulating and inspecting storage entities (volumes, filesystems, charm storage).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAddCommand

func NewAddCommand() cmd.Command

NewAddCommand returns a command used to add unit storage.

func NewListCommand

func NewListCommand() cmd.Command

NewListCommand returns a command for listing storage instances.

func NewPoolCreateCommand

func NewPoolCreateCommand() cmd.Command

NewPoolCreateCommand returns a command that creates or defines a storage pool

func NewPoolListCommand

func NewPoolListCommand() cmd.Command

NewPoolListCommand returns a command that lists storage pools on a model

func NewShowCommand

func NewShowCommand() cmd.Command

NewShowCommand returns a command that shows storage details on the specified machine

Types

type EntityStatus

type EntityStatus struct {
	Current status.Status `json:"current,omitempty" yaml:"current,omitempty"`
	Message string        `json:"message,omitempty" yaml:"message,omitempty"`
	Since   string        `json:"since,omitempty" yaml:"since,omitempty"`
}

type FilesystemAttachments

type FilesystemAttachments struct {
	Machines map[string]MachineFilesystemAttachment `yaml:"machines,omitempty" json:"machines,omitempty"`
	Units    map[string]UnitStorageAttachment       `yaml:"units,omitempty" json:"units,omitempty"`
}

type FilesystemCommandBase

type FilesystemCommandBase struct {
	StorageCommandBase
}

FilesystemCommandBase is a helper base structure for filesystem commands.

type FilesystemInfo

type FilesystemInfo struct {
	// from params.Filesystem. This is provider-supplied unique filesystem id.
	ProviderFilesystemId string `yaml:"provider-id,omitempty" json:"provider-id,omitempty"`

	// Volume is the ID of the volume that the filesystem is backed by, if any.
	Volume string

	// Storage is the ID of the storage instance that the filesystem is
	// assigned to, if any.
	Storage string

	// Attachments is the set of entities attached to the filesystem.
	Attachments *FilesystemAttachments

	// from params.FilesystemInfo
	Size uint64 `yaml:"size" json:"size"`

	// from params.FilesystemInfo.
	Status EntityStatus `yaml:"status,omitempty" json:"status,omitempty"`
}

FilesystemInfo defines the serialization behaviour for storage filesystem.

type MachineFilesystemAttachment

type MachineFilesystemAttachment struct {
	MountPoint string `yaml:"mount-point" json:"mount-point"`
	ReadOnly   bool   `yaml:"read-only" json:"read-only"`
}

type MachineVolumeAttachment

type MachineVolumeAttachment struct {
	DeviceName string `yaml:"device,omitempty" json:"device,omitempty"`
	DeviceLink string `yaml:"device-link,omitempty" json:"device-link,omitempty"`
	BusAddress string `yaml:"bus-address,omitempty" json:"bus-address,omitempty"`
	ReadOnly   bool   `yaml:"read-only" json:"read-only"`
}

type PoolCommandBase

type PoolCommandBase struct {
	StorageCommandBase
}

PoolCommandBase is a helper base structure for pool commands.

type PoolCreateAPI

type PoolCreateAPI interface {
	Close() error
	CreatePool(pname, ptype string, pconfig map[string]interface{}) error
}

PoolCreateAPI defines the API methods that pool create command uses.

type PoolInfo

type PoolInfo struct {
	Provider string                 `yaml:"provider" json:"provider"`
	Attrs    map[string]interface{} `yaml:"attrs,omitempty" json:"attrs,omitempty"`
}

PoolInfo defines the serialization behaviour of the storage pool information.

type PoolListAPI

type PoolListAPI interface {
	Close() error
	ListPools(providers, names []string) ([]params.StoragePool, error)
}

PoolListAPI defines the API methods that the storage commands use.

type StorageAddAPI

type StorageAddAPI interface {
	Close() error
	AddToUnit(storages []params.StorageAddParams) ([]params.ErrorResult, error)
}

StorageAddAPI defines the API methods that the storage commands use.

type StorageAttachments

type StorageAttachments struct {
	// Units is a mapping from unit ID to unit storage attachment details.
	Units map[string]UnitStorageAttachment `yaml:"units" json:"units"`
}

StorageAttachments contains details about all attachments to a storage instance.

type StorageCommandBase

type StorageCommandBase struct {
	modelcmd.ModelCommandBase
}

StorageCommandBase is a helper base structure that has a method to get the storage managing client.

func (*StorageCommandBase) NewStorageAPI

func (c *StorageCommandBase) NewStorageAPI() (*storage.Client, error)

NewStorageAPI returns a storage api for the root api endpoint that the environment command returns.

type StorageInfo

type StorageInfo struct {
	Kind        string              `yaml:"kind" json:"kind"`
	Status      EntityStatus        `yaml:"status" json:"status"`
	Persistent  bool                `yaml:"persistent" json:"persistent"`
	Attachments *StorageAttachments `yaml:"attachments" json:"attachments"`
}

StorageInfo defines the serialization behaviour of the storage information.

type StorageListAPI

type StorageListAPI interface {
	Close() error
	ListStorageDetails() ([]params.StorageDetails, error)
	ListFilesystems(machines []string) ([]params.FilesystemDetailsListResult, error)
	ListVolumes(machines []string) ([]params.VolumeDetailsListResult, error)
}

StorageAPI defines the API methods that the storage commands use.

type StorageShowAPI

type StorageShowAPI interface {
	Close() error
	StorageDetails(tags []names.StorageTag) ([]params.StorageDetailsResult, error)
}

StorageAPI defines the API methods that the storage commands use.

type UnitStorageAttachment

type UnitStorageAttachment struct {
	// MachineId is the ID of the machine that the unit is assigned to.
	//
	// This is omitempty to cater for legacy results, where the machine
	// information is not available.
	MachineId string `yaml:"machine,omitempty" json:"machine,omitempty"`

	// Location is the location of the storage attachment.
	Location string `yaml:"location,omitempty" json:"location,omitempty"`
}

UnitStorageAttachment contains details of a unit storage attachment.

type VolumeAttachments

type VolumeAttachments struct {
	Machines map[string]MachineVolumeAttachment `yaml:"machines,omitempty" json:"machines,omitempty"`
	Units    map[string]UnitStorageAttachment   `yaml:"units,omitempty" json:"units,omitempty"`
}

type VolumeInfo

type VolumeInfo struct {
	// from params.Volume. This is provider-supplied unique volume id.
	ProviderVolumeId string `yaml:"provider-id,omitempty" json:"provider-id,omitempty"`

	// Storage is the ID of the storage instance that the volume is
	// assigned to, if any.
	Storage string `yaml:"storage,omitempty" json:"storage,omitempty"`

	// Attachments is the set of entities attached to the volume.
	Attachments *VolumeAttachments `yaml:"attachments,omitempty" json:"attachments,omitempty"`

	// from params.Volume
	HardwareId string `yaml:"hardware-id,omitempty" json:"hardware-id,omitempty"`

	// from params.Volume
	Size uint64 `yaml:"size" json:"size"`

	// from params.Volume
	Persistent bool `yaml:"persistent" json:"persistent"`

	// from params.Volume
	Status EntityStatus `yaml:"status,omitempty" json:"status,omitempty"`
}

VolumeInfo defines the serialization behaviour for storage volume.

Jump to

Keyboard shortcuts

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