Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultStoragePools(registry storage.ProviderRegistry) ([]*storage.Config, error)
- func NewStorageDirectivesValidator(modelType coremodel.ModelType, registry storage.ProviderRegistry, ...) (*storageDirectivesValidator, error)
- func StorageDirectivesWithDefaults(charmStorage map[string]charm.Storage, modelType coremodel.ModelType, ...) (map[string]storage.Directive, error)
- type Attrs
- type Charm
- type FilesystemInfo
- type ModelDetails
- type Names
- type Providers
- type ProvisioningStatus
- type StorageDefaults
- type StorageDirectivesValidator
- type StorageKind
- type StoragePoolDetails
- type StoragePoolGetter
Constants ¶
const ( StoragePoolName = "name" StorageProviderType = "type" )
Pool configuration attribute names.
Variables ¶
var ( NilNames = Names(nil) NilProviders = Providers(nil) )
These consts are used to specify nil filter terms.
Functions ¶
func DefaultStoragePools ¶
func DefaultStoragePools(registry storage.ProviderRegistry) ([]*storage.Config, error)
DefaultStoragePools returns the default storage pools to add to a new model for a given provider registry.
func NewStorageDirectivesValidator ¶
func NewStorageDirectivesValidator(modelType coremodel.ModelType, registry storage.ProviderRegistry, storagePoolGetter StoragePoolGetter) (*storageDirectivesValidator, error)
NewStorageDirectivesValidator creates a validator that can be used to check storage directives are compatible with a given charm.
func StorageDirectivesWithDefaults ¶
func StorageDirectivesWithDefaults( charmStorage map[string]charm.Storage, modelType coremodel.ModelType, defaults StorageDefaults, allDirectives map[string]storage.Directive, ) (map[string]storage.Directive, error)
StorageDirectivesWithDefaults takes a storage directives map and fills in any defaults as required.
Types ¶
type FilesystemInfo ¶
type FilesystemInfo struct { storage.FilesystemInfo Pool string BackingVolume *storage.VolumeInfo }
FilesystemInfo describes information about a filesystem.
type ModelDetails ¶
ModelDetails describes details about a model.
type ProvisioningStatus ¶
type ProvisioningStatus int
ProvisioningStatus represents the status of a storage entity as recorded in the storage provisioning status lookup table.
const ( ProvisioningStatusPending ProvisioningStatus = iota ProvisioningStatusProvisioned ProvisioningStatusError )
type StorageDefaults ¶
StorageDefaults holds the default sources of storage for an application.
type StorageDirectivesValidator ¶
type StorageDirectivesValidator interface {
ValidateStorageDirectivesAgainstCharm(ctx context.Context, allDirectives map[string]storage.Directive, charm Charm) error
}
StorageDirectivesValidator instances can be used to check storage directives are compatible with a given charm.
type StorageKind ¶
type StorageKind int
StorageKind represents the kind of storage as recorded in the storage kind lookup table.
const ( StorageKindBlock StorageKind = iota StorageKindFilesystem )
type StoragePoolDetails ¶
StoragePoolDetails defines the details of a storage pool to save. This type is also used when returning query results from state.
func BuiltInStoragePools ¶
func BuiltInStoragePools() ([]StoragePoolDetails, error)
BuiltInStoragePools returns the built in providers common to all.
type StoragePoolGetter ¶
type StoragePoolGetter interface {
GetStoragePoolByName(ctx context.Context, name string) (StoragePoolDetails, error)
}
StoragePoolGetter provides access to a storage pool getter for validation purposes.