Documentation
¶
Index ¶
- Constants
- type AccessInfo
- type BlockDeviceAccessInfo
- type ChapInfo
- type Device
- type DevicePartition
- type DeviceState
- type FcHostPort
- type FcSession
- type FilesystemOpts
- type Host
- type HostUUID
- type Hosts
- type Iface
- type Initiator
- type IscsiAccessInfo
- type IscsiSession
- type IscsiTarget
- type IscsiTargets
- type KeyValue
- type Mount
- type NetworkInterface
- type Node
- type PathInfo
- type PublishInfo
- type PublishOptions
- type SecondaryBackendDetails
- type SecondaryLunInfo
- type Snapshot
- type SnapshotGroup
- type Token
- type VirtualDeviceAccessInfo
- type Volume
- type VolumeAccessType
- type VolumeGroup
Constants ¶
const ( // FsCreateOpt filesystem create type FsCreateOpt = "filesystem" // FsModeOpt filesystem mode option FsModeOpt = "fsMode" // FsOwnerOpt filesystem owner option FsOwnerOpt = "fsOwner" )
const ( // VolumeScope scope of the device is volume VolumeScope targetScope = 1 // GroupScope scope of the device is group GroupScope targetScope = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessInfo ¶
type AccessInfo struct {
BlockDeviceAccessInfo
VirtualDeviceAccessInfo
}
AccessInfo describes the various ways a volume can be accessed
type BlockDeviceAccessInfo ¶
type BlockDeviceAccessInfo struct {
AccessProtocol string `json:"access_protocol,omitempty"`
TargetNames []string `json:"target_names,omitempty"`
LunID int32 `json:"lun_id,omitempty"`
SecondaryBackendDetails
IscsiAccessInfo
}
BlockDeviceAccessInfo contains the common fields for accessing a block device
type ChapInfo ¶
type ChapInfo struct {
Name string `json:"chap_user,omitempty"`
Password string `json:"chap_password,omitempty"`
}
ChapInfo : Host initiator CHAP credentials
type Device ¶
type Device struct {
VolumeID string `json:"volume_id,omitempty"`
Pathname string `json:"path_name,omitempty"`
LuksPathname string `json:"luks_path_name,omitempty"`
SerialNumber string `json:"serial_number,omitempty"`
Major string `json:"major,omitempty"`
Minor string `json:"minor,omitempty"`
AltFullPathName string `json:"alt_full_path_name,omitempty"`
AltFullLuksPathName string `json:"alt_full_luks_path_name,omitempty"`
MpathName string `json:"mpath_device_name,omitempty"`
Size int64 `json:"size,omitempty"` // size in MiB
Slaves []string `json:"slaves,omitempty"`
IscsiTargets []*IscsiTarget `json:"iscsi_target,omitempty"`
Hcils []string `json:"-"` // export it if needed
TargetScope string `json:"target_scope,omitempty"` //GST="group", VST="volume" or empty(older array fiji etc), and no-op for FC
State string `json:"state,omitempty"` // state of the device needed to verify the device is active
Filesystem string `json:"filesystem,omitempty"`
StorageVendor string `json:"storage_vendor,omitempty"` //3PARdata
}
Device struct
type DevicePartition ¶
type DevicePartition struct {
Name string `json:"name,omitempty"`
Partitiontype string `json:"partition_type,omitempty"`
Size int64 `json:"size,omitempty"`
}
DevicePartition Partition Info for a Device
type DeviceState ¶
type DeviceState int
DeviceState : various device states
const ( // FailedState : device is in in failed state FailedState DeviceState = iota // ActiveState : device is active and running and available for I/O ActiveState // Orphan : if the multipathd show paths shows them as orphan Orphan // LunIDConflict : When device has a different serial from inquiry and current vpd page LunIDConflict )
func (DeviceState) String ¶
func (e DeviceState) String() string
type FcHostPort ¶
FcHostPort FC host port
type FcSession ¶
type FcSession struct {
InitiatorWwpn string `json:"initiator_wwpn,omitempty"`
InitiatorWwpnLegacy string `json:"initiatorWwpn,omitempty"`
}
Workaround NOS 5.0.x vs 5.1.x responses with different case FcSession info
func (FcSession) InitiatorWwpnStr ¶
type FilesystemOpts ¶
FilesystemOpts to store fsType, fsMode, fsOwner options
func (FilesystemOpts) GetCreateOpts ¶
func (f FilesystemOpts) GetCreateOpts() []string
GetCreateOpts returns a clean array that can be passed to the command line
type Host ¶
type Host struct {
UUID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Domain string `json:"domain,omitempty"`
NodeID string `json:"node_id,omitempty"`
AccessProtocol string `json:"access_protocol,omitempty"`
NetworkInterfaces []*NetworkInterface `json:"networks,omitempty"`
Initiators []*Initiator `json:"initiators,omitempty"`
}
Host : provide host information
type Iface ¶
type Iface struct {
Name string
NetworkInterface *NetworkInterface
}
Iface represents iface configuring with port binding
type Initiator ¶
type Initiator struct {
Type string `json:"type,omitempty"`
Init []string `json:"initiator,omitempty"`
Chap *ChapInfo `json:"chap_info,omitempty"`
}
Initiator : Host initiator
type IscsiAccessInfo ¶
type IscsiAccessInfo struct {
DiscoveryIPs []string `json:"discovery_ips,omitempty"`
ChapUser string `json:"chap_user,omitempty"`
ChapPassword string `json:"chap_password,omitempty"`
}
IscsiAccessInfo contains the fields necessary for iSCSI access
type IscsiSession ¶
type IscsiSession struct {
InitiatorName string `json:"initiator_name,omitempty"`
InitiatorNameLegacy string `json:"initiatorName,omitempty"`
InitiatorIP string `json:"initiator_ip_addr,omitempty"`
}
IscsiSession info
func (IscsiSession) InitiatorNameStr ¶
func (s IscsiSession) InitiatorNameStr() string
type IscsiTarget ¶
type IscsiTarget struct {
Name string
Address string
Port string // 3260
Tag string // 2460
Scope string // GST or VST
}
IscsiTarget struct
type IscsiTargets ¶
type IscsiTargets []*IscsiTarget
IscsiTargets : array of pointers to IscsiTarget
type Mount ¶
type Mount struct {
ID string `json:"id,omitempty"`
Mountpoint string `json:"Mountpoint,omitempty"`
Options []string `json:"Options,omitempty"`
Device *Device `json:"device,omitempty"`
}
Mount struct ID data type is string
type NetworkInterface ¶
type NetworkInterface struct {
Name string `json:"name,omitempty"`
AddressV4 string `json:"address_v4,omitempty"`
MaskV4 string `json:"mask_v4,omitempty"`
BroadcastV4 string `json:",omitempty"`
Mac string `json:",omitempty"`
Mtu int64 `json:",omitempty"`
Up bool
CidrNetwork string
}
NetworkInterface : network interface info for host
type Node ¶
type Node struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
UUID string `json:"uuid,omitempty"`
Iqns []*string `json:"iqns,omitempty"`
Networks []*string `json:"networks,omitempty"`
Wwpns []*string `json:"wwpns,omitempty"`
ChapUser string `json:"chap_user,omitempty"`
ChapPassword string `json:"chap_password,omitempty"`
}
Node represents a host that would access volumes through the CSP
type PathInfo ¶
type PathInfo struct {
UUID string
Device string
DmState string
Hcil string
DevState string
ChkState string
Checker string
}
PathInfo :
type PublishInfo ¶
type PublishInfo struct {
SerialNumber string `json:"serial_number,omitempty"`
AccessInfo
}
PublishInfo is the node side data required to access a volume
type PublishOptions ¶
type PublishOptions struct {
HostUUID string `json:"host_uuid,omitempty"`
AccessProtocol string `json:"access_protocol,omitempty"`
}
PublishOptions are the options needed to publish a volume
type SecondaryBackendDetails ¶
type SecondaryBackendDetails struct {
PeerArrayDetails []*SecondaryLunInfo
}
Information of LUN id, IQN, discovery IP's the secondary array
type SecondaryLunInfo ¶
type SecondaryLunInfo struct {
LunID int32 `json:"lun_id,omitempty""`
TargetNames []string `json:"target_names,omitempty"`
IscsiAccessInfo
}
Information of the each secondary array
type Snapshot ¶
type Snapshot struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
VolumeID string `json:"volume_id,omitempty"`
VolumeName string `json:"volume_name,omitempty"`
Size int64 `json:"size,omitempty"`
CreationTime int64 `json:"creation_time,omitempty"`
ReadyToUse bool `json:"ready_to_use,omitempty"`
InUse bool `json:"in_use,omitempty"`
Config map[string]interface{} `json:"config,omitempty"`
}
Snapshot is a snapshot of a volume
type SnapshotGroup ¶
type SnapshotGroup struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
SourceVolumeGroupID string `json:"volume_group_id,omitempty"`
SourceVolumeGroupName string `json:"volume_group_name,omitempty"`
Snapshots []*Snapshot `json:"snapshots,omitempty"`
CreationTime int64 `json:"creation_time,omitempty"`
Config map[string]interface{} `json:"config,omitempty"`
}
type Token ¶
type Token struct {
ID string `json:"id,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
ArrayIP string `json:"array_ip,omityempty"`
SessionToken string `json:"session_token,omitempty"`
}
Token is the authentication token used to communicate with the CSP
type VirtualDeviceAccessInfo ¶
type VirtualDeviceAccessInfo struct {
}
VirtualDeviceAccessInfo contains the required data to access a virtual device
type Volume ¶
type Volume struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Size int64 `json:"size,omitempty"` // size in bytes
Description string `json:"description,omitempty"`
InUse bool `json:"in_use,omitempty"` // deprecated for published in the CSP implementation
Published bool `json:"published,omitempty"`
BaseSnapID string `json:"base_snapshot_id,omitempty"`
ParentVolID string `json:"parent_volume_id,omitempty"`
Clone bool `json:"clone,omitempty"`
Config map[string]interface{} `json:"config,omitempty"`
Metadata []*KeyValue `json:"metadata,omitempty"`
SerialNumber string `json:"serial_number,omitempty"`
AccessProtocol string `json:"access_protocol,omitempty"`
Iqn string `json:"iqn,omitempty"` // deprecated
Iqns []string `json:"iqns,omitempty"`
DiscoveryIP string `json:"discovery_ip,omitempty"` // deprecated
DiscoveryIPs []string `json:"discovery_ips,omitempty"`
MountPoint string `json:"Mountpoint,omitempty"`
Status map[string]interface{} `json:"status,omitempty"` // interface so that we can map any number of arguments
Chap *ChapInfo `json:"chap_info,omitempty"`
Networks []*NetworkInterface `json:"networks,omitempty"`
ConnectionMode string `json:"connection_mode,omitempty"`
LunID string `json:"lun_id,omitempty"`
TargetScope string `json:"target_scope,omitempty"` //GST="group", VST="volume" or empty(older array fiji etc), and no-op for FC
IscsiSessions []*IscsiSession `json:"iscsi_sessions,omitempty"`
FcSessions []*FcSession `json:"fc_sessions,omitempty"`
VolumeGroupId string `json:"volume_group_id"`
SecondaryArrayDetails string `json:"secondary_array_details,omitempty"`
UsedBytes int64 `json:"used_bytes,omitempty"`
FreeBytes int64 `json:"free_bytes,omitempty"`
EncryptionKey string `json:"encryption_key,omitempty"`
}
Volume : Thin version of Volume object for Host side
func (Volume) TargetNames ¶
type VolumeAccessType ¶
type VolumeAccessType int
VolumeAccessType : Type of volume access (block, mount)
const ( // BlockType volume access BlockType VolumeAccessType = 1 // MountType volume access MountType VolumeAccessType = 2 // UnknownType volume access UnknownType )
func (VolumeAccessType) String ¶
func (e VolumeAccessType) String() string