hpeOneView.resources.settings package
Submodules
hpeOneView.resources.settings.appliance_configuration_timeconfig module
hpeOneView.resources.settings.appliance_device_read_community module
- class hpeOneView.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 = '/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
hpeOneView.resources.settings.appliance_device_snmp_v1_trap_destinations module
- class hpeOneView.resources.settings.appliance_device_snmp_v1_trap_destinations.ApplianceDeviceSNMPv1TrapDestinations(connection, data=None)[source]
Bases:
Resource
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 = '/rest/appliance/trap-destinations'
- create(data, 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
data (dict) – Object to create.
id – id of the resource to be created
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
- create_validation(destination, community_string, uri, timeout=-1)[source]
Validate whether a hostname or ip address is a valid trap destination. If validation fails, it returns an error identifying the problem that occurred.
- Parameters
destination (uri - uri of the snmpv1 trap) – destination ip address.
community_string (str) –
destination –
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
Returns error message if destination already exists.
hpeOneView.resources.settings.appliance_device_snmp_v3_trap_destinations module
- class hpeOneView.resources.settings.appliance_device_snmp_v3_trap_destinations.ApplianceDeviceSNMPv3TrapDestinations(connection, data=None)[source]
Bases:
Resource
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 = '/rest/appliance/snmpv3-trap-forwarding/destinations'
- create(data, timeout=-1)[source]
Creates a new SNMPv3 trap forwarding destination. Traps will be forwarded to this destination only if the SNMPv3 user is associated with it. Only one user can be assigned to a destination at any time.
- 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 resource.
- Return type
dict
- create_validation(destination_address, existing_destinations=None, timeout=-1)[source]
Validate whether a host name or IP address is valid and does not already exist. Supplying invalid destination address results in failure.
- Parameters
destination_address (str) – destination ip address.
existing_destinations (list) –
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
Returns error message if provides invalid destination address.
- get_all(start=0, count=-1, filter='', sort='', query='')[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.
query – A general query string to narrow the list of resources returned. The default is no query - all resources are returned.
- Returns
A list of SNMPv3 Trap Destionations.
- Return type
list
hpeOneView.resources.settings.appliance_device_snmp_v3_users module
- class hpeOneView.resources.settings.appliance_device_snmp_v3_users.ApplianceDeviceSNMPv3Users(connection, data=None)[source]
Bases:
Resource
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 = '/rest/appliance/snmpv3-trap-forwarding/users'
- get_all(start=0, count=-1, filter='', sort='', query='')[source]
Lists all SNMPv3 Users. :param start: The first item to return, using 0-based indexing.
If not specified, the default is 0 - start with the first available item.
- Parameters
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
hpeOneView.resources.settings.appliance_health_status module
hpeOneView.resources.settings.appliance_network_interfaces module
- class hpeOneView.resources.settings.appliance_network_interfaces.ApplianceNetworkInterfaces(connection, data=None)[source]
Bases:
Resource
ApplianceNetworkInterface API Client.
- URI = '/rest/appliance/network-interfaces'
- get_all()[source]
Gets all items according with the given arguments.
- 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 (default).
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 items matching the specified filter.
- Return type
list
hpeOneView.resources.settings.appliance_node_information module
- class hpeOneView.resources.settings.appliance_node_information.ApplianceNodeInformation(connection, data=None)[source]
Bases:
Resource
The nodeinfo resource manager provides REST APIs to retrieve information about the nodes of the appliance.
- URI = '/rest/appliance/nodeinfo'
hpeOneView.resources.settings.appliance_proxy_configuration module
- class hpeOneView.resources.settings.appliance_proxy_configuration.ApplianceProxyConfiguration(connection, data=None)[source]
Bases:
Resource
,ResourceHelper
ApplianceProxyConfig API Client.
- URI = '/rest/appliance/proxy-config'
- delete()[source]
partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.
- get_all()[source]
Gets all items according with the given arguments.
- 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 (default).
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 items matching the specified filter.
- Return type
list
hpeOneView.resources.settings.appliance_ssh_access module
- class hpeOneView.resources.settings.appliance_ssh_access.ApplianceSshAccess(connection, data=None)[source]
Bases:
Resource
ApplianceSshAccess API Client.
- URI = '/rest/appliance/ssh-access'
- get_all()[source]
Gets all items according with the given arguments.
- 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 (default).
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 items matching the specified filter.
- Return type
list
hpeOneView.resources.settings.appliance_time_and_locale_configuration module
- class hpeOneView.resources.settings.appliance_time_and_locale_configuration.ApplianceTimeAndLocaleConfiguration(connection, data=None)[source]
Bases:
Resource
ApplianceTimeAndLocaleConfiguration API client.
- URI = '/rest/appliance/configuration/time-locale'
- get_all()[source]
Gets all items according with the given arguments.
- 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 (default).
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 items matching the specified filter.
- Return type
list
hpeOneView.resources.settings.backups module
- class hpeOneView.resources.settings.backups.Backups(con)[source]
Bases:
object
Backups API client.
- URI = '/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
hpeOneView.resources.settings.firmware_bundles module
- class hpeOneView.resources.settings.firmware_bundles.FirmwareBundles(connection, data=None)[source]
Bases:
ResourceFileHandlerMixin
,Resource
The firmware-bundles resource provides REST APIs for uploading firmware ServicePack files or hotfixes to the CI appliance.
- URI = '/rest/firmware-bundles'
- get_by_name(name)[source]
Retrieves the specified firmware bundle resource by name.
- Parameters
name – name of specified firmware bundle resource
- Returns
Get response of specified firmware bundle resource.
- Return type
dict
- upload_compsig(file_path, timeout=-1)[source]
Upload a compsig file for Gen10 and above hotfixes to the appliance. The uploaded signature file name will be encoded to a URI safe value. The API supports upload of one compsig at a time into the system. For the successful upload of a compsig, ensure its original name and extension are not altered.
- Parameters
file_path – Full path to compsig file.
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 added compsig file.
- Return type
dict
hpeOneView.resources.settings.firmware_drivers module
- class hpeOneView.resources.settings.firmware_drivers.FirmwareDrivers(connection, data=None)[source]
Bases:
ResourceSchemaMixin
,Resource
The firmware drivers resource managers provides REST APIs to retrieve the firmware bundle inventory data. Note: As per the API docs, ‘type’ field is not present in the firmware drivers POST call. So default values are not added.
- URI = '/rest/firmware-drivers'
- get_by_name(name, version=None)[source]
Retrieves the specified firmware driver resource by name and version.
- Parameters
name – name of specified firmware driver resource
version – version of specified firmware driver resource (optional)
- Returns
Get response of specified firmware driver resource.
- Return type
dict
hpeOneView.resources.settings.ha_nodes module
- class hpeOneView.resources.settings.ha_nodes.HANodes(connection, data=None)[source]
Bases:
Resource
,ResourcePatchMixin
HA Nodes resources represent the individual members used to provide high-availability for the management appliance cluster.
- URI = '/rest/appliance/ha-nodes'
hpeOneView.resources.settings.licenses module
- class hpeOneView.resources.settings.licenses.Licenses(con)[source]
Bases:
object
Licenses. Gets a list of all license resources that are known by the appliance.
- DEFAULT_VALUES = {'200': {'type': 'LicenseList'}, '300': {'type': 'LicenseList'}, '500': {'type': 'LicenseListV500'}, '600': {'type': 'LicenseListV500'}}
- URI = '/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='', sort='')[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
hpeOneView.resources.settings.repositories module
- class hpeOneView.resources.settings.repositories.Repositories(connection, data=None)[source]
Bases:
ResourcePatchMixin
,Resource
Repositories API client.
- URI = '/rest/repositories'
hpeOneView.resources.settings.restores module
- class hpeOneView.resources.settings.restores.Restores(connection, data=None)[source]
Bases:
Resource
Restore API client for initiate a restore of an appliance and to get the status of the restore operation.
- DEFAULT_VALUES = {'1000': {'type': 'RESTOREV1000'}, '1200': {'type': 'RESTOREV1000'}, '1600': {'type': 'RESTOREV1000'}, '800': {'type': 'RESTORE'}}
- URI = '/rest/restores'
- 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
hpeOneView.resources.settings.scopes module
- class hpeOneView.resources.settings.scopes.Scopes(connection, data=None)[source]
Bases:
Resource
,ResourcePatchMixin
Scopes API client.
Note
This resource is available for API version 300 or later.
- DEFAULT_VALUES = {'1000': {'type': 'ScopeV3'}, '1200': {'type': 'ScopeV3'}, '1600': {'type': 'ScopeV3'}, '1800': {'type': 'ScopeV3'}, '300': {'type': 'Scope'}, '500': {'type': 'ScopeV2'}, '800': {'type': 'ScopeV3'}}
- URI = '/rest/scopes'
- delete(timeout=-1)[source]
Deletes a Scope.
- Parameters
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='', sort='', query='', view='')[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.
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.
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]
Retrieves the specified scope resource by name.
- Parameters
name – name of specified scope resource
- Returns
Get response of specified scope resource.
- Return type
dict
- get_by_uri(uri)[source]
Retrieves the specified scope resource by uri.
- Parameters
uri – Uri of specified scope resource
- Returns
Get response of specified scope resource.
- Return type
dict
- get_scope_resource(resource_uri)[source]
Gets a resource’s scope, containing a list of the scopes to which the resource is assigned.
- Parameters
resource_uri – Uri of the resource
- Returns
Gets the scope assignments for a specified 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
hpeOneView.resources.settings.versions module
- class hpeOneView.resources.settings.versions.Versions(con)[source]
Bases:
object
Version API client. It indicates the range of API versions supported by the appliance.
- URI = '/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