Code
stringlengths
103
85.9k
Summary
listlengths
0
94
Please provide a description of the function:def get_reachable_storage_pools(self, start=0, count=-1, filter='', query='', sort='', networks=None, scope_exclusions=None, scope_uris=''): uri = self.URI + "/reachable-storage-pools" if networks: elements = "\'" for n in networks: elements += n + ',' elements = elements[:-1] + "\'" uri = uri + "?networks=" + elements if scope_exclusions: storage_pools_uris = ",".join(scope_exclusions) uri = uri + "?" if "?" not in uri else uri + "&" uri += "scopeExclusions={}".format(storage_pools_uris) return self._client.get(self._client.build_query_uri(start=start, count=count, filter=filter, query=query, sort=sort, uri=uri, scope_uris=scope_uris))
[ "\n Gets the storage pools that are connected on the specified networks\n based on the storage system port's expected network connectivity.\n\n Args:\n start: The first item to return, using 0-based indexing. If not specified,\n the default is 0 - start with the first available item.\n count: The number of resources to return. A count of -1 requests all items.\n The actual number of items in the response might differ from the requested\n count if the sum of start and count exceeds the total number of items.\n filter: A general filter/query string to narrow the list of items returned.\n The default is no filter - all resources are returned.\n sort: The sort order of the returned data set. By default, the sort order\n is based on create time with the oldest entry first.\n query: A general query string to narrow the list of resources returned.\n The default is no query - all resources are returned.\n networks: Specifies the comma-separated list of network URIs used by the\n reachable storage pools.\n scope_exclusions: Specifies the comma-separated list of storage-pools URIs\n that will be excluded from the scope validation checks.\n scope_uris: Specifies the comma-separated list of scope URIs used by the\n reachable storage pools.\n\n Returns:\n list: Reachable Storage Pools List.\n " ]
Please provide a description of the function:def generate(self, information, timeout=-1): return self._client.create(information, timeout=timeout)
[ "\n Generates a self signed certificate or an internal CA signed certificate for RabbitMQ clients.\n\n Args:\n information (dict): Information to generate the certificate for RabbitMQ clients.\n timeout:\n Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView; it just stops waiting for its completion.\n\n Returns:\n dict: RabbitMQ certificate generated\n " ]
Please provide a description of the function:def get_key_pair(self, alias_name): uri = self.URI + "/keypair/" + alias_name return self._client.get(uri)
[ "\n Retrieves the public and private key pair associated with the specified alias name.\n\n Args:\n alias_name: Key pair associated with the RabbitMQ\n\n Returns:\n dict: RabbitMQ certificate\n " ]
Please provide a description of the function:def get_keys(self, alias_name, key_format): uri = self.URI + "/keys/" + alias_name + "?format=" + key_format return self._client.get(uri)
[ "\n Retrieves the contents of PKCS12 file in the format specified.\n This PKCS12 formatted file contains both the certificate as well as the key file data.\n Valid key formats are Base64 and PKCS12.\n\n Args:\n alias_name: Key pair associated with the RabbitMQ\n key_format: Valid key formats are Base64 and PKCS12.\n Returns:\n dict: RabbitMQ certificate\n " ]
Please provide a description of the function:def validate_id_pool(self, id_or_uri, ids_pools): uri = self._client.build_uri(id_or_uri) + "/validate?idList=" + "&idList=".join(ids_pools) return self._client.get(uri)
[ "\n Validates an ID pool.\n\n Args:\n id_or_uri:\n ID or URI of range.\n ids_pools (list):\n List of Id Pools.\n\n Returns:\n dict: A dict containing a list with IDs.\n " ]
Please provide a description of the function:def generate(self, id_or_uri): uri = self._client.build_uri(id_or_uri) + "/generate" return self._client.get(uri)
[ "\n Generates and returns a random range.\n\n Args:\n id_or_uri:\n ID or URI of range.\n\n Returns:\n dict: A dict containing a list with IDs.\n " ]
Please provide a description of the function:def get_connectable_volume_templates(self, start=0, count=-1, filter='', query='', sort=''): uri = self.URI + "/connectable-volume-templates" get_uri = self._client.build_query_uri(start=start, count=count, filter=filter, query=query, sort=sort, uri=uri) return self._client.get(get_uri)
[ "\n Gets the storage volume templates that are available on the specified networks based on the storage system\n port's expected network connectivity. If there are no storage volume templates that meet the specified\n connectivity criteria, an empty collection will be returned.\n\n Returns:\n list: Storage volume templates.\n " ]
Please provide a description of the function:def get_reachable_volume_templates(self, start=0, count=-1, filter='', query='', sort='', networks=None, scope_uris='', private_allowed_only=False): uri = self.URI + "/reachable-volume-templates" uri += "?networks={}&privateAllowedOnly={}".format(networks, private_allowed_only) get_uri = self._client.build_query_uri(start=start, count=count, filter=filter, query=query, sort=sort, uri=uri, scope_uris=scope_uris) return self._client.get(get_uri)
[ "\n Gets the storage templates that are connected on the specified networks based on the storage system\n port's expected network connectivity.\n\n Returns:\n list: Storage volume templates.\n " ]
Please provide a description of the function:def get_compatible_systems(self, id_or_uri): uri = self._client.build_uri(id_or_uri) + "/compatible-systems" return self._client.get(uri)
[ "\n Retrieves a collection of all storage systems that is applicable to this storage volume template.\n\n Args:\n id_or_uri:\n Can be either the power device id or the uri\n\n Returns:\n list: Storage systems.\n " ]
Please provide a description of the function:def add_from_existing(self, resource, timeout=-1): uri = self.URI + "/from-existing" return self._client.create(resource, uri=uri, timeout=timeout)
[ "\n Adds a volume that already exists in the Storage system\n\n Args:\n resource (dict):\n Object to create.\n timeout:\n Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView, just stop waiting for its completion.\n\n Returns:\n dict: Added resource.\n " ]
Please provide a description of the function:def create_from_snapshot(self, data, timeout=-1): uri = self.URI + "/from-snapshot" return self._client.create(data, uri=uri, timeout=timeout)
[ "\n Creates a new volume on the storage system from a snapshot of a volume.\n A volume template must also be specified when creating a volume from a snapshot.\n\n The global setting \"StorageVolumeTemplateRequired\" controls whether or\n not root volume templates can be used to provision volumes.\n The value of this setting defaults to \"false\".\n If the value is set to \"true\", then only templates with an \"isRoot\" value of \"false\"\n can be used to provision a volume.\n\n Args:\n data (dict):\n Object to create.\n timeout:\n Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView, just stop waiting for its completion.\n\n Returns:\n dict: Created data.\n " ]
Please provide a description of the function:def delete(self, resource, force=False, export_only=None, suppress_device_updates=None, timeout=-1): custom_headers = {'If-Match': '*'} if 'uri' in resource: uri = resource['uri'] else: uri = self._client.build_uri(resource) if suppress_device_updates: uri += '?suppressDeviceUpdates=true' if export_only: custom_headers['exportOnly'] = True return self._client.delete(uri, force=force, timeout=timeout, custom_headers=custom_headers)
[ "\n Deletes a managed volume.\n\n Args:\n resource (dict):\n Object to delete.\n force:\n If set to true, the operation completes despite any problems with\n network connectivity or errors on the resource itself. The default is false.\n timeout:\n Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView; it just stops waiting for its completion.\n export_only:\n Valid prior to API500. By default, volumes will be deleted from OneView, and storage system.\n To delete the volume from OneView only, you must set its value to True.\n Setting its value to False has the same behavior as the default behavior.\n suppress_device_updates:\n Valid API500 onwards. By default, volumes will be deleted from OneView, and storage system.\n To delete the volume from OneView only, you must set its value to True.\n Setting its value to False has the same behavior as the default behavior.\n\n Returns:\n bool: Indicates if the volume was successfully deleted.\n " ]
Please provide a description of the function:def get_snapshots(self, volume_id_or_uri, start=0, count=-1, filter='', sort=''): uri = self.__build_volume_snapshot_uri(volume_id_or_uri) return self._client.get_all(start, count, filter=filter, sort=sort, uri=uri)
[ "\n Gets all snapshots of a volume. Returns a list of snapshots based on optional sorting and filtering, and\n constrained by start and count parameters.\n\n Args:\n volume_id_or_uri:\n Can be either the volume id or the volume uri.\n start:\n The first item to return, using 0-based indexing.\n If not specified, the default is 0 - start with the first available item.\n count:\n The number of resources to return. A count of -1 requests all items.\n The actual number of items in the response might differ from the requested\n count if the sum of start and count exceeds the total number of items.\n filter (list or str):\n A general filter/query string to narrow the list of items returned. The\n default is no filter; all resources are returned.\n sort:\n The sort order of the returned data set. By default, the sort order is based\n on create time with the oldest entry first.\n\n Returns:\n list: A list of snapshots.\n " ]
Please provide a description of the function:def create_snapshot(self, volume_id_or_uri, snapshot, timeout=-1): uri = self.__build_volume_snapshot_uri(volume_id_or_uri) return self._client.create(snapshot, uri=uri, timeout=timeout, default_values=self.DEFAULT_VALUES_SNAPSHOT)
[ "\n Creates a snapshot for the specified volume.\n\n Args:\n volume_id_or_uri:\n Can be either the volume ID or the volume URI.\n snapshot (dict):\n Object to create.\n timeout:\n Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation in\n OneView, just stops waiting for its completion.\n\n Returns:\n dict: Storage volume.\n " ]
Please provide a description of the function:def get_snapshot(self, snapshot_id_or_uri, volume_id_or_uri=None): uri = self.__build_volume_snapshot_uri(volume_id_or_uri, snapshot_id_or_uri) return self._client.get(uri)
[ "\n Gets a snapshot of a volume.\n\n Args:\n volume_id_or_uri:\n Can be either the volume ID or the volume URI. It is optional if it is passed a snapshot URI,\n but required if it passed a snapshot ID.\n snapshot_id_or_uri:\n Can be either the snapshot ID or the snapshot URI.\n\n Returns:\n dict: The snapshot.\n " ]
Please provide a description of the function:def get_snapshot_by(self, volume_id_or_uri, field, value): uri = self.__build_volume_snapshot_uri(volume_id_or_uri) return self._client.get_by(field, value, uri=uri)
[ "\n Gets all snapshots that match the filter.\n\n The search is case-insensitive.\n\n Args:\n volume_id_or_uri: Can be either the volume id or the volume uri.\n field: Field name to filter.\n value: Value to filter.\n\n Returns:\n list: Snapshots\n " ]
Please provide a description of the function:def get_extra_managed_storage_volume_paths(self, start=0, count=-1, filter='', sort=''): uri = self.URI + '/repair?alertFixType=ExtraManagedStorageVolumePaths' return self._client.get_all(start, count, filter=filter, sort=sort, uri=uri)
[ "\n Gets the list of extra managed storage volume paths.\n\n Args:\n start:\n The first item to return, using 0-based indexing.\n If not specified, the default is 0 - start with the first available item.\n count:\n The number of resources to return. A count of -1 requests all items.\n The actual number of items in the response might differ from the requested\n count if the sum of start and count exceeds the total number of items.\n filter (list or str):\n A general filter/query string to narrow the list of items returned. The\n default is no filter; all resources are returned.\n sort:\n The sort order of the returned data set. By default, the sort order is based\n on create time with the oldest entry first.\n\n Returns:\n list: A list of extra managed storage volume paths.\n " ]
Please provide a description of the function:def repair(self, volume_id_or_uri, timeout=-1): data = { "type": "ExtraManagedStorageVolumePaths", "resourceUri": self._client.build_uri(volume_id_or_uri) } custom_headers = {'Accept-Language': 'en_US'} uri = self.URI + '/repair' return self._client.create(data, uri=uri, timeout=timeout, custom_headers=custom_headers)
[ "\n Removes extra presentations from a specified volume on the storage system.\n\n Args:\n volume_id_or_uri:\n Can be either the volume id or the volume uri.\n timeout:\n Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation in\n OneView, just stops waiting for its completion.\n\n Returns:\n dict: Storage volume.\n " ]
Please provide a description of the function:def get_attachable_volumes(self, start=0, count=-1, filter='', query='', sort='', scope_uris='', connections=''): uri = self.URI + '/attachable-volumes' if connections: uri += str('?' + 'connections=' + connections.__str__()) return self._client.get_all(start, count, filter=filter, query=query, sort=sort, uri=uri, scope_uris=scope_uris)
[ "\n Gets the volumes that are connected on the specified networks based on the storage system port's expected\n network connectivity.\n\n A volume is attachable if it satisfies either of the following conditions:\n * The volume is shareable.\n * The volume not shareable and not attached.\n\n Args:\n start:\n The first item to return, using 0-based indexing.\n If not specified, the default is 0 - start with the first available item.\n count:\n The number of resources to return. A count of -1 requests all items.\n The actual number of items in the response might differ from the requested\n count if the sum of start and count exceeds the total number of items.\n filter (list or str):\n A general filter/query string to narrow the list of items returned. The\n default is no filter; all resources are returned.\n query:\n A general query string to narrow the list of resources returned. The default\n is no query; all resources are returned.\n sort:\n The sort order of the returned data set. By default, the sort order is based\n on create time with the oldest entry first.\n connections:\n A list of dicts specifics the connections used by the attachable volumes. Needs network uri, initiatoer\n name and optional proxy name\n scope_uris:\n A list specifics the list of scope uris used by the attachable volumed.\n\n Returns:\n list: A list of attachable volumes that the appliance manages.\n " ]
Please provide a description of the function:def add(self, information, timeout=-1): return self.create(data=information, timeout=timeout)
[ "\n C7000:\n Takes information about an enclosure (for example: IP address, username, password) and uses\n it to claim/configure the enclosure and add its components to the appliance.\n\n Synergy:\n Adds a remote enclosure and all the enclosures linked to that enclosure by their frame link\n modules. The remote enclosures' frame link modules must not be claimed by another appliance.\n The IP used must be the frame link module's Link Local IPv6 address.\n\n Args:\n information: Enclosure information to add.\n timeout: Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView; it just stops waiting for its completion.\n\n Returns:\n dict: Enclosure.\n\n " ]
Please provide a description of the function:def update_configuration(self, timeout=-1): uri = "{}/configuration".format(self.data['uri']) return self.update_with_zero_body(uri=uri, timeout=timeout)
[ "\n Reapplies the appliance's configuration on the enclosure. This includes running the same configure steps\n that were performed as part of the enclosure add.\n\n Args:\n timeout: Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView; it just stops waiting for its completion.\n\n Returns:\n Enclosure\n " ]
Please provide a description of the function:def get_by_hostname(self, hostname): def filter_by_hostname(hostname, enclosure): is_primary_ip = ('activeOaPreferredIP' in enclosure and enclosure['activeOaPreferredIP'] == hostname) is_standby_ip = ('standbyOaPreferredIP' in enclosure and enclosure['standbyOaPreferredIP'] == hostname) return is_primary_ip or is_standby_ip enclosures = self.get_all() result = [x for x in enclosures if filter_by_hostname(hostname, x)] if result: new_resource = self.new(self._connection, result[0]) else: new_resource = None return new_resource
[ "Get enclosure by it's hostname" ]
Please provide a description of the function:def get_environmental_configuration(self): uri = '{}/environmentalConfiguration'.format(self.data['uri']) return self._helper.do_get(uri)
[ "\n Gets the settings that describe the environmental configuration (supported feature set, calibrated minimum &\n maximum power, location & dimensions, ...) of the enclosure resource.\n\n Returns:\n Settings that describe the environmental configuration.\n " ]
Please provide a description of the function:def update_environmental_configuration(self, configuration, timeout=-1): uri = '{}/environmentalConfiguration'.format(self.data['uri']) return self._helper.do_put(uri, configuration, timeout, None)
[ "\n Sets the calibrated max power of an unmanaged or unsupported enclosure.\n\n Args:\n configuration: Configuration\n timeout: Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView; it just stops waiting for its completion.\n\n Returns:\n Settings that describe the environmental configuration.\n " ]
Please provide a description of the function:def get_sso(self, role): uri = "{}/sso?role={}".format(self.data['uri'], role) return self._helper.do_get(uri)
[ "\n Builds the SSO (Single Sign-On) URL parameters for the specified enclosure. This allows the user to\n log in to the enclosure without providing credentials. This API is currently only supported by C7000 enclosures.\n\n Args:\n role: Role\n\n Returns:\n SSO (Single Sign-On) URL parameters.\n " ]
Please provide a description of the function:def generate_csr(self, csr_data, bay_number=None): uri = "{}/https/certificaterequest".format(self.data['uri']) if bay_number: uri += "?bayNumber=%d" % (bay_number) headers = {'Content-Type': 'application/json'} return self._helper.do_post(uri, csr_data, -1, headers)
[ "\n Creates a Certificate Signing Request (CSR) for an enclosure.\n\n Args:\n csr_data: Dictionary with csr details.\n bay_number: OA from which the CSR should be generated.\n\n Returns:\n Enclosure.\n " ]
Please provide a description of the function:def get_csr(self, bay_number=None): uri = "{}/https/certificaterequest".format(self.data['uri']) if bay_number: uri += "?bayNumber=%d" % (bay_number) return self._helper.do_get(uri)
[ "\n Get an enclosure's Certificate Signing Request (CSR) that was generated by previous POST to the same URI.\n\n Args:\n bay_number: OA to retrieve the previously generated CSR.\n\n Returns:\n dict\n " ]
Please provide a description of the function:def import_certificate(self, certificate_data, bay_number=None): uri = "{}/https/certificaterequest".format(self.data['uri']) if bay_number: uri += "?bayNumber=%d" % (bay_number) headers = {'Content-Type': 'application/json'} return self._helper.do_put(uri, certificate_data, -1, headers)
[ "\n Imports a signed server certificate into the enclosure.\n\n Args:\n certificate_data: Dictionary with Signed certificate and type.\n bay_number: OA to which the signed certificate will be imported.\n\n Returns:\n Enclosure.\n " ]
Please provide a description of the function:def delete(self, alias_name, timeout=-1): uri = self.URI + "/" + alias_name return self._client.delete(uri, timeout=timeout)
[ "\n Revokes a certificate signed by the internal CA. If client certificate to be revoked is RabbitMQ_readonly,\n then the internal CA root certificate, RabbitMQ client certificate and RabbitMQ server certificate will be\n regenerated. This will invalidate the previous version of RabbitMQ client certificate and the RabbitMQ server\n will be restarted to read the latest certificates.\n\n Args:\n alias_name (str): Alias name.\n timeout:\n Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView, just stop waiting for its completion.\n " ]
Please provide a description of the function:def get_by_name(self, name): scopes = self._client.get_all() result = [x for x in scopes if x['name'] == name] return result[0] if result else None
[ "\n Gets a Scope by name.\n\n Args:\n name: Name of the Scope\n\n Returns:\n dict: Scope.\n " ]
Please provide a description of the function:def create(self, resource, timeout=-1): return self._client.create(resource, timeout=timeout, default_values=self.DEFAULT_VALUES)
[ "\n Creates a scope.\n\n Args:\n resource (dict): Object to create.\n timeout:\n Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView, just stop waiting for its completion.\n\n Returns:\n dict: Created scope.\n\n " ]
Please provide a description of the function:def delete(self, resource, timeout=-1): if type(resource) is dict: headers = {'If-Match': resource.get('eTag', '*')} else: headers = {'If-Match': '*'} return self._client.delete(resource, timeout=timeout, custom_headers=headers)
[ "\n Deletes a Scope.\n\n Args:\n resource: dict object to delete\n timeout:\n Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView; it just stops waiting for its completion.\n\n Returns:\n bool: Indicates if the resource was successfully deleted.\n\n " ]
Please provide a description of the function:def update_resource_assignments(self, id_or_uri, resource_assignments, timeout=-1): uri = self._client.build_uri(id_or_uri) + "/resource-assignments" headers = {'Content-Type': 'application/json'} return self._client.patch_request(uri, resource_assignments, timeout=timeout, custom_headers=headers)
[ "\n Modifies scope membership by adding or removing resource assignments.\n\n Args:\n id_or_uri: Can be either the resource ID or the resource URI.\n resource_assignments (dict):\n A dict object with a list of resource URIs to be added and a list of resource URIs to be removed.\n timeout: Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView; it just stops waiting for its completion.\n\n Returns:\n dict: Updated resource.\n " ]
Please provide a description of the function:def golden_images(self): if not self.__golden_images: self.__golden_images = GoldenImages(self.__connection) return self.__golden_images
[ "\n Gets the Golden Images API client.\n\n Returns:\n GoldenImages:\n " ]
Please provide a description of the function:def plan_scripts(self): if not self.__plan_scripts: self.__plan_scripts = PlanScripts(self.__connection) return self.__plan_scripts
[ "\n Gets the Plan Scripts API client.\n\n Returns:\n PlanScripts:\n " ]
Please provide a description of the function:def build_plans(self): if not self.__build_plans: self.__build_plans = BuildPlans(self.__connection) return self.__build_plans
[ "\n Gets the Build Plans API client.\n\n Returns:\n BuildPlans:\n " ]
Please provide a description of the function:def os_volumes(self): if not self.__os_volumes: self.__os_volumes = OsVolumes(self.__connection) return self.__os_volumes
[ "\n Gets the OS Volumes API client.\n\n Returns:\n OsVolumes:\n " ]
Please provide a description of the function:def deployment_plans(self): if not self.__deployment_plans: self.__deployment_plans = DeploymentPlans(self.__connection) return self.__deployment_plans
[ "\n Gets the Deployment Plans API client.\n\n Returns:\n DeploymentPlans:\n " ]
Please provide a description of the function:def artifact_bundles(self): if not self.__artifact_bundles: self.__artifact_bundles = ArtifactBundles(self.__connection) return self.__artifact_bundles
[ "\n Gets the Artifact Bundles API client.\n\n Returns:\n ArtifactBundles:\n " ]
Please provide a description of the function:def deployment_groups(self): if not self.__deployment_groups: self.__deployment_groups = DeploymentGroups(self.__connection) return self.__deployment_groups
[ "\n Gets the Deployment Groups API client.\n\n Returns:\n DeploymentGroups:\n " ]
Please provide a description of the function:def create(self, resource, timeout=-1): data = self.__default_values.copy() data.update(resource) return self._client.create(data, timeout=timeout)
[ "\n Creates a Golden Image resource from the deployed OS Volume as per the attributes specified.\n\n Args:\n resource (dict): Object to create.\n timeout:\n Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation\n in OneView, it just stops waiting for its completion.\n\n Returns:\n dict: Golden Image created.\n " ]
Please provide a description of the function:def upload(self, file_path, golden_image_info): uri = "{0}?name={1}&description={2}".format(self.URI, quote(golden_image_info.get('name', '')), quote(golden_image_info.get('description', ''))) return self._client.upload(file_path, uri)
[ "\n Adds a Golden Image resource from the file that is uploaded from a local drive. Only the .zip format file can\n be used for the upload.\n\n Args:\n file_path (str): File name to upload.\n golden_image_info (dict): Golden Image information.\n\n Returns:\n dict: Golden Image.\n " ]
Please provide a description of the function:def download_archive(self, id_or_uri, file_path): uri = self.URI + "/archive/" + extract_id_from_uri(id_or_uri) return self._client.download(uri, file_path)
[ "\n Download the details of the Golden Image capture logs, which has been archived based on the specific attribute\n ID.\n\n Args:\n id_or_uri: ID or URI of the Golden Image.\n file_path (str): File name to save the archive.\n\n Returns:\n bool: Success.\n " ]
Please provide a description of the function:def update(self, resource, id_or_uri=None, timeout=-1): uri = resource.pop('uri', None) if not uri: if not id_or_uri: raise ValueError("URI was not provided") uri = self._client.build_uri(id_or_uri) return self._client.update(resource=resource, uri=uri, timeout=timeout)
[ "\n Updates the specified alert resource.\n\n Args:\n resource (dict): Object to update.\n timeout: Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView; it just stops waiting for its completion.\n\n Returns:\n dict: Updated alert.\n " ]
Please provide a description of the function:def delete_alert_change_log(self, id_or_uri): uri = self.URI + "/AlertChangeLog/" + extract_id_from_uri(id_or_uri) resource = { "uri": uri } self._client.delete(resource)
[ "\n Deletes alert change log by alert ID or URI.\n\n Args:\n id_or_uri: alert ID or URI.\n " ]
Please provide a description of the function:def add_multiple_servers(self, information, timeout=-1): uri = "{}/discovery".format(self.URI) return self.create(information, uri=uri, timeout=timeout)
[ "\n Adds multiple rack-mount servers for management by the appliance. This API initiates the asynchronous addition of\n supported server models.\n\n Note: Servers in an enclosure are added by adding the enclosure resource. This is\n only supported on appliances that support rack-mounted servers.\n\n This is only supported for api version 600\n\n Args:\n information (dict): Objects to create\n timeout: Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView; it just stops waiting for its completion.\n\n Returns:\n dict: Created rack-mount servers.\n " ]
Please provide a description of the function:def remove(self, force=False, timeout=-1): return self.delete(force=force, timeout=timeout)
[ "\n Removes the rackserver with the specified URI.\n Note: This operation is only supported on appliances that support rack-mounted servers.\n\n Args:\n force (bool):\n If set to true, the operation completes despite any problems with\n network connectivity or errors on the resource itself. The default is false.\n timeout:\n Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView; it just stops waiting for its completion.\n\n Returns:\n bool: Indicates whether the resource was successfully removed.\n " ]
Please provide a description of the function:def get_bios(self): uri = "{}/bios".format(self.data["uri"]) return self._helper.do_get(uri)
[ "\n Gets the list of BIOS/UEFI values currently set on the physical server.\n\n Returns:\n dict: Dictionary of BIOS/UEFI values.\n " ]
Please provide a description of the function:def get_ilo_sso_url(self, ip=None): uri = "{}/iloSsoUrl".format(self.data["uri"]) if ip: uri = "{}?ip={}".format(uri, ip) return self._helper.do_get(uri)
[ "\n Retrieves the URL to launch a Single Sign-On (SSO) session for the iLO web interface. If the server hardware is\n unsupported, the resulting URL will not use SSO and the iLO web interface will prompt for credentials.\n This is not supported on G7/iLO3 or earlier servers.\n\n Args:\n ip: IP address or host name of the server's iLO management processor\n\n Returns:\n URL\n " ]
Please provide a description of the function:def get_all_firmwares(self, filter='', start=0, count=-1, query='', sort=''): uri = self.URI + "/*/firmware" return self._helper.get_all(start, count, filter, query, sort, '', '', uri)
[ "\n Gets a list of firmware inventory across all servers. To filter the returned data, specify a filter\n expression to select a particular server model, component name, and/or component firmware version.\n\n Note:\n This method is available for API version 300 or later.\n\n Args:\n start:\n The first item to return, using 0-based indexing.\n If not specified, the default is 0 - start with the first available item.\n count:\n The number of resources to return. A count of -1 requests all items.\n The actual number of items in the response might differ from the requested\n count if the sum of start and count exceeds the total number of items.\n filter (list or str):\n A general filter/query string to narrow the list of items returned. The\n default is no filter; all resources are returned.\n query:\n A general query string to narrow the list of resources returned. The default is no query; all resources\n are returned.\n sort:\n The sort order of the returned data set. By default, the sort order is based\n on create time with the oldest entry first.\n\n Returns:\n list: List of firmware inventory.\n " ]
Please provide a description of the function:def get_firmware(self): uri = "{}/firmware".format(self.data["uri"]) return self._helper.do_get(uri)
[ "\n Get the firmware inventory of a server.\n\n Note:\n This method is available for API version 300 or later.\n\n Returns:\n dict: Server Hardware firmware.\n " ]
Please provide a description of the function:def get_java_remote_console_url(self, ip=None): uri = "{}/javaRemoteConsoleUrl".format(self.data["uri"]) if ip: uri = "{}?ip={}".format(uri, ip) return self._helper.do_get(uri)
[ "\n Generates a Single Sign-On (SSO) session for the iLO Java Applet console and returns the URL to launch it.\n If the server hardware is unmanaged or unsupported, the resulting URL will not use SSO and the iLO Java Applet\n will prompt for credentials. This is not supported on G7/iLO3 or earlier servers.\n\n Args:\n ip: IP address or host name of the server's iLO management processor\n\n Returns:\n URL\n " ]
Please provide a description of the function:def update_mp_firware_version(self, timeout=-1): uri = "{}/mpFirmwareVersion".format(self.data["uri"]) return self._helper.do_put(uri, None, timeout, None)
[ "\n Updates the iLO firmware on a physical server to a minimum ILO firmware version required by OneView to\n manage the server.\n\n Args:\n timeout:\n Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView; it just stops waiting for its completion.\n Returns:\n Resource\n " ]
Please provide a description of the function:def get_remote_console_url(self, ip=None): uri = "{}/remoteConsoleUrl".format(self.data["uri"]) if ip: uri = "{}?ip={}".format(uri, ip) return self._helper.do_get(uri)
[ "\n Generates a Single Sign-On (SSO) session for the iLO Integrated Remote Console Application (IRC) and returns the\n URL to launch it. If the server hardware is unmanaged or unsupported, the resulting URL will not use SSO and the\n IRC application will prompt for credentials. Use of this URL requires a previous installation of the iLO IRC and\n is supported only on Windows clients.\n\n Args:\n ip: IP address or host name of the server's iLO management processor\n\n Returns:\n URL\n " ]
Please provide a description of the function:def get_physical_server_hardware(self): uri = "{}/physicalServerHardware".format(self.data["uri"]) return self._helper.do_get(uri)
[ "\n Information describing an 'SDX' partition including a list of physical server blades represented by a server\n hardware. Used with SDX enclosures only.\n\n Returns:\n Resource\n " ]
Please provide a description of the function:def update(self, resource, timeout=-1): self.__set_default_values(resource) uri = self._client.build_uri(resource['logicalSwitch']['uri']) return self._client.update(resource, uri=uri, timeout=timeout)
[ "\n Updates a Logical Switch.\n\n Args:\n resource (dict): Object to update.\n timeout:\n Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView, just stop waiting for its completion.\n\n Returns:\n dict: Updated resource.\n " ]
Please provide a description of the function:def refresh(self, id_or_uri, timeout=-1): uri = self._client.build_uri(id_or_uri) + "/refresh" return self._client.update_with_zero_body(uri, timeout=timeout)
[ "\n The Refresh action reclaims the top-of-rack switches in a logical switch.\n\n Args:\n id_or_uri:\n Can be either the Logical Switch ID or URI\n timeout:\n Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView, just stop waiting for its completion.\n\n Returns:\n dict: The Logical Switch\n " ]
Please provide a description of the function:def patch(self, id_or_uri, operation, path, value, timeout=-1): return self._client.patch(id_or_uri, operation, path, value, timeout=timeout)
[ "\n Uses the PATCH to update a resource for a given logical switch group.\n\n Only one operation can be performed in each PATCH call.\n\n Args:\n id_or_uri: Can be either the resource ID or the resource URI.\n operation: Patch operation\n path: Path\n value: Value\n timeout: Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView; it just stops waiting for its completion.\n\n Returns:\n dict: Updated resource.\n " ]
Please provide a description of the function:def migrate(self, id_or_uri, timeout=-1): # create the special payload to tell the VC Migration Manager to migrate the VC domain migrationInformation = { 'migrationState': 'Migrated', 'type': 'migratable-vc-domains', 'category': 'migratable-vc-domains' } # call build_uri manually since .update(...) doesn't do it and the URI is not to be included in the body when # requesting a migration complete_uri = self._client.build_uri(id_or_uri) return self._client.update(migrationInformation, uri=complete_uri, timeout=timeout)
[ "\n Initiates a migration of an enclosure specified by the ID or URI of a migration report.\n\n Args:\n id_or_uri: ID or URI of the migration report.\n timeout: Timeout in seconds. Waits for task completion by default. The timeout does not abort the task in\n OneView; just stops waiting for its completion.\n\n Returns: dict: a migration report.\n " ]
Please provide a description of the function:def get_by_resource(self, resource_uri): uri = self.URI + self.RESOURCES_PATH + '/' + resource_uri return self._client.get(id_or_uri=uri)
[ "\n Gets all the labels for the specified resource\n\n Args:\n resource_uri: The resource URI\n\n Returns:\n dict: Resource Labels\n " ]
Please provide a description of the function:def create(self, resource): uri = self.URI + self.RESOURCES_PATH return self._client.create(resource=resource, uri=uri)
[ "\n Set all the labels for a resource.\n\n Args:\n resource: The object containing the resource URI and a list of labels\n\n Returns:\n dict: Resource Labels\n " ]
Please provide a description of the function:def delete(self, resource, timeout=-1): self._client.delete(resource=resource, timeout=timeout)
[ "\n Delete all the labels for a resource.\n\n Args:\n resource (dict): Object to delete.\n timeout:\n Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView, just stop waiting for its completion.\n " ]
Please provide a description of the function:def update(self, resource, timeout=-1): return self._client.update(resource, timeout=timeout, default_values=self.DEFAULT_VALUES, uri=self.URI)
[ "\n Updates a User.\n\n Args:\n resource (dict): Object to update.\n timeout:\n Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView, just stop waiting for its completion.\n\n Returns:\n dict: Updated resource.\n\n " ]
Please provide a description of the function:def get_by(self, field, value): if field == 'userName' or field == 'name': return self._client.get(self.URI + '/' + value) elif field == 'role': value = value.replace(" ", "%20") return self._client.get(self.URI + '/roles/users/' + value)['members'] else: raise HPOneViewException('Only userName, name and role can be queried for this resource.')
[ "\n Gets all Users that match the filter.\n\n The search is case-insensitive.\n\n Args:\n field: Field name to filter. Accepted values: 'name', 'userName', 'role'\n value: Value to filter.\n\n Returns:\n list: A list of Users.\n " ]
Please provide a description of the function:def validate_user_name(self, user_name, timeout=-1): uri = self.URI + '/validateLoginName/' + user_name return self._client.create_with_zero_body(uri=uri, timeout=timeout)
[ "\n Verifies if a userName is already in use.\n\n Args:\n user_name:\n The userName to be verified.\n timeout:\n Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation in\n OneView, just stops waiting for its completion.\n\n Returns: True if user name is in use, False if it is not.\n " ]
Please provide a description of the function:def validate_full_name(self, full_name, timeout=-1): uri = self.URI + '/validateUserName/' + full_name return self._client.create_with_zero_body(uri=uri, timeout=timeout)
[ "\n Verifies if a fullName is already in use.\n\n Args:\n full_name:\n The fullName to be verified.\n timeout:\n Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation in\n OneView, just stops waiting for its completion.\n\n Returns: True if full name is in use, False if it is not.\n " ]
Please provide a description of the function:def add_ipdu(self, information, timeout=-1): uri = self.URI + "/discover" return self._client.create(information, uri=uri, timeout=timeout)
[ "\n Add an HP iPDU and bring all components under management by discovery of its management module. Bring the\n management module under exclusive management by the appliance, configure any management or data collection\n settings, and create a private set of administrative credentials to enable ongoing communication and management\n of the iPDU. Use \"force\" to claim the device, even if claimed by another management appliance\n\n Args:\n resource: power device information\n timeout: Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView; it just stops waiting for its completion.\n\n Returns:\n dict: added power device.\n " ]
Please provide a description of the function:def get_power_state(self, id_or_uri): uri = self._client.build_uri(id_or_uri) + "/powerState" return self._client.get(uri)
[ "\n Gets the power state (on, off or unknown) of the specified power delivery device that supports power control.\n The device must be an HP Intelligent Outlet.\n\n Args:\n id_or_uri:\n Can be either the power device id or the uri\n\n Returns:\n str: The power state\n " ]
Please provide a description of the function:def update_power_state(self, id_or_uri, power_state): uri = self._client.build_uri(id_or_uri) + "/powerState" return self._client.update(power_state, uri)
[ "\n Sets the power state of the specified power delivery device. The device must be an HP Intelligent Outlet.\n\n Args:\n id_or_uri:\n Can be either the power device id or the uri\n power_state:\n {\"powerState\":\"On|Off\"}\n\n Returns:\n str: The power state\n " ]
Please provide a description of the function:def update_refresh_state(self, id_or_uri, refresh_state_data): uri = self._client.build_uri(id_or_uri) + "/refreshState" return self._client.update(refresh_state_data, uri=uri)
[ "\n Refreshes a given intelligent power delivery device.\n\n Args:\n id_or_uri:\n Can be either the power device id or the uri\n refresh_state_data:\n Power device refresh request\n\n Returns:\n str: The power state\n " ]
Please provide a description of the function:def remove_synchronous(self, resource, force=False, timeout=-1): uri = self._client.build_uri(resource['uri']) + "/synchronous" remove_resource = {'uri': uri} return self._client.delete(remove_resource, force=force, timeout=timeout)
[ "\n Deletes the resource specified by {id} synchronously.\n\n Args:\n resource: dict object to remove\n force:\n If set to true, the operation completes despite any problems with\n network connectivity or errors on the resource itself. The default is false.\n timeout: Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView; it just stops waiting for its completion.\n\n Returns:\n bool: operation success\n " ]
Please provide a description of the function:def get_uid_state(self, id_or_uri): uri = self._client.build_uri(id_or_uri) + "/uidState" return self._client.get(uri)
[ "\n Retrieves the unit identification (UID) state (on, off, unknown) of the specified power outlet or extension bar\n resource. The device must be an HP iPDU component with a locator light (HP Intelligent Load Segment,\n HP AC Module, HP Intelligent Outlet Bar, or HP Intelligent Outlet).\n\n Args:\n id_or_uri:\n Can be either the power device id or the uri\n\n Returns:\n str: unit identification (UID) state\n " ]
Please provide a description of the function:def update_uid_state(self, id_or_uri, refresh_state_data): uri = self._client.build_uri(id_or_uri) + "/uidState" return self._client.update(refresh_state_data, uri)
[ "\n Sets the unit identification (UID) light state of the specified power delivery device. The device must be an\n HP iPDU component with a locator light (HP Intelligent Load Segment, HP AC Module, HP Intelligent Outlet Bar,\n or HP Intelligent Outlet)\n\n Args:\n id_or_uri:\n Can be either the power device id or the uri\n refresh_state_data:\n Power device refresh request\n\n Returns:\n str: The UID state\n " ]
Please provide a description of the function:def get_utilization(self, id_or_uri, fields=None, filter=None, refresh=False, view=None): return self._client.get_utilization(id_or_uri, fields, filter, refresh, view)
[ "\n Retrieves historical utilization data for the specified metrics and time span. The device must be a component\n of an HPE iPDU.\n\n Args:\n id_or_uri:\n The power device id or the resource uri\n fields:\n Name of the metric(s) to be retrieved in the format METRIC[,METRIC]...If unspecified, all metrics\n supported are returned. Power delivery devices support the following utilization metrics:\n\n * AveragePower\n Average power consumption in Watts during this sample interval.\n * PeakPower\n Peak power consumption in Watts during this sample interval.\n\n filter (list or str):\n Filters should be in the format: FILTER_NAME=VALUE[,FILTER_NAME=VALUE]...\n\n For Example: 'startDate=2016-05-30T11:20:44.541Z,endDate=2016-05-30T19:20:44.541Z'\n\n startDate:\n Start date of requested starting time range in ISO 8601 format. If omitted, the startDate is\n determined by the endDate minus 24 hours.\n endDate:\n End date of requested starting time range in ISO 8601 format. When omitted the endDate includes the\n latest data sample available.\n\n If an excessive number of samples would otherwise be returned, the results will be segmented. The caller\n is responsible for comparing the returned sliceStartTime with the requested startTime in the response.\n If the sliceStartTime is greater than the oldestSampleTime and the requested start time, the caller is\n responsible for repeating the request with endTime set to sliceStartTime to obtain the next segment.\n This process is repeated until the full data set is retrieved.\n\n If the resource has no data, the UtilizationData is still returned, but will contain no samples and\n sliceStartTime/sliceEndTime will be equal. oldestSampleTime/newestSampleTime will still be set\n appropriately (null if no data is available). If the filter does not happen to overlap the data\n that a resource does have, then the metric history service will return null sample values for any\n missing samples.\n\n refresh:\n Specifies that if necessary, an additional request will be queued to obtain the most recent utilization\n data from the enclosure. The response will not include any refreshed data. To track the availability\n of the newly collected data, monitor the TaskResource identified by the refreshTaskUri property in\n the response. If null, no refresh was queued.\n view:\n Specifies the resolution interval length of the samples to be retrieved. This is reflected in the\n resolution in the returned response. Utilization data is automatically purged to stay within storage\n space constraints. Supported views are listed below:\n\n native (DEFAULT)\n Resolution of the samples returned will be one sample for each 5-minute time period. This is the\n default view and matches the resolution of the data returned by the enclosure. Samples at this\n resolution are retained up to one year.\n hour\n Resolution of the samples returned will be one sample for each 60-minute time period. Samples are\n calculated by averaging the available 5-minute data samples that occurred within the hour, except\n for PeakPower which is calculated by reporting the peak observed 5-minute sample value data during\n the hour. Samples at this resolution are retained up to three years.\n day\n Resolution of the samples returned will be one sample for each 24-hour time period. One day is a\n 24-hour period that starts at midnight GMT regardless of the time zone in which the appliance or\n client is located. Samples are calculated by averaging the available 5-minute data samples that\n occurred during the day, except for PeakPower which is calculated by reporting the peak observed\n 5-minute sample value data during the day. Samples at this resolution are retained up to three\n years.\n\n Returns:\n dict: Utilization data\n " ]
Please provide a description of the function:def retrieve_differences(self, id_or_uri, content, timeout=-1): uri = self.URI + "/differences/" + extract_id_from_uri(id_or_uri) return self._client.create(content, uri=uri, timeout=timeout)
[ "\n Retrieves the modified contents of the selected Plan Script according to the provided content object, as per\n the selected attributes.\n\n Args:\n id_or_uri: ID or URI of the Plan Script.\n content (str): Plan Script content.\n timeout:\n Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation\n in OneView, it just stops waiting for its completion.\n\n Returns:\n dict: Script differences.\n " ]
Please provide a description of the function:def get_usedby_and_readonly(self, id): uri = self.URI + "/" + id + "/usedby/readonly" return self._client.get(uri)
[ "\n Gets the build plans details os teh selected plan script as per the selected attributes.\n\n Args:\n id: ID of the Plan Script.\n\n Returns:\n array of build plans\n " ]
Please provide a description of the function:def get_osdp(self, id_or_uri): uri = self._client.build_subresource_uri(resource_id_or_uri=id_or_uri, subresource_path="osdp") return self._client.get(uri)
[ "\n Retrieves facts about Server Profiles and Server Profile Templates that are using Deployment Plan based on the ID or URI provided.\n\n Args:\n id_or_uri: ID or URI of the Deployment Plan.\n\n Returns:\n dict: Server Profiles and Server Profile Templates\n " ]
Please provide a description of the function:def update(self, data=None, timeout=-1, force=''): uri = self.data['uri'] resource = deepcopy(self.data) resource.update(data) # Removes related fields to serverHardware in case of unassign if resource.get('serverHardwareUri') is None: resource.pop('enclosureBay', None) resource.pop('enclosureUri', None) self.data = self._helper.update(resource, uri, force, timeout) return self
[ "Updates server profile template.\n\n Args:\n data: Data to update the resource.\n timeout: Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView; it just stops waiting for its completion.\n force: Force the update operation.\n\n Returns:\n A dict with the updated resource data.\n " ]
Please provide a description of the function:def delete_all(self, filter, timeout=-1, force=False): return self._helper.delete_all(filter=filter, force=force, timeout=timeout)
[ "\n Deletes all Server Profile objects from the appliance that match the provided filter.\n Filters are supported only for the following profile attributes: name, description, serialnumber, uuid,\n mactype, wwntype, serialnumbertype, status, and state.\n\n\n Examples:\n >>> server_profile_client.delete_all(filter=\"name='Exchange Server'\")\n # Remove all profiles that match the name \"Exchange Server\"\n\n >>> server_profile_client.delete_all(filter=\"name matches'%25Database%25'\")\n # Remove all profiles that have the word \"Database\" in its name\n\n The filter function here operates similarly to the function defined for GET Server Profiles. It allows\n for both actual and partial matches of data in the profile. Any requests that use a wildcard match\n must include a %25 as illustrated in the previous example. This is how you encode that character for\n transmission to the appliance.\n\n Args:\n filter (dict): Object to delete.\n timeout: Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView; it just stops waiting for its completion.\n\n Returns:\n bool: Indicates whether the server profile was successfully deleted.\n " ]
Please provide a description of the function:def get_compliance_preview(self): uri = '{}/compliance-preview'.format(self.data["uri"]) return self._helper.do_get(uri)
[ "\n Gets the preview of manual and automatic updates required to make the server profile\n consistent with its template.\n\n Returns:\n dict: Server profile compliance preview.\n " ]
Please provide a description of the function:def get_profile_ports(self, **kwargs): uri = self._helper.build_uri_with_query_string(kwargs, '/profile-ports') return self._helper.do_get(uri)
[ "\n Retrieves the port model associated with a server or server hardware type and enclosure group.\n\n Args:\n enclosureGroupUri (str):\n The URI of the enclosure group associated with the resource.\n serverHardwareTypeUri (str):\n The URI of the server hardware type associated with the resource.\n serverHardwareUri (str):\n The URI of the server hardware associated with the resource.\n\n Returns:\n dict: Profile port.\n " ]
Please provide a description of the function:def get_messages(self): uri = '{}/messages'.format(self.data["uri"]) return self._helper.do_get(uri)
[ "\n Retrieves the error or status messages associated with the specified profile.\n\n Returns:\n dict: Server Profile Health.\n " ]
Please provide a description of the function:def get_available_networks(self, **kwargs): uri = self._helper.build_uri_with_query_string(kwargs, '/available-networks') return self._helper.do_get(uri)
[ "\n Retrieves the list of Ethernet networks, Fiber Channel networks, and network sets that are available to a\n server profile, along with their respective ports.\n\n Args:\n enclosureGroupUri (str): The URI of the enclosure group associated with the resource.\n functionType (str): The FunctionType (Ethernet or FibreChannel) to filter the list of networks returned.\n serverHardwareTypeUri (str): The URI of the server hardware type associated with the resource.\n serverHardwareUri (str): The URI of the server hardware associated with the resource.\n view (str): Returns a specific subset of the attributes of the resource or collection, by\n specifying the name of a predefined view. The default view is expand (show all attributes\n of the resource and all elements of collections of resources).\n\n Values:\n Ethernet\n Specifies that the connection is to an Ethernet network or a network set.\n FibreChannel\n Specifies that the connection is to a Fibre Channel network.\n profileUri (str): If the URI of the server profile is provided the list of available networks will\n include only networks that share a scope with the server profile.\n scopeUris (str): An expression to restrict the resources returned according to the scopes\n to which they are assigned\n\n Returns:\n list: Available networks.\n " ]
Please provide a description of the function:def get_available_servers(self, **kwargs): uri = self._helper.build_uri_with_query_string(kwargs, '/available-servers') return self._helper.do_get(uri)
[ "\n Retrieves the list of available servers.\n\n Args:\n enclosureGroupUri (str): The URI of the enclosure group associated with the resource.\n serverHardwareTypeUri (str): The URI of the server hardware type associated with the resource.\n profileUri (str): The URI of the server profile resource.\n scopeUris (str): An expression to restrict the resources returned according to\n the scopes to which they are assigned.\n filter (list or str): A general filter/query string to narrow the list of items returned.\n The default is no filter, all resources are returned.\n Returns:\n list: Available servers.\n " ]
Please provide a description of the function:def get_available_storage_system(self, **kwargs): uri = self._helper.build_uri_with_query_string(kwargs, '/available-storage-system') return self._helper.do_get(uri)
[ "\n Retrieves a specific storage system and its associated volumes available to the server profile based\n on the given server hardware type and enclosure group.\n\n Args:\n enclosureGroupUri (str):\n The URI of the enclosure group associated with the resource.\n serverHardwareTypeUri (str):\n The URI of the server hardware type associated with the resource.\n storageSystemId (str):\n The storage system ID associated with the resource.\n\n Returns:\n dict: Available storage system.\n " ]
Please provide a description of the function:def get_available_storage_systems(self, start=0, count=-1, filter='', sort='', **kwargs): uri = self._helper.build_uri_with_query_string(kwargs, '/available-storage-systems') return self._helper.get_all(start=start, count=count, filter=filter, sort=sort, uri=uri)
[ "\n Retrieves the list of the storage systems and their associated volumes available to the server profile\n based on the given server hardware type and enclosure group.\n\n Args:\n count:\n The number of resources to return. A count of -1 requests all items. The actual number of items in\n the response may differ from the requested count if the sum of start and count exceed the total\n number of items.\n start:\n The first item to return, using 0-based indexing. If not specified, the default is 0 - start with the\n first available item.\n filter (list or str):\n A general filter/query string to narrow the list of items returned. The default is no filter; all\n resources are returned.\n sort:\n The sort order of the returned data set. By default, the sort order is based on create time, with the\n oldest entry first.\n enclosureGroupUri (str):\n The URI of the enclosure group associated with the resource.\n serverHardwareTypeUri (str):\n The URI of the server hardware type associated with the resource.\n\n Returns:\n list: Available storage systems.\n " ]
Please provide a description of the function:def get_available_targets(self, **kwargs): uri = self._helper.build_uri_with_query_string(kwargs, '/available-targets') return self._helper.do_get(uri)
[ "\n Retrieves a list of the target servers and empty device bays that are available for assignment to the server\n profile.\n\n Args:\n enclosureGroupUri (str): The URI of the enclosure group associated with the resource.\n serverHardwareTypeUri (str): The URI of the server hardware type associated with the resource.\n profileUri (str): The URI of the server profile associated with the resource.\n scopeUris (str): An expression to restrict the resources returned according to\n the scopes to which they are assigned.\n filter (list or str): A general filter/query string to narrow the list of items returned.\n The default is no filter, all resources are returned.\n\n Returns:\n list: List of available servers and bays.\n " ]
Please provide a description of the function:def get_new_profile_template(self): uri = '{}/new-profile-template'.format(self.data["uri"]) return self._helper.do_get(uri)
[ "\n Retrieves the profile template for a given server profile.\n\n Returns:\n dict: Server profile template.\n " ]
Please provide a description of the function:def update_script(self, script_body): uri = "{}/script".format(self.data['uri']) return self._helper.update(script_body, uri=uri)
[ "\n Updates the configuration script of the enclosure-group with the specified URI.\n\n Args:\n id_or_uri: Resource id or resource uri.\n script_body: Configuration script.\n\n Returns:\n dict: Updated enclosure group.\n " ]
Please provide a description of the function:def remove_extra_presentations(self, resource, timeout=-1): uri = self.URI + "/repair" custom_headers = {'Accept-Language': 'en_US'} return self._client.create(resource, uri=uri, timeout=timeout, custom_headers=custom_headers)
[ "\n Removes extra presentations from a specified server profile.\n\n Args:\n resource (dict):\n Object to create\n timeout:\n Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation\n in OneView; it just stops waiting for its completion.\n Returns:\n dict: Associated storage attachment resource.\n " ]
Please provide a description of the function:def get_paths(self, id_or_uri, path_id_or_uri=''): if path_id_or_uri: uri = self._client.build_uri(path_id_or_uri) if "/paths" not in uri: uri = self._client.build_uri( id_or_uri) + "/paths" + "/" + path_id_or_uri else: uri = self._client.build_uri(id_or_uri) + "/paths" return self._client.get(uri)
[ "\n Gets all paths or a specific attachment path for the specified volume attachment.\n\n Args:\n id_or_uri: Can be either the volume attachment id or the volume attachment uri.\n path_id_or_uri: Can be either the path id or the path uri.\n\n Returns:\n dict: Paths.\n " ]
Please provide a description of the function:def get_backup(self, id_or_uri): uri = self.BACKUPS_PATH + '/' + extract_id_from_uri(id_or_uri) return self._client.get(id_or_uri=uri)
[ "\n Get the details for the backup from an Artifact Bundle.\n\n Args:\n id_or_uri: ID or URI of the Artifact Bundle.\n\n Returns:\n Dict: Backup for an Artifacts Bundle.\n " ]
Please provide a description of the function:def download_archive_artifact_bundle(self, id_or_uri, file_path): uri = self.BACKUP_ARCHIVE_PATH + '/' + extract_id_from_uri(id_or_uri) return self._client.download(uri, file_path)
[ "\n Downloads an archive for the Artifact Bundle.\n\n Args:\n id_or_uri: ID or URI of the Artifact Bundle.\n file_path(str): Destination file path.\n\n Returns:\n bool: Successfully downloaded.\n " ]
Please provide a description of the function:def download_artifact_bundle(self, id_or_uri, file_path): uri = self.DOWNLOAD_PATH + '/' + extract_id_from_uri(id_or_uri) return self._client.download(uri, file_path)
[ "\n Download the Artifact Bundle.\n\n Args:\n id_or_uri: ID or URI of the Artifact Bundle.\n file_path(str): Destination file path.\n\n Returns:\n bool: Successfully downloaded.\n " ]
Please provide a description of the function:def create_backup(self, resource, timeout=-1): return self._client.create(resource, uri=self.BACKUPS_PATH, timeout=timeout)
[ "\n Creates a backup bundle with all the artifacts present on the appliance. At any given point only one backup\n bundle will exist on the appliance.\n\n Args:\n resource (dict): Deployment Group to create the backup.\n timeout:\n Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in\n OneView, it just stops waiting for its completion.\n\n Returns:\n dict: A Deployment Group associated with the Artifact Bundle backup.\n " ]
Please provide a description of the function:def upload_backup_bundle_from_file(self, file_path, deployment_groups_id_or_uri): deployment_groups_uri = deployment_groups_id_or_uri if self.DEPLOYMENT_GROUPS_URI not in deployment_groups_id_or_uri: deployment_groups_uri = self.DEPLOYMENT_GROUPS_URI + deployment_groups_id_or_uri uri = self.BACKUP_ARCHIVE_PATH + "?deploymentGrpUri=" + deployment_groups_uri return self._client.upload(file_path, uri)
[ "\n Restore an Artifact Bundle from a backup file.\n\n Args:\n file_path (str): The File Path to restore the Artifact Bundle.\n deployment_groups_id_or_uri: ID or URI of the Deployment Groups.\n\n Returns:\n dict: Deployment group.\n " ]
Please provide a description of the function:def update(self, resource, timeout=-1): return self._client.update(resource, timeout=timeout, default_values=self.DEFAULT_VALUES)
[ "\n Updates only name for the Artifact Bundle.\n\n Args:\n resource (dict): Object to update.\n timeout:\n Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation\n in OneView, it just stops waiting for its completion.\n\n Returns:\n dict: Updated resource.\n " ]
Please provide a description of the function:def extract_bundle(self, resource, timeout=-1): return self._client.update(resource, timeout=timeout, custom_headers={"Content-Type": "text/plain"})
[ "\n Extracts the existing bundle on the appliance and creates all the artifacts.\n\n Args:\n resource (dict): Artifact Bundle to extract.\n timeout:\n Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in\n OneView, it just stops waiting for its completion.\n\n Returns:\n dict: The Artifact Bundle.\n " ]
Please provide a description of the function:def extract_backup_bundle(self, resource, timeout=-1): return self._client.update(resource, uri=self.BACKUP_ARCHIVE_PATH, timeout=timeout)
[ "\n Extracts the existing backup bundle on the appliance and creates all the artifacts.\n\n Args:\n resource (dict): Deployment Group to extract.\n timeout:\n Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in\n OneView, it just stops waiting for its completion.\n\n Returns:\n dict: A Deployment Group associated with the Artifact Bundle backup.\n " ]
Please provide a description of the function:def stop_artifact_creation(self, id_or_uri, task_uri): data = { "taskUri": task_uri } uri = self.URI + '/' + extract_id_from_uri(id_or_uri) + self.STOP_CREATION_PATH return self._client.update(data, uri=uri)
[ "\n Stops creation of the selected Artifact Bundle.\n\n Args:\n id_or_uri: ID or URI of the Artifact Bundle.\n task_uri: Task URI associated with the Artifact Bundle.\n\n Returns:\n string:\n " ]