github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/storage/poolmanager/interface.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package poolmanager 5 6 import ( 7 "github.com/juju/juju/storage" 8 ) 9 10 // A PoolManager provides access to storage pools. 11 type PoolManager interface { 12 // Create makes a new pool with the specified configuration and persists it to state. 13 Create(name string, providerType storage.ProviderType, attrs map[string]interface{}) (*storage.Config, error) 14 15 // Delete removes the pool with name from state. 16 Delete(name string) error 17 18 // Get returns the pool with name from state. 19 Get(name string) (*storage.Config, error) 20 21 // List returns all the pools from state. 22 List() ([]*storage.Config, error) 23 } 24 25 type SettingsManager interface { 26 CreateSettings(key string, settings map[string]interface{}) error 27 ReadSettings(key string) (map[string]interface{}, error) 28 RemoveSettings(key string) error 29 ListSettings(keyPrefix string) (map[string]map[string]interface{}, error) 30 }