client

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

README

Client API

The client API is the interface between client and server gRPC applications and provides capabilities to manage storage and network hardware local to the storage nodes in addition to DAOS pools and services.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MockServers      = Addresses{"1.2.3.4:10000", "1.2.3.5:10001"}
	MockCtrlrs       = NvmeControllers{MockControllerPB()}
	MockSuccessState = ctlpb.ResponseState{Status: ctlpb.ResponseStatus_CTL_SUCCESS}
	MockState        = ctlpb.ResponseState{
		Status: ctlpb.ResponseStatus_CTL_ERR_APP,
		Error:  "example application error",
	}
	MockCtrlrResults = NvmeControllerResults{
		&ctlpb.NvmeControllerResult{
			Pciaddr: "0000:81:00.0",
			State:   &MockState,
		},
	}
	MockScmModules    = ScmModules{MockModulePB()}
	MockModuleResults = ScmModuleResults{
		&ctlpb.ScmModuleResult{
			Loc:   &ctlpb.ScmModule_Location{},
			State: &MockState,
		},
	}
	MockScmNamespaces = ScmNamespaces{MockPmemDevicePB()}
	MockMounts        = ScmMounts{MockMountPB()}
	MockMountResults  = ScmMountResults{
		&ctlpb.ScmMountResult{
			Mntpoint: "/mnt/daos",
			State:    &MockState,
		},
	}
	MockACL = &mockACLResult{
		acl: []string{
			"A::OWNER@:rw",
			"A::GROUP@:r",
		},
	}
	MockErr = errors.New("unknown failure")
)

Functions

func StorageFormatRequest

func StorageFormatRequest(mc Control, parms interface{}, ch chan ClientResult)

StorageFormatRequest attempts to format nonvolatile storage devices on a remote server over gRPC.

Calls control StorageFormat routine which activates StorageFormat service rpc and returns an open stream handle. Receive on stream and send ClientResult over channel for each.

Types

type AccessControlList

type AccessControlList struct {
	Entries []string // Access Control Entries in short string format
}

AccessControlList is a structure for the access control list.

func (*AccessControlList) Empty

func (acl *AccessControlList) Empty() bool

Empty checks whether there are any entries in the AccessControlList

func (*AccessControlList) String

func (acl *AccessControlList) String() string

String converts the AccessControlList to a human-readable string.

type Addresses

type Addresses []string

Addresses is an alias for a slice of <ipv4/hostname>:<port> addresses.

type ClientBioResult

type ClientBioResult struct {
	Address string
	Stats   *mgmtpb.BioHealthResp
	Err     error
}

ClientBioResult is a container for output of BIO health query client requests.

func (ClientBioResult) String

func (cr ClientBioResult) String() string

type ClientCtrlrMap

type ClientCtrlrMap map[string]pb_types.CtrlrResults

ClientCtrlrMap is an alias for query results of NVMe controllers (and any residing namespaces) on connected servers keyed on address.

func NewClientNvmeResults

func NewClientNvmeResults(results []*ctlpb.NvmeControllerResult, addrs Addresses) ClientCtrlrMap

NewClientNvmeResults provides a mock ClientCtrlrMap populated with controller operation responses

func (ClientCtrlrMap) String

func (ccm ClientCtrlrMap) String() string

type ClientMountMap

type ClientMountMap map[string]pb_types.MountResults

ClientMountMap is an alias for query results of SCM regions mounted on connected servers keyed on address.

func NewClientScmMount

func NewClientScmMount(mounts ScmMounts, addrs Addresses) ClientMountMap

NewClientScmMount provides a mock ClientMountMap populated with scm mount details

func NewClientScmMountResults

func NewClientScmMountResults(
	results []*ctlpb.ScmMountResult, addrs Addresses) ClientMountMap

NewClientScmMountResults provides a mock ClientMountMap populated with scm mount operation responses

func (ClientMountMap) String

func (cmm ClientMountMap) String() string

type ClientResult

type ClientResult struct {
	Address string
	Value   interface{}
	Err     error
}

ClientResult is a container for output of any type of client request.

func (ClientResult) String

func (cr ClientResult) String() string

type ClientSmdResult

type ClientSmdResult struct {
	Address string
	Devs    *mgmtpb.SmdDevResp
	Pools   *mgmtpb.SmdPoolResp
	Err     error
}

ClientSmdResult is a container for output of SMD dev list query client requests.

func (ClientSmdResult) String

func (cr ClientSmdResult) String() string

type Configuration

type Configuration struct {
	SystemName      string   `yaml:"name"`
	AccessPoints    []string `yaml:"access_points"`
	Port            int      `yaml:"port"`
	HostList        []string `yaml:"hostlist"`
	RuntimeDir      string   `yaml:"runtime_dir"`
	HostFile        string   `yaml:"host_file"`
	LogFile         string   `yaml:"log_file"`
	LogFileFormat   string   `yaml:"log_file_format"`
	Path            string
	TransportConfig *security.TransportConfig `yaml:"transport_config"`
	Ext             External
}

Configuration contains all known configuration variables available to the client

func GetConfig

func GetConfig(log logging.Logger, ConfigPath string) (*Configuration, error)

GetConfig loads a configuration file from the path given, or from the default location if none is provided. It returns a populated Configuration struct based upon the default values and any config file overrides.

func NewConfiguration

func NewConfiguration() *Configuration

NewConfiguration creates a new instance of the Configuration struct populated with defaults and default external interface.

func (*Configuration) LoadConfig

func (c *Configuration) LoadConfig() error

LoadConfig reads the configuration file specified by Configuration.Path and parses it. Parsed values override any default values.

type Connect

type Connect interface {
	BioHealthQuery(*mgmtpb.BioHealthReq) ResultQueryMap
	ClearConns() ResultMap
	ConnectClients(Addresses) ResultMap
	GetActiveConns(ResultMap) ResultMap
	KillRank(rank uint32) ResultMap
	NetworkListProviders() ResultMap
	NetworkScanDevices(searchProvider string) NetworkScanResultMap
	PoolCreate(*PoolCreateReq) (*PoolCreateResp, error)
	PoolDestroy(*PoolDestroyReq) error
	PoolGetACL(PoolGetACLReq) (*PoolGetACLResp, error)
	PoolOverwriteACL(PoolOverwriteACLReq) (*PoolOverwriteACLResp, error)
	PoolUpdateACL(PoolUpdateACLReq) (*PoolUpdateACLResp, error)
	PoolDeleteACL(PoolDeleteACLReq) (*PoolDeleteACLResp, error)
	SetTransportConfig(*security.TransportConfig)
	SmdListDevs(*mgmtpb.SmdDevReq) ResultSmdMap
	SmdListPools(*mgmtpb.SmdPoolReq) ResultSmdMap
	StorageScan(*StorageScanReq) *StorageScanResp
	StorageFormat(reformat bool) (ClientCtrlrMap, ClientMountMap)
	StoragePrepare(*ctlpb.StoragePrepareReq) ResultMap
	SystemMemberQuery() (common.SystemMembers, error)
	SystemStop() (common.SystemMemberResults, error)
}

Connect is an external interface providing functionality across multiple connected clients (controllers).

func NewConnect

func NewConnect(log logging.Logger) Connect

NewConnect is a factory for Connect interface to operate over multiple clients.

type Control

type Control interface {
	// contains filtered or unexported methods
}

Control interface provides connection handling capabilities.

type ControllerFactory

type ControllerFactory interface {
	// contains filtered or unexported methods
}

ControllerFactory is an interface providing capability to connect clients.

type External

type External interface {
	Getenv(string) string
	RunCommand(string) error
}

External interface provides methods to support various os operations.

type NetworkScanResult

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

func (NetworkScanResult) String

func (nsr NetworkScanResult) String() string

type NetworkScanResultMap

type NetworkScanResultMap map[string][]NetworkScanResult

func (NetworkScanResultMap) String

func (nsrm NetworkScanResultMap) String() string

type NvmeScanResult

type NvmeScanResult struct {
	Ctrlrs pb_types.NvmeControllers
	Err    error
}

NvmeScanResult represents the result of scanning for SCM modules installed on a storage node.

func (*NvmeScanResult) String

func (result *NvmeScanResult) String() string

func (*NvmeScanResult) StringHealthStats

func (result *NvmeScanResult) StringHealthStats() string

func (*NvmeScanResult) Summary

func (result *NvmeScanResult) Summary() (out string)

type NvmeScanResults

type NvmeScanResults map[string]*NvmeScanResult

NvmeScanResults maps NvmeScanResult structs to the addresses of remote servers identified by an address string.

type PoolCreateReq

type PoolCreateReq struct {
	ScmBytes   uint64
	NvmeBytes  uint64
	RankList   string
	NumSvcReps uint32
	Sys        string
	Usr        string
	Grp        string
	ACL        *AccessControlList
	UUID       string
}

PoolCreateReq struct contains request

type PoolCreateResp

type PoolCreateResp struct {
	UUID    string
	SvcReps string
}

PoolCreateResp struct contains response

type PoolDeleteACLReq

type PoolDeleteACLReq struct {
	UUID      string // UUID of the pool
	Principal string // Principal whose entry will be removed
}

PoolDeleteACLReq contains the input parameters for PoolDeleteACL.

type PoolDeleteACLResp

type PoolDeleteACLResp struct {
	ACL *AccessControlList // actual ACL of the pool
}

PoolDeleteACLResp returns the updated ACL for the pool.

type PoolDestroyReq

type PoolDestroyReq struct {
	UUID  string
	Force bool
}

PoolDestroyReq struct contains request

type PoolGetACLReq

type PoolGetACLReq struct {
	UUID string // pool UUID
}

PoolGetACLReq contains the input parameters for PoolGetACL

type PoolGetACLResp

type PoolGetACLResp struct {
	ACL *AccessControlList
}

PoolGetACLResp contains the output results for PoolGetACL

type PoolOverwriteACLReq

type PoolOverwriteACLReq struct {
	UUID string             // pool UUID
	ACL  *AccessControlList // new ACL for the pool
}

PoolOverwriteACLReq contains the input parameters for PoolOverwriteACL

type PoolOverwriteACLResp

type PoolOverwriteACLResp struct {
	ACL *AccessControlList // actual ACL of the pool
}

PoolOverwriteACLResp returns the updated ACL for the pool

type PoolUpdateACLReq

type PoolUpdateACLReq struct {
	UUID string             // pool UUID
	ACL  *AccessControlList // ACL entries to add to the pool
}

PoolUpdateACLReq contains the input parameters for PoolUpdateACL

type PoolUpdateACLResp

type PoolUpdateACLResp struct {
	ACL *AccessControlList // actual ACL of the pool
}

PoolUpdateACLResp returns the updated ACL for the pool

type ProviderListResult

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

type ResultMap

type ResultMap map[string]ClientResult

ResultMap map client addresses to method call ClientResults

func (ResultMap) String

func (rm ResultMap) String() string

type ResultQueryMap

type ResultQueryMap map[string]ClientBioResult

func (ResultQueryMap) String

func (rm ResultQueryMap) String() string

type ResultSmdMap

type ResultSmdMap map[string]ClientSmdResult

func (ResultSmdMap) String

func (rm ResultSmdMap) String() string

type ScmScanResult

type ScmScanResult struct {
	Modules    storage.ScmModules
	Namespaces storage.ScmNamespaces
	Err        error
}

ScmScanResult represents the result of scanning for SCM modules installed on a storage node and SCM namespaces.

func (*ScmScanResult) String

func (result *ScmScanResult) String() string

func (*ScmScanResult) Summary

func (result *ScmScanResult) Summary() (out string)

type ScmScanResults

type ScmScanResults map[string]*ScmScanResult

ScmScanMap maps ScmModuleScanResult structs to the addresses of remote servers identified by an address string.

type StorageFormatResult

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

StorageFormatResult stores results of format operations on NVMe controllers and SCM mountpoints.

type StorageScanReq

type StorageScanReq struct {
	Summary bool
}

StorageScanReq encapsulated subsystem scan parameters.

type StorageScanResp

type StorageScanResp struct {
	Servers []string
	Nvme    NvmeScanResults
	Scm     ScmScanResults
	// contains filtered or unexported fields
}

StorageScanResp encapsulated subsystem results.

func MockScanResp

func MockScanResp(cs NvmeControllers, ms ScmModules, nss ScmNamespaces, addrs Addresses, summary bool) *StorageScanResp

MockScanResp mocks scan results from scm and nvme for multiple servers. Each result indicates success or failure through presence of Err.

func (*StorageScanResp) String

func (ssr *StorageScanResp) String() string

func (*StorageScanResp) StringHealthStats

func (ssr *StorageScanResp) StringHealthStats() string

Jump to

Keyboard shortcuts

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