Documentation ¶
Index ¶
- Variables
- func CheckFsCreationInProgress(device model.Device) (inProgress bool, err error)
- func GetHostURL(hostName string, port uint64) string
- func GetSocketName() string
- func IsChapidRunning(chapidSocket string) bool
- func NewRouter() *mux.Router
- func Run() (err error)
- func RunNimbled(c chan error)
- func StopChapid() error
- type AccessKeyPath
- type Client
- func NewChapiClient() (*Client, error)
- func NewChapiClientWithTimeout(timeout time.Duration) (*Client, error)
- func NewChapiHTTPClient(hostName string, port uint64) (*Client, error)
- func NewChapiHTTPClientWithTimeout(hostName string, port uint64, timeout time.Duration) (*Client, error)
- func NewChapiHTTPClientWithTimeoutAndHeader(hostName string, port uint64, timeout time.Duration, header map[string]string) (*Client, error)
- func NewChapiSocketClient() (*Client, error)
- func NewChapiSocketClientWithTimeout(timeout time.Duration) (*Client, error)
- func (chapiClient *Client) AddHeader(header map[string]string) error
- func (chapiClient *Client) AttachAndMountDevice(volume *model.Volume, mountPath string) (err error)
- func (chapiClient *Client) AttachDevice(volumes []*model.Volume) (devices []*model.Device, err error)
- func (chapiClient *Client) CreateFilesystem(device *model.Device, vol *model.Volume, filesystem string) (err error)
- func (chapiClient *Client) DeleteDevice(device *model.Device) (err error)
- func (chapiClient *Client) GetChapInfo() (chapInfo *model.ChapInfo, err error)
- func (chapiClient *Client) GetDeviceFromVolume(volume *model.Volume) (device *model.Device, err error)
- func (chapiClient *Client) GetDevices() (devices []*model.Device, err error)
- func (chapiClient *Client) GetHostID() (string, error)
- func (chapiClient *Client) GetHostName() (host *model.Host, err error)
- func (chapiClient *Client) GetInitiators() (initiators []*model.Initiator, err error)
- func (chapiClient *Client) GetMounts(respMount *[]*model.Mount, serialNumber string) (err error)
- func (chapiClient *Client) GetNetworks() (networks []*model.NetworkInterface, err error)
- func (chapiClient *Client) Mount(reqMount *model.Mount, respMount *model.Mount) (err error)
- func (chapiClient *Client) MountFilesystem(volume *model.Volume, mountPoint string) error
- func (chapiClient *Client) OfflineDevice(device *model.Device) (err error)
- func (chapiClient *Client) Print()
- func (chapiClient *Client) SetupFilesystemAndPermissions(device *model.Device, vol *model.Volume, filesystem string) error
- func (chapiClient *Client) Unmount(reqMount *model.Mount, respMount *model.Mount) (err error)
- func (chapiClient *Client) UnmountDevice(volume *model.Volume) error
- type Driver
- type ErrorResponse
- type FakeDriver
- func (driver *FakeDriver) BindMount(mountPoint string, newMountPoint string, rbind bool) error
- func (driver *FakeDriver) BindUnmount(mountPoint string) error
- func (driver *FakeDriver) CreateDevices(volumes []*model.Volume) ([]*model.Device, error)
- func (driver *FakeDriver) CreateFilesystemOnDevice(device *model.Device, filesytemType string) error
- func (driver *FakeDriver) DeleteDevice(device *model.Device) error
- func (driver *FakeDriver) ExpandDevice(targetPath string, volAccessType model.VolumeAccessType) error
- func (driver *FakeDriver) GetBlockSizeBytes(devicePath string) (int64, error)
- func (driver *FakeDriver) GetDevice(volume *model.Volume) (*model.Device, error)
- func (driver *FakeDriver) GetFilesystemOptionsFromDevice(device *model.Device, mountPoint string) (*model.FilesystemOpts, error)
- func (driver *FakeDriver) GetHostInfo() (*model.Host, error)
- func (driver *FakeDriver) GetHostInitiators() ([]*model.Initiator, error)
- func (driver *FakeDriver) GetHostNameAndDomain() ([]string, error)
- func (driver *FakeDriver) GetHostNetworks() ([]*model.NetworkInterface, error)
- func (driver *FakeDriver) GetHosts() (*model.Hosts, error)
- func (driver *FakeDriver) GetMountOptions(device *model.Device, mountPoint string) ([]string, error)
- func (driver *FakeDriver) GetMounts(serialNumber string) ([]*model.Mount, error)
- func (driver *FakeDriver) GetMountsForDevice(device *model.Device) ([]*model.Mount, error)
- func (driver *FakeDriver) IsBlockDevice(devicePath string) (bool, error)
- func (driver *FakeDriver) MountDevice(device *model.Device, mountPoint string, options []string, ...) (*model.Mount, error)
- func (driver *FakeDriver) MountNFSVolume(source string, targetPath string, mountOptions []string, nfsType string) error
- func (driver *FakeDriver) OfflineDevice(device *model.Device) error
- func (driver *FakeDriver) SetFilesystemOptions(mountPoint string, fsOpts *model.FilesystemOpts) error
- func (driver *FakeDriver) SetMountOptions(device *model.Device, mountPoint string, options []string) error
- func (driver *FakeDriver) UnmountDevice(device *model.Device, mountPoint string) (*model.Mount, error)
- func (driver *FakeDriver) UnmountFileSystem(mountPoint string) (*model.Mount, error)
- type LinuxDriver
- func (driver *LinuxDriver) BindMount(mountPoint string, newMountPoint string, rbind bool) error
- func (driver *LinuxDriver) BindUnmount(mountPoint string) error
- func (driver *LinuxDriver) CreateDevices(volumes []*model.Volume) ([]*model.Device, error)
- func (driver *LinuxDriver) CreateFilesystemOnDevice(device *model.Device, filesystemType string) error
- func (driver *LinuxDriver) DeleteDevice(device *model.Device) error
- func (driver *LinuxDriver) ExpandDevice(targetPath string, volAccessType model.VolumeAccessType) error
- func (driver *LinuxDriver) GetBlockSizeBytes(devicePath string) (int64, error)
- func (driver *LinuxDriver) GetDevice(volume *model.Volume) (*model.Device, error)
- func (driver *LinuxDriver) GetFilesystemFromDevice(device *model.Device) (*model.FilesystemOpts, error)
- func (driver *LinuxDriver) GetHostInfo() (*model.Host, error)
- func (driver *LinuxDriver) GetHostInitiators() ([]*model.Initiator, error)
- func (driver *LinuxDriver) GetHostNameAndDomain() ([]string, error)
- func (driver *LinuxDriver) GetHostNetworks() ([]*model.NetworkInterface, error)
- func (driver *LinuxDriver) GetHosts() (*model.Hosts, error)
- func (driver *LinuxDriver) GetMounts(serialNumber string) ([]*model.Mount, error)
- func (driver *LinuxDriver) GetMountsForDevice(device *model.Device) ([]*model.Mount, error)
- func (driver *LinuxDriver) IsBlockDevice(devicePath string) (bool, error)
- func (driver *LinuxDriver) MountDevice(device *model.Device, mountPoint string, mountOptions []string, ...) (*model.Mount, error)
- func (driver *LinuxDriver) MountNFSVolume(source string, targetPath string, mountOptions []string, nfsType string) error
- func (driver *LinuxDriver) OfflineDevice(device *model.Device) error
- func (driver *LinuxDriver) SetFilesystemOptions(mountPoint string, options *model.FilesystemOpts) error
- func (driver *LinuxDriver) UnmountDevice(device *model.Device, mountPoint string) (*model.Mount, error)
- func (driver *LinuxDriver) UnmountFileSystem(mountPoint string) (*model.Mount, error)
- type Response
Constants ¶
This section is empty.
Variables ¶
var ( // Hosts represents collection of hosts Hosts model.Hosts // DeviceURIfmt represents particular device endpoint format for GET and POST requests DeviceURIfmt = "%sdevices/%s" // HostURIfmt represents hosts endpoint format for GET requests HostURIfmt = "/hosts/%s/" // MountURIfmt represents mounts endpoint format for GET and POST requests MountURIfmt = "%smounts/%s" // DevicesURIfmt represents devices endpoint format for GET requests DevicesURIfmt = "%sdevices" // UnmountURIfmt represents particular mount endpoint for POST requests UnmountURIfmt = "%smounts/%s" // CreateFSURIfmt represents devices endpoint format for POST requests CreateFSURIfmt = "%sdevices/%s/%s" // NetworksURIfmt represents networks endpoint format for GET requests NetworksURIfmt = "%snetworks" // InitiatorsURIfmt represents initiators endpoint for GET requests InitiatorsURIfmt = "%sinitiators" // HostnameURIfmt represents hostname endpoint for GET requests HostnameURIfmt = "%shostname" // ChapInfoURIfmt represents endpoint to obtain initiator CHAP credentials ChapInfoURIfmt = "%schapinfo" // LogLevel of the chapi client LogLevel = "info" )
var ( //ChapidSocketPath : the directory for chapid socket ChapidSocketPath = "/opt/hpe-storage/etc/" //ChapidSocketName : chapid socket name ChapidSocketName = "chapid" )
Functions ¶
func CheckFsCreationInProgress ¶
CheckFsCreationInProgress checks if mkfs process is using the device
func GetHostURL ¶
GetHostURL to consruct HTTP URL of the form "hostname:port"
func GetSocketName ¶
func GetSocketName() string
GetSocketName returns unix socket name (per process)
func IsChapidRunning ¶
IsChapidRunning return true if chapid is running as part of service listening on given socket
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client defines client for chapid and corresponding socket file or http:port info
func NewChapiClient ¶
NewChapiClient returns the chapi client that communicates over the required unix socket(per process or common service)
func NewChapiClientWithTimeout ¶
NewChapiClientWithTimeout returns the chapi client with timeout configuration that communicates over the required unix socket(per process or common service)
func NewChapiHTTPClient ¶
NewChapiHTTPClient to create chapi http client
func NewChapiHTTPClientWithTimeout ¶
func NewChapiHTTPClientWithTimeout(hostName string, port uint64, timeout time.Duration) (*Client, error)
NewChapiHTTPClientWithTimeout to create chapi http client with timeout
func NewChapiHTTPClientWithTimeoutAndHeader ¶
func NewChapiHTTPClientWithTimeoutAndHeader(hostName string, port uint64, timeout time.Duration, header map[string]string) (*Client, error)
NewChapiHTTPClientWithTimeoutAndHeader to create chapi http client with timeout and headers
func NewChapiSocketClient ¶
NewChapiSocketClient to create chapi socket client
func NewChapiSocketClientWithTimeout ¶
NewChapiSocketClientWithTimeout to create chapi socket client with timeout
func (*Client) AttachAndMountDevice ¶
AttachAndMountDevice will attach the given os device for given volume and mounts the filesystem on the host
func (*Client) AttachDevice ¶
func (chapiClient *Client) AttachDevice(volumes []*model.Volume) (devices []*model.Device, err error)
AttachDevice will attach the given os device for given volume on the host
func (*Client) CreateFilesystem ¶
func (chapiClient *Client) CreateFilesystem(device *model.Device, vol *model.Volume, filesystem string) (err error)
CreateFilesystem calls chapi server to create filesystem
func (*Client) DeleteDevice ¶
DeleteDevice : delete the os device on the host nolint : Remove this once 'DetachDevice' from chapiclient_windows.go is removed
func (*Client) GetChapInfo ¶
GetChapInfo will return host initiator CHAP details
func (*Client) GetDeviceFromVolume ¶
func (chapiClient *Client) GetDeviceFromVolume(volume *model.Volume) (device *model.Device, err error)
GetDeviceFromVolume will return os device for given storage volume
func (*Client) GetDevices ¶
GetDevices will return all the OS devices on the host
func (*Client) GetHostName ¶
GetHostName returns hostname and domain name of given host
func (*Client) GetInitiators ¶
GetInitiators will return host initiator list (WWPNs in case of FC)
func (*Client) GetNetworks ¶
func (chapiClient *Client) GetNetworks() (networks []*model.NetworkInterface, err error)
GetNetworks return list of host network interface details
func (*Client) MountFilesystem ¶
MountFilesystem calls POST on mounts for chapi to mount volume on host
func (*Client) OfflineDevice ¶
OfflineDevice : offline the device in preparation of removing ACL to avoid race-condition to be discovered again
func (*Client) SetupFilesystemAndPermissions ¶
func (chapiClient *Client) SetupFilesystemAndPermissions(device *model.Device, vol *model.Volume, filesystem string) error
SetupFilesystemAndPermissions creates filesystem and applies permissions if present
type Driver ¶
type Driver interface { GetHosts() (*model.Hosts, error) GetHostInfo() (*model.Host, error) GetHostInitiators() ([]*model.Initiator, error) GetHostNetworks() ([]*model.NetworkInterface, error) GetHostNameAndDomain() ([]string, error) CreateDevices(volumes []*model.Volume) ([]*model.Device, error) GetDevice(volume *model.Volume) (*model.Device, error) DeleteDevice(device *model.Device) error OfflineDevice(device *model.Device) error MountDevice(device *model.Device, mountPoint string, mountOptions []string, fsOpts *model.FilesystemOpts) (*model.Mount, error) // Idempotent MountNFSVolume(source string, target string, mountOptions []string, nfsType string) error // Idempotent BindMount(mountPoint string, newMountPoint string, rbind bool) error // Idempotent BindUnmount(mountPoint string) error // Idempotent UnmountDevice(device *model.Device, mountPoint string) (*model.Mount, error) // Idempotent UnmountFileSystem(mountPoint string) (*model.Mount, error) // Idempotent GetMounts(serialNumber string) ([]*model.Mount, error) GetMountsForDevice(device *model.Device) ([]*model.Mount, error) ExpandDevice(targetPath string, volAccessType model.VolumeAccessType) error IsBlockDevice(devicePath string) (bool, error) GetBlockSizeBytes(devicePath string) (int64, error) }
Driver provides a common interface for host related operations
type ErrorResponse ¶
type ErrorResponse struct {
Info string `json:"info,omitempty"`
}
ErrorResponse struct
type FakeDriver ¶
type FakeDriver struct { }
FakeDriver ... the name says it all
func (*FakeDriver) BindMount ¶
func (driver *FakeDriver) BindMount(mountPoint string, newMountPoint string, rbind bool) error
BindMount binds the existing mountpoint to another mountpoint
func (*FakeDriver) BindUnmount ¶
func (driver *FakeDriver) BindUnmount(mountPoint string) error
BindUnmount unmounts the given bind mount
func (*FakeDriver) CreateDevices ¶
CreateDevices will create devices on this host based on the volume details provided
func (*FakeDriver) CreateFilesystemOnDevice ¶
func (driver *FakeDriver) CreateFilesystemOnDevice(device *model.Device, filesytemType string) error
CreateFilesystemOnDevice writes the given filesystem to the device with the given serial number
func (*FakeDriver) DeleteDevice ¶
func (driver *FakeDriver) DeleteDevice(device *model.Device) error
DeleteDevice will delete the given device from the host
func (*FakeDriver) ExpandDevice ¶
func (driver *FakeDriver) ExpandDevice(targetPath string, volAccessType model.VolumeAccessType) error
ExpandDevice will expand the given device/filesystem on the host
func (*FakeDriver) GetBlockSizeBytes ¶
func (driver *FakeDriver) GetBlockSizeBytes(devicePath string) (int64, error)
GetBlockSizeBytes returns the size of the block device
func (*FakeDriver) GetFilesystemOptionsFromDevice ¶
func (driver *FakeDriver) GetFilesystemOptionsFromDevice(device *model.Device, mountPoint string) (*model.FilesystemOpts, error)
GetFilesystemOptionsFromDevice retrieves the filesystem options from the filesystem on the device
func (*FakeDriver) GetHostInfo ¶
func (driver *FakeDriver) GetHostInfo() (*model.Host, error)
GetHostInfo returns host name, domain, and network interfaces
func (*FakeDriver) GetHostInitiators ¶
func (driver *FakeDriver) GetHostInitiators() ([]*model.Initiator, error)
GetHostInitiators reports the initiators on this host
func (*FakeDriver) GetHostNameAndDomain ¶
func (driver *FakeDriver) GetHostNameAndDomain() ([]string, error)
GetHostNameAndDomain reports the host name and domain
func (*FakeDriver) GetHostNetworks ¶
func (driver *FakeDriver) GetHostNetworks() ([]*model.NetworkInterface, error)
GetHostNetworks reports the networks on this host
func (*FakeDriver) GetHosts ¶
func (driver *FakeDriver) GetHosts() (*model.Hosts, error)
GetHosts returns information about this host within an array. Not sure why but we should probably fix that.
func (*FakeDriver) GetMountOptions ¶
func (driver *FakeDriver) GetMountOptions(device *model.Device, mountPoint string) ([]string, error)
GetMountOptions retrieves the mount options of the mountpoint of the device
func (*FakeDriver) GetMounts ¶
func (driver *FakeDriver) GetMounts(serialNumber string) ([]*model.Mount, error)
GetMounts reports all mounts on this host
func (*FakeDriver) GetMountsForDevice ¶
GetMountsForDevice reports all mounts for the device on this host
func (*FakeDriver) IsBlockDevice ¶
func (driver *FakeDriver) IsBlockDevice(devicePath string) (bool, error)
IsBlockDevice will check if the given path is a block device
func (*FakeDriver) MountDevice ¶
func (driver *FakeDriver) MountDevice(device *model.Device, mountPoint string, options []string, fsOpts *model.FilesystemOpts) (*model.Mount, error)
MountDevice mounts the given device to the given mount point
func (*FakeDriver) MountNFSVolume ¶
func (driver *FakeDriver) MountNFSVolume(source string, targetPath string, mountOptions []string, nfsType string) error
MountNFSVolume mounts NFS share onto given target path
func (*FakeDriver) OfflineDevice ¶
func (driver *FakeDriver) OfflineDevice(device *model.Device) error
OfflineDevice will offline the given device from the host
func (*FakeDriver) SetFilesystemOptions ¶
func (driver *FakeDriver) SetFilesystemOptions(mountPoint string, fsOpts *model.FilesystemOpts) error
SetFilesystemOptions applies given filesystem options to the filesystem on the device
func (*FakeDriver) SetMountOptions ¶
func (driver *FakeDriver) SetMountOptions(device *model.Device, mountPoint string, options []string) error
SetMountOptions applies the mount options to the mountpoint of the device
func (*FakeDriver) UnmountDevice ¶
func (driver *FakeDriver) UnmountDevice(device *model.Device, mountPoint string) (*model.Mount, error)
UnmountDevice unmounts the given device from the given mount point
func (*FakeDriver) UnmountFileSystem ¶
func (driver *FakeDriver) UnmountFileSystem(mountPoint string) (*model.Mount, error)
UnmountFileSystem will unmount the given mount point
type LinuxDriver ¶
type LinuxDriver struct { }
LinuxDriver ... Linux implementation of the CHAPI driver
func (*LinuxDriver) BindMount ¶
func (driver *LinuxDriver) BindMount(mountPoint string, newMountPoint string, rbind bool) error
BindMount bind mounts the existing mountpoint to the given mount point
func (*LinuxDriver) BindUnmount ¶
func (driver *LinuxDriver) BindUnmount(mountPoint string) error
BindUnmount unmounts the given bind mount
func (*LinuxDriver) CreateDevices ¶
CreateDevices will create devices on this host based on the volume details provided
func (*LinuxDriver) CreateFilesystemOnDevice ¶
func (driver *LinuxDriver) CreateFilesystemOnDevice(device *model.Device, filesystemType string) error
CreateFilesystemOnDevice writes the given filesystem on the given device
func (*LinuxDriver) DeleteDevice ¶
func (driver *LinuxDriver) DeleteDevice(device *model.Device) error
DeleteDevice will delete the given device from the host
func (*LinuxDriver) ExpandDevice ¶
func (driver *LinuxDriver) ExpandDevice(targetPath string, volAccessType model.VolumeAccessType) error
ExpandDevice will expand the given device/filesystem on the host
func (*LinuxDriver) GetBlockSizeBytes ¶
func (driver *LinuxDriver) GetBlockSizeBytes(devicePath string) (int64, error)
GetBlockSizeBytes returns the size of the block device
func (*LinuxDriver) GetFilesystemFromDevice ¶
func (driver *LinuxDriver) GetFilesystemFromDevice(device *model.Device) (*model.FilesystemOpts, error)
GetFilesystemFromDevice writes the given filesystem on the given device
func (*LinuxDriver) GetHostInfo ¶
func (driver *LinuxDriver) GetHostInfo() (*model.Host, error)
GetHostInfo returns host name, domain, and network interfaces
func (*LinuxDriver) GetHostInitiators ¶
func (driver *LinuxDriver) GetHostInitiators() ([]*model.Initiator, error)
GetHostInitiators reports the initiators on this host
func (*LinuxDriver) GetHostNameAndDomain ¶
func (driver *LinuxDriver) GetHostNameAndDomain() ([]string, error)
GetHostNameAndDomain reports the host name and domain
func (*LinuxDriver) GetHostNetworks ¶
func (driver *LinuxDriver) GetHostNetworks() ([]*model.NetworkInterface, error)
GetHostNetworks reports the networks on this host
func (*LinuxDriver) GetHosts ¶
func (driver *LinuxDriver) GetHosts() (*model.Hosts, error)
GetHosts returns information about this host within an array. Not sure why but we should probably fix that.
func (*LinuxDriver) GetMounts ¶
func (driver *LinuxDriver) GetMounts(serialNumber string) ([]*model.Mount, error)
GetMounts reports all mounts on this host
func (*LinuxDriver) GetMountsForDevice ¶
GetMountsForDevice reports all mounts for the given device on the host
func (*LinuxDriver) IsBlockDevice ¶
func (driver *LinuxDriver) IsBlockDevice(devicePath string) (bool, error)
IsBlockDevice will check if the given path is a block device
func (*LinuxDriver) MountDevice ¶
func (driver *LinuxDriver) MountDevice(device *model.Device, mountPoint string, mountOptions []string, fsOpts *model.FilesystemOpts) (*model.Mount, error)
MountDevice mounts the given device to the given mount point. This must be idempotent.
func (*LinuxDriver) MountNFSVolume ¶
func (*LinuxDriver) OfflineDevice ¶
func (driver *LinuxDriver) OfflineDevice(device *model.Device) error
OfflineDevice will offline the given device from the host
func (*LinuxDriver) SetFilesystemOptions ¶
func (driver *LinuxDriver) SetFilesystemOptions(mountPoint string, options *model.FilesystemOpts) error
SetFilesystemOptions applies the given FS options on the filesystem of the device
func (*LinuxDriver) UnmountDevice ¶
func (driver *LinuxDriver) UnmountDevice(device *model.Device, mountPoint string) (*model.Mount, error)
UnmountDevice unmounts the given device from the given mount point
func (*LinuxDriver) UnmountFileSystem ¶
func (driver *LinuxDriver) UnmountFileSystem(mountPoint string) (*model.Mount, error)
UnmountFileSystem will unmount the given mount point