juju: github.com/juju/juju/cmd/juju/storage Index | Files

package storage

import "github.com/juju/juju/cmd/juju/storage"

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

Index

Package Files

add.go attach.go detach.go filesystem.go filesystemlistformatters.go import.go list.go listformatters.go poolcreate.go pooldelete.go poollist.go poollistformatters.go poolupdate.go remove.go show.go storage.go volume.go volumelistformatters.go

Constants

const (
    Type = "type"
)

func FormatListTabularAll Uses

func FormatListTabularAll(writer io.Writer, value interface{}) error

FormatListTabularAll writes a tabular summary of storage instances, filesystems and volumes.

func FormatStorageListForStatusTabular Uses

func FormatStorageListForStatusTabular(writer *ansiterm.TabWriter, s CombinedStorage) error

FormatStorageListForStatusTabular writes a tabular summary of storage for status tabular view.

func NewAddCommand Uses

func NewAddCommand() cmd.Command

NewAddCommand returns a command used to add unit storage.

func NewAttachStorageCommand Uses

func NewAttachStorageCommand(new NewEntityAttacherCloserFunc) cmd.Command

NewAttachStorageCommand returns a command used to attach storage to application units.

func NewAttachStorageCommandWithAPI Uses

func NewAttachStorageCommandWithAPI() cmd.Command

NewAttachStorageCommandWithAPI returns a command used to attach storage to application units.

func NewDetachStorageCommand Uses

func NewDetachStorageCommand(new NewEntityDetacherCloserFunc) cmd.Command

NewDetachStorageCommand returns a command used to detach storage from application units.

func NewDetachStorageCommandWithAPI Uses

func NewDetachStorageCommandWithAPI() cmd.Command

NewDetachStorageCommandWithAPI returns a command used to detach storage from application units.

func NewImportFilesystemCommand Uses

func NewImportFilesystemCommand(
    newStorageImporter NewStorageImporterFunc,
    store jujuclient.ClientStore,
) cmd.Command

NewImportFilesystemCommand returns a command used to import a filesystem.

newStorageImporter is the function to use to acquire a StorageImporter. A non-nil function must be provided.

store is an optional ClientStore to use for interacting with the client model/controller storage. If nil, the default file-based store will be used.

func NewListCommand Uses

func NewListCommand() cmd.Command

NewListCommand returns a command for listing storage instances.

func NewPoolCreateCommand Uses

func NewPoolCreateCommand() cmd.Command

NewPoolCreateCommand returns a command that creates or defines a storage pool

func NewPoolListCommand Uses

func NewPoolListCommand() cmd.Command

NewPoolListCommand returns a command that lists storage pools on a model

func NewPoolRemoveCommand Uses

func NewPoolRemoveCommand() cmd.Command

NewPoolRemoveCommand returns a command that removes the named storage pool.

func NewPoolUpdateCommand Uses

func NewPoolUpdateCommand() cmd.Command

NewPoolUpdateCommand returns a command that replaces the named storage pools' attributes.

func NewRemoveStorageCommandWithAPI Uses

func NewRemoveStorageCommandWithAPI() cmd.Command

NewRemoveStorageCommandWithAPI returns a command used to remove storage from the model.

func NewShowCommand Uses

func NewShowCommand() cmd.Command

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

type CombinedStorage Uses

type CombinedStorage struct {
    StorageInstances map[string]StorageInfo    `yaml:"storage,omitempty" json:"storage,omitempty"`
    Filesystems      map[string]FilesystemInfo `yaml:"filesystems,omitempty" json:"filesystems,omitempty"`
    Volumes          map[string]VolumeInfo     `yaml:"volumes,omitempty" json:"volumes,omitempty"`
}

CombinedStorage holds a list of StorageInstances, Filesystems and Volumes for juju cmdline display purposes.

func GetCombinedStorageInfo Uses

func GetCombinedStorageInfo(p GetCombinedStorageInfoParams) (*CombinedStorage, error)

GetCombinedStorageInfo returns a list of StorageInstances, Filesystems and Volumes for juju cmdline display purposes

func (*CombinedStorage) Empty Uses

func (c *CombinedStorage) Empty() bool

Empty checks if CombinedStorage is empty.

type EntityAttacher Uses

type EntityAttacher interface {
    Attach(string, []string) ([]params.ErrorResult, error)
}

EntityAttacher defines an interface for attaching storage with the specified IDs to a unit.

type EntityAttacherCloser Uses

type EntityAttacherCloser interface {
    EntityAttacher
    Close() error
}

EntityAttacherCloser extends EntityAttacher with a Closer method.

type EntityDetacher Uses

type EntityDetacher interface {
    Detach([]string, *bool, *time.Duration) ([]params.ErrorResult, error)
}

EntityDetacher defines an interface for detaching storage with the specified IDs.

type EntityDetacherCloser Uses

type EntityDetacherCloser interface {
    EntityDetacher
    Close() error
}

EntityDetacherCloser extends EntityDetacher with a Closer method.

type EntityStatus Uses

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 FilesystemAttachment Uses

type FilesystemAttachment struct {
    MountPoint string `yaml:"mount-point" json:"mount-point"`
    ReadOnly   bool   `yaml:"read-only" json:"read-only"`
    Life       string `yaml:"life,omitempty" json:"life,omitempty"`
}

type FilesystemAttachments Uses

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

type FilesystemCommandBase Uses

type FilesystemCommandBase struct {
    StorageCommandBase
}

FilesystemCommandBase is a helper base structure for filesystem commands.

type FilesystemInfo Uses

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 `yaml:"volume,omitempty" json:"volume,omitempty"`

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

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

    // Pool is the name of the storage pool that the filesystem came from.
    Pool string `yaml:"pool,omitempty" json:"pool,omitempty"`

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

    // Life is the lifecycle state of the filesystem.
    Life string `yaml:"life,omitempty" json:"life,omitempty"`

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

FilesystemInfo defines the serialization behaviour for storage filesystem.

type GetCombinedStorageInfoParams Uses

type GetCombinedStorageInfoParams struct {
    Context                                   *cmd.Context
    APIClient                                 StorageListAPI
    Ids                                       []string
    WantStorage, WantVolumes, WantFilesystems bool
}

GetCombinedStorageInfoParams holds parameters for the GetCombinedStorageInfo call.

type NewEntityAttacherCloserFunc Uses

type NewEntityAttacherCloserFunc func() (EntityAttacherCloser, error)

NewEntityAttacherCloser is the type of a function that returns an EntityAttacherCloser.

type NewEntityDetacherCloserFunc Uses

type NewEntityDetacherCloserFunc func() (EntityDetacherCloser, error)

NewEntityDetacherCloser is the type of a function that returns an EntityDetacherCloser.

type NewStorageImporterFunc Uses

type NewStorageImporterFunc func(*StorageCommandBase) (StorageImporter, error)

NewStorageImporterFunc is the type of a function passed to NewImportFilesystemCommand, in order to acquire a StorageImporter.

type NewStorageRemoverCloserFunc Uses

type NewStorageRemoverCloserFunc func() (StorageRemoverCloser, error)

NewStorageRemoverCloserFunc is the type of a function that returns an StorageRemoverCloser.

type PoolCommandBase Uses

type PoolCommandBase struct {
    StorageCommandBase
}

PoolCommandBase is a helper base structure for pool commands.

type PoolCreateAPI Uses

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 Uses

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 Uses

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

PoolListAPI defines the API methods that the storage commands use.

type PoolRemoveAPI Uses

type PoolRemoveAPI interface {
    Close() error
    RemovePool(name string) error
    BestAPIVersion() int
}

PoolRemoveAPI defines the API methods that the storage commands use.

type PoolUpdateAPI Uses

type PoolUpdateAPI interface {
    Close() error
    UpdatePool(name, provider string, attr map[string]interface{}) error
    BestAPIVersion() int
}

PoolUpdateAPI defines the API methods that the storage commands use.

type StorageAddAPI Uses

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

StorageAddAPI defines the API methods that the storage commands use.

type StorageAttachments Uses

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 Uses

type StorageCommandBase struct {
    modelcmd.ModelCommandBase
}

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

func (*StorageCommandBase) NewStorageAPI Uses

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

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

type StorageImporter Uses

type StorageImporter interface {
    Close() error

    ImportStorage(
        kind storage.StorageKind,
        storagePool, storageProviderId, storageName string,
    ) (names.StorageTag, error)
}

StorageImporter provides a method for importing storage into the model.

func NewStorageImporter Uses

func NewStorageImporter(cmd *StorageCommandBase) (StorageImporter, error)

NewStorageImporter returns a new StorageImporter, given a StorageCommandBase.

type StorageInfo Uses

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

StorageInfo defines the serialization behaviour of the storage information.

type StorageListAPI Uses

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

StorageListAPI defines the API methods that the storage commands use.

type StorageRemover Uses

type StorageRemover interface {
    Remove(
        storageIds []string,
        destroyAttachments, destroyStorage bool,
        force *bool, maxWait *time.Duration,
    ) ([]params.ErrorResult, error)
}

StorageRemover defines an interface for destroying storage instances with the specified IDs.

type StorageRemoverCloser Uses

type StorageRemoverCloser interface {
    StorageRemover
    Close() error
}

StorageRemoverCloser extends StorageRemover with a Closer method.

type StorageShowAPI Uses

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

StorageAPI defines the API methods that the storage commands use.

type UnitStorageAttachment Uses

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"`

    // Life is the lifecycle state of the storage attachment.
    Life string `yaml:"life,omitempty" json:"life,omitempty"`
}

UnitStorageAttachment contains details of a unit storage attachment.

type VolumeAttachment Uses

type VolumeAttachment 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"`
    Life       string `yaml:"life,omitempty" json:"life,omitempty"`
}

type VolumeAttachments Uses

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

type VolumeInfo Uses

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"`

    // Pool is the name of the storage pool that the volume came from.
    Pool string `yaml:"pool,omitempty" json:"pool,omitempty"`

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

    // from params.Volume
    WWN string `yaml:"wwn,omitempty" json:"wwn,omitempty"`

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

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

    // Life is the lifecycle state of the volume.
    Life string `yaml:"life,omitempty" json:"life,omitempty"`

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

VolumeInfo defines the serialization behaviour for storage volume.

Package storage imports 27 packages (graph) and is imported by 37 packages. Updated 2019-08-23. Refresh now. Tools for package owners.