hpeOneView.resources.storage package
Submodules
hpeOneView.resources.storage.drive_enclosures module
hpeOneView.resources.storage.sas_logical_jbod_attachments module
hpeOneView.resources.storage.sas_logical_jbods module
hpeOneView.resources.storage.storage_pools module
- class hpeOneView.resources.storage.storage_pools.StoragePools(connection, data=None)[source]
Bases:
Resource
Storage Pools API client.
- URI = '/rest/storage-pools'
- add(resource, timeout=-1)[source]
Adds storage pool for management by the appliance.
- Parameters
resource (dict) – Object to create
timeout – Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation in OneView; it just stops waiting for its completion.
- Returns
Created storage pool.
- Return type
dict
- get_reachable_storage_pools(start=0, count=-1, filter='', query='', sort='', networks=None, scope_exclusions=None, scope_uris='')[source]
Gets the storage pools that are connected on the specified networks based on the storage system port’s expected network connectivity.
- Parameters
start – The first item to return, using 0-based indexing. If not specified, the default is 0 - start with the first available item.
count – The number of resources to return. A count of -1 requests all items. The actual number of items in the response might differ from the requested count if the sum of start and count exceeds the total number of items.
filter – A general filter/query string to narrow the list of items returned. The default is no filter - all resources are returned.
sort – The sort order of the returned data set. By default, the sort order is based on create time with the oldest entry first.
query – A general query string to narrow the list of resources returned. The default is no query - all resources are returned.
networks – Specifies the comma-separated list of network URIs used by the reachable storage pools.
scope_exclusions – Specifies the comma-separated list of storage-pools URIs that will be excluded from the scope validation checks.
scope_uris – Specifies the comma-separated list of scope URIs used by the reachable storage pools.
- Returns
Reachable Storage Pools List.
- Return type
list
- remove(force=False, timeout=-1)[source]
Removes an imported storage pool from OneView.
- Parameters
resource (dict) – Object to remove.
force (bool) – If set to true, the operation completes despite any problems with network connectivity or errors on the resource itself. The default is false.
timeout – Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation in OneView; it just stops waiting for its completion.
- Returns
Details of associated resource.
- Return type
dict
hpeOneView.resources.storage.storage_systems module
- class hpeOneView.resources.storage.storage_systems.StorageSystems(connection, data=None)[source]
Bases:
Resource
Storage Systems API client.
- URI = '/rest/storage-systems'
- add(resource, timeout=-1)[source]
Adds a storage system for management by the appliance. The storage system resource created will be in a Connected state and will not yet be available for further operations. Users are required to perform a PUT API on the storage system resource to complete the management of the storage system resource. An asynchronous task will be created as a result of this API call to discover available domains, target ports, and storage pools.
- Parameters
resource (dict) – Object to create.
timeout – Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation in OneView; it just stops waiting for its completion.
- Returns
Created storage system.
- Return type
dict
- get_by_hostname(hostname)[source]
Retrieve a storage system by its hostname.
Works only in API500 onwards.
- Parameters
hostname – Storage system hostname.
- Returns
dict
- get_by_ip_hostname(ip_hostname)[source]
Retrieve a storage system by its IP.
Works only with API version <= 300.
- Parameters
ip_hostname – Storage system IP or hostname.
- Returns
dict
- get_host_types()[source]
Gets the list of supported host types.
- Returns
Host types.
- Return type
list
- get_managed_ports(port_id_or_uri='')[source]
Gets all ports or a specific managed target port for the specified storage system.
- Parameters
port_id_or_uri – Can be either the port id or the port uri.
- Returns
Managed ports.
- Return type
dict
- get_reachable_ports(start=0, count=-1, filter='', query='', sort='', networks=[])[source]
Gets the storage ports that are connected on the specified networks based on the storage system port’s expected network connectivity.
- Returns
Reachable Storage Port List.
- Return type
list
- get_storage_pools()[source]
Gets a list of Storage pools. Returns a list of storage pools belonging to the storage system referred by the Path property {ID} parameter or URI.
- Returns
Host types.
- Return type
dict
- get_templates(start=0, count=-1, filter='', query='', sort='')[source]
Gets a list of volume templates. Returns a list of storage templates belonging to the storage system.
- Returns
Storage Template List.
- Return type
list
- remove(force=False, timeout=-1)[source]
Removes the storage system from OneView.
- Parameters
force (bool) – If set to true, the operation completes despite any problems with network connectivity or errors on the resource itself. The default is false.
timeout – Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation in OneView; it just stops waiting for its completion.
- Returns
Details of associated resource.
- Return type
dict
hpeOneView.resources.storage.storage_volume_attachments module
- class hpeOneView.resources.storage.storage_volume_attachments.StorageVolumeAttachments(connection, data=None)[source]
Bases:
Resource
Storage Volume Attachments API client.
- URI = '/rest/storage-volume-attachments'
- get_extra_unmanaged_storage_volumes(start=0, count=-1, filter='', sort='')[source]
Gets the list of extra unmanaged storage volumes.
- Parameters
start – The first item to return, using 0-based indexing. If not specified, the default is 0 - start with the first available item.
count – The number of resources to return. A count of -1 requests all items. The actual number of items in the response might differ from the requested count if the sum of start and count exceeds the total number of items.
filter (list or str) – A general filter/query string to narrow the list of items returned. The default is no filter; all resources are returned.
sort – The sort order of the returned data set. By default, the sort order is based on create time with the oldest entry first.
- Returns
Extra unmanaged storage volumes.
- Return type
list
- get_paths(path_id='')[source]
Gets all paths or a specific attachment path for the specified volume attachment.
- Parameters
path_id – path id
- Returns
Paths.
- Return type
dict
- remove_extra_presentations(resource, timeout=-1)[source]
Removes extra presentations from a specified server profile.
- Parameters
resource (dict) – Object to create
timeout – Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation in OneView; it just stops waiting for its completion.
- Returns
Associated storage attachment resource.
- Return type
dict
hpeOneView.resources.storage.storage_volume_templates module
- class hpeOneView.resources.storage.storage_volume_templates.StorageVolumeTemplates(connection, data=None)[source]
Bases:
Resource
Storage Volume Templates API client.
- DEFAULT_VALUES = {'200': {'type': 'StorageVolumeTemplateV3'}, '300': {'type': 'StorageVolumeTemplateV3'}}
- URI = '/rest/storage-volume-templates'
- delete(force=False, timeout=-1)[source]
Deletes the specified storage volume template.
- Parameters
force (bool) – If set to true, the operation completes despite any problems with network connectivity or errors on the resource itself. The default is false.
timeout – Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation in OneView; it just stops waiting for its completion.
- Returns
Indicates if the resource was successfully deleted.
- Return type
bool
- get_compatible_systems()[source]
Retrieves a collection of all storage systems that is applicable to this storage volume template.
- Returns
Storage systems.
- Return type
list
- get_connectable_volume_templates(start=0, count=-1, filter='', query='', sort='')[source]
Gets the storage volume templates that are available on the specified networks based on the storage system port’s expected network connectivity. If there are no storage volume templates that meet the specified connectivity criteria, an empty collection will be returned.
- Returns
Storage volume templates.
- Return type
list
- get_reachable_volume_templates(start=0, count=-1, filter='', query='', sort='', networks=None, scope_uris='', private_allowed_only=False)[source]
Gets the storage templates that are connected on the specified networks based on the storage system port’s expected network connectivity.
- Returns
Storage volume templates.
- Return type
list
hpeOneView.resources.storage.volumes module
- class hpeOneView.resources.storage.volumes.VolumeSnapshots(connection, data=None, volume_uri=None, snapshot_id=None)[source]
Bases:
Resource
Volume snapshots API client.
- DEFAULT_VALUES = {'200': {'type': 'Snapshot'}, '300': {'type': 'Snapshot'}, '500': {}}
- create(data=None, timeout=-1, custom_headers=None, force=False)[source]
Makes a POST request to create a resource when a request body is required.
- Parameters
data – Additional fields can be passed to create the resource.
timeout – Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation in OneView; it just stops waiting for its completion.
custom_headers – Allows set specific HTTP headers.
- Returns
Created resource.
- delete(force=False, timeout=-1)[source]
Deletes a snapshot from OneView and the storage system.
- Parameters
force (bool) – If set to true, the operation completes despite any problems with network connectivity or errors on the resource itself. The default is false.
timeout – Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation in OneView; it just stops waiting for its completion.
- Returns
Details of associated volume.
- Return type
dict
- class hpeOneView.resources.storage.volumes.Volumes(connection, data=None)[source]
Bases:
Resource
Volumes API client.
- URI = '/rest/storage-volumes'
- add_from_existing(resource, timeout=-1)[source]
Adds a volume that already exists in the Storage system
- Parameters
resource (dict) – Object to create.
timeout – Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation in OneView, just stop waiting for its completion.
- Returns
Added resource.
- Return type
dict
- create_from_snapshot(data, timeout=-1)[source]
Creates a new volume on the storage system from a snapshot of a volume. A volume template must also be specified when creating a volume from a snapshot.
The global setting “StorageVolumeTemplateRequired” controls whether or not root volume templates can be used to provision volumes. The value of this setting defaults to “false”. If the value is set to “true”, then only templates with an “isRoot” value of “false” can be used to provision a volume.
- Parameters
data (dict) – Object to create.
timeout – Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation in OneView, just stop waiting for its completion.
- Returns
Created data.
- Return type
dict
- create_snapshot(snapshot, timeout=-1)[source]
Creates a snapshot for the specified volume.
- Parameters
snapshot (dict) – Object to create.
timeout – Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation in OneView, just stops waiting for its completion.
- Returns
Storage volume.
- Return type
dict
- delete(force=False, export_only=None, suppress_device_updates=None, timeout=-1)[source]
Deletes a managed volume.
- Parameters
force – If set to true, the operation completes despite any problems with network connectivity or errors on the resource itself. The default is false.
timeout – Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation in OneView; it just stops waiting for its completion.
export_only – Valid prior to API500. By default, volumes will be deleted from OneView, and storage system. To delete the volume from OneView only, you must set its value to True. Setting its value to False has the same behavior as the default behavior.
suppress_device_updates – Valid API500 onwards. By default, volumes will be deleted from OneView, and storage system. To delete the volume from OneView only, you must set its value to True. Setting its value to False has the same behavior as the default behavior.
- Returns
Indicates if the volume was successfully deleted.
- Return type
bool
- get_attachable_volumes(start=0, count=-1, filter='', query='', sort='', scope_uris='', connections='')[source]
Gets the volumes that are connected on the specified networks based on the storage system port’s expected network connectivity.
- A volume is attachable if it satisfies either of the following conditions:
The volume is shareable.
The volume not shareable and not attached.
- Parameters
start – The first item to return, using 0-based indexing. If not specified, the default is 0 - start with the first available item.
count – The number of resources to return. A count of -1 requests all items. The actual number of items in the response might differ from the requested count if the sum of start and count exceeds the total number of items.
filter (list or str) – A general filter/query string to narrow the list of items returned. The default is no filter; all resources are returned.
query – A general query string to narrow the list of resources returned. The default is no query; all resources are returned.
sort – The sort order of the returned data set. By default, the sort order is based on create time with the oldest entry first.
connections – A list of dicts specifics the connections used by the attachable volumes. Needs network uri, initiatoer name and optional proxy name
scope_uris – A list specifics the list of scope uris used by the attachable volumed.
- Returns
A list of attachable volumes that the appliance manages.
- Return type
list
- get_extra_managed_storage_volume_paths(start=0, count=-1, filter='', sort='')[source]
Gets the list of extra managed storage volume paths.
- Parameters
start – The first item to return, using 0-based indexing. If not specified, the default is 0 - start with the first available item.
count – The number of resources to return. A count of -1 requests all items. The actual number of items in the response might differ from the requested count if the sum of start and count exceeds the total number of items.
filter (list or str) – A general filter/query string to narrow the list of items returned. The default is no filter; all resources are returned.
sort – The sort order of the returned data set. By default, the sort order is based on create time with the oldest entry first.
- Returns
A list of extra managed storage volume paths.
- Return type
list
- get_snapshot_by(field, value)[source]
Gets all snapshots that match the filter.
The search is case-insensitive.
- Parameters
field – Field name to filter.
value – Value to filter.
- Returns
Snapshots
- Return type
list
- get_snapshot_by_name(name)[source]
Gets snapshot by name.
- Parameters
name – Snapshot name
- Returns
VolumeSnapshots
- Return type
object
- get_snapshot_by_uri(uri)[source]
Gets snapshot by uri.
- Parameters
uri – Snapshot uri
- Returns
VolumeSnapshots
- Return type
object
- get_snapshots(start=0, count=-1, filter='', sort='')[source]
Gets all snapshots of a volume. Returns a list of snapshots based on optional sorting and filtering, and constrained by start and count parameters.
- Parameters
start – The first item to return, using 0-based indexing. If not specified, the default is 0 - start with the first available item.
count – The number of resources to return. A count of -1 requests all items. The actual number of items in the response might differ from the requested count if the sum of start and count exceeds the total number of items.
filter (list or str) – A general filter/query string to narrow the list of items returned. The default is no filter; all resources are returned.
sort – The sort order of the returned data set. By default, the sort order is based on create time with the oldest entry first.
- Returns
A list of snapshots.
- Return type
list
- repair(timeout=-1)[source]
Removes extra presentations from a specified volume on the storage system.
- Parameters
timeout – Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation in OneView, just stops waiting for its completion.
- Returns
Storage volume.
- Return type
dict