hpOneView.resources.networking package

Submodules

hpOneView.resources.networking.connection_templates module

class hpOneView.resources.networking.connection_templates.ConnectionTemplates(connection, data=None)[source]

Bases: hpOneView.resources.resource.Resource

Connection Templates API client.

DEFAULT_VALUES = {u'200': {u'type': u'connection-template'}, u'300': {u'type': u'connection-template'}, u'500': {u'type': u'connection-template'}, u'600': {u'type': u'connection-template'}, u'800': {u'type': u'connection-template'}}
URI = u'/rest/connection-templates'
get_default()[source]

Gets the default network connection template. This is the default connection template used for construction of networks. Its value is copied when a new connection template is made.

Returns:
Return type:dict

hpOneView.resources.networking.ethernet_networks module

class hpOneView.resources.networking.ethernet_networks.EthernetNetworks(connection, data=None)[source]

Bases: hpOneView.resources.resource.ResourcePatchMixin, hpOneView.resources.resource.Resource

Ethernet Networks API client.

BULK_DEFAULT_VALUES = {u'200': {u'type': u'bulk-ethernet-network'}, u'300': {u'type': u'bulk-ethernet-network'}, u'500': {u'type': u'bulk-ethernet-network'}, u'600': {u'type': u'bulk-ethernet-networkV1'}, u'800': {u'type': u'bulk-ethernet-networkV1'}}
DEFAULT_VALUES = {u'200': {u'type': u'ethernet-networkV3'}, u'300': {u'type': u'ethernet-networkV300'}, u'500': {u'type': u'ethernet-networkV300'}, u'600': {u'type': u'ethernet-networkV4'}, u'800': {u'type': u'ethernet-networkV4'}}
URI = u'/rest/ethernet-networks'
create_bulk(resource, timeout=-1)[source]

Creates bulk Ethernet networks.

Parameters:
  • resource (dict) – Specifications to create in bulk.
  • 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:

List of created Ethernet Networks.

Return type:

list

dissociate_values_or_ranges(vlan_id_range)[source]

Build a list of vlan ids given a combination of ranges and/or values

Examples

>>> enet.dissociate_values_or_ranges('1-2,5')
    [1, 2, 5]
>>> enet.dissociate_values_or_ranges('5')
    [1, 2, 3, 4, 5]
>>> enet.dissociate_values_or_ranges('4-5,7-8')
    [4, 5, 7, 8]
Parameters:vlan_id_range – A combination of values or ranges. For example, ‘1-10,50,51,500-700’.
Returns:vlan ids
Return type:list
get_associated_profiles = <functools.partial object>
get_range(name_prefix, vlan_id_range)[source]

Gets a list of Ethernet Networks that match the ‘given name_prefix’ and the ‘vlan_id_range’.

Examples

>>> enet.get_range('Enet_name', '1-2,5')
    # The result contains the ethernet network with names:
    ['Enet_name_1', 'Enet_name_2', 'Enet_name_5']
>>> enet.get_range('Enet_name', '2')
    # The result contains the ethernet network with names:
    ['Enet_name_1', 'Enet_name_2']
Parameters:
  • name_prefix – The Ethernet Network prefix
  • vlan_id_range – A combination of values or ranges to be retrieved. For example, ‘1-10,50,51,500-700’.
Returns:

A list of Ethernet Networks.

Return type:

list

hpOneView.resources.networking.fabrics module

class hpOneView.resources.networking.fabrics.Fabrics(con)[source]

Bases: object

Fabrics API client.

DEFAULT_VALUES = {u'300': {u'type': u'vlan-pool'}, u'500': {u'type': u'vlan-pool'}}
URI = u'/rest/fabrics'
get(id_or_uri)[source]

Gets the fabric with the specified ID.

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

Gets a paginated collection of all fabrics based on the specified parameters.

Filters can be used in the URL to control the number of fabrics that are returned. With no filters specified, the API returns all supported fabrics.

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

Return type:

list

get_by(field, value)[source]

Gets all fabrics that match the filter.

The search is case-insensitive.

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

A list of fabrics.

Return type:

list

get_reserved_vlan_range(id_or_uri)[source]

Gets the reserved vlan ID range for the fabric.

Note

This method is only available on HPE Synergy.

Parameters:id_or_uri – ID or URI of fabric.
Returns:vlan-pool
Return type:dict
update_reserved_vlan_range(id_or_uri, vlan_pool, force=False)[source]

Updates the reserved vlan ID range for the fabric.

Note

This method is only available on HPE Synergy.

Parameters:
  • id_or_uri – ID or URI of fabric.
  • vlan_pool (dict) – vlan-pool data 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.
Returns:

The fabric

Return type:

dict

hpOneView.resources.networking.fc_networks module

class hpOneView.resources.networking.fc_networks.FcNetworks(connection, data=None)[source]

Bases: hpOneView.resources.resource.ResourcePatchMixin, hpOneView.resources.resource.Resource

Fibre Channel networks API client.

DEFAULT_VALUES = {u'200': {u'type': u'fc-networkV2'}, u'300': {u'type': u'fc-networkV300'}, u'500': {u'type': u'fc-networkV300'}, u'600': {u'type': u'fc-networkV4'}, u'800': {u'type': u'fc-networkV4'}}
URI = u'/rest/fc-networks'

hpOneView.resources.networking.fcoe_networks module

class hpOneView.resources.networking.fcoe_networks.FcoeNetworks(connection, data=None)[source]

Bases: hpOneView.resources.resource.ResourcePatchMixin, hpOneView.resources.resource.Resource

FCoE Networks API client.

DEFAULT_VALUES = {u'200': {u'type': u'fcoe-network'}, u'300': {u'type': u'fcoe-networkV300'}, u'500': {u'type': u'fcoe-networkV300'}, u'600': {u'type': u'fcoe-networkV4'}, u'800': {u'type': u'fcoe-networkV4'}}
URI = u'/rest/fcoe-networks'

hpOneView.resources.networking.interconnect_types module

class hpOneView.resources.networking.interconnect_types.InterconnectTypes(connection, data=None)[source]

Bases: hpOneView.resources.resource.Resource

Interconnect Types API client.

URI = u'/rest/interconnect-types'

hpOneView.resources.networking.interconnects module

class hpOneView.resources.networking.interconnects.Interconnects(con)[source]

Bases: object

Interconnects API client.

URI = u'/rest/interconnects'
get(id_or_uri)[source]

Gets the Interconnect by ID or by URI.

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

Gets a paginated collection of interconnects that includes the ports.

To avoid a timeout on busy systems, the recommended maximum value of count is 2.

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

Return type:

list

get_by(field, value)[source]

Gets all interconnects that match the filter The search is case-insensitive

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

A list of interconnects.

Return type:

list

get_by_name(name)[source]

Retrieve an Interconnect by its name.

Parameters:name – Interconnect name.
Returns:Interconnect.
Return type:dict
get_name_servers(id_or_uri)[source]

Gets the named servers for an interconnect.

Parameters:id_or_uri – Can be either the interconnect id or the interconnect uri.
Returns:the name servers for an interconnect.
Return type:dict
get_pluggable_module_information(id_or_uri)[source]

Gets all the pluggable module information.

Parameters:id_or_uri – Can be either the interconnect id or uri.
Returns:dicts of the pluggable module information.
Return type:array
get_port(id_or_uri, port_id_or_uri)[source]

Gets an interconnect port.

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

The interconnect port.

Return type:

dict

get_ports(id_or_uri, start=0, count=-1)[source]

Gets all interconnect ports.

Parameters:
  • id_or_uri – Can be either the interconnect id or the interconnect 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.
Returns:

All interconnect ports.

Return type:

list

get_statistics(id_or_uri, port_name=u'')[source]

Gets the statistics from an interconnect.

Parameters:
  • id_or_uri – Can be either the interconnect id or the interconnect uri.
  • port_name (str) – A specific port name of an interconnect.
Returns:

The statistics for the interconnect that matches id.

Return type:

dict

get_subport_statistics(id_or_uri, port_name, subport_number)[source]

Gets the subport statistics on an interconnect.

Parameters:
  • id_or_uri – Can be either the interconnect id or the interconnect uri.
  • port_name (str) – A specific port name of an interconnect.
  • subport_number (int) – The subport.
Returns:

The statistics for the interconnect that matches id, port_name, and subport_number.

Return type:

dict

patch(id_or_uri, operation, path, value, timeout=-1)[source]

Performs a specific patch operation for the given interconnect.

There is a limited set of interconnect properties which might be changed. They are: ‘powerState’, ‘uidState’, and ‘deviceResetState’.

If the interconnect supports the operation, the operation is performed and a task is returned through which the results are reported.

Parameters:
  • id_or_uri – Can be either the interconnect id or the interconnect uri
  • operation – The type of operation: one of “add”, “copy”, “move”, “remove”, “replace”, or “test”.
  • path – The JSON path the operation is to use. The exact meaning depends on the type of operation.
  • value – The value to add or replace for “add” and “replace” operations or the value to compare against for a “test” operation. Not used by “copy”, “move”, or “remove”.
Returns:

dict

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

Triggers a reset of port protection.

Cause port protection to be reset on all the interconnects of the logical interconnect that matches ID.

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

The interconnect.

Return type:

dict

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

Reapplies the appliance’s configuration on the interconnect. This includes running the same configure steps that were performed as part of the interconnect add by the enclosure.

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

Interconnect

update_port(port_information, id_or_uri, timeout=-1)[source]

Updates an interconnect port.

Parameters:
  • id_or_uri – Can be either the interconnect id or the interconnect uri.
  • port_information (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:

The interconnect.

Return type:

dict

update_ports(ports, id_or_uri, timeout=-1)[source]

Updates the interconnect ports.

Parameters:
  • id_or_uri – Can be either the interconnect id or the interconnect uri.
  • ports (list) – Ports 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:

The interconnect.

Return type:

dict

hpOneView.resources.networking.logical_interconnect_groups module

class hpOneView.resources.networking.logical_interconnect_groups.LogicalInterconnectGroups(connection, data=None)[source]

Bases: hpOneView.resources.resource.ResourcePatchMixin, hpOneView.resources.resource.Resource

Logical Interconnect Groups API client.

DEFAULT_VALUES = {u'200': {u'type': u'logical-interconnect-groupV3'}, u'300': {u'type': u'logical-interconnect-groupV300'}, u'500': {u'type': u'logical-interconnect-groupV300'}, u'600': {u'type': u'logical-interconnect-groupV4'}, u'800': {u'type': u'logical-interconnect-groupV5'}}
URI = u'/rest/logical-interconnect-groups'
get_all(start=0, count=-1, filter=u'', sort=u'', scope_uris=u'')[source]

Gets a list of logical interconnect groups 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.
  • scope_uris – An expression to restrict the resources returned according to the scopes to which they are assigned.
Returns:

A list of logical interconnect groups.

Return type:

list

get_default_settings()[source]

Gets the default interconnect settings for a logical interconnect group.

Returns:Interconnect Settings.
Return type:dict
get_settings()[source]

Gets the interconnect settings for a logical interconnect group.

Returns:Interconnect Settings.
Return type:dict

hpOneView.resources.networking.logical_interconnects module

class hpOneView.resources.networking.logical_interconnects.LogicalInterconnects(connection, data=None)[source]

Bases: hpOneView.resources.resource.ResourcePatchMixin, hpOneView.resources.resource.Resource

Logical Interconnects API client.

FIRMWARE_PATH = u'/firmware'
FORWARDING_INFORMATION_PATH = u'/forwarding-information-base'
LOCATIONS_PATH = u'/locations/interconnects'
PORT_MONITOR_PATH = u'/port-monitor'
QOS_AGGREGATED_CONFIGURATION = u'/qos-aggregated-configuration'
SETTINGS_DEFAULT_VALUES = {u'200': {u'type': u'InterconnectSettingsV3'}, u'300': {u'type': u'InterconnectSettingsV201'}, u'500': {u'type': u'InterconnectSettingsV201'}}
SETTINGS_ETHERNET_DEFAULT_VALUES = {u'200': {u'type': u'EthernetInterconnectSettingsV3'}, u'300': {u'type': u'EthernetInterconnectSettingsV201'}, u'500': {u'type': u'EthernetInterconnectSettingsV201'}, u'600': {u'type': u'EthernetInterconnectSettingsV4'}, u'800': {u'type': u'EthernetInterconnectSettingsV4'}}
SETTINGS_TELEMETRY_CONFIG_DEFAULT_VALUES = {u'200': {u'type': u'telemetry-configuration'}, u'300': {u'type': u'telemetry-configuration'}, u'500': {u'type': u'telemetry-configuration'}, u'600': {u'type': u'telemetry-configuration'}, u'800': {u'type': u'telemetry-configuration'}}
SNMP_CONFIGURATION_PATH = u'/snmp-configuration'
URI = u'/rest/logical-interconnects'
create()[source]

Create method is not available for this resource

create_forwarding_information_base = <functools.partial object>
create_interconnect(location_entries, timeout=-1)[source]

Creates an interconnect at the given location.

Warning

It does not create the LOGICAL INTERCONNECT itself. It will fail if no interconnect is already present on the specified position.

Parameters:
  • location_entries (dict) – Dictionary with location entries.
  • 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 interconnect.

Return type:

dict

delete()[source]

Delete method is not available for this resource

delete_interconnect(enclosure_uri, bay, timeout=-1)[source]

Deletes an interconnect from a location.

Warning

This won’t delete the LOGICAL INTERCONNECT itself and might cause inconsistency between the enclosure and Logical Interconnect Group.

Parameters:
  • enclosure_uri – URI of the Enclosure
  • bay – Bay
  • 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:

Indicating if the interconnect was successfully deleted.

Return type:

bool

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

Gets a list of logical interconnects 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.
  • 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 logical interconnects.

Return type:

list

get_by_name(name)[source]

Gets a logical interconnect by name.

Parameters:name – Name of the logical interconnect.
Returns:Logical Interconnect.
Return type:dict
get_ethernet_settings = <functools.partial object>
get_firmware = <functools.partial object>
get_forwarding_information_base = <functools.partial object>
get_internal_vlans = <functools.partial object>
get_port_monitor = <functools.partial object>
get_qos_aggregated_configuration = <functools.partial object>
get_snmp_configuration = <functools.partial object>
get_telemetry_configuration = <functools.partial object>
get_unassigned_ports = <functools.partial object>
install_firmware = <functools.partial object>
locations_uri = u'/rest/logical-interconnects/locations/interconnects'
update()[source]

Update method is not available for this resource

update_compliance = <functools.partial object>
update_configuration = <functools.partial object>
update_ethernet_settings = <functools.partial object>
update_internal_networks = <functools.partial object>
update_port_monitor = <functools.partial object>
update_qos_aggregated_configuration = <functools.partial object>
update_settings = <functools.partial object>
update_snmp_configuration = <functools.partial object>
update_telemetry_configurations = <functools.partial object>

hpOneView.resources.networking.logical_switch_groups module

class hpOneView.resources.networking.logical_switch_groups.LogicalSwitchGroups(connection, data=None)[source]

Bases: hpOneView.resources.resource.ResourcePatchMixin, hpOneView.resources.resource.Resource

Logical Switch Groups API client.

Note

This resource is only available on C7000 enclosures.

DEFAULT_VALUES = {u'200': {u'type': u'logical-switch-group'}, u'300': {u'type': u'logical-switch-groupV300'}, u'500': {u'type': u'logical-switch-groupV300'}, u'600': {u'type': u'logical-switch-groupV4'}, u'800': {u'type': u'logical-switch-groupV4'}}
URI = u'/rest/logical-switch-groups'

hpOneView.resources.networking.logical_switches module

class hpOneView.resources.networking.logical_switches.LogicalSwitches(con)[source]

Bases: object

Logical Switches API client.

Note

This resource is only available on C7000 enclosures.

SWITCH_DEFAULT_VALUES = {u'200': {u'type': u'logical-switch'}, u'300': {u'type': u'logical-switchV300'}, u'500': {u'type': u'logical-switchV300'}, u'600': {u'type': u'logical-switchV4'}}
URI = u'/rest/logical-switches'
create(resource, timeout=-1)[source]

Creates a Logical Switch.

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]

Deletes a Logical Switch.

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 Logical Switch with the specified ID.

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

Gets a paginated collection of Logical Switches. 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 Logical Switches.

Return type:

list

get_by(field, value)[source]

Gets all Logical Switches that match the filter.

The search is case-insensitive.

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

A list of Logical Switches.

Return type:

list

patch(id_or_uri, operation, path, value, timeout=-1)[source]

Uses the PATCH to update a resource for a given logical switch group.

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

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

The Refresh action reclaims the top-of-rack switches in a logical switch.

Parameters:
  • id_or_uri – Can be either the Logical Switch ID or URI
  • 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:

The Logical Switch

Return type:

dict

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

Updates a Logical Switch.

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

Return type:

dict

hpOneView.resources.networking.network_sets module

class hpOneView.resources.networking.network_sets.NetworkSets(con)[source]

Bases: object

Network Sets API client.

DEFAULT_VALUES = {u'200': {u'type': u'network-set'}, u'300': {u'type': u'network-setV300'}, u'500': {u'type': u'network-setV300'}, u'600': {u'type': u'network-setV4'}}
URI = u'/rest/network-sets'
create(resource, timeout=-1)[source]

Creates a network set.

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

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

Deletes a network set.

Any deployed connections that are using the network are placed in the ‘Failed’ state.

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 network set with the specified ID.

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

Gets a paginated collection of network sets. 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 Network sets.

Return type:

list

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

Gets a paginated collection of network sets without ethernet. 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:

List of network sets, excluding Ethernet networks.

Return type:

list

get_by(field, value)[source]

Gets all network sets that match the filter.

The search is case-insensitive.

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

A list of Network sets.

Return type:

list

get_without_ethernet(id_or_uri)[source]

Gets the network set with the specified ID or URI without ethernet.

Parameters:id_or_uri – Can be either the Network Set ID or URI.
Returns:Network set excluding Ethernet networks.
Return type:dict
patch(id_or_uri, operation, path, value, timeout=-1)[source]

Uses the PATCH to update the given resource.

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 network set.

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

Return type:

dict

hpOneView.resources.networking.sas_interconnect_types module

class hpOneView.resources.networking.sas_interconnect_types.SasInterconnectTypes(connection, data=None)[source]

Bases: hpOneView.resources.resource.Resource

SAS Interconnect Types API client.

Note

This resource is only available on HPE Synergy.

URI = u'/rest/sas-interconnect-types'
create()[source]

Create method is not available

delete()[source]

Delete method is not avaialble

update()[source]

Update method is not avaialble

hpOneView.resources.networking.sas_interconnects module

class hpOneView.resources.networking.sas_interconnects.SasInterconnects(connection, data=None)[source]

Bases: hpOneView.resources.resource.ResourcePatchMixin, hpOneView.resources.resource.Resource

SAS Interconnects API client.

Note

This resource is only available on HPE Synergy.

URI = u'/rest/sas-interconnects'
create()[source]

Create method is not available

delete()[source]

Delete method is not available

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

Get list of SAS interconnects each with port details.

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 may differ from the requested count if the sum of start and count exceeds the total number of items.
  • fields – Specifies which fields should be returned in the result set.
  • 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.
  • 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 SAS interconnects.

Return type:

list

refresh_state(configuration)[source]

Refresh a SAS Interconnect.

Parameters:configuration – Configuration
Returns:SAS Interconnect
Return type:dict
update()[source]

Update method is not available

hpOneView.resources.networking.sas_logical_interconnect_groups module

class hpOneView.resources.networking.sas_logical_interconnect_groups.SasLogicalInterconnectGroups(connection, data=None)[source]

Bases: hpOneView.resources.resource.Resource

SAS Logical Interconnect Groups API client.

Note

This resource is only available on HPE Synergy.

DEFAULT_VALUES = {u'300': {u'type': u'sas-logical-interconnect-group'}, u'500': {u'type': u'sas-logical-interconnect-group'}, u'600': {u'type': u'sas-logical-interconnect-groupV2'}, u'800': {u'type': u'sas-logical-interconnect-groupV2'}}
URI = u'/rest/sas-logical-interconnect-groups'
get_all(start=0, count=-1, filter=u'', sort=u'', scope_uris=u'', query=u'')[source]

Gets a paginated collection of SAS logical interconnect groups. 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.
  • scope_uris – An expression to restrict the resources returned according to the scopes to which they are assigned.
  • query (str) – A general query string to narrow the list of resources returned. The default is no query - all resources are returned.
Returns:

A list of SAS logical interconnect groups.

Return type:

list

hpOneView.resources.networking.sas_logical_interconnects module

class hpOneView.resources.networking.sas_logical_interconnects.SasLogicalInterconnects(connection, data=None)[source]

Bases: hpOneView.resources.resource.Resource

SAS Logical Interconnects API client.

URI = u'/rest/sas-logical-interconnects'
create()[source]

Create method is not available

delete()[source]

Delete method is not available

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

Gets a list of SAS Logical Interconnects 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 may differ from the requested count if the sum of start and count exceeds the total number of items.
  • fields – Specifies which fields should be returned in the result set.
  • 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.
  • 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 SAS logical interconnects.

Return type:

list

get_firmware = <functools.partial object>
replace_drive_enclosure = <functools.partial object>
update()[source]

update method is not available

update_compliance = <functools.partial object>
update_compliance_all(information, timeout=-1)[source]

Returns SAS Logical Interconnects to a consistent state. The current SAS Logical Interconnect state is compared to the associated SAS Logical Interconnect group.

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

SAS Logical Interconnect.

Return type:

dict

update_configuration = <functools.partial object>
update_firmware = <functools.partial object>

hpOneView.resources.networking.switch_types module

class hpOneView.resources.networking.switch_types.SwitchTypes(connection, data=None)[source]

Bases: hpOneView.resources.resource.Resource

Switch Types API client.

URI = u'/rest/switch-types'

hpOneView.resources.networking.switches module

class hpOneView.resources.networking.switches.Switches(con)[source]

Bases: object

Switches API client.

Note

This resource is only available on C7000 enclosures.

URI = u'/rest/switches'
delete(resource, force=False, timeout=-1)[source]

Deletes a migrated switch.

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:

Indicates if the resource was successfully deleted.

Return type:

bool

get(id_or_uri)[source]

Gets a switch by ID or by URI.

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

Gets a list of top of rack switches.

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 rack switches.

Return type:

list

get_by(field, value)[source]

Gets all switches that match the filter.

The search is case-insensitive.

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

A list of rack switches.

Return type:

list

get_environmental_configuration(id_or_uri)[source]

Gets the environmental configuration for a switch.

Parameters:id_or_uri – Can be either the resource ID or URI.
Returns:environmental configuration
Return type:dict
get_statistics(id_or_uri, port_name=u'')[source]

Gets statistics for a switch.

Parameters:
  • id_or_uri – Can be either the switch id or the switch uri.
  • port_name – switch port number (optional)
Returns:

dict

patch(id_or_uri, operation, path, value, timeout=-1)[source]

Uses the PATCH to update a resource for a given logical switch.

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_ports(ports, id_or_uri)[source]

Updates the switch ports. Only the ports under the management of OneView and those that are unlinked are supported for update.

Note

This method is available for API version 300 or later.

Parameters:
  • ports – List of Switch Ports.
  • id_or_uri – Can be either the switch id or the switch uri.
Returns:

Switch

Return type:

dict

Module contents