Documentation
¶
Index ¶
- type ImportStorageParams
- type PoolAttrs
- type Service
- type State
- type StoragePoolService
- func (s *StoragePoolService) AllStoragePools(ctx context.Context) ([]*storage.Config, error)
- func (s *StoragePoolService) CreateStoragePool(ctx context.Context, name string, providerType storage.ProviderType, ...) error
- func (s *StoragePoolService) DeleteStoragePool(ctx context.Context, name string) error
- func (s *StoragePoolService) GetStoragePoolByName(ctx context.Context, name string) (*storage.Config, error)
- func (s *StoragePoolService) ListStoragePools(ctx context.Context, names domainstorage.Names, ...) ([]*storage.Config, error)
- func (s *StoragePoolService) ReplaceStoragePool(ctx context.Context, name string, providerType storage.ProviderType, ...) error
- type StoragePoolState
- type StorageService
- type StorageState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImportStorageParams ¶
type ImportStorageParams struct { // Kind is the kind of the storage to import. Kind internalstorage.StorageKind // Pool is the name of the storage pool into which the storage is to // be imported. Pool string // ProviderId is the storage provider's unique ID for the storage, // e.g. the EBS volume ID. ProviderId string // StorageName is the name to assign to the imported storage. StorageName storage.Name }
ImportStorageParams contains the parameters for importing storage into a model.
type Service ¶
type Service struct { *StoragePoolService *StorageService }
Service defines a service for interacting with the underlying state.
func NewService ¶
func NewService(st State, logger logger.Logger, registryGetter corestorage.ModelStorageRegistryGetter) *Service
NewService returns a new Service for interacting with the underlying state.
func (*Service) GetStorageRegistry
deprecated
func (s *Service) GetStorageRegistry(ctx context.Context) (internalstorage.ProviderRegistry, error)
GetStorageRegistry returns the storage registry for the model.
Deprecated: This method will be removed once the storage registry is fully implemented in each service.
type State ¶
type State interface { StoragePoolState StorageState }
State defines an interface for interacting with the underlying state.
type StoragePoolService ¶
type StoragePoolService struct {
// contains filtered or unexported fields
}
StoragePoolService defines a service for interacting with the underlying state.
func (*StoragePoolService) AllStoragePools ¶
AllStoragePools returns the all storage pools.
func (*StoragePoolService) CreateStoragePool ¶
func (s *StoragePoolService) CreateStoragePool(ctx context.Context, name string, providerType storage.ProviderType, attrs PoolAttrs) error
CreateStoragePool creates a storage pool, returning an error satisfying errors.AlreadyExists if a pool with the same name already exists.
func (*StoragePoolService) DeleteStoragePool ¶
func (s *StoragePoolService) DeleteStoragePool(ctx context.Context, name string) error
DeleteStoragePool deletes a storage pool, returning an error satisfying errors.NotFound if it doesn't exist.
func (*StoragePoolService) GetStoragePoolByName ¶
func (s *StoragePoolService) GetStoragePoolByName(ctx context.Context, name string) (*storage.Config, error)
GetStoragePoolByName returns the storage pool with the specified name, returning an error satisfying storageerrors.PoolNotFoundError if it doesn't exist.
func (*StoragePoolService) ListStoragePools ¶
func (s *StoragePoolService) ListStoragePools(ctx context.Context, names domainstorage.Names, providers domainstorage.Providers) ([]*storage.Config, error)
ListStoragePools returns the storage pools matching the specified filter.
func (*StoragePoolService) ReplaceStoragePool ¶
func (s *StoragePoolService) ReplaceStoragePool(ctx context.Context, name string, providerType storage.ProviderType, attrs PoolAttrs) error
ReplaceStoragePool replaces an existing storage pool, returning an error satisfying storageerrors.PoolNotFoundError if a pool with the name does not exist.
type StoragePoolState ¶
type StoragePoolState interface { CreateStoragePool(ctx context.Context, pool domainstorage.StoragePoolDetails) error DeleteStoragePool(ctx context.Context, name string) error ReplaceStoragePool(ctx context.Context, pool domainstorage.StoragePoolDetails) error ListStoragePools(ctx context.Context, filter domainstorage.Names, providers domainstorage.Providers) ([]domainstorage.StoragePoolDetails, error) GetStoragePoolByName(ctx context.Context, name string) (domainstorage.StoragePoolDetails, error) }
StoragePoolState defines an interface for interacting with the underlying state.
type StorageService ¶
type StorageService struct {
// contains filtered or unexported fields
}
StorageService defines a service for storage related behaviour.
func (*StorageService) ImportFilesystem ¶
func (s *StorageService) ImportFilesystem(ctx context.Context, arg ImportStorageParams) (corestorage.ID, error)
ImportFilesystem associates a filesystem (either native or volume backed) hosted by a cloud provider with a new storage instance (and storage pool) in a model. The following error types can be expected: - coreerrors.NotSupported: when the importing the kind of storage is not supported by the provider. - storageerrors.InvalidPoolNameError: when the supplied pool name is invalid.
type StorageState ¶
type StorageState interface { // GetModelDetails returns the model and controller UUID for the current model. GetModelDetails() (storage.ModelDetails, error) // ImportFilesystem associates a filesystem (either native or volume backed) hosted by a cloud provider // with a new storage instance (and storage pool) in a model. ImportFilesystem(ctx context.Context, name corestorage.Name, filesystem storage.FilesystemInfo) (corestorage.ID, error) }
StorageState defines an interface for interacting with the underlying state.