hpOneView.resources.storage package

Submodules

hpOneView.resources.storage.drive_enclosures module

class hpOneView.resources.storage.drive_enclosures.DriveEnclosures(con)[source]

Bases: object

Drive Enclosures API client.

Note

This resource is only available on HPE Synergy

PORT_MAP_PATH = u'/port-map'
REFRESH_STATE_PATH = u'/refreshState'
URI = u'/rest/drive-enclosures'
get(id_or_uri)[source]

Gets the specified drive enclosure resource by ID or by URI.

Parameters:id_or_uri – Can be either the drive enclosure ID or the drive enclosure URI.
Returns:The drive enclosure.
Return type:dict
get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Gets information about all drive enclosures. Filtering and sorting are supported with the retrieval of managed storage systems. The following storage system attributes can be used with filtering and sorting operation: name, model, serialNumber, firmware, status, managedDomain, and state.

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 all drive enclosures.

Return type:

list

get_by(field, value)[source]

Gets all drive enclosures that match the filter.

The search is case-insensitive.

Parameters:
  • Field – field name to filter.
  • Value – value to filter.
Returns:

A list of drive enclosures.

Return type:

list

get_port_map(id_or_uri)[source]

Use to get the drive enclosure I/O adapter port to SAS interconnect port connectivity.

Parameters:id_or_uri – Can be either the resource ID or the resource URI.
Returns:Drive Enclosure Port Map
Return type:dict
patch(id_or_uri, operation, path, value, timeout=-1)[source]

Performs a specific patch operation for the given drive enclosure. If the server supports the particular operation, the operation is performed and a response is returned to the caller with the results.

Parameters:
  • id_or_uri – Can be either the resource ID or the resource URI.
  • operation – Patch operation
  • path – Path
  • value – Value
  • 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:

Drive Enclosure.

Return type:

dict

refresh_state(id_or_uri, configuration, timeout=-1)[source]

Refreshes a drive enclosure.

Parameters:
  • id_or_uri – Can be either the resource ID or the resource URI.
  • configuration – Configuration
  • 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:

Drive Enclosure

Return type:

dict

hpOneView.resources.storage.sas_logical_jbod_attachments module

class hpOneView.resources.storage.sas_logical_jbod_attachments.SasLogicalJbodAttachments(con)[source]

Bases: object

SAS Logical JBOD Attachments API client.

Note

This resource is only available on HPE Synergy

URI = u'/rest/sas-logical-jbod-attachments'
get(id_or_uri)[source]

Gets the SAS Logical JBOD Attachment with the specified ID or URI.

Parameters:id_or_uri – ID or URI of the SAS Logical JBOD Attachment.
Returns:SAS Logical JBOD Attachment
Return type:dict
get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Gets a paginated collection of SAS Logical JBOD Attachments. The collection is based on optional sorting and filtering and is 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 SAS Logical JBOD Attachments.

Return type:

list

get_by(field, value)[source]

Gets all SAS Logical JBOD Attachments that match the filter.

The search is case-insensitive.

Parameters:
  • field – Field name to filter.
  • value – Value to filter.
Returns:

A list of SAS Logical JBOD Attachments.

Return type:

list

hpOneView.resources.storage.sas_logical_jbods module

class hpOneView.resources.storage.sas_logical_jbods.SasLogicalJbods(con)[source]

Bases: object

SAS Logical JBODs API client.

Note

This resource is only available on HPE Synergy

DRIVES_PATH = u'/drives'
URI = u'/rest/sas-logical-jbods'
get(id_or_uri)[source]

Gets the specified SAS logical JBODs resource by ID or by URI.

Parameters:id_or_uri – Can be either the SAS logical JBOD ID or the SAS logical JBOD URI.
Returns:The SAS logical JBOD.
Return type:dict
get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Gets a paginated collection of SAS logical JBODs 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 all SAS logical JBODs.

Return type:

list

get_by(field, value)[source]

Gets all SAS Logical JBODs that match the filter.

The search is case-insensitive.

Parameters:
  • field – Field name to filter.
  • value – Value to filter.
Returns:

A list of SAS Logical JBODs.

Return type:

list

get_drives(id_or_uri)[source]

Gets the list of drives allocated to this SAS logical JBOD.

Parameters:id_or_uri – Can be either the SAS logical JBOD ID or the SAS logical JBOD URI.
Returns:A list of Drives
Return type:list

hpOneView.resources.storage.storage_pools module

class hpOneView.resources.storage.storage_pools.StoragePools(con)[source]

Bases: object

Storage Pools API client.

URI = u'/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(id_or_uri)[source]

Gets the specified storage pool resource by ID or by URI.

Parameters:id_or_uri – Can be either the storage pool id or the storage pool uri.
Returns:The storage pool.
Return type:dict
get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Gets a list of storage pools. Returns a list of storage pools based on optional sorting and filtering, and constrained by start and count parameters. The following storage pool attributes can be used with filtering and sorting operation: name, domain, deviceType, deviceSpeed, supportedRAIDLevel, status, and state.

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 storage pools.

Return type:

list

get_by(field, value)[source]

Gets all storage pools that match the filter.

The search is case-insensitive.

Parameters:
  • field – Field name to filter.
  • value – Value to filter.
Returns:

A list of storage pools.

Return type:

list

get_reachable_storage_pools(start=0, count=-1, filter=u'', query=u'', sort=u'', networks=None, scope_exclusions=None, scope_uris=u'')[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(resource, 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

update(resource, timeout=-1)[source]

Updates a storage pool. It can be used to manage/unmanage a storage pool, update attributes or to request a refresh. To manage or unmanage a storage pool: Set the isManaged attribute true to manage or false to unmanage. Attempting to unmanage a StoreVirtual pool is not allowed and the attempt will return a task error. To request a refresh set the “requestingRefresh” attribute to true. No other attribute update can be performed while also requesting a refresh of the pool.

Parameters:
  • resource (dict) – Object to update.
  • 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:

Updated storage system.

Return type:

dict

hpOneView.resources.storage.storage_systems module

class hpOneView.resources.storage.storage_systems.StorageSystems(con)[source]

Bases: object

Storage Systems API client.

URI = u'/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(id_or_uri)[source]

Gets the specified storage system resource by ID or by URI.

Parameters:id_or_uri – Can be either the storage system id or the storage system uri.
Returns:The storage system.
Return type:dict
get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Gets information about all managed storage systems. Filtering and sorting are supported with the retrieval of managed storage systems. The following storage system attributes can be used with filtering and sorting operation: name, model, serialNumber, firmware, status, managedDomain, and state.

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 all managed storage systems.

Return type:

list

get_by(field, value)[source]

Gets all storage systems that match the filter.

The search is case-insensitive.

Parameters:
  • Field – field name to filter.
  • Value – value to filter.
Returns:

A list of storage systems.

Return type:

list

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_by_name(name)[source]

Retrieves a resource by its name.

Parameters:name – Resource name.
Returns:dict
get_host_types()[source]

Gets the list of supported host types.

Returns:Host types.
Return type:list
get_managed_ports(id_or_uri, port_id_or_uri=u'')[source]

Gets all ports or a specific managed target port for the specified storage system.

Parameters:
  • id_or_uri – Can be either the storage system id or the storage system uri.
  • port_id_or_uri – Can be either the port id or the port uri.
Returns:

Managed ports.

Return type:

dict

get_reachable_ports(id_or_uri, start=0, count=-1, filter=u'', query=u'', sort=u'', 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(id_or_uri)[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.

Parameters:id_or_uri – Can be either the storage system ID (serial number) or the storage system URI.
Returns:Host types.
Return type:dict
get_templates(id_or_uri, start=0, count=-1, filter=u'', query=u'', sort=u'')[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(resource, force=False, timeout=-1)[source]

Removes the storage system from OneView.

Parameters:
  • resource (dict) – Object to delete
  • 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

update(resource, timeout=-1)[source]

Updates the storage system. To complete the addition of a storage system for management by the appliance, this must be called after create() of a storage system.

Parameters:
  • resource (dict) – Object to update.
  • 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:

Updated storage system.

Return type:

dict

hpOneView.resources.storage.storage_volume_attachments module

class hpOneView.resources.storage.storage_volume_attachments.StorageVolumeAttachments(con)[source]

Bases: object

Storage Volume Attachments API client.

URI = u'/rest/storage-volume-attachments'
get(id_or_uri)[source]

Gets a volume attachment by ID or URI.

Parameters:id_or_uri – Can be either the volume attachment ID or the volume attachment URI.
Returns:volume attachment
Return type:dict
get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Gets a list of volume attachment resources.

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:

Volume attachment resources.

Return type:

list

get_by(field, value)[source]

Gets all storage systems that match the filter.

The search is case-insensitive.

Parameters:
  • field – Field name to filter.
  • value – Value to filter.
Returns:

List of volume attachments.

Return type:

list

get_extra_unmanaged_storage_volumes(start=0, count=-1, filter=u'', sort=u'')[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(id_or_uri, path_id_or_uri=u'')[source]

Gets all paths or a specific attachment path for the specified volume attachment.

Parameters:
  • id_or_uri – Can be either the volume attachment id or the volume attachment uri.
  • path_id_or_uri – Can be either the path id or the path uri.
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

hpOneView.resources.storage.storage_volume_templates module

class hpOneView.resources.storage.storage_volume_templates.StorageVolumeTemplates(con)[source]

Bases: object

Storage Volume Templates API client.

DEFAULT_VALUES = {u'200': {u'type': u'StorageVolumeTemplateV3'}, u'300': {u'type': u'StorageVolumeTemplateV3'}}
URI = u'/rest/storage-volume-templates'
create(resource, timeout=-1)[source]

Creates a new storage volume template.

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 volume template.

Return type:

dict

delete(resource, force=False, timeout=-1)[source]

Deletes the specified storage volume template.

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:

Indicates if the resource was successfully deleted.

Return type:

bool

get(id_or_uri)[source]

Gets the specified storage volume template resource by ID or by URI.

Parameters:id_or_uri – Can be either the storage volume template ID or the storage volume template URI.
Returns:The storage volume template
Return type:dict
get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Gets a list of storage volume templates.

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 storage volume templates.

Return type:

list

get_by(field, value)[source]

Gets all storage volume templates that match the filter.

The search is case-insensitive.

Parameters:
  • field – Field name to filter.
  • value – Value to filter.
Returns:

A list of storage volume templates that match the filter.

Return type:

list

get_compatible_systems(id_or_uri)[source]

Retrieves a collection of all storage systems that is applicable to this storage volume template.

Parameters:id_or_uri – Can be either the power device id or the uri
Returns:Storage systems.
Return type:list
get_connectable_volume_templates(start=0, count=-1, filter=u'', query=u'', sort=u'')[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=u'', query=u'', sort=u'', networks=None, scope_uris=u'', 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
update(resource, timeout=-1)[source]

Updates a storage volume template.

Parameters:
  • resource (dict) – Object to update.
  • 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:

Updated storage volume system

Return type:

dict

hpOneView.resources.storage.volumes module

class hpOneView.resources.storage.volumes.Volumes(con)[source]

Bases: object

Volumes API client.

DEFAULT_VALUES_SNAPSHOT = {u'200': {u'type': u'Snapshot'}, u'300': {u'type': u'Snapshot'}, u'500': {}}
URI = u'/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(resource, timeout=-1)[source]

Creates or adds a volume.

There are six different methods to create the volume:

  1. Common = Storage System + Storage Pool
  2. Template = Storage Volume Template
  3. Common with snapshots = Storage System + Storage Pool + Snapshot Pool
  4. Management = Storage System + wwn
  5. Management by name = Storage System + Storage System Volume Name
  6. Snapshot = Snapshot Pool + Storage Pool + Snapshot.

NOTE: Use numbers 4 and 5 to add a volume for management; it does not create new volumes.

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:

Created or 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(volume_id_or_uri, snapshot, timeout=-1)[source]

Creates a snapshot for the specified volume.

Parameters:
  • volume_id_or_uri – Can be either the volume ID or the volume URI.
  • 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(resource, force=False, export_only=None, suppress_device_updates=None, timeout=-1)[source]

Deletes a managed volume.

Parameters:
  • resource (dict) – Object to delete.
  • 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

delete_snapshot(resource, force=False, timeout=-1)[source]

Deletes a snapshot from OneView and the storage system.

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 volume.

Return type:

dict

get(id_or_uri)[source]

Gets the managed volume.

Parameters:id_or_uri – Can be either the volume ID or the volume URI.
Returns:Managed volume.
get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Gets a paginated collection of managed volumes. The collection is based on optional sorting and filtering and is 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 managed volumes.

Return type:

list

get_attachable_volumes(start=0, count=-1, filter=u'', query=u'', sort=u'', scope_uris=u'', connections=u'')[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_by(field, value)[source]

Gets all managed volumes that matches the given filter.

The search is case-insensitive.

Parameters:
  • field – Field name to filter.
  • value – Value to filter.
Returns:

A list of managed volumes.

Return type:

list

get_extra_managed_storage_volume_paths(start=0, count=-1, filter=u'', sort=u'')[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(snapshot_id_or_uri, volume_id_or_uri=None)[source]

Gets a snapshot of a volume.

Parameters:
  • volume_id_or_uri – Can be either the volume ID or the volume URI. It is optional if it is passed a snapshot URI, but required if it passed a snapshot ID.
  • snapshot_id_or_uri – Can be either the snapshot ID or the snapshot URI.
Returns:

The snapshot.

Return type:

dict

get_snapshot_by(volume_id_or_uri, field, value)[source]

Gets all snapshots that match the filter.

The search is case-insensitive.

Parameters:
  • volume_id_or_uri – Can be either the volume id or the volume uri.
  • field – Field name to filter.
  • value – Value to filter.
Returns:

Snapshots

Return type:

list

get_snapshots(volume_id_or_uri, start=0, count=-1, filter=u'', sort=u'')[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:
  • volume_id_or_uri – Can be either the volume id or the volume uri.
  • 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(volume_id_or_uri, timeout=-1)[source]

Removes extra presentations from a specified volume on the storage system.

Parameters:
  • volume_id_or_uri – Can be either the volume id or the volume uri.
  • 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

update(resource, force=False, timeout=-1)[source]

Updates properties of a volume.

Reverts a volume to the specified snapshot.

Parameters:
  • resource (dict) – Object to update.
  • 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, just stops waiting for its completion.
Returns:

Updated resource.

Module contents