Documentation ¶
Overview ¶
The storage command provides a storage management interface, for manipulating and inspecting storage entities (volumes, filesystems, charm storage).
Index ¶
- Constants
- func NewFilesystemSuperCommand() cmd.Command
- func NewPoolSuperCommand() cmd.Command
- func NewSuperCommand() cmd.Command
- func NewVolumeSuperCommand() cmd.Command
- type AddCommand
- type EntityStatus
- type FilesystemAttachments
- type FilesystemCommandBase
- type FilesystemInfo
- type FilesystemListAPI
- type FilesystemListCommand
- type ListCommand
- type MachineFilesystemAttachment
- type MachineVolumeAttachment
- type PoolCommandBase
- type PoolCreateAPI
- type PoolCreateCommand
- type PoolInfo
- type PoolListAPI
- type PoolListCommand
- type ShowCommand
- type StorageAddAPI
- type StorageAttachments
- type StorageCommandBase
- type StorageInfo
- type StorageListAPI
- type StorageShowAPI
- type UnitStorageAttachment
- type VolumeAttachments
- type VolumeCommandBase
- type VolumeInfo
- type VolumeListAPI
- type VolumeListCommand
Constants ¶
const FilesystemListCommandDoc = `` /* 205-byte string literal not displayed */
const ListCommandDoc = `` /* 224-byte string literal not displayed */
const PoolCreateCommandDoc = `` /* 1103-byte string literal not displayed */
const PoolListCommandDoc = `` /* 725-byte string literal not displayed */
const ShowCommandDoc = `` /* 347-byte string literal not displayed */
const VolumeListCommandDoc = `` /* 209-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func NewFilesystemSuperCommand ¶
NewFilesystemSuperCommand creates the storage filesystem super subcommand and registers the subcommands that it supports.
func NewPoolSuperCommand ¶
NewPoolSuperCommand creates the storage pool super subcommand and registers the subcommands that it supports.
func NewSuperCommand ¶
NewSuperCommand creates the storage supercommand and registers the subcommands that it supports.
func NewVolumeSuperCommand ¶
NewVolumeSuperCommand creates the storage volume super subcommand and registers the subcommands that it supports.
Types ¶
type AddCommand ¶
type AddCommand struct { StorageCommandBase // contains filtered or unexported fields }
AddCommand adds unit storage instances dynamically.
func (*AddCommand) Init ¶
func (c *AddCommand) Init(args []string) (err error)
Init implements Command.Init.
type EntityStatus ¶
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 FilesystemListAPI ¶
type FilesystemListAPI interface { Close() error ListFilesystems(machines []string) ([]params.FilesystemDetailsResult, error) }
FilesystemListAPI defines the API methods that the filesystem list command use.
type FilesystemListCommand ¶
type FilesystemListCommand struct { FilesystemCommandBase Ids []string // contains filtered or unexported fields }
FilesystemListCommand lists storage filesystems.
func (*FilesystemListCommand) Info ¶
func (c *FilesystemListCommand) Info() *cmd.Info
Info implements Command.Info.
func (*FilesystemListCommand) Init ¶
func (c *FilesystemListCommand) Init(args []string) (err error)
Init implements Command.Init.
func (*FilesystemListCommand) Run ¶
func (c *FilesystemListCommand) Run(ctx *cmd.Context) (err error)
Run implements Command.Run.
func (*FilesystemListCommand) SetFlags ¶
func (c *FilesystemListCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags implements Command.SetFlags.
type ListCommand ¶
type ListCommand struct { StorageCommandBase // contains filtered or unexported fields }
ListCommand returns storage instances.
func (*ListCommand) Init ¶
func (c *ListCommand) Init(args []string) (err error)
Init implements Command.Init.
func (*ListCommand) Run ¶
func (c *ListCommand) Run(ctx *cmd.Context) (err error)
Run implements Command.Run.
func (*ListCommand) SetFlags ¶
func (c *ListCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags implements Command.SetFlags.
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 PoolCreateCommand ¶
type PoolCreateCommand struct { PoolCommandBase // contains filtered or unexported fields }
PoolCreateCommand lists storage pools.
func (*PoolCreateCommand) Info ¶
func (c *PoolCreateCommand) Info() *cmd.Info
Info implements Command.Info.
func (*PoolCreateCommand) Init ¶
func (c *PoolCreateCommand) Init(args []string) (err error)
Init implements Command.Init.
func (*PoolCreateCommand) Run ¶
func (c *PoolCreateCommand) Run(ctx *cmd.Context) (err error)
Run implements Command.Run.
func (*PoolCreateCommand) SetFlags ¶
func (c *PoolCreateCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags implements Command.SetFlags.
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 PoolListCommand ¶
type PoolListCommand struct { PoolCommandBase Providers []string Names []string // contains filtered or unexported fields }
PoolListCommand lists storage pools.
func (*PoolListCommand) Info ¶
func (c *PoolListCommand) Info() *cmd.Info
Info implements Command.Info.
func (*PoolListCommand) Init ¶
func (c *PoolListCommand) Init(args []string) (err error)
Init implements Command.Init.
func (*PoolListCommand) Run ¶
func (c *PoolListCommand) Run(ctx *cmd.Context) (err error)
Run implements Command.Run.
func (*PoolListCommand) SetFlags ¶
func (c *PoolListCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags implements Command.SetFlags.
type ShowCommand ¶
type ShowCommand struct { StorageCommandBase // contains filtered or unexported fields }
ShowCommand attempts to release storage instance.
func (*ShowCommand) Init ¶
func (c *ShowCommand) Init(args []string) (err error)
Init implements Command.Init.
func (*ShowCommand) Run ¶
func (c *ShowCommand) Run(ctx *cmd.Context) (err error)
Run implements Command.Run.
func (*ShowCommand) SetFlags ¶
func (c *ShowCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags implements Command.SetFlags.
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 {
envcmd.EnvCommandBase
}
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 List() ([]params.StorageDetailsResult, error) }
StorageAPI defines the API methods that the storage commands use.
type StorageShowAPI ¶
type StorageShowAPI interface { Close() error Show(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 VolumeCommandBase ¶
type VolumeCommandBase struct {
StorageCommandBase
}
VolumeCommandBase is a helper base structure for volume commands.
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.
type VolumeListAPI ¶
type VolumeListAPI interface { Close() error ListVolumes(machines []string) ([]params.VolumeDetailsResult, error) }
VolumeListAPI defines the API methods that the volume list command use.
type VolumeListCommand ¶
type VolumeListCommand struct { VolumeCommandBase Ids []string // contains filtered or unexported fields }
VolumeListCommand lists storage volumes.
func (*VolumeListCommand) Info ¶
func (c *VolumeListCommand) Info() *cmd.Info
Info implements Command.Info.
func (*VolumeListCommand) Init ¶
func (c *VolumeListCommand) Init(args []string) (err error)
Init implements Command.Init.
func (*VolumeListCommand) Run ¶
func (c *VolumeListCommand) Run(ctx *cmd.Context) (err error)
Run implements Command.Run.
func (*VolumeListCommand) SetFlags ¶
func (c *VolumeListCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags implements Command.SetFlags.