hpOneView.resources.settings package

Submodules

hpOneView.resources.settings.appliance_device_read_community module

class hpOneView.resources.settings.appliance_device_read_community.ApplianceDeviceReadCommunity(con)[source]

Bases: object

ApplianceDeviceReadCommunity API client. The device read community string is used by the appliance to establish SNMP communication with devices managed by the appliance.

URI = u'/rest/appliance/device-read-community-string'
get()[source]

Retrieves the global community string.

Returns:ApplianceDeviceReadCommunity
Return type:dict
update(resource, timeout=-1)[source]

Update the device read community string. This results in an update of the community string on all servers being managed/monitored by this OneView instance.

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, just stop waiting for its completion.
Returns:

Updated appliance SNMPv1 read community string.

Return type:

dict

hpOneView.resources.settings.appliance_device_snmp_v1_trap_destinations module

class hpOneView.resources.settings.appliance_device_snmp_v1_trap_destinations.ApplianceDeviceSNMPv1TrapDestinations(con)[source]

Bases: object

ApplianceDeviceSNMPv1TrapDestinations API client. The appliance has the ability to forward events received from monitored or managed server hardware to the specified destinations as SNMPv1 traps.

URI = u'/rest/appliance/trap-destinations'
create(resource, id=None, timeout=-1)[source]

Adds the specified trap forwarding destination. The trap destination associated with the specified id will be created if trap destination with that id does not exists. The id can only be an integer greater than 0.

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

Return type:

dict

delete(id_or_uri, timeout=-1)[source]

Deletes SNMPv1 trap forwarding destination based on {Id}.

Parameters:
  • id_or_uri – dict object to delete
  • 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:

Indicates if the resource was successfully deleted.

Return type:

bool

get(id_or_uri)[source]

Returns the SNMPv1 trap forwarding destination with the specified ID, if it exists.

Parameters:id_or_uri – ID or URI of SNMPv1 trap destination.
Returns:Appliance SNMPv1 trap destination.
Return type:dict
get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Retrieves all SNMPv1 trap forwarding destinations.

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 SNMPv1 Trap Destionations.

Return type:

list

get_by(field, value)[source]

Gets all SNMPv1 trap forwarding destinations that match the filter. The search is case-insensitive.

Parameters:
  • field – field name to filter
  • value – value to filter
Returns:

A list of SNMPv1 Trap Destionations.

Return type:

list

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

Updates the specified trap forwarding destination. The trap destination associated with the specified id will be updated if a trap destination with that id already exists. The id can only be an integer greater than 0.

Parameters:
  • resource – dict object with changes.
  • 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:

Updated appliance SNMPv1 trap destinations.

Return type:

dict

hpOneView.resources.settings.appliance_device_snmp_v3_trap_destinations module

class hpOneView.resources.settings.appliance_device_snmp_v3_trap_destinations.ApplianceDeviceSNMPv3TrapDestinations(con)[source]

Bases: object

ApplianceDeviceSNMPv3TrapDestinations API client. The appliance has the ability to forward events received from monitored or managed server hardware to the specified destinations as SNMPv3 traps.

URI = u'/rest/appliance/snmpv3-trap-forwarding/destinations'
create(resource, timeout=-1)[source]

Adds the specified trap forwarding destination. The trap destination associated with the specified id will be created if trap destination with that id does not exists. The id can only be an integer greater than 0.

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

Return type:

dict

delete(id_or_uri, timeout=-1)[source]

Deletes SNMPv3 trap forwarding destination based on {Id} only if no User is assigned to it.

Parameters:
  • id_or_uri – dict object to delete
  • 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:

Indicates if the resource was successfully deleted.

Return type:

bool

get(id_or_uri)[source]

Returns the SNMPv3 trap forwarding destination with the specified ID, if it exists.

Parameters:id_or_uri – ID or URI of SNMPv3 trap destination.
Returns:Appliance SNMPv3 trap destination.
Return type:dict
get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Retrieves all SNMPv3 trap forwarding destinations.

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 SNMPv3 Trap Destionations.

Return type:

list

get_by(field, value)[source]

Gets all SNMPv3 trap forwarding destinations that match the filter. The search is case-insensitive.

Parameters:
  • field – field name to filter
  • value – value to filter
Returns:

A list of SNMPv3 Trap Destionations.

Return type:

list

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

Updates SNMPv3 trap forwarding destination based on Id.

Parameters:
  • resource – dict object with changes.
  • 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:

Updated appliance SNMPv3 trap destinations.

Return type:

dict

hpOneView.resources.settings.appliance_device_snmp_v3_users module

class hpOneView.resources.settings.appliance_device_snmp_v3_users.ApplianceDeviceSNMPv3Users(con)[source]

Bases: object

ApplianceDeviceSNMPv3Users API client [Available only since API 600].

As part of SNMPv3 trap forwarding support, the appliance provides APIs for creating User-based Security Model (USM) and forwarding destinations. The following protocols are supported while defining USM.

Authentication protocols: MD5 / SHA1 / SHA256 / SHA384 / SHA512 Privacy protocols: AES / DES The security levels supported while defining USM are None, Authentication only and both Authentication and Privacy.

URI = u'/rest/appliance/snmpv3-trap-forwarding/users'
create(resource, timeout=-1)[source]

Creates a new SNMPv3 user. This user will be used for sending the SNMPv3 trap to the associated destinations. One user can be assigned to multiple destinations.

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

Return type:

dict

delete(id_or_uri, timeout=-1)[source]

Delete an SNMPv3 User based on User Id specified in {Id}. The user will be deleted only if it has no associated destinations.

Parameters:
  • id_or_uri – dict object to delete
  • 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:

Indicates if the resource was successfully deleted.

Return type:

bool

delete_all(filter=None, timeout=-1)[source]

Delete an SNMPv3 User based on User name specified in filter. The user will be deleted only if it has no associated destinations.

Parameters:
  • username – ID or URI of SNMPv3 user.
  • filter – A general filter/query string to narrow the list of items returned. The default is no filter - all resources are returned.
Returns:

Indicates if the resource was successfully deleted.

Return type:

bool

get(id_or_uri)[source]

Returns the SNMPv3 user with the specified ID, if it exists.

Parameters:id_or_uri – ID or URI of SNMPv3 user.
Returns:Appliance SNMPv3 user.
Return type:dict
get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Lists all SNMPv3 Users.

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 SNMPv3 Users.

Return type:

list

get_by(field, value)[source]

Gets all SNMPv3 users that match the filter. The search is case-insensitive.

Parameters:
  • field – field name to filter
  • value – value to filter
Returns:

A list of SNMPv3 Users.

Return type:

list

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

Updates SNMPv3 User based on User Id as specified in {Id}

Parameters:
  • resource – dict object with changes.
  • 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:

Updated appliance SNMPv3 user.

Return type:

dict

hpOneView.resources.settings.appliance_node_information module

class hpOneView.resources.settings.appliance_node_information.ApplianceNodeInformation(con)[source]

Bases: object

ApplianceNodeInformation API client.

URI = u'/rest/appliance/nodeinfo'
get_status()[source]

Retrieves node’s status information

Returns:Node’s status information
Return type:dict
get_version()[source]

Retrieves node’s version information

Returns:Node’s version information
Return type:dict

hpOneView.resources.settings.appliance_time_and_locale_configuration module

class hpOneView.resources.settings.appliance_time_and_locale_configuration.ApplianceTimeAndLocaleConfiguration(con)[source]

Bases: object

ApplianceTimeAndLocaleConfiguration API client.

DEFAULT_VALUES = {u'200': {u'type': u'TimeAndLocale'}, u'300': {u'type': u'TimeAndLocale'}}
URI = u'/rest/appliance/configuration/time-locale'
get()[source]

Gets the appliance time and locale configuration.

Returns:ApplianceTimeAndLocaleConfiguration
Return type:dict
update(resource, timeout=-1)[source]

Updates the appliance time and locale configuration.

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, just stop waiting for its completion.
Returns:

Updated appliance time and locale configuration.

Return type:

dict

hpOneView.resources.settings.backups module

class hpOneView.resources.settings.backups.Backups(con)[source]

Bases: object

Backups API client.

URI = u'/rest/backups'
create(timeout=-1)[source]

Starts backing up the appliance. After completion, the backup file must be downloaded and saved off-appliance. Appliance backups can be started at any time, and do not require any special setup to prepare the appliance for the backup.

Parameters: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:Details of the created backup.
Return type:dict
download(id_or_uri, file_path)[source]

Downloads a backup archive previously created on the appliance. Uploaded backup files cannot be downloaded.

Parameters:
  • id_or_uri – ID or URI of the Artifact Bundle.
  • file_path (str) – Destination file path.
Returns:

Successfully downloaded.

Return type:

bool

get(id_or_uri)[source]

Gets the details of the specified backup.

Parameters:id_or_uri – ID or URI of the backup
Returns:Details of the specified backup.
Return type:dict
get_all()[source]

Retrieves the details for any current appliance backup. Only one backup file is present on the appliance at any time.

Returns:A list of Backups.
Return type:list
get_config()[source]

Retrieves the details of the backup configuration for the remote server and automatic backup schedule.

Parameters:id_or_uri – ID or URI of the backup
Returns:Details of the backup configuration for the remote server and automatic backup schedule.
Return type:dict
update_config(config, timeout=-1)[source]

Updates the remote server configuration and the automatic backup schedule for backup.

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

Backup details.

Return type:

dict

update_remote_archive(save_uri, timeout=-1)[source]

Saves a backup of the appliance to a previously-configured remote location.

Parameters:
  • save_uri (dict) – The URI for saving the backup to a previously configured location.
  • 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:

Backup details.

Return type:

dict

upload(file_path)[source]

Uploads an appliance backup file in preparation of a restore. Any existing backup on the appliance is removed.

After the backup file is uploaded and validated, its details are returned. The URI of the backup can be used to start a restore.

Parameters:file_path (str) – The local backup filepath
Returns:Details of the uploaded backup.
Return type:dict

hpOneView.resources.settings.firmware_bundles module

class hpOneView.resources.settings.firmware_bundles.FirmwareBundles(con)[source]

Bases: object

Firmware Bundles API client.

URI = u'/rest/firmware-bundles'
upload(file_path, timeout=-1)[source]

Upload an SPP ISO image file or a hotfix file to the appliance. The API supports upload of one hotfix at a time into the system. For the successful upload of a hotfix, ensure its original name and extension are not altered.

Parameters:
  • file_path – Full path to firmware.
  • 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:

Information about the updated firmware bundle.

Return type:

dict

hpOneView.resources.settings.firmware_drivers module

class hpOneView.resources.settings.firmware_drivers.FirmwareDrivers(con)[source]

Bases: object

Firmware Drivers API client.

URI = u'/rest/firmware-drivers'
create(resource, timeout=-1)[source]

Creates a custom SPP (Service Pack for ProLiant) from an existing SPP and one or more hotfixes that have already been added to the 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:

Created resource.

Return type:

dict

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

Delete the firmware baseline resource with the specified ID. If force is set to true, the firmware baseline resource will be deleted even if it is assigned to devices.

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.
Returns:

Indicates if the resource was successfully deleted.

Return type:

bool

get(id_or_uri)[source]

Gets the individual firmware baseline resource for the given URI.

Parameters:id – ID or URI of firmware baseline resource.
Returns:Firmware baseline resource.
Return type:dict
get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Gets a paginated collection of Firmware Drivers. The collection is 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:

list of firmware baseline resources.

Return type:

list

get_by(field, value)[source]

Gets the list of firmware baseline resources managed by the appliance. Optional parameters can be used to filter the list of resources returned.

The search is case-insensitive.

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

List of firmware baseline resources.

Return type:

list

hpOneView.resources.settings.licenses module

class hpOneView.resources.settings.licenses.Licenses(con)[source]

Bases: object

Licenses. Gets a list of all license resources that are known by the appliance.

DEFAULT_VALUES = {u'200': {u'type': u'LicenseList'}, u'300': {u'type': u'LicenseList'}, u'500': {u'type': u'LicenseListV500'}, u'600': {u'type': u'LicenseListV500'}}
URI = u'/rest/licenses'
create(resource, timeout=-1)[source]

Add a license to 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, just stop waiting for its completion.
Returns:

Created resource.

Return type:

dict

delete(id_or_uri)[source]

Deletes a License.

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.
Returns:

Indicates if the resource was successfully deleted.

Return type:

bool

get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Gets all the licenses loaded on the appliance. 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 Licenses.

Return type:

list

get_by_id(id_or_uri)[source]

Gets the License with the specified ID.

Parameters:id_or_uri – ID or URI of License.
Returns:The License.
Return type:dict

hpOneView.resources.settings.restores module

class hpOneView.resources.settings.restores.Restores(con)[source]

Bases: object

Restore API client for initiate a restore of an appliance and to get the status of the restore operation.

DEFAULT_VALUES = {u'200': {u'type': u'RESTORE'}, u'300': {u'type': u'RESTORE'}}
URI = u'/rest/restores'
get(id_or_uri)[source]

Retrieves the status of the specified restore operation.

Parameters:id_or_uri – ID or URI of the Restore.
Returns:Restore
Return type:dict
get_all()[source]

Retrieve the status of any current appliance restore.

Returns:A collection of restore status, but there will be at most one restore status. The status for the last restore will be returned if there has been a restore.
Return type:list
get_by(field, value)[source]

Gets all Restores that match the filter.

The search is case-insensitive.

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

A list of Restores.

Return type:

list

get_failure()[source]

Retrieves the result of an appliance restore operation after it has completed.

The restore result remains valid until a user logs in. After a user logs in, the restore result will be reset. This rest request will return only the valid result after restore has completed and before a user logs in.

Returns:Restore Result
Return type:dict
restore(resource, timeout=-1)[source]

Starts a restore operation with the specified backup file. The backup must be uploaded to the appliance prior to running this command. Only one restore can run at a time.

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

Restore.

Return type:

dict

hpOneView.resources.settings.scopes module

class hpOneView.resources.settings.scopes.Scopes(con)[source]

Bases: object

Scopes API client.

Note

This resource is available for API version 300 or later.

DEFAULT_VALUES = {u'300': {u'type': u'Scope'}, u'500': {u'type': u'ScopeV2'}}
URI = u'/rest/scopes'
create(resource, timeout=-1)[source]

Creates a scope.

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

Return type:

dict

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

Deletes a Scope.

Parameters:
  • resource – dict object to delete
  • 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 Scope with the specified ID or URI.

Parameters:id_or_uri – ID or URI of the Scope
Returns:Scope
Return type:dict
get_all(start=0, count=-1, sort=u'', query=u'', view=u'')[source]
Gets a list of scopes.
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.
  • 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.
  • view – Returns a specific subset of the attributes of the resource or collection, by specifying the name of a predefined view. The default view is expand (show all attributes of the resource and all elements of collections of resources).
Returns:

A list of scopes.

Return type:

list

get_by_name(name)[source]

Gets a Scope by name.

Parameters:name – Name of the Scope
Returns:Scope.
Return type:dict
patch(id_or_uri, operation, path, value, timeout=-1)[source]

Uses the PATCH to update a resource for the given scope.

Only one operation can be performed in each PATCH call.

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:

Updated resource.

Return type:

dict

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

Updates a scope.

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, just stop waiting for its completion.
Returns:

Updated scope.

Return type:

dict

update_resource_assignments(id_or_uri, resource_assignments, timeout=-1)[source]

Modifies scope membership by adding or removing resource assignments.

Parameters:
  • id_or_uri – Can be either the resource ID or the resource URI.
  • resource_assignments (dict) – A dict object with a list of resource URIs to be added and a list of resource URIs to be removed.
  • 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 resource.

Return type:

dict

hpOneView.resources.settings.versions module

class hpOneView.resources.settings.versions.Versions(con)[source]

Bases: object

Version API client. It indicates the range of API versions supported by the appliance.

URI = u'/rest/version'
get_version()[source]

Returns the range of possible API versions supported by the appliance. The response contains the current version and the minimum version. The current version is the recommended version to specify in the REST header. The other versions are supported for backward compatibility, but might not support the most current features.

Returns:The minimum and maximum supported API versions.
Return type:dict

Module contents