query
stringlengths
5
1.23k
positive
stringlengths
53
15.2k
id_
int64
0
252k
task_name
stringlengths
87
242
negative
listlengths
20
553
Updates the Ethernet interconnect settings for the logical interconnect .
def update_ethernet_settings ( self , configuration , force = False , timeout = - 1 ) : uri = "{}/ethernetSettings" . format ( self . data [ "uri" ] ) return self . _helper . update ( configuration , uri = uri , force = force , timeout = timeout )
251,400
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_interconnects.py#L153-L168
[ "def", "create_stream_subscription", "(", "self", ",", "stream", ",", "on_data", ",", "timeout", "=", "60", ")", ":", "options", "=", "rest_pb2", ".", "StreamSubscribeRequest", "(", ")", "options", ".", "stream", "=", "stream", "manager", "=", "WebSocketSubscr...
Updates internal networks on the logical interconnect .
def update_internal_networks ( self , network_uri_list , force = False , timeout = - 1 ) : uri = "{}/internalNetworks" . format ( self . data [ "uri" ] ) return self . _helper . update ( network_uri_list , uri = uri , force = force , timeout = timeout )
251,401
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_interconnects.py#L171-L186
[ "def", "remove_mentions", "(", "self", ",", "string", ")", ":", "def", "replace", "(", "obj", ",", "*", ",", "transforms", "=", "self", ".", "MENTION_TRANSFORMS", ")", ":", "return", "transforms", ".", "get", "(", "obj", ".", "group", "(", "0", ")", ...
Asynchronously applies or re - applies the logical interconnect configuration to all managed interconnects .
def update_configuration ( self , timeout = - 1 ) : uri = "{}/configuration" . format ( self . data [ "uri" ] ) return self . _helper . update ( None , uri = uri , timeout = timeout )
251,402
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_interconnects.py#L232-L244
[ "def", "retrieve_mtm_results", "(", "self", ",", "book_id", ",", "asset_manager_id", ",", "paramaters", ")", ":", "self", ".", "logger", ".", "info", "(", "'Retrieving mtm Positions - Asset Manager: %s'", ",", "asset_manager_id", ")", "url", "=", "'%s/mtm/%s'", "%",...
Gets the SNMP configuration for a logical interconnect .
def get_snmp_configuration ( self ) : uri = "{}{}" . format ( self . data [ "uri" ] , self . SNMP_CONFIGURATION_PATH ) return self . _helper . do_get ( uri )
251,403
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_interconnects.py#L247-L255
[ "def", "enable_notebook", "(", "verbose", "=", "0", ")", ":", "libs", "=", "[", "'objexporter.js'", ",", "'ArcballControls.js'", ",", "'filesaver.js'", ",", "'base64-arraybuffer.js'", ",", "'context.js'", ",", "'chemview.js'", ",", "'three.min.js'", ",", "'jquery-ui...
Updates the SNMP configuration of a logical interconnect . Changes to the SNMP configuration are asynchronously applied to all managed interconnects .
def update_snmp_configuration ( self , configuration , timeout = - 1 ) : data = configuration . copy ( ) if 'type' not in data : data [ 'type' ] = 'snmp-configuration' uri = "{}{}" . format ( self . data [ "uri" ] , self . SNMP_CONFIGURATION_PATH ) return self . _helper . update ( data , uri = uri , timeout = timeout )
251,404
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_interconnects.py#L258-L274
[ "def", "_parseElfHeader", "(", "self", ",", "data", ")", ":", "ehdr", "=", "self", ".", "__classes", ".", "EHDR", ".", "from_buffer", "(", "data", ")", "return", "EhdrData", "(", "header", "=", "ehdr", ")" ]
Gets the collection ports from the member interconnects which are eligible for assignment to an anlyzer port
def get_unassigned_ports ( self ) : uri = "{}/unassignedPortsForPortMonitor" . format ( self . data [ "uri" ] ) response = self . _helper . do_get ( uri ) return self . _helper . get_members ( response )
251,405
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_interconnects.py#L277-L288
[ "def", "__get_registry_key", "(", "self", ",", "key", ")", ":", "import", "winreg", "root", "=", "winreg", ".", "OpenKey", "(", "winreg", ".", "HKEY_CURRENT_USER", ",", "r'SOFTWARE\\GSettings\\org\\gnucash\\general'", ",", "0", ",", "winreg", ".", "KEY_READ", ")...
Gets the port monitor configuration of a logical interconnect .
def get_port_monitor ( self ) : uri = "{}{}" . format ( self . data [ "uri" ] , self . PORT_MONITOR_PATH ) return self . _helper . do_get ( uri )
251,406
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_interconnects.py#L306-L314
[ "def", "_generate_examples_validation", "(", "self", ",", "archive", ",", "labels", ")", ":", "# Get the current random seeds.", "numpy_st0", "=", "np", ".", "random", ".", "get_state", "(", ")", "# Set new random seeds.", "np", ".", "random", ".", "seed", "(", ...
Updates the port monitor configuration of a logical interconnect .
def update_port_monitor ( self , resource , timeout = - 1 ) : data = resource . copy ( ) if 'type' not in data : data [ 'type' ] = 'port-monitor' uri = "{}{}" . format ( self . data [ "uri" ] , self . PORT_MONITOR_PATH ) return self . _helper . update ( data , uri = uri , timeout = timeout )
251,407
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_interconnects.py#L317-L332
[ "def", "_generate_examples_validation", "(", "self", ",", "archive", ",", "labels", ")", ":", "# Get the current random seeds.", "numpy_st0", "=", "np", ".", "random", ".", "get_state", "(", ")", "# Set new random seeds.", "np", ".", "random", ".", "seed", "(", ...
Creates an interconnect at the given location .
def create_interconnect ( self , location_entries , timeout = - 1 ) : return self . _helper . create ( location_entries , uri = self . locations_uri , timeout = timeout )
251,408
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_interconnects.py#L334-L351
[ "def", "strip_system_metadata", "(", "etree_obj", ")", ":", "for", "series_id_el", "in", "etree_obj", ".", "findall", "(", "'seriesId'", ")", ":", "etree_obj", ".", "remove", "(", "series_id_el", ")", "for", "media_type_el", "in", "etree_obj", ".", "findall", ...
Deletes an interconnect from a location .
def delete_interconnect ( self , enclosure_uri , bay , timeout = - 1 ) : uri = "{path}?location=Enclosure:{enclosure_uri},Bay:{bay}" . format ( path = self . LOCATIONS_PATH , enclosure_uri = enclosure_uri , bay = bay ) return self . _helper . delete ( uri , timeout = timeout )
251,409
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_interconnects.py#L353-L374
[ "def", "pack_turret", "(", "turret", ",", "temp_files", ",", "base_config_path", ",", "path", "=", "None", ")", ":", "file_name", "=", "turret", "[", "'name'", "]", "files", "=", "temp_files", "[", ":", "]", "for", "fname", "in", "turret", ".", "get", ...
Gets the installed firmware for a logical interconnect .
def get_firmware ( self ) : firmware_uri = self . _helper . build_subresource_uri ( self . data [ "uri" ] , subresource_path = self . FIRMWARE_PATH ) return self . _helper . do_get ( firmware_uri )
251,410
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_interconnects.py#L377-L385
[ "def", "remove_mentions", "(", "self", ",", "string", ")", ":", "def", "replace", "(", "obj", ",", "*", ",", "transforms", "=", "self", ".", "MENTION_TRANSFORMS", ")", ":", "return", "transforms", ".", "get", "(", "obj", ".", "group", "(", "0", ")", ...
Gets the forwarding information base data for a logical interconnect . A maximum of 100 entries is returned . Optional filtering criteria might be specified .
def get_forwarding_information_base ( self , filter = '' ) : uri = "{}{}" . format ( self . data [ "uri" ] , self . FORWARDING_INFORMATION_PATH ) return self . _helper . get_collection ( uri , filter = filter )
251,411
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_interconnects.py#L404-L420
[ "def", "_wait_and_except_if_failed", "(", "self", ",", "event", ",", "timeout", "=", "None", ")", ":", "event", ".", "wait", "(", "timeout", "or", "self", ".", "__sync_timeout", ")", "self", ".", "_except_if_failed", "(", "event", ")" ]
Generates the forwarding information base dump file for a logical interconnect .
def create_forwarding_information_base ( self , timeout = - 1 ) : uri = "{}{}" . format ( self . data [ "uri" ] , self . FORWARDING_INFORMATION_PATH ) return self . _helper . do_post ( uri , None , timeout , None )
251,412
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_interconnects.py#L423-L435
[ "def", "get_n_config_to_keep", "(", "self", ",", "n_suggestions", ",", "bracket_iteration", ")", ":", "n_configs", "=", "n_suggestions", "*", "(", "self", ".", "eta", "**", "-", "bracket_iteration", ")", "return", "int", "(", "n_configs", "/", "self", ".", "...
Gets the QoS aggregated configuration for the logical interconnect .
def get_qos_aggregated_configuration ( self ) : uri = "{}{}" . format ( self . data [ "uri" ] , self . QOS_AGGREGATED_CONFIGURATION ) return self . _helper . do_get ( uri )
251,413
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_interconnects.py#L438-L446
[ "def", "main", "(", "args", ")", ":", "random", ".", "seed", "(", ")", "temp_dir", "=", "tempfile", ".", "mkdtemp", "(", ")", "logging", ".", "info", "(", "'Created temporary directory: %s'", ",", "temp_dir", ")", "validator", "=", "SubmissionValidator", "("...
Updates the QoS aggregated configuration for the logical interconnect .
def update_qos_aggregated_configuration ( self , qos_configuration , timeout = - 1 ) : uri = "{}{}" . format ( self . data [ "uri" ] , self . QOS_AGGREGATED_CONFIGURATION ) return self . _helper . update ( qos_configuration , uri = uri , timeout = timeout )
251,414
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_interconnects.py#L449-L464
[ "def", "main", "(", "args", ")", ":", "random", ".", "seed", "(", ")", "temp_dir", "=", "tempfile", ".", "mkdtemp", "(", ")", "logging", ".", "info", "(", "'Created temporary directory: %s'", ",", "temp_dir", ")", "validator", "=", "SubmissionValidator", "("...
Updates the telemetry configuration of a logical interconnect . Changes to the telemetry configuration are asynchronously applied to all managed interconnects .
def update_telemetry_configurations ( self , configuration , timeout = - 1 ) : telemetry_conf_uri = self . _get_telemetry_configuration_uri ( ) default_values = self . _get_default_values ( self . SETTINGS_TELEMETRY_CONFIG_DEFAULT_VALUES ) configuration = self . _helper . update_resource_fields ( configuration , default_values ) return self . _helper . update ( configuration , uri = telemetry_conf_uri , timeout = timeout )
251,415
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_interconnects.py#L485-L504
[ "def", "create", "(", "cls", ",", "destination", ")", ":", "mdb_gz_b64", "=", "\"\"\"\\\n H4sICIenn1gC/25ldzIwMDMubWRiAO2de2wcRx3Hf7O7Pt/d3u6eLyEtVaOaqg+EkjQvuVVDwa9a\n jWXHdZxQQlCJ7fOrfp3OTpqkhVxTItFWIhVQVFBRVNIKRaColVpAUKGKRwwFqUAhKiBIpUaoVWP+\n qKgIIHL8Znb39u72znWJiWP3+9l...
Gets the Ethernet interconnect settings for the Logical Interconnect .
def get_ethernet_settings ( self ) : uri = "{}/ethernetSettings" . format ( self . data [ "uri" ] ) return self . _helper . do_get ( uri )
251,416
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_interconnects.py#L507-L515
[ "def", "_to_unit_base", "(", "self", ",", "base_unit", ",", "values", ",", "unit", ",", "from_unit", ")", ":", "self", ".", "_is_numeric", "(", "values", ")", "namespace", "=", "{", "'self'", ":", "self", ",", "'values'", ":", "values", "}", "if", "not...
Download archived logs of the OS Volume .
def download_archive ( self , name , file_path ) : uri = self . URI + "/archive/" + name return self . _client . download ( uri , file_path )
251,417
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/resources/os_volumes.py#L110-L122
[ "def", "create_token_response", "(", "self", ",", "request", ",", "token_handler", ")", ":", "headers", "=", "self", ".", "_get_default_headers", "(", ")", "try", ":", "if", "self", ".", "request_validator", ".", "client_authentication_required", "(", "request", ...
Get storage details of an OS Volume .
def get_storage ( self , id_or_uri ) : uri = self . URI + "/{}/storage" . format ( extract_id_from_uri ( id_or_uri ) ) return self . _client . get ( uri )
251,418
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/resources/os_volumes.py#L124-L135
[ "def", "real_main", "(", "release_url", "=", "None", ",", "tests_json_path", "=", "None", ",", "upload_build_id", "=", "None", ",", "upload_release_name", "=", "None", ")", ":", "coordinator", "=", "workers", ".", "get_coordinator", "(", ")", "fetch_worker", "...
Retrieves the topology information for the rack resource specified by ID or URI .
def get_device_topology ( self , id_or_uri ) : uri = self . _client . build_uri ( id_or_uri ) + "/deviceTopology" return self . _client . get ( uri )
251,419
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/facilities/racks.py#L91-L102
[ "def", "removeAllEntitlements", "(", "self", ",", "appId", ")", ":", "params", "=", "{", "\"f\"", ":", "\"json\"", ",", "\"appId\"", ":", "appId", "}", "url", "=", "self", ".", "_url", "+", "\"/licenses/removeAllEntitlements\"", "return", "self", ".", "_post...
Gets a Managed SAN by name .
def get_by_name ( self , name ) : managed_sans = self . get_all ( ) result = [ x for x in managed_sans if x [ 'name' ] == name ] resource = result [ 0 ] if result else None if resource : resource = self . new ( self . _connection , resource ) return resource
251,420
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/fc_sans/managed_sans.py#L71-L88
[ "def", "recv_raw", "(", "self", ",", "timeout", ",", "opcodes", ",", "*", "*", "kwargs", ")", ":", "orig_timeout", "=", "self", ".", "get_timeout", "(", "timeout", ")", "timeout", "=", "orig_timeout", "while", "timeout", ">", "0.0", ":", "start", "=", ...
Gets a list of endpoints in a SAN .
def get_endpoints ( self , start = 0 , count = - 1 , filter = '' , sort = '' ) : uri = "{}/endpoints/" . format ( self . data [ "uri" ] ) return self . _helper . get_all ( start , count , filter = filter , sort = sort , uri = uri )
251,421
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/fc_sans/managed_sans.py#L99-L122
[ "async", "def", "register", "(", "self", ",", "request", ")", ":", "session", "=", "await", "get_session", "(", "request", ")", "user_id", "=", "session", ".", "get", "(", "'user_id'", ")", "if", "user_id", ":", "return", "redirect", "(", "request", ",",...
Creates an endpoints CSV file for a SAN .
def create_endpoints_csv_file ( self , timeout = - 1 ) : uri = "{}/endpoints/" . format ( self . data [ "uri" ] ) return self . _helper . do_post ( uri , { } , timeout , None )
251,422
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/fc_sans/managed_sans.py#L125-L138
[ "def", "bulk_remove_entities", "(", "self", ",", "entities_and_kinds", ")", ":", "criteria", "=", "[", "Q", "(", "entity", "=", "entity", ",", "sub_entity_kind", "=", "entity_kind", ")", "for", "entity", ",", "entity_kind", "in", "entities_and_kinds", "]", "cr...
Creates an unexpected zoning report for a SAN .
def create_issues_report ( self , timeout = - 1 ) : uri = "{}/issues/" . format ( self . data [ "uri" ] ) return self . _helper . create_report ( uri , timeout )
251,423
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/fc_sans/managed_sans.py#L141-L154
[ "def", "add_metadata", "(", "file_name", ",", "title", ",", "artist", ",", "album", ")", ":", "tags", "=", "EasyMP3", "(", "file_name", ")", "if", "title", ":", "tags", "[", "\"title\"", "]", "=", "title", "if", "artist", ":", "tags", "[", "\"artist\""...
Adds the specified trap forwarding destination . The trap destination associated with the specified id will be created if trap destination with that id does not exists . The id can only be an integer greater than 0 .
def create ( self , resource , id = None , timeout = - 1 ) : if not id : available_id = self . __get_first_available_id ( ) uri = '%s/%s' % ( self . URI , str ( available_id ) ) else : uri = '%s/%s' % ( self . URI , str ( id ) ) return self . _client . create ( resource , uri = uri , timeout = timeout )
251,424
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/settings/appliance_device_snmp_v1_trap_destinations.py#L46-L67
[ "def", "to", "(", "self", ",", "unit", ")", ":", "u", "=", "Unit", "(", "\"0cm\"", ")", "u", ".", "value", "=", "self", ".", "value", "/", "self", ".", "per_inch", "[", "self", ".", "unit", "]", "*", "self", ".", "per_inch", "[", "unit", "]", ...
Find the smallest elements missing in a sorted array .
def __findFirstMissing ( self , array , start , end ) : if ( start > end ) : return end + 1 if ( start != array [ start ] ) : return start mid = int ( ( start + end ) / 2 ) if ( array [ mid ] == mid ) : return self . __findFirstMissing ( array , mid + 1 , end ) return self . __findFirstMissing ( array , start , mid )
251,425
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/settings/appliance_device_snmp_v1_trap_destinations.py#L69-L87
[ "def", "_connect", "(", "self", ")", ":", "try", ":", "# Open Connection", "self", ".", "influx", "=", "InfluxDBClient", "(", "self", ".", "hostname", ",", "self", ".", "port", ",", "self", ".", "username", ",", "self", ".", "password", ",", "self", "....
Private method to get the first available id . The id can only be an integer greater than 0 .
def __get_first_available_id ( self ) : traps = self . get_all ( ) if traps : used_ids = [ 0 ] for trap in traps : used_uris = trap . get ( 'uri' ) used_ids . append ( int ( used_uris . split ( '/' ) [ - 1 ] ) ) used_ids . sort ( ) return self . __findFirstMissing ( used_ids , 0 , len ( used_ids ) - 1 ) else : return 1
251,426
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/settings/appliance_device_snmp_v1_trap_destinations.py#L89-L106
[ "def", "write_biom_table", "(", "table", ",", "biom_fp", ")", ":", "logger", "=", "logging", ".", "getLogger", "(", "__name__", ")", "logger", ".", "debug", "(", "'write_biom_table to file %s'", "%", "biom_fp", ")", "with", "biom_open", "(", "biom_fp", ",", ...
Edit an IPv4 Range .
def update ( self , information , timeout = - 1 ) : return self . _client . update ( information , timeout = timeout )
251,427
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/id_pools_ipv4_ranges.py#L92-L105
[ "def", "_get_container_dirs", "(", "source_dir", ",", "manifest_dir", ")", ":", "base", "=", "\"/tmp/samcli\"", "result", "=", "{", "\"source_dir\"", ":", "\"{}/source\"", ".", "format", "(", "base", ")", ",", "\"artifacts_dir\"", ":", "\"{}/artifacts\"", ".", "...
Wait for task execution and return associated resource .
def wait_for_task ( self , task , timeout = - 1 ) : self . __wait_task_completion ( task , timeout ) task = self . get ( task ) logger . debug ( "Waiting for task. Percentage complete: " + str ( task . get ( 'computedPercentComplete' ) ) ) logger . debug ( "Waiting for task. Task state: " + str ( task . get ( 'taskState' ) ) ) task_response = self . __get_task_response ( task ) logger . debug ( 'Task completed' ) return task_response
251,428
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/task_monitor.py#L70-L90
[ "def", "find_apikey", "(", ")", ":", "env_keys", "=", "[", "'TINYPNG_APIKEY'", ",", "'TINYPNG_API_KEY'", "]", "paths", "=", "[", "]", "paths", ".", "append", "(", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "abspath", "(", "\".\"", "...
Waits until the task is completed and returns the task resource .
def get_completed_task ( self , task , timeout = - 1 ) : self . __wait_task_completion ( task , timeout ) return self . get ( task )
251,429
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/task_monitor.py#L92-L105
[ "def", "public_dsn", "(", "dsn", ")", ":", "m", "=", "RE_DSN", ".", "match", "(", "dsn", ")", "if", "not", "m", ":", "log", ".", "error", "(", "'Unable to parse Sentry DSN'", ")", "public", "=", "'{scheme}://{client_id}@{domain}/{site_id}'", ".", "format", "...
Retrieve a resource associated with a task .
def get_associated_resource ( self , task ) : if not task : raise HPOneViewUnknownType ( MSG_INVALID_TASK ) if task [ 'category' ] != 'tasks' and task [ 'category' ] != 'backups' : # it is an error if type is not in obj, so let the except flow raise HPOneViewUnknownType ( MSG_UNKNOWN_OBJECT_TYPE ) if task [ 'type' ] == 'TaskResourceV2' : resource_uri = task [ 'associatedResource' ] [ 'resourceUri' ] if resource_uri and resource_uri . startswith ( "/rest/appliance/support-dumps/" ) : # Specific for support dumps return task , resource_uri elif task [ 'type' ] == 'BACKUP' : task = self . _connection . get ( task [ 'taskUri' ] ) resource_uri = task [ 'uri' ] else : raise HPOneViewInvalidResource ( MSG_TASK_TYPE_UNRECONIZED % task [ 'type' ] ) entity = { } if resource_uri : entity = self . _connection . get ( resource_uri ) return task , entity
251,430
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/task_monitor.py#L225-L261
[ "def", "get_or_generate_vocabulary", "(", "data_dir", ",", "tmp_dir", ",", "data_prefix", ",", "max_page_size_exp", ",", "approx_vocab_size", "=", "32768", ",", "strip", "=", "True", ")", ":", "num_pages_for_vocab_generation", "=", "approx_vocab_size", "//", "3", "v...
Updates the remote server configuration and the automatic backup schedule for backup .
def update_config ( self , config , timeout = - 1 ) : return self . _client . update ( config , uri = self . URI + "/config" , timeout = timeout )
251,431
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/settings/backups.py#L125-L139
[ "def", "zlib_decompress_all_frames", "(", "data", ")", ":", "frames", "=", "bytearray", "(", ")", "data", "=", "bytes", "(", "data", ")", "while", "data", ":", "decomp", "=", "zlib", ".", "decompressobj", "(", ")", "try", ":", "frames", ".", "extend", ...
Saves a backup of the appliance to a previously - configured remote location .
def update_remote_archive ( self , save_uri , timeout = - 1 ) : return self . _client . update_with_zero_body ( uri = save_uri , timeout = timeout )
251,432
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/settings/backups.py#L141-L155
[ "def", "detail_dict", "(", "self", ")", ":", "d", "=", "self", ".", "dict", "def", "aug_col", "(", "c", ")", ":", "d", "=", "c", ".", "dict", "d", "[", "'stats'", "]", "=", "[", "s", ".", "dict", "for", "s", "in", "c", ".", "stats", "]", "r...
Gets a list of associated ethernet networks of an uplink set .
def get_ethernet_networks ( self ) : network_uris = self . data . get ( 'networkUris' ) networks = [ ] if network_uris : for uri in network_uris : networks . append ( self . _ethernet_networks . get_by_uri ( uri ) ) return networks
251,433
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/uplink_sets.py#L60-L75
[ "def", "RunOnce", "(", "self", ")", ":", "# pylint: disable=unused-variable,g-import-not-at-top", "from", "grr_response_server", ".", "gui", "import", "gui_plugins", "# pylint: enable=unused-variable,g-import-not-at-top", "if", "config", ".", "CONFIG", ".", "Get", "(", "\"A...
Updates network uris .
def __set_ethernet_uris ( self , ethernet_names , operation = "add" ) : if not isinstance ( ethernet_names , list ) : ethernet_names = [ ethernet_names ] associated_enets = self . data . get ( 'networkUris' , [ ] ) ethernet_uris = [ ] for i , enet in enumerate ( ethernet_names ) : enet_exists = self . _ethernet_networks . get_by_name ( enet ) if enet_exists : ethernet_uris . append ( enet_exists . data [ 'uri' ] ) else : raise HPOneViewResourceNotFound ( "Ethernet: {} does not exist" . foramt ( enet ) ) if operation == "remove" : enets_to_update = sorted ( list ( set ( associated_enets ) - set ( ethernet_uris ) ) ) elif operation == "add" : enets_to_update = sorted ( list ( set ( associated_enets ) . union ( set ( ethernet_uris ) ) ) ) else : raise ValueError ( "Value {} is not supported as operation. The supported values are: ['add', 'remove']" ) if set ( enets_to_update ) != set ( associated_enets ) : updated_network = { 'networkUris' : enets_to_update } self . update ( updated_network )
251,434
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/uplink_sets.py#L110-L134
[ "def", "detach_storage", "(", "self", ",", "server", ",", "address", ")", ":", "body", "=", "{", "'storage_device'", ":", "{", "'address'", ":", "address", "}", "}", "url", "=", "'/server/{0}/storage/detach'", ".", "format", "(", "server", ")", "res", "=",...
Gets the interconnect settings for a logical interconnect group .
def get_settings ( self ) : uri = "{}/settings" . format ( self . data [ "uri" ] ) return self . _helper . do_get ( uri )
251,435
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_interconnect_groups.py#L93-L101
[ "def", "DocbookMan", "(", "env", ",", "target", ",", "source", "=", "None", ",", "*", "args", ",", "*", "*", "kw", ")", ":", "# Init list of targets/sources", "target", ",", "source", "=", "__extend_targets_sources", "(", "target", ",", "source", ")", "# I...
Upload an SPP ISO image file or a hotfix file to the appliance . The API supports upload of one hotfix at a time into the system . For the successful upload of a hotfix ensure its original name and extension are not altered .
def upload ( self , file_path , timeout = - 1 ) : return self . _client . upload ( file_path , timeout = timeout )
251,436
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/settings/firmware_bundles.py#L48-L62
[ "def", "tables", "(", "self", ")", ":", "with", "self", ".", "conn", ".", "cursor", "(", ")", "as", "cur", ":", "cur", ".", "execute", "(", "self", ".", "TABLES_QUERY", ")", "for", "row", "in", "cur", ":", "yield", "row" ]
Gets an index resource by URI .
def get ( self , uri ) : uri = self . URI + uri return self . _client . get ( uri )
251,437
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/search/index_resources.py#L104-L115
[ "def", "connect", "(", "dsn", "=", "None", ",", "turbodbc_options", "=", "None", ",", "connection_string", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "turbodbc_options", "is", "None", ":", "turbodbc_options", "=", "make_options", "(", ")", "if",...
Gets the storage pools that are connected on the specified networks based on the storage system port s expected network connectivity .
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 ) )
251,438
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/storage/storage_pools.py#L138-L181
[ "def", "subtract", "(", "self", ")", ":", "if", "self", ".", "moc", "is", "None", ":", "raise", "CommandError", "(", "'No MOC information present for subtraction'", ")", "filename", "=", "self", ".", "params", ".", "pop", "(", ")", "self", ".", "moc", "-="...
Generates a self signed certificate or an internal CA signed certificate for RabbitMQ clients .
def generate ( self , information , timeout = - 1 ) : return self . _client . create ( information , timeout = timeout )
251,439
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/security/certificate_rabbitmq.py#L44-L57
[ "def", "delete_datapoints_in_time_range", "(", "self", ",", "start_dt", "=", "None", ",", "end_dt", "=", "None", ")", ":", "start_dt", "=", "to_none_or_dt", "(", "validate_type", "(", "start_dt", ",", "datetime", ".", "datetime", ",", "type", "(", "None", ")...
Retrieves the public and private key pair associated with the specified alias name .
def get_key_pair ( self , alias_name ) : uri = self . URI + "/keypair/" + alias_name return self . _client . get ( uri )
251,440
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/security/certificate_rabbitmq.py#L71-L82
[ "def", "__run_sql_file", "(", "self", ",", "filepath", ")", ":", "with", "open", "(", "filepath", ",", "'r'", ")", "as", "delta_file", ":", "sql", "=", "delta_file", ".", "read", "(", ")", "if", "self", ".", "variables", ":", "self", ".", "cursor", "...
Retrieves the contents of PKCS12 file in the format specified . This PKCS12 formatted file contains both the certificate as well as the key file data . Valid key formats are Base64 and PKCS12 .
def get_keys ( self , alias_name , key_format ) : uri = self . URI + "/keys/" + alias_name + "?format=" + key_format return self . _client . get ( uri )
251,441
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/security/certificate_rabbitmq.py#L84-L97
[ "def", "reduce_sort", "(", "self", ",", "js_cmp", "=", "None", ",", "options", "=", "None", ")", ":", "if", "options", "is", "None", ":", "options", "=", "dict", "(", ")", "if", "js_cmp", ":", "options", "[", "'arg'", "]", "=", "js_cmp", "return", ...
Validates an ID pool .
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 )
251,442
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/id_pools.py#L73-L87
[ "def", "getMetastable", "(", "rates", ",", "ver", ":", "np", ".", "ndarray", ",", "lamb", ",", "br", ",", "reactfn", ":", "Path", ")", ":", "with", "h5py", ".", "File", "(", "reactfn", ",", "'r'", ")", "as", "f", ":", "A", "=", "f", "[", "'/met...
Generates and returns a random range .
def generate ( self , id_or_uri ) : uri = self . _client . build_uri ( id_or_uri ) + "/generate" return self . _client . get ( uri )
251,443
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/id_pools.py#L169-L181
[ "def", "cudnnSetPooling2dDescriptor", "(", "poolingDesc", ",", "mode", ",", "windowHeight", ",", "windowWidth", ",", "verticalPadding", ",", "horizontalPadding", ",", "verticalStride", ",", "horizontalStride", ")", ":", "status", "=", "_libcudnn", ".", "cudnnSetPoolin...
Gets the storage volume templates that are available on the specified networks based on the storage system port s expected network connectivity . If there are no storage volume templates that meet the specified connectivity criteria an empty collection will be returned .
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 )
251,444
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/storage/storage_volume_templates.py#L107-L120
[ "def", "count", "(", "self", ",", "event_str", ",", "inc_int", "=", "1", ")", ":", "self", ".", "_event_dict", ".", "setdefault", "(", "event_str", ",", "0", ")", "self", ".", "_event_dict", "[", "event_str", "]", "+=", "inc_int" ]
Gets the storage templates that are connected on the specified networks based on the storage system port s expected network connectivity .
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 )
251,445
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/storage/storage_volume_templates.py#L122-L137
[ "def", "subtract", "(", "self", ")", ":", "if", "self", ".", "moc", "is", "None", ":", "raise", "CommandError", "(", "'No MOC information present for subtraction'", ")", "filename", "=", "self", ".", "params", ".", "pop", "(", ")", "self", ".", "moc", "-="...
Retrieves a collection of all storage systems that is applicable to this storage volume template .
def get_compatible_systems ( self , id_or_uri ) : uri = self . _client . build_uri ( id_or_uri ) + "/compatible-systems" return self . _client . get ( uri )
251,446
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/storage/storage_volume_templates.py#L139-L151
[ "def", "reindex", "(", "series1", ",", "series2", ")", ":", "# turns out the merge is much faster than the .loc below", "df", "=", "pd", ".", "merge", "(", "pd", ".", "DataFrame", "(", "{", "\"left\"", ":", "series2", "}", ")", ",", "pd", ".", "DataFrame", "...
Adds a volume that already exists in the Storage system
def add_from_existing ( self , resource , timeout = - 1 ) : uri = self . URI + "/from-existing" return self . _client . create ( resource , uri = uri , timeout = timeout )
251,447
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/storage/volumes.py#L136-L151
[ "def", "get_csrf_token", "(", "response", ")", ":", "cookie_headers", "=", "[", "h", ".", "decode", "(", "'ascii'", ")", "for", "h", "in", "response", ".", "headers", ".", "getlist", "(", "\"Set-Cookie\"", ")", "]", "if", "not", "cookie_headers", ":", "r...
Creates a new volume on the storage system from a snapshot of a volume . A volume template must also be specified when creating a volume from a snapshot .
def create_from_snapshot ( self , data , timeout = - 1 ) : uri = self . URI + "/from-snapshot" return self . _client . create ( data , uri = uri , timeout = timeout )
251,448
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/storage/volumes.py#L153-L175
[ "def", "cleanup", "(", "self", ")", ":", "if", "self", ".", "sock", "is", "not", "None", ":", "self", ".", "sock", ".", "close", "(", ")", "if", "self", ".", "outfile", "is", "not", "None", ":", "self", ".", "outfile", ".", "close", "(", ")", "...
Deletes a managed volume .
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 )
251,449
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/storage/volumes.py#L197-L231
[ "def", "world_series_logs", "(", ")", ":", "file_name", "=", "'GLWS.TXT'", "z", "=", "get_zip_file", "(", "world_series_url", ")", "data", "=", "pd", ".", "read_csv", "(", "z", ".", "open", "(", "file_name", ")", ",", "header", "=", "None", ",", "sep", ...
Gets all snapshots of a volume . Returns a list of snapshots based on optional sorting and filtering and constrained by start and count parameters .
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 )
251,450
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/storage/volumes.py#L242-L268
[ "def", "inspect_workers", "(", "self", ")", ":", "workers", "=", "tuple", "(", "self", ".", "workers", ".", "values", "(", ")", ")", "expired", "=", "tuple", "(", "w", "for", "w", "in", "workers", "if", "not", "w", ".", "is_alive", "(", ")", ")", ...
Creates a snapshot for the specified volume .
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 )
251,451
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/storage/volumes.py#L270-L288
[ "def", "jtag_configure", "(", "self", ",", "instr_regs", "=", "0", ",", "data_bits", "=", "0", ")", ":", "if", "not", "util", ".", "is_natural", "(", "instr_regs", ")", ":", "raise", "ValueError", "(", "'IR value is not a natural number.'", ")", "if", "not",...
Gets a snapshot of a volume .
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 )
251,452
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/storage/volumes.py#L290-L305
[ "def", "jwt_decode_token", "(", "token", ")", ":", "try", ":", "return", "decode", "(", "token", ",", "current_app", ".", "config", "[", "'ACCOUNTS_JWT_SECRET_KEY'", "]", ",", "algorithms", "=", "[", "current_app", ".", "config", "[", "'ACCOUNTS_JWT_ALOGORITHM'"...
Gets all snapshots that match the filter .
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 )
251,453
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/storage/volumes.py#L327-L342
[ "def", "convert_ascii_field", "(", "string", ")", ":", "values", "=", "[", "]", "for", "codepoint", "in", "[", "s", "for", "s", "in", "string", ".", "split", "(", "DATA_FILE_CODEPOINT_SEPARATOR", ")", "if", "(", "s", "!=", "DATA_FILE_VALUE_NOT_AVAILABLE", ")...
Gets the list of extra managed storage volume paths .
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 )
251,454
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/storage/volumes.py#L344-L367
[ "def", "calculate", "(", "cls", ",", "byte_arr", ",", "crc", "=", "0", ")", ":", "for", "byte", "in", "byte_iter", "(", "byte_arr", ")", ":", "# Taken verbatim from FIT SDK docs", "tmp", "=", "cls", ".", "CRC_TABLE", "[", "crc", "&", "0xF", "]", "crc", ...
Removes extra presentations from a specified volume on the storage system .
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 )
251,455
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/storage/volumes.py#L369-L389
[ "def", "download_sample_and_align", "(", "job", ",", "sample", ",", "inputs", ",", "ids", ")", ":", "uuid", ",", "urls", "=", "sample", "r1_url", ",", "r2_url", "=", "urls", "if", "len", "(", "urls", ")", "==", "2", "else", "(", "urls", "[", "0", "...
Gets the volumes that are connected on the specified networks based on the storage system port s expected network connectivity .
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 )
251,456
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/storage/volumes.py#L391-L429
[ "def", "sample_pixels", "(", "img", ",", "options", ")", ":", "pixels", "=", "img", ".", "reshape", "(", "(", "-", "1", ",", "3", ")", ")", "num_pixels", "=", "pixels", ".", "shape", "[", "0", "]", "num_samples", "=", "int", "(", "num_pixels", "*",...
Reapplies the appliance s configuration on the enclosure . This includes running the same configure steps that were performed as part of the enclosure add .
def update_configuration ( self , timeout = - 1 ) : uri = "{}/configuration" . format ( self . data [ 'uri' ] ) return self . update_with_zero_body ( uri = uri , timeout = timeout )
251,457
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/enclosures.py#L106-L119
[ "def", "FindFileByName", "(", "self", ",", "file_name", ")", ":", "try", ":", "return", "self", ".", "_file_descriptors", "[", "file_name", "]", "except", "KeyError", ":", "pass", "try", ":", "file_proto", "=", "self", ".", "_internal_db", ".", "FindFileByNa...
Get enclosure by it s hostname
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
251,458
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/enclosures.py#L121-L136
[ "def", "generate_http_manifest", "(", "self", ")", ":", "base_path", "=", "os", ".", "path", ".", "dirname", "(", "self", ".", "translate_path", "(", "self", ".", "path", ")", ")", "self", ".", "dataset", "=", "dtoolcore", ".", "DataSet", ".", "from_uri"...
Sets the calibrated max power of an unmanaged or unsupported enclosure .
def update_environmental_configuration ( self , configuration , timeout = - 1 ) : uri = '{}/environmentalConfiguration' . format ( self . data [ 'uri' ] ) return self . _helper . do_put ( uri , configuration , timeout , None )
251,459
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/enclosures.py#L151-L164
[ "def", "get_results", "(", "self", ",", "limit", "=", "None", ",", "offset", "=", "None", ",", "query", "=", "None", ",", "admin_name", "=", "None", ",", "row_number", "=", "False", ")", ":", "add_extra_ids", "=", "(", "admin_name", "is", "not", "None"...
Imports a signed server certificate into the enclosure .
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 )
251,460
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/enclosures.py#L251-L268
[ "def", "_PurgeTable", "(", "self", ",", "tableName", ")", ":", "goodlogging", ".", "Log", ".", "Info", "(", "\"DB\"", ",", "\"Deleting all entries from table {0}\"", ".", "format", "(", "tableName", ")", ",", "verbosity", "=", "self", ".", "logVerbosity", ")",...
Revokes a certificate signed by the internal CA . If client certificate to be revoked is RabbitMQ_readonly then the internal CA root certificate RabbitMQ client certificate and RabbitMQ server certificate will be regenerated . This will invalidate the previous version of RabbitMQ client certificate and the RabbitMQ server will be restarted to read the latest certificates .
def delete ( self , alias_name , timeout = - 1 ) : uri = self . URI + "/" + alias_name return self . _client . delete ( uri , timeout = timeout )
251,461
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/security/certificate_authority.py#L67-L81
[ "def", "dataframes", "(", "self", ")", ":", "frames", "=", "[", "]", "for", "team", "in", "self", ".", "__iter__", "(", ")", ":", "frames", ".", "append", "(", "team", ".", "dataframe", ")", "return", "pd", ".", "concat", "(", "frames", ")" ]
Gets a Scope by name .
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
251,462
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/settings/scopes.py#L95-L107
[ "def", "mock_xray_client", "(", "f", ")", ":", "@", "wraps", "(", "f", ")", "def", "_wrapped", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "print", "(", "\"Starting X-Ray Patch\"", ")", "old_xray_context_var", "=", "os", ".", "environ", ".", "...
Creates a scope .
def create ( self , resource , timeout = - 1 ) : return self . _client . create ( resource , timeout = timeout , default_values = self . DEFAULT_VALUES )
251,463
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/settings/scopes.py#L109-L123
[ "def", "unbind", "(", "self", ",", "devices_to_unbind", ")", ":", "if", "self", ".", "entity_api_key", "==", "\"\"", ":", "return", "{", "'status'", ":", "'failure'", ",", "'response'", ":", "'No API key found in request'", "}", "url", "=", "self", ".", "bas...
Deletes a Scope .
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 )
251,464
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/settings/scopes.py#L143-L161
[ "def", "unbind", "(", "self", ",", "devices_to_unbind", ")", ":", "if", "self", ".", "entity_api_key", "==", "\"\"", ":", "return", "{", "'status'", ":", "'failure'", ",", "'response'", ":", "'No API key found in request'", "}", "url", "=", "self", ".", "bas...
Modifies scope membership by adding or removing resource assignments .
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 )
251,465
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/settings/scopes.py#L163-L181
[ "def", "_error_messages", "(", "self", ",", "driver_id", ")", ":", "assert", "isinstance", "(", "driver_id", ",", "ray", ".", "DriverID", ")", "message", "=", "self", ".", "redis_client", ".", "execute_command", "(", "\"RAY.TABLE_LOOKUP\"", ",", "ray", ".", ...
Gets the Golden Images API client .
def golden_images ( self ) : if not self . __golden_images : self . __golden_images = GoldenImages ( self . __connection ) return self . __golden_images
251,466
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/image_streamer_client.py#L69-L78
[ "def", "get_python_args", "(", "fname", ",", "python_args", ",", "interact", ",", "debug", ",", "end_args", ")", ":", "p_args", "=", "[", "]", "if", "python_args", "is", "not", "None", ":", "p_args", "+=", "python_args", ".", "split", "(", ")", "if", "...
Gets the Plan Scripts API client .
def plan_scripts ( self ) : if not self . __plan_scripts : self . __plan_scripts = PlanScripts ( self . __connection ) return self . __plan_scripts
251,467
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/image_streamer_client.py#L81-L90
[ "def", "num_in_memory", "(", "self", ")", ":", "n", "=", "len", "(", "self", ".", "_data", ")", "-", "1", "while", "n", ">=", "0", ":", "if", "isinstance", "(", "self", ".", "_data", "[", "n", "]", ",", "_TensorValueDiscarded", ")", ":", "break", ...
Gets the Build Plans API client .
def build_plans ( self ) : if not self . __build_plans : self . __build_plans = BuildPlans ( self . __connection ) return self . __build_plans
251,468
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/image_streamer_client.py#L93-L102
[ "def", "remove_backslash_r", "(", "filename", ",", "encoding", ")", ":", "with", "open", "(", "filename", ",", "'r'", ",", "encoding", "=", "encoding", ",", "newline", "=", "r'\\n'", ")", "as", "filereader", ":", "contents", "=", "filereader", ".", "read",...
Gets the OS Volumes API client .
def os_volumes ( self ) : if not self . __os_volumes : self . __os_volumes = OsVolumes ( self . __connection ) return self . __os_volumes
251,469
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/image_streamer_client.py#L105-L114
[ "def", "json_splitter", "(", "buffer", ")", ":", "buffer", "=", "buffer", ".", "strip", "(", ")", "try", ":", "obj", ",", "index", "=", "json_decoder", ".", "raw_decode", "(", "buffer", ")", "rest", "=", "buffer", "[", "json", ".", "decoder", ".", "W...
Gets the Deployment Plans API client .
def deployment_plans ( self ) : if not self . __deployment_plans : self . __deployment_plans = DeploymentPlans ( self . __connection ) return self . __deployment_plans
251,470
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/image_streamer_client.py#L117-L126
[ "def", "wid_to_gid", "(", "wid", ")", ":", "widval", "=", "wid", "[", "1", ":", "]", "if", "len", "(", "wid", ")", ">", "3", "else", "wid", "xorval", "=", "474", "if", "len", "(", "wid", ")", ">", "3", "else", "31578", "return", "str", "(", "...
Gets the Artifact Bundles API client .
def artifact_bundles ( self ) : if not self . __artifact_bundles : self . __artifact_bundles = ArtifactBundles ( self . __connection ) return self . __artifact_bundles
251,471
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/image_streamer_client.py#L129-L138
[ "def", "clean_tenant_url", "(", "url_string", ")", ":", "if", "hasattr", "(", "settings", ",", "'PUBLIC_SCHEMA_URLCONF'", ")", ":", "if", "(", "settings", ".", "PUBLIC_SCHEMA_URLCONF", "and", "url_string", ".", "startswith", "(", "settings", ".", "PUBLIC_SCHEMA_UR...
Gets the Deployment Groups API client .
def deployment_groups ( self ) : if not self . __deployment_groups : self . __deployment_groups = DeploymentGroups ( self . __connection ) return self . __deployment_groups
251,472
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/image_streamer_client.py#L141-L150
[ "def", "clean_except_files", "(", "self", ")", ":", "if", "self", ".", "is_finalized", ":", "self", ".", "warn", "(", "\"Can't clean; bundle is finalized\"", ")", "return", "False", "self", ".", "log", "(", "'---- Cleaning ----'", ")", "self", ".", "state", "=...
Creates a Golden Image resource from the deployed OS Volume as per the attributes specified .
def create ( self , resource , timeout = - 1 ) : data = self . __default_values . copy ( ) data . update ( resource ) return self . _client . create ( data , timeout = timeout )
251,473
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/resources/golden_images.py#L73-L88
[ "def", "kendalltau", "(", "X", ")", ":", "corrs", "=", "np", ".", "zeros", "(", "(", "X", ".", "shape", "[", "1", "]", ",", "X", ".", "shape", "[", "1", "]", ")", ")", "for", "idx", ",", "cola", "in", "enumerate", "(", "X", ".", "T", ")", ...
Adds a Golden Image resource from the file that is uploaded from a local drive . Only the . zip format file can be used for the upload .
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 )
251,474
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/resources/golden_images.py#L90-L106
[ "def", "wait_for_start", "(", "self", ")", ":", "if", "self", ".", "wait_matchers", ":", "matcher", "=", "UnorderedMatcher", "(", "*", "self", ".", "wait_matchers", ")", "self", ".", "wait_for_logs_matching", "(", "matcher", ",", "timeout", "=", "self", ".",...
Download the details of the Golden Image capture logs which has been archived based on the specific attribute ID .
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 )
251,475
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/resources/golden_images.py#L108-L121
[ "def", "is_registration_possible", "(", "self", ",", "user_info", ")", ":", "return", "self", ".", "get_accessibility", "(", ")", ".", "is_open", "(", ")", "and", "self", ".", "_registration", ".", "is_open", "(", ")", "and", "self", ".", "is_user_accepted_b...
Updates the specified alert resource .
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 )
251,476
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/activity/alerts.py#L135-L152
[ "def", "cublasZgemm", "(", "handle", ",", "transa", ",", "transb", ",", "m", ",", "n", ",", "k", ",", "alpha", ",", "A", ",", "lda", ",", "B", ",", "ldb", ",", "beta", ",", "C", ",", "ldc", ")", ":", "status", "=", "_libcublas", ".", "cublasZge...
Deletes alert change log by alert ID or URI .
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 )
251,477
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/activity/alerts.py#L154-L165
[ "def", "deconstruct", "(", "self", ")", ":", "name", ",", "path", ",", "args", ",", "kwargs", "=", "super", "(", "AssetsFileField", ",", "self", ")", ".", "deconstruct", "(", ")", "kwargs", "[", "'denormalize'", "]", "=", "False", "return", "name", ","...
Adds multiple rack - mount servers for management by the appliance . This API initiates the asynchronous addition of supported server models .
def add_multiple_servers ( self , information , timeout = - 1 ) : uri = "{}/discovery" . format ( self . URI ) return self . create ( information , uri = uri , timeout = timeout )
251,478
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/server_hardware.py#L68-L87
[ "def", "all_experiments", "(", "self", ")", ":", "from", "db", ".", "models", ".", "experiments", "import", "Experiment", "return", "Experiment", ".", "all", ".", "filter", "(", "experiment_group", "=", "self", ")" ]
Get the firmware inventory of a server .
def get_firmware ( self ) : uri = "{}/firmware" . format ( self . data [ "uri" ] ) return self . _helper . do_get ( uri )
251,479
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/server_hardware.py#L199-L210
[ "def", "load_ragged_time_series", "(", "filename", ",", "dtype", "=", "float", ",", "delimiter", "=", "r'\\s+'", ",", "header", "=", "False", ")", ":", "# Initialize empty lists", "times", "=", "[", "]", "values", "=", "[", "]", "# Create re object for splitting...
Updates the iLO firmware on a physical server to a minimum ILO firmware version required by OneView to manage the server .
def update_mp_firware_version ( self , timeout = - 1 ) : uri = "{}/mpFirmwareVersion" . format ( self . data [ "uri" ] ) return self . _helper . do_put ( uri , None , timeout , None )
251,480
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/server_hardware.py#L233-L246
[ "def", "wait", "(", "timeout", ":", "Optional", "[", "float", "]", "=", "None", ")", "->", "Iterator", "[", "Any", "]", ":", "if", "timeout", "is", "not", "None", ":", "tcod", ".", "lib", ".", "SDL_WaitEventTimeout", "(", "tcod", ".", "ffi", ".", "...
Information describing an SDX partition including a list of physical server blades represented by a server hardware . Used with SDX enclosures only .
def get_physical_server_hardware ( self ) : uri = "{}/physicalServerHardware" . format ( self . data [ "uri" ] ) return self . _helper . do_get ( uri )
251,481
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/server_hardware.py#L302-L311
[ "def", "resource_to_url", "(", "resource", ",", "request", "=", "None", ",", "quote", "=", "False", ")", ":", "if", "request", "is", "None", ":", "request", "=", "get_current_request", "(", ")", "# cnv = request.registry.getAdapter(request, IResourceUrlConverter)",...
Updates a Logical Switch .
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 )
251,482
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_switches.py#L130-L145
[ "def", "extract_declarations", "(", "map_el", ",", "dirs", ",", "scale", "=", "1", ",", "user_styles", "=", "[", "]", ")", ":", "styles", "=", "[", "]", "#", "# First, look at all the stylesheets defined in the map itself.", "#", "for", "stylesheet", "in", "map_...
The Refresh action reclaims the top - of - rack switches in a logical switch .
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 )
251,483
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_switches.py#L162-L177
[ "def", "_update_job", "(", "job_id", ",", "job_dict", ")", ":", "# Avoid SQLAlchemy \"Unicode type received non-unicode bind param value\"", "# warnings.", "if", "job_id", ":", "job_id", "=", "unicode", "(", "job_id", ")", "if", "\"error\"", "in", "job_dict", ":", "jo...
Uses the PATCH to update a resource for a given logical switch group .
def patch ( self , id_or_uri , operation , path , value , timeout = - 1 ) : return self . _client . patch ( id_or_uri , operation , path , value , timeout = timeout )
251,484
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/logical_switches.py#L179-L196
[ "def", "parse_registries", "(", "filesystem", ",", "registries", ")", ":", "results", "=", "{", "}", "for", "path", "in", "registries", ":", "with", "NamedTemporaryFile", "(", "buffering", "=", "0", ")", "as", "tempfile", ":", "filesystem", ".", "download", ...
Initiates a migration of an enclosure specified by the ID or URI of a migration report .
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 )
251,485
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/migratable_vc_domains.py#L95-L118
[ "def", "_get_keycodes", "(", ")", ":", "try", ":", "return", "_key_cache", ".", "pop", "(", ")", "except", "IndexError", ":", "pass", "result", "=", "[", "]", "terminators", "=", "'ABCDFHPQRS~'", "with", "TerminalContext", "(", ")", ":", "code", "=", "ge...
Gets all the labels for the specified resource
def get_by_resource ( self , resource_uri ) : uri = self . URI + self . RESOURCES_PATH + '/' + resource_uri return self . _client . get ( id_or_uri = uri )
251,486
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/search/labels.py#L87-L98
[ "def", "_read_console_output", "(", "self", ",", "ws", ",", "out", ")", ":", "while", "True", ":", "msg", "=", "yield", "from", "ws", ".", "receive", "(", ")", "if", "msg", ".", "tp", "==", "aiohttp", ".", "WSMsgType", ".", "text", ":", "out", ".",...
Set all the labels for a resource .
def create ( self , resource ) : uri = self . URI + self . RESOURCES_PATH return self . _client . create ( resource = resource , uri = uri )
251,487
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/search/labels.py#L100-L111
[ "def", "_read_console_output", "(", "self", ",", "ws", ",", "out", ")", ":", "while", "True", ":", "msg", "=", "yield", "from", "ws", ".", "receive", "(", ")", "if", "msg", ".", "tp", "==", "aiohttp", ".", "WSMsgType", ".", "text", ":", "out", ".",...
Delete all the labels for a resource .
def delete ( self , resource , timeout = - 1 ) : self . _client . delete ( resource = resource , timeout = timeout )
251,488
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/search/labels.py#L125-L135
[ "def", "_read_console_output", "(", "self", ",", "ws", ",", "out", ")", ":", "while", "True", ":", "msg", "=", "yield", "from", "ws", ".", "receive", "(", ")", "if", "msg", ".", "tp", "==", "aiohttp", ".", "WSMsgType", ".", "text", ":", "out", ".",...
Updates a User .
def update ( self , resource , timeout = - 1 ) : return self . _client . update ( resource , timeout = timeout , default_values = self . DEFAULT_VALUES , uri = self . URI )
251,489
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/security/users.py#L116-L130
[ "def", "_remove_entry", "(", "self", ",", "source_file", ",", "key", ")", ":", "entry", "=", "self", ".", "__index", ".", "get", "(", "key", ")", "if", "entry", "is", "None", ":", "return", "# Release the referenced files...", "for", "id_", ",", "_", "in...
Gets all Users that match the filter .
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.' )
251,490
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/security/users.py#L132-L151
[ "def", "aux", "(", "self", ",", "aux", ")", ":", "if", "aux", "==", "self", ".", "_aux", ":", "return", "if", "self", ".", "_aux", ":", "self", ".", "_manager", ".", "port_manager", ".", "release_tcp_port", "(", "self", ".", "_aux", ",", "self", "....
Verifies if a userName is already in use .
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 )
251,491
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/security/users.py#L153-L167
[ "def", "libvlc_log_set_file", "(", "p_instance", ",", "stream", ")", ":", "f", "=", "_Cfunctions", ".", "get", "(", "'libvlc_log_set_file'", ",", "None", ")", "or", "_Cfunction", "(", "'libvlc_log_set_file'", ",", "(", "(", "1", ",", ")", ",", "(", "1", ...
Verifies if a fullName is already in use .
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 )
251,492
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/security/users.py#L169-L183
[ "def", "_setup_ipc", "(", "self", ")", ":", "log", ".", "debug", "(", "'Setting up the server IPC puller to receive from the listener'", ")", "self", ".", "ctx", "=", "zmq", ".", "Context", "(", ")", "# subscribe to listener", "self", ".", "sub", "=", "self", "....
Add an HP iPDU and bring all components under management by discovery of its management module . Bring the management module under exclusive management by the appliance configure any management or data collection settings and create a private set of administrative credentials to enable ongoing communication and management of the iPDU . Use force to claim the device even if claimed by another management appliance
def add_ipdu ( self , information , timeout = - 1 ) : uri = self . URI + "/discover" return self . _client . create ( information , uri = uri , timeout = timeout )
251,493
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/facilities/power_devices.py#L126-L142
[ "def", "PopEvents", "(", "self", ")", ":", "event", "=", "self", ".", "PopEvent", "(", ")", "while", "event", ":", "yield", "event", "event", "=", "self", ".", "PopEvent", "(", ")" ]
Sets the power state of the specified power delivery device . The device must be an HP Intelligent Outlet .
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 )
251,494
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/facilities/power_devices.py#L176-L190
[ "def", "_save", "(", "self", ")", ":", "if", "self", ".", "__modified_flag", ":", "self", ".", "__filename_rep", ".", "update_id_counter", "(", ")", "indexfilename", "=", "os", ".", "path", ".", "join", "(", "self", ".", "__dir", ",", "\"index.dat\"", ")...
Refreshes a given intelligent power delivery device .
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 )
251,495
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/facilities/power_devices.py#L192-L206
[ "def", "store_contents", "(", "self", ")", ":", "string_buffer", "=", "os", ".", "linesep", ".", "join", "(", "map", "(", "lambda", "x", ":", "os", ".", "linesep", ".", "join", "(", "[", "\"<begin_table>\"", "]", "+", "[", "x", ".", "name", "]", "+...
Retrieves historical utilization data for the specified metrics and time span . The device must be a component of an HPE iPDU .
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 )
251,496
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/facilities/power_devices.py#L261-L333
[ "def", "remove", "(", "self", ",", "objs", ")", ":", "if", "self", ".", "readonly", ":", "raise", "NotImplementedError", "(", "'{} links can\\'t be modified'", ".", "format", "(", "self", ".", "_slug", ")", ")", "if", "not", "self", ".", "_parent", ".", ...
Retrieves the modified contents of the selected Plan Script according to the provided content object as per the selected attributes .
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 )
251,497
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/resources/plan_scripts.py#L154-L170
[ "def", "_set_idx_to_vec_by_embeddings", "(", "self", ",", "token_embeddings", ",", "vocab_len", ",", "vocab_idx_to_token", ")", ":", "new_vec_len", "=", "sum", "(", "embed", ".", "vec_len", "for", "embed", "in", "token_embeddings", ")", "new_idx_to_vec", "=", "nd"...
Gets the build plans details os teh selected plan script as per the selected attributes .
def get_usedby_and_readonly ( self , id ) : uri = self . URI + "/" + id + "/usedby/readonly" return self . _client . get ( uri )
251,498
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/resources/plan_scripts.py#L172-L183
[ "def", "set_guest_access", "(", "self", ",", "room_id", ",", "guest_access", ")", ":", "content", "=", "{", "\"guest_access\"", ":", "guest_access", "}", "return", "self", ".", "send_state_event", "(", "room_id", ",", "\"m.room.guest_access\"", ",", "content", "...
Retrieves facts about Server Profiles and Server Profile Templates that are using Deployment Plan based on the ID or URI provided .
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 )
251,499
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/resources/deployment_plans.py#L131-L142
[ "def", "flash", "(", "self", ",", "duration", "=", "0.0", ")", ":", "for", "_", "in", "range", "(", "2", ")", ":", "self", ".", "on", "=", "not", "self", ".", "on", "time", ".", "sleep", "(", "duration", ")" ]