Documentation

Overview

Package storage provides an API server facade for managing storage entities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StorageAPI

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

StorageAPI implements the latest version (v6) of the Storage API.

func NewStorageAPI

func NewStorageAPI(ctx facade.Context) (*StorageAPI, error)

NewStorageAPI returns a new storage API facade.

func (*StorageAPI) AddToUnit

AddToUnit validates and creates additional storage instances for units. A "CHANGE" block can block this operation.

func (*StorageAPI) Attach

Attach attaches existing storage instances to units. A "CHANGE" block can block this operation.

func (*StorageAPI) CreatePool

CreatePool creates a new pool with specified parameters.

func (*StorageAPI) DetachStorage

DetachStorage sets the specified storage attachments to Dying, unless they are already Dying or Dead. Any associated, persistent storage will remain alive. This call can be forced.

func (*StorageAPI) Import

Import imports existing storage into the model. A "CHANGE" block can block this operation.

func (*StorageAPI) ListFilesystems

ListFilesystems returns a list of filesystems in the environment matching the provided filter. Each result describes a filesystem in detail, including the filesystem's attachments.

func (*StorageAPI) ListPools

ListPools returns a list of pools. If filter is provided, returned list only contains pools that match the filter. Pools can be filtered on names and provider types. If both names and types are provided as filter, pools that match either are returned. This method lists union of pools and environment provider types. If no filter is provided, all pools are returned.

func (*StorageAPI) ListStorageDetails

func (a *StorageAPI) ListStorageDetails(filters params.StorageFilters) (params.StorageDetailsListResults, error)

ListStorageDetails returns storage matching a filter.

func (*StorageAPI) ListVolumes

ListVolumes lists volumes with the given filters. Each filter produces an independent list of volumes, or an error if the filter is invalid or the volumes could not be listed.

func (*StorageAPI) Remove

Remove sets the specified storage entities to Dying, unless they are already Dying or Dead, such that the storage will eventually be removed from the model. If the arguments specify that the storage should be destroyed, then the associated cloud storage will be destroyed first; otherwise it will only be released from Juju's control.

func (*StorageAPI) RemovePool

RemovePool deletes the named pool

func (*StorageAPI) StorageDetails

func (a *StorageAPI) StorageDetails(entities params.Entities) (params.StorageDetailsResults, error)

StorageDetails retrieves and returns detailed information about desired storage identified by supplied tags. If specified storage cannot be retrieved, individual error is returned instead of storage information.

func (*StorageAPI) UpdatePool

UpdatePool deletes the named pool

type StorageAPIv3

type StorageAPIv3 struct {
	StorageAPIv4
}

APIv3 implements the storage v3 API.

func NewStorageAPIV3

func NewStorageAPIV3(context facade.Context) (*StorageAPIv3, error)

NewStorageAPIV3 returns a new storage v3 API facade.

func (*StorageAPIv3) AddToUnit

AddToUnit validates and creates additional storage instances for units. A "CHANGE" block can block this operation.

func (*StorageAPIv3) Destroy

func (a *StorageAPIv3) Destroy(args params.Entities) (params.ErrorResults, error)

Destroy sets the specified storage entities to Dying, unless they are already Dying or Dead.

func (*StorageAPIv3) Import

func (*StorageAPIv3) Import(_, _ struct{})

func (*StorageAPIv3) Remove

func (*StorageAPIv3) Remove(_, _ struct{})

Added in v4 Destroy was dropped in V4, replaced with Remove.

type StorageAPIv4

type StorageAPIv4 struct {
	StorageAPIv5
}

APIv4 implements the storage v4 API adding AddToUnit, Import and Remove (replacing Destroy)

func NewStorageAPIV4

func NewStorageAPIV4(context facade.Context) (*StorageAPIv4, error)

NewStorageAPIV4 returns a new storage v4 API facade.

func (*StorageAPIv4) CreatePool

func (a *StorageAPIv4) CreatePool(p params.StoragePool) error

CreatePool creates a new pool with specified parameters.

func (*StorageAPIv4) RemovePool

func (*StorageAPIv4) RemovePool(_, _ struct{})

Added in v5 api version

func (*StorageAPIv4) UpdatePool

func (*StorageAPIv4) UpdatePool(_, _ struct{})

type StorageAPIv5

type StorageAPIv5 struct {
	StorageAPI
}

APIv5 implements the storage v5 API.

func NewStorageAPIV5

func NewStorageAPIV5(context facade.Context) (*StorageAPIv5, error)

NewStorageAPIV5 returns a new storage v5 API facade.

func (*StorageAPIv5) Detach

Detach sets the specified storage attachments to Dying, unless they are already Dying or Dead. Any associated, persistent storage will remain alive.

func (*StorageAPIv5) DetachStorage

func (*StorageAPIv5) DetachStorage(_, _ struct{})

Added in v6 api version

type Unit

type Unit interface {
	AssignedMachineId() (string, error)
}

Source Files