Documentation ¶
Index ¶
- Constants
- func AddSystem(url string, client *Client) error
- func CreateCommonStatus(logger logr.Logger, response *[]client.StatusResourceInner) *common.ResponseStatus
- func GetPoolType(system *common.SystemInfo, pool string) (string, error)
- func GetPortals(system *common.SystemInfo) (string, error)
- func GetSystem(url string) (*common.SystemInfo, error)
- func GetTargetId(system *common.SystemInfo, portType string) (string, error)
- func Log(system *common.SystemInfo) error
- func UpdateVolumeObject(target *common.VolumeObject, source *client.VolumesResourceInner)
- type Client
- func (client *Client) CheckVolumeExists(volumeId string, size int64) (bool, error)
- func (client *Client) CopyVolume(sourceName string, destinationName string, pool string) (*common.ResponseStatus, error)
- func (client *Client) CreateNickname(name, iqn string) (*common.ResponseStatus, error)
- func (client *Client) CreateSnapshot(volumeName string, snapshotName string) (*common.ResponseStatus, error)
- func (client *Client) CreateVolume(name, size, pool string) (*common.VolumeObject, *common.ResponseStatus, error)
- func (client *Client) DeleteSnapshot(name string) (*common.ResponseStatus, error)
- func (client *Client) DeleteVolume(name string) (*common.ResponseStatus, error)
- func (client *Client) ExpandVolume(name, size string) (*common.ResponseStatus, error)
- func (client *Client) GetPoolType(pool string) (string, error)
- func (client *Client) GetPortals() (string, error)
- func (client *Client) GetVolumeMapsHostNames(name string) ([]string, *common.ResponseStatus, error)
- func (client *Client) GetVolumeWwn(volumeName string) (string, error)
- func (client *Client) InitSystemInfo() error
- func (client *Client) Login(ctx context.Context) error
- func (client *Client) Logout() error
- func (client *Client) MapVolume(name, initiator, access string, lun int) (*common.ResponseStatus, error)
- func (client *Client) PublishVolume(volumeId string, initiators []string) (string, error)
- func (client *Client) SessionValid(addr, username string) booldeprecated
- func (client *Client) ShowHostMaps(host string) ([]Volume, *common.ResponseStatus, error)
- func (client *Client) ShowSnapshots(snapshotId string, sourceVolumeId string) ([]common.SnapshotObject, *common.ResponseStatus, error)
- func (client *Client) ShowVolumes(volume string) ([]common.VolumeObject, *common.ResponseStatus, error)
- func (client *Client) StoreCredentials(addr string, protocol string, username string, password string)
- func (client *Client) UnmapVolume(name, initiator string) (*common.ResponseStatus, error)
- type Volume
- type Volumes
Constants ¶
const ( ApiMaximumLUN = 255 ApiTierAffinity = "no-affinity" ApiSuccess = 0 ApiError = 1 ApiInfo = 2 ApiWarning = 3 )
Variables ¶
This section is empty.
Functions ¶
func CreateCommonStatus ¶
func CreateCommonStatus(logger logr.Logger, response *[]client.StatusResourceInner) *common.ResponseStatus
CreateCommonStatus : create a common API status object based on the OpenAPI client response
func GetPoolType ¶
func GetPoolType(system *common.SystemInfo, pool string) (string, error)
GetPoolType: Return the pool type for a given pool
func GetPortals ¶
func GetPortals(system *common.SystemInfo) (string, error)
GetPortals: Return a list of iSCSI portals for the storage system
func GetSystem ¶
func GetSystem(url string) (*common.SystemInfo, error)
GetSystem: Return the System data object corresponding to the IP Address
func GetTargetId ¶
func GetTargetId(system *common.SystemInfo, portType string) (string, error)
GetTargetId: Return the target id value for this storage system
func Log ¶
func Log(system *common.SystemInfo) error
Log: Display the contents of all system information collected
func UpdateVolumeObject ¶
func UpdateVolumeObject(target *common.VolumeObject, source *client.VolumesResourceInner)
UpdateVolumeObject: transfer results to the common Volume object
Types ¶
type Client ¶
type Client struct { Ctx context.Context Username string Password string Addr string Protocol string HTTPClient http.Client Collector *common.Collector SessionKey string Initiator []string PoolName string Info *common.SystemInfo // contains filtered or unexported fields }
Client : Can be used to request the API
func NewClient ¶
func NewClient() *Client
NewClient : Creates an API client by setting up its HTTP transport
func (*Client) CheckVolumeExists ¶
CheckVolumeExists: Return true if a volume already exists
func (*Client) CopyVolume ¶
func (client *Client) CopyVolume(sourceName string, destinationName string, pool string) (*common.ResponseStatus, error)
CopyVolume : create an new volume by copying another one or a snapshot
func (*Client) CreateNickname ¶
func (client *Client) CreateNickname(name, iqn string) (*common.ResponseStatus, error)
CreateNickname : Create a nickname for an initiator. The Storage API policy is to prohibit mapping of initiators which are not either (a) presently connected to the array or (b) represented by an entry in the initiator nickname table.
func (*Client) CreateSnapshot ¶
func (client *Client) CreateSnapshot(volumeName string, snapshotName string) (*common.ResponseStatus, error)
CreateSnapshot : create a snapshot in a snap pool and the snap pool if it doesn't already exist
func (*Client) CreateVolume ¶
func (client *Client) CreateVolume(name, size, pool string) (*common.VolumeObject, *common.ResponseStatus, error)
CreateVolume : creates a volume with the given name, capacity in the given pool
func (*Client) DeleteSnapshot ¶
func (client *Client) DeleteSnapshot(name string) (*common.ResponseStatus, error)
DeleteSnapshot : delete a snapshot
func (*Client) DeleteVolume ¶
func (client *Client) DeleteVolume(name string) (*common.ResponseStatus, error)
DeleteVolume : deletes a volume
func (*Client) ExpandVolume ¶
func (client *Client) ExpandVolume(name, size string) (*common.ResponseStatus, error)
ExpandVolume : extend a volume if there is enough space in the disk group
func (*Client) GetPoolType ¶ added in v2.0.2
GetPoolType: Return the pool type of the storage system
func (*Client) GetPortals ¶
GetPortals: Return a list of portals for the storage system
func (*Client) GetVolumeMapsHostNames ¶
GetVolumeMapsHostNames: Use /show/maps to retrieve host names
func (*Client) GetVolumeWwn ¶
GetVolumeWwn: Retrieve the WWN for a volume, very useful for host operating system device mapping
func (*Client) InitSystemInfo ¶
InitSystemInfo: Retrieve and store system information for this client
func (*Client) MapVolume ¶
func (client *Client) MapVolume(name, initiator, access string, lun int) (*common.ResponseStatus, error)
MapVolume : map a volume to an initiator using a specified LUN
func (*Client) PublishVolume ¶
PublishVolume: Attach a volume to an initiator
func (*Client) SessionValid
deprecated
SessionValid : Determine if a session is valid, if not a login is required Makes the 'show controller-date' API call to validate the session is still valid
Deprecated: This function will be made redundant by retry logic in a future update
func (*Client) ShowHostMaps ¶
ShowHostMaps: list the volume mappings for given host. If host is an empty string, mapping for all hosts is shown
func (*Client) ShowSnapshots ¶
func (client *Client) ShowSnapshots(snapshotId string, sourceVolumeId string) ([]common.SnapshotObject, *common.ResponseStatus, error)
ShowSnapshots : Show one snaphot, or all snapshots, or all snapshots for a volume
func (*Client) ShowVolumes ¶
func (client *Client) ShowVolumes(volume string) ([]common.VolumeObject, *common.ResponseStatus, error)
ShowVolumes : get information about volumes
func (*Client) StoreCredentials ¶
func (client *Client) StoreCredentials(addr string, protocol string, username string, password string)
StoreCredentials : Called to store ip address, username, and password for the client
func (*Client) UnmapVolume ¶
func (client *Client) UnmapVolume(name, initiator string) (*common.ResponseStatus, error)
UnmapVolume : unmap a volume from an initiator