storage_class

package
v17.10.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	//NOTE:  Ensure that any changes made to this data structure are reflected
	// in the Unmarshal method of config.go
	Version             string                               `json:"version"`
	Name                string                               `json:"name"`
	Attributes          map[string]storage_attribute.Request `json:"attributes,omitempty"`
	BackendStoragePools map[string][]string                  `json:"requiredStorage,omitempty"`
}

func (*Config) MarshalJSON

func (c *Config) MarshalJSON() ([]byte, error)

func (*Config) UnmarshalJSON

func (c *Config) UnmarshalJSON(data []byte) error

type StorageClass

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

func New

func New(c *Config) *StorageClass

func NewForConfig

func NewForConfig(configJSON string) (*StorageClass, error)

func NewFromPersistent

func NewFromPersistent(persistent *StorageClassPersistent) *StorageClass

func (*StorageClass) CheckAndAddBackend

func (s *StorageClass) CheckAndAddBackend(b *storage.StorageBackend) int

CheckAndAddBackend iterates through each of the storage pools for a given backend. If the pool satisfies the storage class, it adds that pool. Returns the number of storage pools added.

func (*StorageClass) ConstructExternal

func (s *StorageClass) ConstructExternal() *StorageClassExternal

func (*StorageClass) ConstructPersistent

func (s *StorageClass) ConstructPersistent() *StorageClassPersistent

func (*StorageClass) GetAttributes

func (s *StorageClass) GetAttributes() map[string]storage_attribute.Request

func (*StorageClass) GetBackendStoragePools

func (s *StorageClass) GetBackendStoragePools() map[string][]string

func (*StorageClass) GetName

func (s *StorageClass) GetName() string

func (*StorageClass) GetStoragePoolsForProtocol

func (s *StorageClass) GetStoragePoolsForProtocol(p config.Protocol) []*storage.StoragePool

func (*StorageClass) GetVolumes

func (s *StorageClass) GetVolumes() []*storage.Volume

func (*StorageClass) Matches

func (s *StorageClass) Matches(storagePool *storage.StoragePool) bool

func (*StorageClass) RemovePoolsForBackend

func (s *StorageClass) RemovePoolsForBackend(backend *storage.StorageBackend)

type StorageClassExternal

type StorageClassExternal struct {
	Config       *Config
	StoragePools map[string][]string `json:"storage"` // Backend -> list of StoragePools
}

func (*StorageClassExternal) GetName

func (s *StorageClassExternal) GetName() string

type StorageClassPersistent

type StorageClassPersistent struct {
	Config *Config `json:"config"`
}

StorageClassPersistent contains the minimal information needed to persist a StorageClass. This exists to give us some flexibility to evolve the struct; it also avoids overloading the semantics of Config and is consistent with StorageBackendExternal.

func (*StorageClassPersistent) GetName

func (s *StorageClassPersistent) GetName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL