HPELeftHand REST Client
| Author: | Kurt Martin |
|---|---|
| Description: | This is the LeftHand/StoreVirtual Client that talks to the |
LeftHand OS REST Service. This version also supports running actions on the LeftHand that use SSH.
This client requires and works with version 11.5 of the LeftHand firmware
This is useful for debugging requests to LeftHand
| Parameters: | flag (bool) – set to True to enable debugging |
|---|
This authenticates against the LH OS REST server and creates a session.
| Parameters: |
|
|---|---|
| Returns: | None |
Get information about a Cluster
| Parameters: | cluster_id (str) – The id of the cluster to find |
|---|---|
| Returns: | cluster |
Get information about a cluster by name
| Parameters: | name (str) – The name of the cluster to find |
|---|---|
| Returns: | cluster |
| Raises: | HTTPNotFound - NON_EXISTENT_CLUSTER - cluster doesn’t exist |
Get information about a server
| Parameters: | server_id (str) – The id of the server to find |
|---|---|
| Returns: | server |
| Raises: | HTTPServerError |
Get information about a server by name
| Parameters: | name (str) – The name of the server to find |
|---|---|
| Returns: | server |
| Raises: | HTTPNotFound - NON_EXISTENT_SERVER - server doesn’t exist |
Create a server by name
| Parameters: |
|
|---|
optional = {
'description' : "some comment",
'iscsiEnabled' : True,
'chapName': "some chap name",
'chapAuthenticationRequired': False,
'chapInitiatorSecret': "initiator secret",
'chapTargetSecret': "target secret",
'iscsiLoadBalancingEnabled': True,
'controllingServerName': "server name",
'fibreChannelEnabled': False,
'inServerCluster": True
}
| Returns: | server |
|---|---|
| Raises: | HTTPNotFound - NON_EXISTENT_SERVER - server doesn’t exist |
Delete a Server
| Parameters: | server_id – the server ID to delete |
|---|---|
| Raises: | HTTPNotFound - NON_EXISTENT_SERVER - The server does not exist |
Get information about a Snapshot
| Returns: | snapshot |
|---|---|
| Raises: | HTTPServerError |
Get information about a snapshot by name
| Parameters: | name – The name of the snapshot to find |
|---|---|
| Returns: | volume |
| Raises: | HTTPNotFound - NON_EXISTENT_SNAP - shapshot doesn’t exist |
Get the parent volume for a Snapshot
| Parameters: | name (str) – The name of the snapshot |
|---|---|
| Returns: | parent volume |
| Raises: | HTTPNotFound - Snapshot not found. |
| Raises: | HTTPNotFound - NON_EXISTENT_VOL - volume doesn’t exist |
Create a snapshot of an existing Volume
| Parameters: |
|
|---|
optional = {
'description' : "some comment",
'inheritAccess' : false
}
Delete a Snapshot
| Parameters: | snapshot_id – the snapshot ID to delete |
|---|---|
| Raises: | HTTPNotFound - NON_EXISTENT_SNAPSHOT - The snapshot does not exist |
Create a clone of an existing Shapshot
| Parameters: |
|
|---|
optional = {
'description' : "some comment"
}
Modify an existing snapshot.
| Parameters: |
|
|---|---|
| Returns: | snapshot |
| Raises: | HTTPServerError - SNAPSHOT_ID_NOT_FOUND - snapshot doesn’t exist |
Get the list of Volumes
| Parameters: |
|
|---|---|
| Returns: | list of Volumes |
Get information about a volume
| Parameters: |
|
|---|---|
| Returns: | volume |
| Raises: | HTTPNotFound - NON_EXISTENT_VOL - volume doesn’t exist |
Get information about a volume by name
| Parameters: | name (str) – The name of the volume to find |
|---|---|
| Returns: | volume |
| Raises: | HTTPNotFound - NON_EXISTENT_VOL - volume doesn’t exist |
Find volumes that are exported to a server.
| Parameters: | server_name (str) – The name of the server to search. |
|---|---|
| Returns: | A list of volumes that are on the specified server. |
Create a new volume
| Parameters: |
|
|---|
optional = {
'description': 'some comment',
'isThinProvisioned': 'true',
'autogrowSeconds': 200,
'clusterName': 'somename',
'isAdaptiveOptimizationEnabled': 'true',
'dataProtectionLevel': 2,
}
| Returns: | List of Volumes |
|---|---|
| Raises: | HTTPConflict - EXISTENT_SV - Volume Exists already |
Delete a volume
| Parameters: | name (str) – the name of the volume |
|---|---|
| Raises: | HTTPNotFound - NON_EXISTENT_VOL - The volume does not exist |
Modify an existing volume.
| Parameters: | volume_id (str) – The id of the volume to find |
|---|---|
| Returns: | volume |
| Raises: | HTTPNotFound - NON_EXISTENT_VOL - volume doesn’t exist |
Create a clone of an existing Volume
| Parameters: |
|
|---|
optional = {
'description' : "some comment"
}
Assign a Volume to a Server
| Parameters: |
|
|---|
optional = {
'Transport' : 0,
'Lun' : 1,
}
Unassign a Volume from a Server
| Parameters: |
|
|---|
Make a volume remote. This command is issued against a secondary cluster and tells a volume it is associated to a primary volume on another system,
| Parameters: |
|
|---|
Make a remote volume a priamry volume. This command is issued against a secondary array to make a volume primary again. After a failover, this is needed to attach the volume.
| Parameters: | name (str) – Name of the volume |
|---|
Creates a remote snapshot schedule. This command is run on the primary system and effectively creates asynchronous periodic replication between two arrays.
| Parameters: |
|
|---|
Deletes and existing remote snapshot schedule.
| Parameters: | name (str) – Name of the remote snapshot schedule. |
|---|
Retrieves remote snapshot schedule information
| Parameters: | name (str) – Name of the remote snapshot schedule. |
|---|---|
| Returns: | Command output with the remote snapshot schedule information. |
Stops a remote snapshot schedule
| Parameters: | name (str) – Name of the remote snapshot schedule. |
|---|
Starts a remote snapshot schedule
| Parameters: | name (str) – Name of the remote snapshot schedule. |
|---|
Determines if a remote snapshot schedule exists.
| Parameters: | name (str) – Name of the remote snapshot schedule. |
|---|---|
| Returns: | Whether or not a remote snapshot schedule exists. |
Given a cluster name, this will return the first IP address in the cluster. The main use case for this is to create remote snapshot schedules, considering the VIP cannot be provided; an individual node IP is required.
| Parameters: | cluster_name (str) – The cluster name |
|---|---|
| Returns: | IP address of a node in the cluster |