chapiclient

package
v4.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSocketName

func GetSocketName() string

GetSocketName returns unix socket name (per process)

Types

type Client

type Client struct {
	ClientBase // Embedded platform independent struct
	// contains filtered or unexported fields
}

Client contains the Linux specific Client properties

func NewChapiClient

func NewChapiClient() (*Client, error)

NewChapiClient returns the CHAPI client object that is used to communicate with the CHAPI server over HTTP.

func NewChapiClientWithTimeout

func NewChapiClientWithTimeout(timeout time.Duration) (*Client, error)

NewChapiClientWithTimeout returns the CHAPI client object that is used to communicate with the CHAPI server over HTTP. A custom timeout value is supported.

func NewChapiSocketClientWithTimeout

func NewChapiSocketClientWithTimeout(timeout *time.Duration) (chapiClient *Client, err error)

NewChapiClientWithTimeout returns the CHAPI client object, using Linux sockets, that is used to communicate with the CHAPI server over HTTP. A custom timeout value is supported.

func (*Client) CreateBindMount

func (chapiClient *Client) CreateBindMount(sourceMount string, targetMount string, bindType string) (mount *model.Mount, err error)

CreateBindMount creates the given bind mount

func (*Client) CreateDevice

func (chapiClient *Client) CreateDevice(publishInfo model.PublishInfo) (device *model.Device, err error)

CreateDevice will attach device on this host based on the details provided

func (*Client) CreateFileSystem

func (chapiClient *Client) CreateFileSystem(serialNumber string, filesystem string) (err error)

CreateFileSystem writes the given file system to the device with the given serial number

func (*Client) CreateMount

func (chapiClient *Client) CreateMount(serialNumber string, mountPoint string, fsOptions *model.FileSystemOptions) (mount *model.Mount, err error)

CreateMount mounts the given device to the given mount point

func (*Client) DeleteDevice

func (chapiClient *Client) DeleteDevice(serialNumber string) (err error)

DeleteDevice will delete the given device from the host

func (*Client) DeleteMount

func (chapiClient *Client) DeleteMount(serialNumber, mountPointID string) (err error)

DeleteMount unmounts the given mount point, serialNumber can be optional in the body

func (*Client) GetAllDeviceDetails

func (chapiClient *Client) GetAllDeviceDetails(serialNumber string) (devices []*model.Device, err error)

GetAllDeviceDetails enumerates all the Nimble volumes with detailed information. If serialNumber is non-empty then only specified device is returned

func (*Client) GetAllMountDetails

func (chapiClient *Client) GetAllMountDetails(serialNumber, mountPointID string) (mounts []*model.Mount, err error)

GetAllMountDetails enumerates the specified mount point ID

func (*Client) GetDevices

func (chapiClient *Client) GetDevices(serialNumber string) (devices []*model.Device, err error)

GetDevices enumerates all the Nimble volumes with basic details. If serialNumber is non-empty then only specified device is returned

func (*Client) GetHostInfo

func (chapiClient *Client) GetHostInfo() (host *model.Host, err error)

GetHostInfo returns host name, domain, and network interfaces

func (*Client) GetHostInitiators

func (chapiClient *Client) GetHostInitiators() (initiators []*model.Initiator, err error)

GetHostInitiators reports the initiators on this host

func (*Client) GetHostNetworks

func (chapiClient *Client) GetHostNetworks() (networks []*model.Network, err error)

GetHostNetworks reports the networks on this host

func (*Client) GetMounts

func (chapiClient *Client) GetMounts(serialNumber string) (mounts []*model.Mount, err error)

GetMounts reports all mounts on this host for the specified Nimble volume

func (*Client) GetPartitionInfo

func (chapiClient *Client) GetPartitionInfo(serialNumber string) (partitions []*model.DevicePartition, err error)

GetPartitionInfo reports the partitions on the provided device

func (*Client) OfflineDevice

func (chapiClient *Client) OfflineDevice(serialNumber string) (err error)

OfflineDevice will offline the given device from the host

func (*Client) Print

func (chapiClient *Client) Print()

Print to dump CHAPI client struct

type ClientBase

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

ClientBase defines platform independent properties and is embedded within the Client object

type Response

type Response struct {
	Data interface{}         `json:"data,omitempty"`
	Err  *cerrors.ChapiError `json:"errors,omitempty"`
}

Response object defines the data and/or error that are returned by a CHAPI endpoint

Jump to

Keyboard shortcuts

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