hpeOneView.resources.servers package

Submodules

hpeOneView.resources.servers.connections module

class hpeOneView.resources.servers.connections.Connections(con)[source]

Bases: object

Connections API client.

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

Returns the connection with the specified ID or URI.

Parameters

id – ID or URI of connection

Returns

dict

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

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

  • fields – Specifies which fields should be returned in the result set.

  • 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 connections.

Return type

list

get_by(field, value)[source]

Gets all connections that match the filter.

The search is case-insensitive.

Parameters
  • field – Field name to filter.

  • value – Value to filter.

Returns

A list of connections.

Return type

list

hpeOneView.resources.servers.enclosure_groups module

class hpeOneView.resources.servers.enclosure_groups.EnclosureGroups(connection, data=None)[source]

Bases: Resource

Enclosure Groups API client.

URI = '/rest/enclosure-groups'
get_all(start=0, count=-1, filter='', sort='', scope_uris='')[source]

Gets a list of enclosure groups.

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 enclosure groups.

Return type

list

get_script(**kwargs)
update_script(script_body)[source]

Updates the configuration script of the enclosure-group with the specified URI.

Parameters
  • id_or_uri – Resource id or resource uri.

  • script_body – Configuration script.

Returns

Updated enclosure group.

Return type

dict

hpeOneView.resources.servers.enclosures module

class hpeOneView.resources.servers.enclosures.Enclosures(connection, data=None)[source]

Bases: ResourcePatchMixin, ResourceZeroBodyMixin, ResourceUtilizationMixin, Resource

Enclosures API client.

URI = '/rest/enclosures'
add(information, timeout=-1)[source]
C7000:

Takes information about an enclosure (for example: IP address, username, password) and uses it to claim/configure the enclosure and add its components to the appliance.

Synergy:

Adds a remote enclosure and all the enclosures linked to that enclosure by their frame link modules. The remote enclosures’ frame link modules must not be claimed by another appliance. The IP used must be the frame link module’s Link Local IPv6 address.

Parameters
  • information – Enclosure information to add.

  • 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

Enclosure.

Return type

dict

generate_csr(**kwargs)
get_all(start=0, count=-1, filter='', sort='', scope_uris='')[source]

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

A list of Enclosures.

Return type

list

get_by_hostname(hostname)[source]

Get enclosure by it’s hostname

get_csr(**kwargs)
get_environmental_configuration(**kwargs)
get_sso(**kwargs)
import_certificate(**kwargs)
refresh_state(**kwargs)
remove(force=False)[source]

Remove enclosure

update_configuration(timeout=-1)[source]

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

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

Enclosure

update_environmental_configuration(**kwargs)

hpeOneView.resources.servers.id_pools module

class hpeOneView.resources.servers.id_pools.IdPools(connection, data=None)[source]

Bases: Resource, ResourceSchemaMixin

Class for Id Pools API client.

URI = '/rest/id-pools'
allocate(information, pool_type, timeout=-1)[source]

Allocates a set of IDs from range.

The allocator returned contains the list of IDs successfully allocated.

Parameters
  • information (dict) – Information to update. Can result in system specified IDs or the system reserving user-specified IDs.

  • pool_type – Id pool type

  • 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

A dict containing a list with IDs.

Return type

dict

collect(information, pool_type, timeout=-1)[source]

Collects one or more IDs to be returned to a pool.

Parameters
  • information (dict) – The list of IDs to be collected

  • pool_type – Id pool type

  • 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

Collector containing list of collected IDs successfully collected.

Return type

dict

generate(pool_type)[source]

Generates and returns a random range.

Parameters

pool_type – Id pool type

Returns

A dict containing a list with IDs.

Return type

dict

get_check_range_availability(pool_type, ids_pools)[source]

Checks the range availability in the ID pool.

Parameters
  • pool_type – Id pool type

  • ids_pools (list) – List of Id Pools.

Returns

A dict containing a list with IDs.

Return type

dict

get_pool_type(pool_type)[source]

Gets a pool along with the list of ranges present in it

Parameters

pool_type – Id pool type

Returns

List of ranges

Return type

dict

update_pool_type(data, pool_type, timeout=-1)[source]

Enables or disables the pool

Parameters
  • data – List of ID ranges

  • pool_type – Id pool type

Returns

Updated Resource.

Return type

dict

validate(information, pool_type, timeout=-1)[source]

Validates a set of user specified IDs to reserve in the pool.

This API can be used to check if the specified IDs can be allocated.

Parameters
  • information (dict) – Information to update. Can result in system specified IDs or the system reserving user-specified IDs.

  • pool_type – Id pool type

  • 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

A dict containing a list with IDs.

Return type

dict

validate_id_pool(pool_type, ids_pools)[source]

Validates an ID pool.

Parameters
  • pool_type – Id pool type

  • ids_pools (list) – List of Id Pools.

Returns

A dict containing a list with IDs.

Return type

dict

hpeOneView.resources.servers.id_pools_ipv4_ranges module

class hpeOneView.resources.servers.id_pools_ipv4_ranges.IdPoolsIpv4Ranges(connection, data=None)[source]

Bases: Resource, ResourceSchemaMixin

The ID pools IPv4 ranges resource provides a Client API for managing IPv4 ranges.

URI = '/rest/id-pools/ipv4/ranges'
enable(information, uri, timeout=-1)[source]

Enables or disables an IPv4 range.

Parameters
  • information (dict) – Information to update.

  • uri – URI of range.

  • 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 IPv4 range.

Return type

dict

get_allocated_fragments(uri, count=-1, start=0)[source]

Gets all fragments that have been allocated in range.

Parameters
  • uri – URI of range.

  • 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 exceed the total number of items.

  • start – The first item to return, using 0-based indexing. If not specified, the default is 0 - start with the first available item.

Returns

A list with the allocated fragements.

Return type

list

get_free_fragments(uri, count=-1, start=0)[source]

Gets all free fragments in an IPv4 range.

Parameters
  • uri – URI of range.

  • 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 exceed the total number of items.

  • start – The first item to return, using 0-based indexing. If not specified, the default is 0 - start with the first available item.

Returns

A list with the free fragments.

Return type

list

update_allocator(information, uri, timeout=-1)[source]

Allocates a set of IDs from an IPv4 range.

Parameters
  • information (dict) – Information to update.

  • id_or_uri – URI of range.

  • 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 allocator returned contains the list of IDs successfully allocated.

Return type

dict

update_collector(information, uri, timeout=-1)[source]

Collects a set of IDs back to an IPv4 range.

Parameters
  • information (dict) – Information to update.

  • id_or_uri – URI of range.

  • 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 collector returned contains the list of IDs successfully collected.

Return type

dict

hpeOneView.resources.servers.id_pools_ipv4_subnets module

class hpeOneView.resources.servers.id_pools_ipv4_subnets.IdPoolsIpv4Subnets(connection, data=None)[source]

Bases: Resource

The ID pools IPv4 subnets resource provides a Client API for managing IPv4 subnets.

URI = '/rest/id-pools/ipv4/subnets'
allocate(information, subnet_id, timeout=-1)[source]

Allocates a set of IDs from range. The allocator returned contains the list of IDs successfully allocated. :param information: Information to update. Can result in system specified IDs or the system reserving user-specified IDs. :type information: dict :param subnet_id: IPv4 subnet id. :param 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

A dict containing a list with IDs.

Return type

dict

collect(information, subnet_id, timeout=-1)[source]

Collects one or more IDs to be returned to a pool. :param information: The list of IDs to be collected :type information: dict :param subnet_id: IPv4 subnet id :param 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

Collector containing list of collected IDs successfully collected.

Return type

dict

hpeOneView.resources.servers.id_pools_ranges module

class hpeOneView.resources.servers.id_pools_ranges.IdPoolsRanges(type, con)[source]

Bases: object

Base class for Id Pools Ranges API client.

Has common function used by: vMAC, vSN, vWWN

allocate(information, id_or_uri, timeout=-1)[source]

Allocates a set of IDs from range.

The allocator returned contains the list of IDs successfully allocated.

Parameters
  • information (dict) – Information to update. Can result in system specified IDs or the system reserving user-specified IDs.

  • id_or_uri – ID or URI of vSN range.

  • 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

Allocator

Return type

dict

collect(information, id_or_uri, timeout=-1)[source]

Collects a set of IDs back to range.

The collector returned contains the list of IDs successfully collected.

Parameters
  • information (dict) – The list of IDs to be collected

  • id_or_uri – ID or URI of range

  • 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

Collector containing list of collected IDs successfully collected.

Return type

dict

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

Creates range.

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

Return type

dict

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

Deletes range.

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

enable(information, id_or_uri, timeout=-1)[source]

Enables or disables a range.

Parameters
  • information (dict) – Information to update.

  • id_or_uri – ID or URI of range.

  • 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

get(id_or_uri)[source]

Gets range.

Using the allocator and collector associated with the range, IDs may be allocated from or collected back to the range.

Parameters

id_or_uri – Can be either the range ID or URI.

Returns

Range

Return type

dict

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

Gets all fragments that have been allocated in range.

Parameters
  • id_or_uri – ID or URI of range.

  • 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 exceed the total number of items.

  • start – The first item to return, using 0-based indexing. If not specified, the default is 0 - start with the first available item.

Returns

A list with the allocated fragements.

Return type

list

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

Gets all free fragments in a vSN range.

Parameters
  • id_or_uri – ID or URI of range.

  • 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 exceed the total number of items.

  • start – The first item to return, using 0-based indexing. If not specified, the default is 0 - start with the first available item.

Returns

A list with the free fragments.

Return type

list

hpeOneView.resources.servers.logical_enclosures module

class hpeOneView.resources.servers.logical_enclosures.LogicalEnclosures(connection, data=None)[source]

Bases: ResourcePatchMixin, Resource

The logical enclosure resource provides methods for managing one or more enclosures that are linked or stacked with stacking links.

URI = '/rest/logical-enclosures'
generate_support_dump(**kwargs)
get_all(start=0, count=-1, filter='', sort='', scope_uris='')[source]

Returns a list of logical enclosures matching the specified filter. A maximum of 40 logical enclosures are returned to the caller. Additional calls can be made to retrieve any other logical enclosures matching the filter. Valid filter parameters include attributes of a Logical Enclosure resource.

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

Return type

list

get_script(**kwargs)
update_configuration(**kwargs)
update_from_group(**kwargs)
update_script(**kwargs)

hpeOneView.resources.servers.migratable_vc_domains module

class hpeOneView.resources.servers.migratable_vc_domains.MigratableVcDomains(connection)[source]

Bases: object

The migratable VC domains resource provides methods for migrating Virtual Connect (VC) enclosures into the appliance. The operations are testing compatibility of a VC managed enclosure, retrieving a compatibility report, deleting a compatibility report and migrating a VC managed enclosure into the appliance.

URI = '/rest/migratable-vc-domains'
delete(id_or_uri, timeout=-1)[source]

Deletes a migration report.

Parameters
  • id_or_uri – ID or URI of the migration report.

  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the task in OneView; just stops waiting for its completion.

Returns: bool: Indicates if the migration report was successfully deleted.

get_migration_report(id_or_uri)[source]

Returns a migration report that has previously been generated.

Parameters

id_or_uri – ID or URI of the migration report.

Returns: dict: a migration report.

static make_migration_information(oaIpAddress, oaUsername, oaPassword, vcmUsername, vcmPassword, iloLicenseType='OneView', enclosureGroupUri=None)[source]
migrate(id_or_uri, timeout=-1)[source]

Initiates a migration of an enclosure specified by the ID or URI of a migration report.

Parameters
  • id_or_uri – ID or URI of the migration report.

  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the task in OneView; just stops waiting for its completion.

Returns: dict: a migration report.

test_compatibility(migrationInformation, timeout=-1)[source]

Creates a migration report for an enclosure with a Virtual Connect domain.

Parameters
  • migrationInformation – A dict specifying the enclosure, OA username, OA password, VCM username, and VCM password among other things. Use make_migration_information to easily create this dict.

  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the task in OneView; just stops waiting for its completion.

Returns: dict: a migration report.

hpeOneView.resources.servers.rack_manager module

class hpeOneView.resources.servers.rack_manager.RackManager(connection, data=None)[source]

Bases: ResourcePatchMixin, Resource

The rack manager resource provides methods for managing one or more rack managers and its components.

URI = '/rest/rack-managers'
add(information, timeout=-1)[source]

Adds a rack manager for management by the appliance.

Parameters
  • information (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 Rack Manager

Return type

dict

get_a_specific_resource(uri)[source]

Gets a specific resource that is part of a rack manager.

Returns

Resource

Return type

dict

get_all_chassis()[source]

Gets the list of chassis from all rack managers.

Returns: List of Chassis

get_all_managers()[source]

Gets the list of manager resources from all rack managers.

Returns: list of managers

get_all_partitions()[source]

Gets the list of partition resources from all rack managers.

Returns: List of partitions

get_associated_chassis(**kwargs)
get_associated_managers(**kwargs)
get_associated_partitions(**kwargs)
get_environmental_configuration(**kwargs)
get_remote_support_settings(**kwargs)
remove(force=False, timeout=-1)[source]

Removes the rack manager with the specified URI. Note: This operation is only supported on appliances that support rack managers.

Parameters
  • 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 whether the resource was successfully removed.

Return type

bool

hpeOneView.resources.servers.server_hardware module

class hpeOneView.resources.servers.server_hardware.ServerHardware(connection, data=None)[source]

Bases: ResourcePatchMixin, ResourceUtilizationMixin, Resource

The server hardware resource is a representation of a physical server. The server hardware resource provides methods for server management tasks such as applying a profile, importing a server and managing an iLO.

URI = '/rest/server-hardware'
add(information, timeout=-1)[source]

Adds a rack-mount server for management by the appliance. This API initiates the asynchronous addition of supported server models.

Note: Servers in an enclosure are added by adding the enclosure resource. This is only supported on appliances that support rack-mounted servers.

Parameters
  • information (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 rack-mount server.

Return type

dict

add_multiple_servers(information, timeout=-1)[source]

Adds multiple rack-mount servers for management by the appliance. This API initiates the asynchronous addition of supported server models.

Note: Servers in an enclosure are added by adding the enclosure resource. This is only supported on appliances that support rack-mounted servers.

This is only supported for api version 600

Parameters
  • information (dict) – Objects 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 rack-mount servers.

Return type

dict

check_firmware_compliance(configuration, timeout=-1, custom_headers=None)[source]

Checks the firmware compliance of a server with the selected firmware baseline. Returns the compliance status of each individual component as well as the overall firmware compliance status of the server.

Parameters

configuration – Firmware Compliance Configuration

Returns

Resource

get_all_firmwares(filter='', start=0, count=-1, query='', sort='')[source]

Gets a list of firmware inventory across all servers. To filter the returned data, specify a filter expression to select a particular server model, component name, and/or component firmware version.

Note

This method is available for API version 300 or later.

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.

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

Returns

List of firmware inventory.

Return type

list

get_bios(**kwargs)
get_environmental_configuration(**kwargs)
get_firmware(**kwargs)
get_ilo_sso_url(**kwargs)
get_java_remote_console_url(**kwargs)
get_local_storage(**kwargs)
get_physical_server_hardware(**kwargs)
get_remote_console_url(**kwargs)
perform_firmware_update(**kwargs)
refresh_state(**kwargs)
remove(force=False, timeout=-1)[source]

Removes the rackserver with the specified URI. Note: This operation is only supported on appliances that support rack-mounted servers.

Parameters
  • 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 whether the resource was successfully removed.

Return type

bool

update_environmental_configuration(**kwargs)
update_mp_firware_version(**kwargs)
update_power_state(**kwargs)
validate_server_hardware_for_firmware_update(**kwargs)

hpeOneView.resources.servers.server_hardware_types module

class hpeOneView.resources.servers.server_hardware_types.ServerHardwareTypes(connection, data=None)[source]

Bases: Resource

The server hardware types resource is a representation/abstraction of a physical server managed by the appliance. It defines capabilities and settings that can be used in a server profile.

URI = '/rest/server-hardware-types'
update(**kwargs)

hpeOneView.resources.servers.server_profile_templates module

class hpeOneView.resources.servers.server_profile_templates.ServerProfileTemplate(connection, data=None)[source]

Bases: Resource, ResourcePatchMixin

The server profile template resource provides methods to create, retrieve, modify, and delete server profile templates.

A server profile template serves as a structural reference when creating a server profile. All of the configuration constructs of a server profile are present in the server profile template. The server profile template serves as the initial and ongoing reference for the structure of a server profile. The server profile template defines the centralized source for the configuration of firmware, connections, local storage, SAN storage, boot, BIOS, profile affinity and hide unused flexNICs.

After being created from a server profile template, the server profile continues to maintain an association to its server profile template. Any drift in configuration consistency between the server profile template and server profile(s) is monitored and made visible on both the server profile template and the associated server profile(s).

DEFAULT_VALUES = {'1000': {'type': 'ServerProfileTemplateV6'}, '1200': {'type': 'ServerProfileTemplateV7'}, '1600': {'type': 'ServerProfileTemplateV8'}, '1800': {'type': 'ServerProfileTemplateV8'}, '200': {'type': 'ServerProfileTemplateV1'}, '300': {'type': 'ServerProfileTemplateV2'}, '500': {'type': 'ServerProfileTemplateV3'}, '600': {'type': 'ServerProfileTemplateV4'}, '800': {'type': 'ServerProfileTemplateV5'}}
TRANSFORMATION_PATH = '/transformation/?serverHardwareTypeUri={server_hardware_type_uri}&enclosureGroupUri={enclosure_group_uri}'
URI = '/rest/server-profile-templates'
create(data=None, uri=None, timeout=-1, force=True)[source]

Makes a POST request to create a resource when a request body is required.

Parameters
  • data – Additional fields can be passed to create the resource.

  • uri – Resouce 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.

  • force – Flag to force the operation

Returns

Created resource.

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

Gets a list of server profile templates 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. Providing a -1 for the count parameter will restrict the result set size to 64 server profile templates. The maximum number of profile templates is restricted to 256, that is, if user requests more than 256, this will be internally limited to 256. 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, or if returning the requested number of items would take too long.

  • 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. Filters are supported for the name, description, affinity, macType, wwnType, serialNumberType, status, serverHardwareTypeUri, enclosureGroupUri, and firmware.firmwareBaselineUri attributes.

  • 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 server profile templates.

Return type

list

get_available_networks(**kwargs)[source]

Retrieves the list of Ethernet networks, Fibre Channel networks and network sets that are available to a server profile template along with their respective ports. The scopeUris, serverHardwareTypeUri and enclosureGroupUri parameters should be specified to get the available networks for a new server profile template. The serverHardwareTypeUri, enclosureGroupUri, and profileTemplateUri should be specified to get available networks for an existing server profile template. The scopeUris parameter is ignored when the profileTemplateUri is specified.

Parameters
  • enclosureGroupUri – The URI of the enclosure group is required when the serverHardwareTypeUri specifies a blade server.

  • profileTemplateUri – If the URI of the server profile template is provided the list of available networks will include only networks that share a scope with the server profile template.

  • scopeUris – An expression to restrict the resources returned according to the scopes to which they are assigned.

  • serverHardwareTypeUri – If the server hardware type specifies a rack server, the list of available network includes all networks that are applicable for the specified server hardware type. If the server hardware type specifies a blade server, the enclosureGroupUri parameter must be specified, and the list of available networks includes all networks that are applicable for the specified server hardware type and all empty bays within the enclosure group that can support the specified server hardware type.

  • view – The FunctionType (Ethernet or FibreChannel) to filter the list of networks returned.

Returns

Dictionary with available networks details.

Return type

dict

get_new_profile(**kwargs)
get_transformation(**kwargs)
update(**kwargs)

hpeOneView.resources.servers.server_profiles module

class hpeOneView.resources.servers.server_profiles.ServerProfiles(connection, data=None)[source]

Bases: ResourcePatchMixin, ResourceSchemaMixin, Resource

Server Profile API client.

DEFAULT_VALUES = {'1000': {'type': 'ServerProfileV10'}, '1200': {'type': 'ServerProfileV11'}, '1600': {'type': 'ServerProfileV12'}, '1800': {'type': 'ServerProfileV12'}, '200': {'type': 'ServerProfileV5'}, '300': {'type': 'ServerProfileV6'}, '500': {'type': 'ServerProfileV7'}, '600': {'type': 'ServerProfileV8'}, '800': {'type': 'ServerProfileV9'}}
URI = '/rest/server-profiles'
create(data=None, timeout=-1, force='')[source]

Makes a POST request to create a resource when a request body is required.

Parameters
  • data – Additional fields can be passed to create the resource.

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

  • force – Flag to force the operation

Returns

Created resource.

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

Deletes all Server Profile objects from the appliance that match the provided filter. Filters are supported only for the following profile attributes: name, description, serialnumber, uuid, mactype, wwntype, serialnumbertype, status, and state.

Examples

>>> server_profile_client.delete_all(filter="name='Exchange Server'")
# Remove all profiles that match the name "Exchange Server"
>>> server_profile_client.delete_all(filter="name matches'%25Database%25'")
# Remove all profiles that have the word "Database" in its name

The filter function here operates similarly to the function defined for GET Server Profiles. It allows for both actual and partial matches of data in the profile. Any requests that use a wildcard match must include a %25 as illustrated in the previous example. This is how you encode that character for transmission to the appliance.

Parameters
  • filter (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 whether the server profile was successfully deleted.

Return type

bool

get_available_networks(**kwargs)[source]

Retrieves the list of Ethernet networks, Fiber Channel networks, and network sets that are available to a server profile, along with their respective ports.

Parameters
  • enclosureGroupUri (str) – The URI of the enclosure group associated with the resource.

  • functionType (str) – The FunctionType (Ethernet or FibreChannel) to filter the list of networks returned.

  • serverHardwareTypeUri (str) – The URI of the server hardware type associated with the resource.

  • serverHardwareUri (str) – The URI of the server hardware associated with the resource.

  • view (str) –

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

    Values:
    Ethernet

    Specifies that the connection is to an Ethernet network or a network set.

    FibreChannel

    Specifies that the connection is to a Fibre Channel network.

  • profileUri (str) – If the URI of the server profile is provided the list of available networks will include only networks that share a scope with the server profile.

  • scopeUris (str) – An expression to restrict the resources returned according to the scopes to which they are assigned

Returns

Available networks.

Return type

list

get_available_servers(**kwargs)[source]

Retrieves the list of available servers.

Parameters
  • enclosureGroupUri (str) – The URI of the enclosure group associated with the resource.

  • serverHardwareTypeUri (str) – The URI of the server hardware type associated with the resource.

  • profileUri (str) – The URI of the server profile resource.

  • scopeUris (str) – An expression to restrict the resources returned according to the scopes to which they are assigned.

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

Returns

Available servers.

Return type

list

get_available_storage_system(**kwargs)[source]

Retrieves a specific storage system and its associated volumes available to the server profile based on the given server hardware type and enclosure group.

Parameters
  • enclosureGroupUri (str) – The URI of the enclosure group associated with the resource.

  • serverHardwareTypeUri (str) – The URI of the server hardware type associated with the resource.

  • storageSystemId (str) – The storage system ID associated with the resource.

Returns

Available storage system.

Return type

dict

get_available_storage_systems(start=0, count=-1, filter='', sort='', **kwargs)[source]

Retrieves the list of the storage systems and their associated volumes available to the server profile based on the given server hardware type and enclosure group.

Parameters
  • 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 exceed the total number of items.

  • start – The first item to return, using 0-based indexing. If not specified, the default is 0 - start with the first available item.

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

  • enclosureGroupUri (str) – The URI of the enclosure group associated with the resource.

  • serverHardwareTypeUri (str) – The URI of the server hardware type associated with the resource.

Returns

Available storage systems.

Return type

list

get_available_targets(**kwargs)[source]

Retrieves a list of the target servers and empty device bays that are available for assignment to the server profile.

Parameters
  • enclosureGroupUri (str) – The URI of the enclosure group associated with the resource.

  • serverHardwareTypeUri (str) – The URI of the server hardware type associated with the resource.

  • profileUri (str) – The URI of the server profile associated with the resource.

  • scopeUris (str) – An expression to restrict the resources returned according to the scopes to which they are assigned.

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

Returns

List of available servers and bays.

Return type

list

get_compliance_preview(**kwargs)
get_messages(**kwargs)
get_new_profile_template(**kwargs)
get_profile_ports(**kwargs)[source]

Retrieves the port model associated with a server or server hardware type and enclosure group.

Parameters
  • enclosureGroupUri (str) – The URI of the enclosure group associated with the resource.

  • serverHardwareTypeUri (str) – The URI of the server hardware type associated with the resource.

  • serverHardwareUri (str) – The URI of the server hardware associated with the resource.

Returns

Profile port.

Return type

dict

get_transformation(**kwargs)
update(**kwargs)

Module contents