hpOneView package

Subpackages

Submodules

hpOneView.connection module

connection.py

This module maintains communication with the appliance.

class hpOneView.connection.connection(applianceIp, api_version=300, sslBundle=False, timeout=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=u'', method=u'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)[source]
getFirstPage()[source]
getLastPage()[source]
getNextPage()[source]
getPrevPage()[source]
get_by_uri(xuri)[source]
get_connection()[source]
get_eula_status()[source]
get_host()[source]
get_session()[source]
get_session_id()[source]
login(cred, 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=u'yes')[source]
set_proxy(proxyHost, proxyPort)[source]
set_session_id(session_id)[source]
set_trusted_ssl_bundle(sslBundle)[source]
validateVersion()[source]
hpOneView.connection.get_member(mlist)[source]
hpOneView.connection.get_members(mlist)[source]
hpOneView.connection.make_eula_dict(supportAccess)[source]
hpOneView.connection.make_initial_password_change_dict(userName, oldPassword, newPassword)[source]

hpOneView.exceptions module

exception hpOneView.exceptions.HPOneViewException(data, error=None)[source]

Bases: exceptions.Exception

OneView base Exception.

msg

Exception message.

Type:str
oneview_response

OneView rest response.

Type:dict
exception hpOneView.exceptions.HPOneViewInvalidResource(data, error=None)[source]

Bases: hpOneView.exceptions.HPOneViewException

OneView Invalid Resource Exception.

msg

Exception message.

Type:str
exception hpOneView.exceptions.HPOneViewMissingUniqueIdentifiers(data, error=None)[source]

Bases: hpOneView.exceptions.HPOneViewException

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

msg

Exception message.

Type:str
exception hpOneView.exceptions.HPOneViewResourceNotFound(data, error=None)[source]

Bases: hpOneView.exceptions.HPOneViewException

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

msg

Exception message.

Type:str
exception hpOneView.exceptions.HPOneViewTaskError(msg, error_code=None)[source]

Bases: hpOneView.exceptions.HPOneViewException

OneView Task Error Exception.

msg

Exception message.

Type:str
error_code

A code which uniquely identifies the specific error.

Type:str
exception hpOneView.exceptions.HPOneViewTimeout(data, error=None)[source]

Bases: hpOneView.exceptions.HPOneViewException

OneView Timeout Exception.

msg

Exception message.

Type:str
exception hpOneView.exceptions.HPOneViewUnavailableMethod(data, error=None)[source]

Bases: hpOneView.exceptions.HPOneViewException

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

msg

Exception message.

Type:str
exception hpOneView.exceptions.HPOneViewUnknownType(data, error=None)[source]

Bases: hpOneView.exceptions.HPOneViewException

OneView Unknown Type Error.

msg

Exception message.

Type:str
exception hpOneView.exceptions.HPOneViewValueError(data, error=None)[source]

Bases: hpOneView.exceptions.HPOneViewException

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

msg

Exception message.

Type:str
hpOneView.exceptions.handle_exceptions(exception_type, exception_value, exception_traceback, logger=<logging.Logger object>)[source]

hpOneView.oneview_client module

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

class hpOneView.oneview_client.OneViewClient(config)[source]

Bases: object

DEFAULT_API_VERSION = 300
alerts

Gets the Alerts API client.

Returns:
Return type:Alerts
api_version

Gets the OneView API Version.

Returns:API Version.
Return type:int
appliance_device_read_community

Gets the ApplianceDeviceReadCommunity API client.

Returns:
Return type:ApplianceDeviceReadCommunity
appliance_device_snmp_v1_trap_destinations

Gets the ApplianceDeviceSNMPv1TrapDestinations API client.

Returns:
Return type:ApplianceDeviceSNMPv1TrapDestinations
appliance_device_snmp_v3_trap_destinations

Gets the ApplianceDeviceSNMPv3TrapDestinations API client.

Returns:
Return type:ApplianceDeviceSNMPv3TrapDestinations
appliance_device_snmp_v3_users

Gets the ApplianceDeviceSNMPv3Users API client.

Returns:
Return type:ApplianceDeviceSNMPv3Users
appliance_node_information

Gets the ApplianceNodeInformation API client.

Returns:
Return type:ApplianceNodeInformation
appliance_time_and_locale_configuration

Gets the ApplianceTimeAndLocaleConfiguration API client.

Returns:
Return type:ApplianceTimeAndLocaleConfiguration
backups

Gets the Backup API client.

Returns:
Return type:Backups
certificate_authority

Gets the Certificate Authority API client.

Returns:
Return type:CertificateAuthority
certificate_rabbitmq

Gets the Certificate RabbitMQ API client.

Returns:
Return type:CertificateRabbitMQ
connection

Gets the underlying HPE OneView connection used by the OneViewClient.

Returns:
Return type:connection
connection_templates

Gets the ConnectionTemplates API client.

Returns:
Return type:ConnectionTemplates
connections

Gets the Connections API client.

Returns:
Return type:Connections
create_image_streamer_client()[source]

Create the Image Streamer API Client.

Returns:
Return type:ImageStreamerClient
datacenters

Gets the Datacenters API client.

Returns:
Return type:Datacenters
drive_enclosures

Gets the Drive Enclosures API client.

Returns:
Return type:DriveEnclosures
enclosure_groups

Gets the EnclosureGroups API client.

Returns:
Return type:EnclosureGroups
enclosures

Gets the Enclosures API client.

Returns:
Return type:Enclosures
endpoints

Gets the Endpoints API client.

Returns:
Return type:Endpoints
ethernet_networks

Gets the EthernetNetworks API client.

Returns:
Return type:EthernetNetworks
events

Gets the Events API client.

Returns:
Return type:Events
fabrics

Gets the Fabrics API client.

Returns:
Return type:Fabrics
fc_networks

Gets the FcNetworks API client.

Returns:
Return type:FcNetworks
fcoe_networks

Gets the FcoeNetworks API client.

Returns:
Return type:FcoeNetworks
firmware_bundles

Gets the FirmwareBundles API client.

Returns:
Return type:FirmwareBundles
firmware_drivers

Gets the FirmwareDrivers API client.

Returns:
Return type:FirmwareDrivers
classmethod from_environment_variables()[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_IMAGE_STREAMER_IP, ONEVIEWSDK_SESSIONID, ONEVIEWSDK_SSL_CERTIFICATE, ONEVIEWSDK_CONNECTION_TIMEOUT and ONEVIEWSDK_PROXY.

Returns:
Return type:OneViewClient
classmethod from_json_file(file_name)[source]

Construct OneViewClient using a json file.

Parameters:file_name – json full path.
Returns:
Return type:OneViewClient
id_pools

Gets the IdPools API client.

Returns:
Return type:IdPools
id_pools_ipv4_ranges

Gets the IdPoolsIpv4Ranges API client.

Returns:
Return type:IdPoolsIpv4Ranges
id_pools_ipv4_subnets

Gets the IdPoolsIpv4Subnets API client.

Returns:
Return type:IdPoolsIpv4Subnets
id_pools_vmac_ranges

Gets the IdPoolsRanges API Client for VMAC Ranges.

Returns:
Return type:IdPoolsRanges
id_pools_vsn_ranges

Gets the IdPoolsRanges API Client for VSN Ranges.

Returns:
Return type:IdPoolsRanges
id_pools_vwwn_ranges

Gets the IdPoolsRanges API Client for VWWN Ranges.

Returns:
Return type:IdPoolsRanges
index_resources

Gets the Index Resources API client.

Returns:
Return type:IndexResources

Gets the InterconnectLinkTopologies API client.

Returns:
Return type:InterconnectLinkTopologies
interconnect_types

Gets the InterconnectTypes API client.

Returns:
Return type:InterconnectTypes
interconnects

Gets the Interconnects API client.

Returns:
Return type:Interconnects

Gets the InternalLinkSets API client.

Returns:
Return type:InternalLinkSets
labels

Gets the Labels API client.

Returns:
Return type:Labels
licenses

Gets all the licenses Returns: List of licenses

Gets the LogicalDownlinks API client.

Returns:
Return type:LogicalDownlinks
logical_enclosures

Gets the LogicalEnclosures API client.

Returns:
Return type:LogicalEnclosures
logical_interconnect_groups

Gets the LogicalInterconnectGroups API client.

Returns:
Return type:LogicalInterconnectGroups
logical_interconnects

Gets the LogicalInterconnects API client.

Returns:
Return type:LogicalInterconnects
logical_switch_groups

Gets the LogicalSwitchGroups API client.

Returns:
Return type:LogicalSwitchGroups
logical_switches

Gets the LogicalSwitches API client.

Returns:
Return type:LogicalSwitches
login_details

Gets the login details

Returns: List of login details

managed_sans

Gets the Managed SANs API client.

Returns:
Return type:ManagedSANs
metric_streaming

Gets the MetricStreaming API client.

Returns:
Return type:MetricStreaming
migratable_vc_domains

Gets the VC Migration Manager API client.

Returns:
Return type:MigratableVcDomains
network_sets

Gets the NetworkSets API client.

Returns:
Return type:NetworkSets
os_deployment_plans

Gets the Os Deployment Plans API client.

Returns:
Return type:OsDeploymentPlans
os_deployment_servers

Gets the Os Deployment Servers API client.

Returns:
Return type:OsDeploymentServers
power_devices

Gets the PowerDevices API client.

Returns:
Return type:PowerDevices
racks

Gets the Racks API client.

Returns:
Return type:Racks
restores

Gets the Restores API client.

Returns:
Return type:Restores
roles

Gets the Roles API client.

Returns:
Return type:Roles
san_managers

Gets the SanManagers API client.

Returns:
Return type:SanManagers
sas_interconnect_types

Gets the SasInterconnectTypes API client.

Returns:
Return type:SasInterconnectTypes
sas_interconnects

Gets the SAS Interconnects API client.

Returns:
Return type:SasInterconnects
sas_logical_interconnect_groups

Gets the SasLogicalInterconnectGroups API client.

Returns:
Return type:SasLogicalInterconnectGroups
sas_logical_interconnects

Gets the SasLogicalInterconnects API client.

Returns:
Return type:SasLogicalInterconnects
sas_logical_jbod_attachments

Gets the SAS Logical JBOD Attachments client.

Returns:
Return type:SasLogicalJbodAttachments
sas_logical_jbods

Gets the SAS Logical JBODs API client.

Returns:
Return type:SasLogicalJbod
scopes

Gets the Scopes API client.

Returns:
Return type:Scopes
server_hardware

Gets the ServerHardware API client.

Returns:
Return type:ServerHardware
server_hardware_types

Gets the ServerHardwareTypes API client.

Returns:
Return type:ServerHardwareTypes
server_profile_templates

Gets the ServerProfileTemplate API client.

Returns:
Return type:ServerProfileTemplate
server_profiles

Gets the ServerProfiles API client.

Returns:
Return type:ServerProfiles
storage_pools

Gets the StoragePools API client.

Returns:
Return type:StoragePools
storage_systems

Gets the StorageSystems API client.

Returns:
Return type:StorageSystems
storage_volume_attachments

Gets the StorageVolumeAttachments API client.

Returns:
Return type:StorageVolumeAttachments
storage_volume_templates

Gets the StorageVolumeTemplates API client.

Returns:
Return type:StorageVolumeTemplates
switch_types

Gets the SwitchTypes API client.

Returns:
Return type:SwitchTypes
switches

Gets the Switches API client.

Returns:
Return type:Switches
tasks

Gets the Tasks API client.

Returns:
Return type:Tasks
unmanaged_devices

Gets the Unmanaged Devices API client.

Returns:
Return type:UnmanagedDevices

Gets the UplinkSets API client.

Returns:
Return type:UplinkSets
users

Gets the Users API client.

Returns:
Return type:Users
versions

Gets the Version API client.

Returns:
Return type:Version
volumes

Gets the Volumes API client.

Returns:
Return type:Volumes

Module contents

HPE OneView Library

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

hpOneView.main()[source]