hpOneView.resources.servers package¶
Submodules¶
hpOneView.resources.servers.connections module¶
-
class
hpOneView.resources.servers.connections.
Connections
(con)[source]¶ Bases:
object
Connections API client.
-
URI
= u'/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=u'', sort=u'', view=u'', fields=u'')[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
-
hpOneView.resources.servers.enclosure_groups module¶
-
class
hpOneView.resources.servers.enclosure_groups.
EnclosureGroups
(connection, data=None)[source]¶ Bases:
hpOneView.resources.resource.Resource
Enclosure Groups API client.
-
DEFAULT_VALUES
= {u'200': {u'type': u'EnclosureGroupV200'}, u'300': {u'type': u'EnclosureGroupV300'}, u'500': {u'type': u'EnclosureGroupV400'}}¶
-
URI
= u'/rest/enclosure-groups'¶
-
get_all
(start=0, count=-1, filter=u'', sort=u'', scope_uris=u'')[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
= <functools.partial object>¶
-
hpOneView.resources.servers.enclosures module¶
-
class
hpOneView.resources.servers.enclosures.
Enclosures
(connection, data=None)[source]¶ Bases:
hpOneView.resources.resource.ResourcePatchMixin
,hpOneView.resources.resource.ResourceZeroBodyMixin
,hpOneView.resources.resource.ResourceUtilizationMixin
,hpOneView.resources.resource.Resource
Enclosures API client.
-
URI
= u'/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
= <functools.partial object>¶
-
get_all
(start=0, count=-1, filter=u'', sort=u'', scope_uris=u'')[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_csr
= <functools.partial object>¶
-
get_environmental_configuration
= <functools.partial object>¶
-
get_script
= <functools.partial object>¶
-
get_sso
= <functools.partial object>¶
-
import_certificate
= <functools.partial object>¶
-
refresh_state
= <functools.partial object>¶
-
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
= <functools.partial object>¶
-
hpOneView.resources.servers.id_pools module¶
-
class
hpOneView.resources.servers.id_pools.
IdPools
(con)[source]¶ Bases:
object
Class for Id Pools API client.
-
URI
= u'/rest/id-pools'¶
-
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: A dict containing a list with IDs.
Return type: dict
-
collect
(information, id_or_uri, timeout=-1)[source]¶ Collects one or more IDs to be returned to a pool.
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
-
enable
(information, id_or_uri, timeout=-1)[source]¶ Enables or disables a pool.
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
-
generate
(id_or_uri)[source]¶ Generates and returns a random range.
Parameters: id_or_uri – ID or URI of range. Returns: A dict containing a list with IDs. Return type: dict
-
get
(id_or_uri)[source]¶ Gets a pool.
Parameters: id_or_uri – Can be either the range ID or URI. Returns: Pool resource. Return type: dict
-
get_check_range_availability
(id_or_uri, ids_pools)[source]¶ Checks the range availability in the ID pool.
Parameters: - id_or_uri – ID or URI of range.
- ids_pools (list) – List of Id Pools.
Returns: A dict containing a list with IDs.
Return type: dict
-
validate
(information, id_or_uri, 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.
- 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: A dict containing a list with IDs.
Return type: dict
-
hpOneView.resources.servers.id_pools_ipv4_ranges module¶
-
class
hpOneView.resources.servers.id_pools_ipv4_ranges.
IdPoolsIpv4Ranges
(con)[source]¶ Bases:
object
The ID pools IPv4 ranges resource provides a Client API for managing IPv4 ranges.
-
URI
= u'/rest/id-pools/ipv4/ranges'¶
-
create
(resource, timeout=-1)[source]¶ Creates an IPv4 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 an IPv4 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 an IPv4 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 IPv4 range.
Return type: dict
-
get
(id_or_uri)[source]¶ Gets an IPv4 range by ID or URI.
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 an IPv4 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
-
update
(information, timeout=-1)[source]¶ Edit an IPv4 Range.
Parameters: - information (dict) – Information 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 IPv4 range.
Return type: dict
-
hpOneView.resources.servers.id_pools_ipv4_subnets module¶
-
class
hpOneView.resources.servers.id_pools_ipv4_subnets.
IdPoolsIpv4Subnets
(con)[source]¶ Bases:
object
The ID pools IPv4 subnets resource provides a Client API for managing IPv4 subnets.
-
URI
= u'/rest/id-pools/ipv4/subnets'¶
-
create
(resource, timeout=-1)[source]¶ Creates subnet.
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 subnet.
Return type: dict
-
delete
(resource, force=False, timeout=-1)[source]¶ Deletes the IPv4 subnet.
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 an IPv4 subnet.
Using the allocator and collector associated with the subnet, IDs may be allocated from or collected back to the subnet.
Parameters: id_or_uri – Can be either the subnet ID or URI. Returns: IPv4 subnet. Return type: dict
-
get_all
(start=0, count=-1, filter=u'', sort=u'')[source]¶ Gets a list of IPV4 Subnet resources. Returns a list of resources 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 IPV4 Subnet resources.
Return type: list
-
update
(resource, timeout=-1)[source]¶ Update the resource.
Parameters: - resource (dict) – Information 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.servers.id_pools_ranges module¶
-
class
hpOneView.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
-
hpOneView.resources.servers.logical_enclosures module¶
-
class
hpOneView.resources.servers.logical_enclosures.
LogicalEnclosures
(connection, data=None)[source]¶ Bases:
hpOneView.resources.resource.ResourcePatchMixin
,hpOneView.resources.resource.Resource
The logical enclosure resource provides methods for managing one or more enclosures that are linked or stacked with stacking links.
-
URI
= u'/rest/logical-enclosures'¶
-
generate_support_dump
= <functools.partial object>¶
-
get_all
(start=0, count=-1, filter=u'', sort=u'', scope_uris=u'')[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
= <functools.partial object>¶
-
update_configuration
= <functools.partial object>¶
-
update_from_group
= <functools.partial object>¶
-
update_script
= <functools.partial object>¶
-
hpOneView.resources.servers.migratable_vc_domains module¶
-
class
hpOneView.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
= u'/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=u'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.
-
hpOneView.resources.servers.server_hardware module¶
-
class
hpOneView.resources.servers.server_hardware.
ServerHardware
(connection, data=None)[source]¶ Bases:
hpOneView.resources.resource.ResourcePatchMixin
,hpOneView.resources.resource.ResourceUtilizationMixin
,hpOneView.resources.resource.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
= u'/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
-
get_all_firmwares
(filter=u'', start=0, count=-1, query=u'', sort=u'')[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
= <functools.partial object>¶
-
get_environmental_configuration
= <functools.partial object>¶
-
get_firmware
= <functools.partial object>¶
-
get_ilo_sso_url
= <functools.partial object>¶
-
get_java_remote_console_url
= <functools.partial object>¶
-
get_physical_server_hardware
= <functools.partial object>¶
-
get_remote_console_url
= <functools.partial object>¶
-
refresh_state
= <functools.partial object>¶
-
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
= <functools.partial object>¶
-
update_mp_firware_version
= <functools.partial object>¶
-
update_power_state
= <functools.partial object>¶
-
hpOneView.resources.servers.server_hardware_types module¶
-
class
hpOneView.resources.servers.server_hardware_types.
ServerHardwareTypes
(connection, data=None)[source]¶ Bases:
hpOneView.resources.resource.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
= u'/rest/server-hardware-types'¶
-
update
= <functools.partial object>¶
-
hpOneView.resources.servers.server_profile_templates module¶
-
class
hpOneView.resources.servers.server_profile_templates.
ServerProfileTemplate
(connection, data=None)[source]¶ Bases:
hpOneView.resources.resource.Resource
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
= {u'200': {u'type': u'ServerProfileTemplateV1'}, u'300': {u'type': u'ServerProfileTemplateV2'}, u'500': {u'type': u'ServerProfileTemplateV3'}, u'600': {u'type': u'ServerProfileTemplateV4'}, u'800': {u'type': u'ServerProfileTemplateV5'}}¶
-
TRANSFORMATION_PATH
= u'/transformation/?serverHardwareTypeUri={server_hardware_type_uri}&enclosureGroupUri={enclosure_group_uri}'¶
-
URI
= u'/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=u'', sort=u'', scope_uris=u'')[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
= <functools.partial object>¶
-
get_transformation
= <functools.partial object>¶
-
update
(**kwargs)¶
-
hpOneView.resources.servers.server_profiles module¶
-
class
hpOneView.resources.servers.server_profiles.
ServerProfiles
(connection, data=None)[source]¶ Bases:
hpOneView.resources.resource.ResourcePatchMixin
,hpOneView.resources.resource.ResourceSchemaMixin
,hpOneView.resources.resource.Resource
Server Profile API client.
-
DEFAULT_VALUES
= {u'200': {u'type': u'ServerProfileV5'}, u'300': {u'type': u'ServerProfileV6'}, u'500': {u'type': u'ServerProfileV7'}, u'600': {u'type': u'ServerProfileV8'}, u'800': {u'type': u'ServerProfileV9'}}¶
-
URI
= u'/rest/server-profiles'¶
-
create
(data=None, timeout=-1, force=u'')[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=u'', sort=u'', **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
= <functools.partial object>¶
-
get_messages
= <functools.partial object>¶
-
get_new_profile_template
= <functools.partial object>¶
-
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
= <functools.partial object>¶
-
update
(**kwargs)¶
-