github.com/altoros/juju-vmware@v0.0.0-20150312064031-f19ae857ccca/storage/pool/interface.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package pool 5 6 import ( 7 "github.com/juju/juju/storage" 8 ) 9 10 // A Pool is a storage provider with configuration. 11 type Pool interface { 12 // Name is the pool's name. 13 Name() string 14 15 // Type is the type of storage provider this pool represents, eg "loop", "ebs. 16 Type() storage.ProviderType 17 18 // Config is the pool's configuration attributes. 19 Config() map[string]interface{} 20 } 21 22 // A PoolManager provides access to storage pools. 23 type PoolManager interface { 24 // Create makes a new pool with the specified configuration and persists it to state. 25 Create(name string, providerType storage.ProviderType, attrs map[string]interface{}) (Pool, error) 26 27 // Delete removes the pool with name from state. 28 Delete(name string) error 29 30 // Get returns the pool with name from state. 31 Get(name string) (Pool, error) 32 33 // List returns all the pools from state. 34 List() ([]Pool, error) 35 } 36 37 type SettingsManager interface { 38 CreateSettings(key string, settings map[string]interface{}) error 39 ReadSettings(key string) (map[string]interface{}, error) 40 RemoveSettings(key string) error 41 ListSettings(keyPrefix string) (map[string]map[string]interface{}, error) 42 }