kvstore

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2017 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const (

	//SdsModeAll is both client and server
	SdsModeAll = 1

	//SdsModeClient is client only
	SdsModeClient = 2

	//SdsModeServer is server only
	SdsModeServer = 3
)

Variables

View Source
var (
	//ErrInvalidKeyValue The Key/Value returned is nil
	ErrInvalidKeyValue = errors.New("The Key/Value returned is nil")

	//ErrStoreType Invalid store type
	ErrStoreType = errors.New("Invalid store type")
)

Functions

This section is empty.

Types

type Device

type Device struct {
	Name   string
	Delete bool
	Add    bool
}

Device representation

type KvStore

type KvStore struct {
	Config  *config.Config
	Store   store.Store
	RootKey string
}

KvStore representation a KeyValue Store

func NewKvStore

func NewKvStore(cfg *config.Config) (*KvStore, error)

NewKvStore generates a new KvStore object

func (*KvStore) DeleteStore

func (kv *KvStore) DeleteStore()

DeleteStore deletes all ScaleIO Framework metadata

func (*KvStore) DumpStore

func (kv *KvStore) DumpStore()

DumpStore prints out the ScaleIO Framework metadata

func (*KvStore) GetConfigured

func (kv *KvStore) GetConfigured() bool

GetConfigured returns if the ScaleIO is configured

func (*KvStore) GetKvStoreVersion

func (kv *KvStore) GetKvStoreVersion() string

GetKvStoreVersion returns the metadata version

func (*KvStore) GetMdmNodes

func (kv *KvStore) GetMdmNodes() (string, string, string)

GetMdmNodes returns the pri, sec, tb mdms nodes in the Store

func (*KvStore) GetMetadata

func (kv *KvStore) GetMetadata(nodeID string) (*Metadata, error)

GetMetadata gets all domains/pools for a given node

func (*KvStore) GetNodeInfo

func (kv *KvStore) GetNodeInfo(nodeID string) (int, int, error)

GetNodeInfo returns all metadata for a give node

func (*KvStore) SetConfigured

func (kv *KvStore) SetConfigured() error

SetConfigured set the ScaleIO node to configured

func (*KvStore) SetMetadata

func (kv *KvStore) SetMetadata(nodeID string, metaData *Metadata) error

SetMetadata sets all domains/pools for a given node

func (*KvStore) SetNodeInfo

func (kv *KvStore) SetNodeInfo(nodeID string, persona int, state int) error

SetNodeInfo sets all metadata for a given node

func (*KvStore) UserDeleteKey

func (kv *KvStore) UserDeleteKey(key string) error

UserDeleteKey returns debug tool for modifying keyvalue pairs

func (*KvStore) UserKeyValue

func (kv *KvStore) UserKeyValue(key string, value string) error

UserKeyValue returns debug tool for modifying keyvalue pairs

type Metadata

type Metadata struct {
	ProtectionDomains map[string]*ProtectionDomain
}

Metadata representation

type ProtectionDomain

type ProtectionDomain struct {
	Name   string
	Pools  map[string]*StoragePool
	Sdss   map[string]*Sds
	Delete bool
	Add    bool
}

ProtectionDomain representation

type Sds

type Sds struct {
	Name   string
	Mode   int
	Delete bool
	Add    bool
}

Sds representation

type StoragePool

type StoragePool struct {
	Name    string
	Devices map[string]*Device
	Delete  bool
	Add     bool
}

StoragePool representation

Jump to

Keyboard shortcuts

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