hpeOneView package

Subpackages

Submodules

hpeOneView.connection module

connection.py

This module maintains communication with the appliance.

class hpeOneView.connection.connection(applianceIp, api_version=None, sslBundle=False, timeout=None, proxy=None)[source]

Bases: object

change_initial_password(newPassword)[source]
delete(uri, custom_headers=None)[source]
disable_etag_validation()[source]

Disable the concurrency control for the PUT and DELETE requests. The requests will be forced without specifying an explicit ETag. This method sets an If-Match header of “*”.

do_http(method, path, body, custom_headers=None)[source]
download_to_stream(stream_writer, url, body='', method='GET', custom_headers=None)[source]
enable_etag_validation()[source]

Enable the concurrency control for the PUT and DELETE requests, in which the requests are conditionally processed only if the provided entity tag in the body matches the latest entity tag stored for the resource.

The eTag validation is enabled by default.

encode_multipart_formdata(fields, files, baseName, verbose=False)[source]

Fields is a sequence of (name, value) elements for regular form fields. Files is a sequence of (name, filename, value) elements for data to be uploaded as files

Returns: (content_type, body) ready for httplib.HTTP instance

get(uri, custom_headers=None)[source]
getFirstPage()[source]
getLastPage()[source]
getNextPage()[source]
getPrevPage()[source]
get_by_uri(xuri)[source]
get_connection()[source]
get_default_api_version()[source]
get_eula_status()[source]
get_host()[source]
get_session()[source]
get_session_id()[source]
login(cred, sessionID=None, verbose=False)[source]
logout(verbose=False)[source]
make_url(path)[source]
patch(uri, body, custom_headers=None)[source]
post(uri, body, custom_headers=None)[source]
post_multipart(uri, fields, files, baseName, verbose=False)[source]
post_multipart_with_response_handling(uri, file_path, baseName)[source]
put(uri, body, custom_headers=None)[source]
set_eula(supportAccess='yes')[source]
set_proxy(proxy)[source]
set_session_id(session_id)[source]
set_trusted_ssl_bundle(sslBundle)[source]
validateVersion()[source]
hpeOneView.connection.get_member(mlist)[source]
hpeOneView.connection.get_members(mlist)[source]
hpeOneView.connection.make_eula_dict(supportAccess)[source]
hpeOneView.connection.make_initial_password_change_dict(userName, oldPassword, newPassword)[source]

hpeOneView.exceptions module

exception hpeOneView.exceptions.HPEOneViewException(data, error=None)[source]

Bases: Exception

OneView base Exception.

msg

Exception message.

Type

str

oneview_response

OneView rest response.

Type

dict

exception hpeOneView.exceptions.HPEOneViewInvalidResource(data, error=None)[source]

Bases: HPEOneViewException

OneView Invalid Resource Exception.

msg

Exception message.

Type

str

exception hpeOneView.exceptions.HPEOneViewMissingUniqueIdentifiers(data, error=None)[source]

Bases: HPEOneViewException

OneView Missing Unique Identifiers Exception. The exception is raised when unique identifiers are missing for the resource

msg

Exception message.

Type

str

exception hpeOneView.exceptions.HPEOneViewResourceNotFound(data, error=None)[source]

Bases: HPEOneViewException

OneView Resource Not Found Exception. The exception is raised when an associated resource was not found.

msg

Exception message.

Type

str

exception hpeOneView.exceptions.HPEOneViewTaskError(msg, error_code=None)[source]

Bases: HPEOneViewException

OneView Task Error Exception.

msg

Exception message.

Type

str

error_code

A code which uniquely identifies the specific error.

Type

str

exception hpeOneView.exceptions.HPEOneViewTimeout(data, error=None)[source]

Bases: HPEOneViewException

OneView Timeout Exception.

msg

Exception message.

Type

str

exception hpeOneView.exceptions.HPEOneViewUnavailableMethod(data, error=None)[source]

Bases: HPEOneViewException

OneView Unavailable Method Exception. The exception is raised when a method is not available for the resource class.

msg

Exception message.

Type

str

exception hpeOneView.exceptions.HPEOneViewUnknownType(data, error=None)[source]

Bases: HPEOneViewException

OneView Unknown Type Error.

msg

Exception message.

Type

str

exception hpeOneView.exceptions.HPEOneViewValueError(data, error=None)[source]

Bases: HPEOneViewException

OneView Value Error. The exception is raised when the data contains an inappropriate value.

msg

Exception message.

Type

str

hpeOneView.exceptions.handle_exceptions(exception_type, exception_value, exception_traceback, logger=<Logger hpeOneView.exceptions (WARNING)>)[source]

hpeOneView.oneview_client module

This module implements a common client for HPE OneView REST API.

class hpeOneView.oneview_client.OneViewClient(config, sessionID=None)[source]

Bases: object

property alerts

Gets the Alerts API client.

Return type

Alerts

property api_version

Gets the OneView API Version.

Returns

API Version.

Return type

int

property appliance_configuration_timeconfig

Gets the ApplianceConfigurationTimeconfig API client.

Return type

ApplianceConfigurationTimeconfig

property appliance_device_read_community

Gets the ApplianceDeviceReadCommunity API client.

Return type

ApplianceDeviceReadCommunity

property appliance_device_snmp_v1_trap_destinations

Gets the ApplianceDeviceSNMPv1TrapDestinations API client.

Return type

ApplianceDeviceSNMPv1TrapDestinations

property appliance_device_snmp_v3_trap_destinations

Gets the ApplianceDeviceSNMPv3TrapDestinations API client.

Return type

ApplianceDeviceSNMPv3TrapDestinations

property appliance_device_snmp_v3_users

Gets the ApplianceDeviceSNMPv3Users API client.

Return type

ApplianceDeviceSNMPv3Users

property appliance_health_status

Gets the ApplianceHealthStatus API client.

Return type

ApplianceHealthStatus

property appliance_network_interfaces

Gets the ApplianceNetworkInterfaces API client.

Return type

ApplianceNetworkInterfaces

property appliance_node_information

Gets the ApplianceNodeInformation API client.

Return type

ApplianceNodeInformation

property appliance_proxy_configuration

Gets the ApplianceProxyConfiguration API client.

Return type

ApplianceProxyConfiguration

property appliance_ssh_access

Gets the ApplianceSshAccess API client.

Return type

ApplianceSshAccess

property appliance_time_and_locale_configuration

Gets the ApplianceTimeAndLocaleConfiguration API client.

Return type

ApplianceTimeAndLocaleConfiguration

property backups

Gets the Backup API client.

Return type

Backups

property certificate_authority

Gets the Certificate Authority API client.

Return type

CertificateAuthority

property certificate_rabbitmq

Gets the Certificate RabbitMQ API client.

Return type

CertificateRabbitMQ

property certificates_server

Gets the Certificates Server API client.

Return type

Server Certificate

property connection

Gets the underlying HPE OneView connection used by the OneViewClient.

Return type

connection

property connection_templates

Gets the ConnectionTemplates API client.

Return type

ConnectionTemplates

property connections

Gets the Connections API client.

Return type

Connections

property datacenters

Gets the Datacenters API client.

Return type

Datacenters

property drive_enclosures

Gets the Drive Enclosures API client.

Return type

DriveEnclosures

property enclosure_groups

Gets the EnclosureGroups API client.

Return type

EnclosureGroups

property enclosures

Gets the Enclosures API client.

Return type

Enclosures

property endpoints

Gets the Endpoints API client.

Return type

Endpoints

property ethernet_networks

Gets the EthernetNetworks API client.

Return type

EthernetNetworks

property events

Gets the Events API client.

Return type

Events

property fabrics

Gets the Fabrics API client.

Return type

Fabrics

property fc_networks

Gets the FcNetworks API client.

Return type

FcNetworks

property fcoe_networks

Gets the FcoeNetworks API client.

Return type

FcoeNetworks

property firmware_bundles

Gets the FirmwareBundles API client.

Return type

FirmwareBundles

property firmware_drivers

Gets the FirmwareDrivers API client.

Return type

FirmwareDrivers

classmethod from_environment_variables(session_id=None)[source]

Construct OneViewClient using environment variables.

Allowed variables: ONEVIEWSDK_IP (required), ONEVIEWSDK_USERNAME (required), ONEVIEWSDK_PASSWORD (required), ONEVIEWSDK_AUTH_LOGIN_DOMAIN, ONEVIEWSDK_API_VERSION, ONEVIEWSDK_SESSIONID, ONEVIEWSDK_SSL_CERTIFICATE, ONEVIEWSDK_CONNECTION_TIMEOUT and ONEVIEWSDK_PROXY.

Return type

OneViewClient

classmethod from_json_file(file_name, sessionID=None)[source]

Construct OneViewClient using a json file.

Parameters

file_name – json full path.

Return type

OneViewClient

property ha_nodes

Gets the HANodes API client.

Return type

HANodes

property hypervisor_cluster_profiles

Gets the Hypervisor Cluster Profiles API client.

Return type

Hypervisor Cluster Profiles

property hypervisor_managers

Gets the Hypervisor Managers API client.

Returns

HypervisorManagers

property id_pools

Gets the IdPools API client.

Return type

IdPools

property id_pools_ipv4_ranges

Gets the IdPoolsIpv4Ranges API client.

Return type

IdPoolsIpv4Ranges

property id_pools_ipv4_subnets

Gets the IdPoolsIpv4Subnets API client.

Return type

IdPoolsIpv4Subnets

property id_pools_vmac_ranges

Gets the IdPoolsRanges API Client for VMAC Ranges.

Return type

IdPoolsRanges

property id_pools_vsn_ranges

Gets the IdPoolsRanges API Client for VSN Ranges.

Return type

IdPoolsRanges

property id_pools_vwwn_ranges

Gets the IdPoolsRanges API Client for VWWN Ranges.

Return type

IdPoolsRanges

property index_resources

Gets the Index Resources API client.

Return type

IndexResources

Gets the InterconnectLinkTopologies API client.

Return type

InterconnectLinkTopologies

property interconnect_types

Gets the InterconnectTypes API client.

Return type

InterconnectTypes

property interconnects

Gets the Interconnects API client.

Return type

Interconnects

Gets the InternalLinkSets API client.

Return type

InternalLinkSets

property labels

Gets the Labels API client.

Return type

Labels

property licenses

Gets all the licenses Returns: List of licenses

Gets the LogicalDownlinks API client.

Return type

LogicalDownlinks

property logical_enclosures

Gets the LogicalEnclosures API client.

Return type

LogicalEnclosures

property logical_interconnect_groups

Gets the LogicalInterconnectGroups API client.

Return type

LogicalInterconnectGroups

property logical_interconnects

Gets the LogicalInterconnects API client.

Return type

LogicalInterconnects

property logical_switch_groups

Gets the LogicalSwitchGroups API client.

Return type

LogicalSwitchGroups

property logical_switches

Gets the LogicalSwitches API client.

Return type

LogicalSwitches

property login_details

Gets the login details

Returns: List of login details

property managed_sans

Gets the Managed SANs API client.

Return type

ManagedSANs

property metric_streaming

Gets the MetricStreaming API client.

Return type

MetricStreaming

property migratable_vc_domains

Gets the VC Migration Manager API client.

Return type

MigratableVcDomains

property network_sets

Gets the NetworkSets API client.

Return type

NetworkSets

property power_devices

Gets the PowerDevices API client.

Return type

PowerDevices

property rack_managers

Gets the Rack Manager API client.

Return type

RackManager

property racks

Gets the Racks API client.

Return type

Racks

property repositories

Gets the Repositories API client.

Return type

Repositories

property restores

Gets the Restores API client.

Return type

Restores

property roles

Gets the Roles API client.

Return type

Roles

property san_managers

Gets the Repositories API client.

Return type

Repositories

property san_providers

Gets the Repositories API client.

Return type

Repositories

property sas_interconnect_types

Gets the SasInterconnectTypes API client.

Return type

SasInterconnectTypes

property sas_interconnects

Gets the SAS Interconnects API client.

Return type

SasInterconnects

property sas_logical_interconnect_groups

Gets the SasLogicalInterconnectGroups API client.

Return type

SasLogicalInterconnectGroups

property sas_logical_interconnects

Gets the SasLogicalInterconnects API client.

Return type

SasLogicalInterconnects

property sas_logical_jbod_attachments

Gets the SAS Logical JBOD Attachments client.

Return type

SasLogicalJbodAttachments

property sas_logical_jbods

Gets the SAS Logical JBODs API client.

Return type

SasLogicalJbod

property scopes

Gets the Scopes API client.

Return type

Scopes

property server_hardware

Gets the ServerHardware API client.

Return type

ServerHardware

property server_hardware_types

Gets the ServerHardwareTypes API client.

Return type

ServerHardwareTypes

property server_profile_templates

Gets the ServerProfileTemplate API client.

Return type

ServerProfileTemplate

property server_profiles

Gets the ServerProfiles API client.

Return type

ServerProfiles

property storage_pools

Gets the StoragePools API client.

Return type

StoragePools

property storage_systems

Gets the StorageSystems API client.

Return type

StorageSystems

property storage_volume_attachments

Gets the StorageVolumeAttachments API client.

Return type

StorageVolumeAttachments

property storage_volume_templates

Gets the StorageVolumeTemplates API client.

Return type

StorageVolumeTemplates

property switch_types

Gets the SwitchTypes API client.

Return type

SwitchTypes

property switches

Gets the Switches API client.

Return type

Switches

property tasks

Gets the Tasks API client.

Return type

Tasks

property unmanaged_devices

Gets the Unmanaged Devices API client.

Return type

UnmanagedDevices

Gets the UplinkSets API client.

Return type

UplinkSets

property users

Gets the Users API client.

Return type

Users

property versions

Gets the Version API client.

Return type

Version

property volumes

Gets the Volumes API client.

Return type

Volumes

Module contents

HPE OneView Library

hpeOneView is a library for interfacing with HPE OneView Management Appliance.

hpeOneView.main()[source]