query
stringlengths
5
1.23k
positive
stringlengths
53
15.2k
id_
int64
0
252k
task_name
stringlengths
87
242
negative
listlengths
20
553
Gets the preview of manual and automatic updates required to make the server profile consistent with its template .
def get_compliance_preview ( self ) : uri = '{}/compliance-preview' . format ( self . data [ "uri" ] ) return self . _helper . do_get ( uri )
251,500
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/server_profiles.py#L138-L147
[ "def", "clean_restricted_chars", "(", "path", ",", "restricted_chars", "=", "restricted_chars", ")", ":", "for", "character", "in", "restricted_chars", ":", "path", "=", "path", ".", "replace", "(", "character", ",", "'_'", ")", "return", "path" ]
Retrieves the port model associated with a server or server hardware type and enclosure group .
def get_profile_ports ( self , * * kwargs ) : uri = self . _helper . build_uri_with_query_string ( kwargs , '/profile-ports' ) return self . _helper . do_get ( uri )
251,501
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/server_profiles.py#L149-L165
[ "async", "def", "expand", "(", "self", ",", "request", ":", "Request", ",", "layer", ":", "BaseLayer", ")", ":", "if", "isinstance", "(", "layer", ",", "lyr", ".", "RawText", ")", ":", "t", "=", "self", ".", "reading_time", "(", "layer", ".", "text",...
Retrieves the error or status messages associated with the specified profile .
def get_messages ( self ) : uri = '{}/messages' . format ( self . data [ "uri" ] ) return self . _helper . do_get ( uri )
251,502
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/server_profiles.py#L168-L176
[ "def", "add_cookie_header", "(", "self", ",", "request", ",", "referrer_host", "=", "None", ")", ":", "new_request", "=", "convert_http_request", "(", "request", ",", "referrer_host", ")", "self", ".", "_cookie_jar", ".", "add_cookie_header", "(", "new_request", ...
Retrieves the list of Ethernet networks Fiber Channel networks and network sets that are available to a server profile along with their respective ports .
def get_available_networks ( self , * * kwargs ) : uri = self . _helper . build_uri_with_query_string ( kwargs , '/available-networks' ) return self . _helper . do_get ( uri )
251,503
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/server_profiles.py#L205-L233
[ "def", "_strip_colors", "(", "self", ",", "message", ":", "str", ")", "->", "str", ":", "for", "c", "in", "self", ".", "COLORS", ":", "message", "=", "message", ".", "replace", "(", "c", ",", "\"\"", ")", "return", "message" ]
Retrieves the list of available servers .
def get_available_servers ( self , * * kwargs ) : uri = self . _helper . build_uri_with_query_string ( kwargs , '/available-servers' ) return self . _helper . do_get ( uri )
251,504
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/server_profiles.py#L235-L251
[ "def", "matchi", "(", "string", ",", "templ", ",", "wstr", ",", "wchr", ")", ":", "string", "=", "stypes", ".", "stringToCharP", "(", "string", ")", "templ", "=", "stypes", ".", "stringToCharP", "(", "templ", ")", "wstr", "=", "ctypes", ".", "c_char", ...
Retrieves a specific storage system and its associated volumes available to the server profile based on the given server hardware type and enclosure group .
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 )
251,505
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/server_profiles.py#L253-L270
[ "def", "get_color_cycle", "(", "n", ",", "cmap", "=", "\"rainbow\"", ",", "rotations", "=", "3", ")", ":", "cmap", "=", "colormaps", "[", "cmap", "]", "if", "np", ".", "mod", "(", "n", ",", "rotations", ")", "==", "0", ":", "per", "=", "np", ".",...
Retrieves the list of the storage systems and their associated volumes available to the server profile based on the given server hardware type and enclosure group .
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 )
251,506
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/server_profiles.py#L272-L300
[ "def", "save_to_file", "(", "self", ",", "filename", ",", "remap_dim0", "=", "None", ",", "remap_dim1", "=", "None", ")", ":", "# rows - first index", "# columns - second index", "with", "open", "(", "filename", ",", "'w'", ")", "as", "fobj", ":", "columns", ...
Retrieves a list of the target servers and empty device bays that are available for assignment to the server profile .
def get_available_targets ( self , * * kwargs ) : uri = self . _helper . build_uri_with_query_string ( kwargs , '/available-targets' ) return self . _helper . do_get ( uri )
251,507
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/server_profiles.py#L302-L320
[ "def", "load_files", "(", "self", ",", "path", ")", ":", "if", "self", ".", "verbose", "==", "2", ":", "print", "(", "\"Indexing {}\"", ".", "format", "(", "path", ")", ")", "for", "filename", "in", "os", ".", "listdir", "(", "path", ")", ":", "fil...
Retrieves the profile template for a given server profile .
def get_new_profile_template ( self ) : uri = '{}/new-profile-template' . format ( self . data [ "uri" ] ) return self . _helper . do_get ( uri )
251,508
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/server_profiles.py#L323-L331
[ "def", "restrict_input_to_index", "(", "df_or_dict", ",", "column_id", ",", "index", ")", ":", "if", "isinstance", "(", "df_or_dict", ",", "pd", ".", "DataFrame", ")", ":", "df_or_dict_restricted", "=", "df_or_dict", "[", "df_or_dict", "[", "column_id", "]", "...
Updates the configuration script of the enclosure - group with the specified URI .
def update_script ( self , script_body ) : uri = "{}/script" . format ( self . data [ 'uri' ] ) return self . _helper . update ( script_body , uri = uri )
251,509
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/enclosure_groups.py#L94-L107
[ "def", "SetConsoleTextAttribute", "(", "stream_id", ",", "attrs", ")", ":", "handle", "=", "handles", "[", "stream_id", "]", "return", "windll", ".", "kernel32", ".", "SetConsoleTextAttribute", "(", "handle", ",", "attrs", ")" ]
Removes extra presentations from a specified server profile .
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 )
251,510
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/storage/storage_volume_attachments.py#L98-L113
[ "def", "img2code", "(", "self", ",", "key", ",", "img", ")", ":", "code_template", "=", "\"wx.ImageFromData({width}, {height}, \"", "+", "\"bz2.decompress(base64.b64decode('{data}'))).ConvertToBitmap()\"", "code_alpha_template", "=", "\"wx.ImageFromDataWithAlpha({width}, {height}, ...
Gets all paths or a specific attachment path for the specified volume attachment .
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 )
251,511
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/storage/storage_volume_attachments.py#L115-L135
[ "def", "AuthorizingClient", "(", "domain", ",", "auth", ",", "request_encoder", ",", "response_decoder", ",", "user_agent", "=", "None", ")", ":", "http_transport", "=", "transport", ".", "HttpTransport", "(", "api_url", "(", "domain", ")", ",", "build_headers",...
Get the details for the backup from an Artifact Bundle .
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 )
251,512
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/resources/artifact_bundles.py#L129-L140
[ "def", "fill_inbuffer", "(", "self", ")", ":", "if", "not", "self", ".", "connection", ":", "raise", "OmapiError", "(", "\"not connected\"", ")", "try", ":", "data", "=", "self", ".", "connection", ".", "recv", "(", "2048", ")", "except", "socket", ".", ...
Downloads an archive for the Artifact Bundle .
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 )
251,513
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/resources/artifact_bundles.py#L142-L155
[ "def", "load_toml_rest_api_config", "(", "filename", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "filename", ")", ":", "LOGGER", ".", "info", "(", "\"Skipping rest api loading from non-existent config file: %s\"", ",", "filename", ")", "return", ...
Download the Artifact Bundle .
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 )
251,514
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/resources/artifact_bundles.py#L157-L169
[ "def", "load_toml_rest_api_config", "(", "filename", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "filename", ")", ":", "LOGGER", ".", "info", "(", "\"Skipping rest api loading from non-existent config file: %s\"", ",", "filename", ")", "return", ...
Creates a backup bundle with all the artifacts present on the appliance . At any given point only one backup bundle will exist on the appliance .
def create_backup ( self , resource , timeout = - 1 ) : return self . _client . create ( resource , uri = self . BACKUPS_PATH , timeout = timeout )
251,515
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/resources/artifact_bundles.py#L171-L185
[ "def", "win32_refresh_window", "(", "cls", ")", ":", "# Get console handle", "handle", "=", "windll", ".", "kernel32", ".", "GetConsoleWindow", "(", ")", "RDW_INVALIDATE", "=", "0x0001", "windll", ".", "user32", ".", "RedrawWindow", "(", "handle", ",", "None", ...
Restore an Artifact Bundle from a backup file .
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 )
251,516
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/resources/artifact_bundles.py#L199-L217
[ "def", "communityvisibilitystate", "(", "self", ")", ":", "if", "self", ".", "_communityvisibilitystate", "==", "None", ":", "return", "None", "elif", "self", ".", "_communityvisibilitystate", "in", "self", ".", "VisibilityState", ":", "return", "self", ".", "Vi...
Updates only name for the Artifact Bundle .
def update ( self , resource , timeout = - 1 ) : return self . _client . update ( resource , timeout = timeout , default_values = self . DEFAULT_VALUES )
251,517
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/resources/artifact_bundles.py#L250-L263
[ "def", "random_connection", "(", "self", ")", ":", "# While at the moment there's no need for this to be a context manager", "# per se, I would like to use that interface since I anticipate", "# adding some wrapping around it at some point.", "yield", "random", ".", "choice", "(", "[", ...
Extracts the existing bundle on the appliance and creates all the artifacts .
def extract_bundle ( self , resource , timeout = - 1 ) : return self . _client . update ( resource , timeout = timeout , custom_headers = { "Content-Type" : "text/plain" } )
251,518
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/resources/artifact_bundles.py#L265-L278
[ "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...
Extracts the existing backup bundle on the appliance and creates all the artifacts .
def extract_backup_bundle ( self , resource , timeout = - 1 ) : return self . _client . update ( resource , uri = self . BACKUP_ARCHIVE_PATH , timeout = timeout )
251,519
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/resources/artifact_bundles.py#L280-L293
[ "def", "ensure_segment_table", "(", "connection", ")", ":", "count", "=", "connection", ".", "cursor", "(", ")", ".", "execute", "(", "\"SELECT count(*) FROM sqlite_master WHERE name='segment'\"", ")", ".", "fetchone", "(", ")", "[", "0", "]", "if", "count", "==...
Stops creation of the selected Artifact Bundle .
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 )
251,520
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/image_streamer/resources/artifact_bundles.py#L295-L312
[ "def", "access_token", "(", "self", ",", "cookie", ")", ":", "if", "(", "cookie", ")", ":", "token", "=", "self", ".", "_generate_random_string", "(", "self", ".", "access_tokens", ")", "self", ".", "access_tokens", "[", "token", "]", "=", "(", "cookie",...
Gets the configuration script of the logical enclosure by ID or URI .
def get_script ( self ) : uri = "{}/script" . format ( self . data [ "uri" ] ) return self . _helper . do_get ( uri )
251,521
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/logical_enclosures.py#L97-L105
[ "def", "get_product_info", "(", "self", ",", "apps", "=", "[", "]", ",", "packages", "=", "[", "]", ",", "timeout", "=", "15", ")", ":", "if", "not", "apps", "and", "not", "packages", ":", "return", "message", "=", "MsgProto", "(", "EMsg", ".", "Cl...
Updates the configuration script of the logical enclosure and on all enclosures in the logical enclosure with the specified ID .
def update_script ( self , information , timeout = - 1 ) : uri = "{}/script" . format ( self . data [ "uri" ] ) return self . _helper . update ( information , uri = uri , timeout = timeout )
251,522
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/logical_enclosures.py#L108-L122
[ "def", "_get_access_from_refresh", "(", "self", ")", "->", "Tuple", "[", "str", ",", "float", "]", ":", "headers", "=", "self", ".", "_get_authorization_headers", "(", ")", "data", "=", "{", "'grant_type'", ":", "'refresh_token'", ",", "'refresh_token'", ":", ...
Generates a support dump for the logical enclosure with the specified ID . A logical enclosure support dump includes content for logical interconnects associated with that logical enclosure . By default it also contains appliance support dump content .
def generate_support_dump ( self , information , timeout = - 1 ) : uri = "{}/support-dumps" . format ( self . data [ "uri" ] ) return self . _helper . create ( information , uri = uri , timeout = timeout )
251,523
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/logical_enclosures.py#L125-L140
[ "def", "_setGroupNames", "(", "classes", ",", "classRename", ")", ":", "groups", "=", "{", "}", "for", "groupName", ",", "glyphList", "in", "classes", ".", "items", "(", ")", ":", "groupName", "=", "classRename", ".", "get", "(", "groupName", ",", "group...
Use this action to make a logical enclosure consistent with the enclosure group when the logical enclosure is in the Inconsistent state .
def update_from_group ( self , data = None , timeout = - 1 ) : uri = "{}/updateFromGroup" . format ( self . data [ "uri" ] ) return self . _helper . update ( data , uri , timeout = timeout )
251,524
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/servers/logical_enclosures.py#L143-L156
[ "def", "fetcher", "(", "date", "=", "datetime", ".", "today", "(", ")", ",", "url_pattern", "=", "URL_PATTERN", ")", ":", "api_url", "=", "url_pattern", "%", "date", ".", "strftime", "(", "'%Y-%m-%d'", ")", "headers", "=", "{", "'Referer'", ":", "'http:/...
Creates bulk Ethernet networks .
def create_bulk ( self , resource , timeout = - 1 ) : uri = self . URI + '/bulk' default_values = self . _get_default_values ( self . BULK_DEFAULT_VALUES ) updated_data = self . _helper . update_resource_fields ( resource , default_values ) self . _helper . create ( updated_data , uri = uri , timeout = timeout ) return self . get_range ( resource [ 'namePrefix' ] , resource [ 'vlanIdRange' ] )
251,525
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/ethernet_networks.py#L63-L83
[ "def", "annotation_wrapper", "(", "annotation", ",", "doc", "=", "None", ")", ":", "def", "decorator", "(", "attr", ")", ":", "__cache__", ".", "setdefault", "(", "attr", ",", "[", "]", ")", ".", "append", "(", "annotation", ")", "# Also mark the annotatio...
Gets a list of Ethernet Networks that match the given name_prefix and the vlan_id_range .
def get_range ( self , name_prefix , vlan_id_range ) : filter = '"\'name\' matches \'{}\_%\'"' . format ( name_prefix ) ethernet_networks = self . get_all ( filter = filter , sort = 'vlanId:ascending' ) vlan_ids = self . dissociate_values_or_ranges ( vlan_id_range ) for net in ethernet_networks [ : ] : if int ( net [ 'vlanId' ] ) not in vlan_ids : ethernet_networks . remove ( net ) return ethernet_networks
251,526
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/ethernet_networks.py#L85-L114
[ "def", "correlator", "(", "A", ",", "B", ")", ":", "correlators", "=", "[", "]", "for", "i", "in", "range", "(", "len", "(", "A", ")", ")", ":", "correlator_row", "=", "[", "]", "for", "j", "in", "range", "(", "len", "(", "B", ")", ")", ":", ...
Gets the URIs of profiles which are using an Ethernet network .
def get_associated_profiles ( self ) : uri = "{}/associatedProfiles" . format ( self . data [ 'uri' ] ) return self . _helper . do_get ( uri )
251,527
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/ethernet_networks.py#L154-L166
[ "def", "get_client_token", "(", ")", ":", "if", "getattr", "(", "settings", ",", "'NOMIS_API_CLIENT_TOKEN'", ",", "''", ")", ":", "return", "settings", ".", "NOMIS_API_CLIENT_TOKEN", "global", "client_token", "if", "not", "client_token", "or", "client_token", "[",...
Gets the uplink sets which are using an Ethernet network .
def get_associated_uplink_groups ( self ) : uri = "{}/associatedUplinkGroups" . format ( self . data [ 'uri' ] ) return self . _helper . do_get ( uri )
251,528
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/ethernet_networks.py#L169-L178
[ "def", "queries", "(", "self", ",", "request", ")", ":", "queries", "=", "self", ".", "get_queries", "(", "request", ")", "worlds", "=", "[", "]", "with", "self", ".", "mapper", ".", "begin", "(", ")", "as", "session", ":", "for", "_", "in", "range...
Updates a copy of resource1 with resource2 values and returns the merged dictionary .
def merge_resources ( resource1 , resource2 ) : merged = resource1 . copy ( ) merged . update ( resource2 ) return merged
251,529
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L1737-L1750
[ "def", "search", "(", "query", ",", "team", "=", "None", ")", ":", "if", "team", "is", "None", ":", "team", "=", "_find_logged_in_team", "(", ")", "if", "team", "is", "not", "None", ":", "session", "=", "_get_session", "(", "team", ")", "response", "...
Generate a new list where each item of original resource_list will be merged with the default_values .
def merge_default_values ( resource_list , default_values ) : def merge_item ( resource ) : return merge_resources ( default_values , resource ) return lmap ( merge_item , resource_list )
251,530
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L1753-L1769
[ "def", "Uptime", "(", ")", ":", "uptime", "=", "''", "try", ":", "uptime", "=", "check_output", "(", "[", "'uptime'", "]", ",", "close_fds", "=", "True", ")", ".", "decode", "(", "'utf-8'", ")", "[", "1", ":", "]", "except", "Exception", "as", "e",...
Retrieves data from OneView and updates resource object .
def ensure_resource_data ( self , update_data = False ) : # Check for unique identifier in the resource data if not any ( key in self . data for key in self . UNIQUE_IDENTIFIERS ) : raise exceptions . HPOneViewMissingUniqueIdentifiers ( MISSING_UNIQUE_IDENTIFIERS ) # Returns if data update is not required if not update_data : return resource_data = None if 'uri' in self . UNIQUE_IDENTIFIERS and self . data . get ( 'uri' ) : resource_data = self . _helper . do_get ( self . data [ 'uri' ] ) else : for identifier in self . UNIQUE_IDENTIFIERS : identifier_value = self . data . get ( identifier ) if identifier_value : result = self . get_by ( identifier , identifier_value ) if result and isinstance ( result , list ) : resource_data = result [ 0 ] break if resource_data : self . data . update ( resource_data ) else : raise exceptions . HPOneViewResourceNotFound ( RESOURCE_DOES_NOT_EXIST )
251,531
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L110-L141
[ "def", "stop_experiment", "(", "args", ")", ":", "experiment_id_list", "=", "parse_ids", "(", "args", ")", "if", "experiment_id_list", ":", "experiment_config", "=", "Experiments", "(", ")", "experiment_dict", "=", "experiment_config", ".", "get_all_experiments", "(...
Get the resource by passing a field and its value .
def get_by ( self , field , value ) : if not field : logger . exception ( RESOURCE_CLIENT_INVALID_FIELD ) raise ValueError ( RESOURCE_CLIENT_INVALID_FIELD ) filter = "\"{0}='{1}'\"" . format ( field , value ) results = self . get_all ( filter = filter ) # Workaround when the OneView filter does not work, it will filter again if "." not in field : # This filter only work for the first level results = [ item for item in results if str ( item . get ( field , "" ) ) . lower ( ) == value . lower ( ) ] return results
251,532
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L234-L259
[ "def", "principal_axis", "(", "inertia", ")", ":", "inertia", "=", "np", ".", "asanyarray", "(", "inertia", ",", "dtype", "=", "np", ".", "float64", ")", "if", "inertia", ".", "shape", "!=", "(", "3", ",", "3", ")", ":", "raise", "ValueError", "(", ...
Retrieves a resource by its name .
def get_by_name ( self , name ) : result = self . get_by ( "name" , name ) if result : data = result [ 0 ] new_resource = self . new ( self . _connection , data ) else : new_resource = None return new_resource
251,533
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L261-L278
[ "def", "dnd_endDnd", "(", "self", ",", "*", "*", "kwargs", ")", "->", "SlackResponse", ":", "self", ".", "_validate_xoxp_token", "(", ")", "return", "self", ".", "api_call", "(", "\"dnd.endDnd\"", ",", "json", "=", "kwargs", ")" ]
Retrieves a resource by its URI
def get_by_uri ( self , uri ) : self . _helper . validate_resource_uri ( uri ) data = self . _helper . do_get ( uri ) if data : new_resource = self . new ( self . _connection , data ) else : new_resource = None return new_resource
251,534
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L280-L297
[ "def", "_index_audio_cmu", "(", "self", ",", "basename", "=", "None", ",", "replace_already_indexed", "=", "False", ")", ":", "self", ".", "_prepare_audio", "(", "basename", "=", "basename", ",", "replace_already_indexed", "=", "replace_already_indexed", ")", "for...
Gets the default values set for a resource
def _get_default_values ( self , default_values = None ) : if not default_values : default_values = self . DEFAULT_VALUES if default_values : api_version = str ( self . _connection . _apiVersion ) values = default_values . get ( api_version , { } ) . copy ( ) else : values = { } return values
251,535
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L299-L311
[ "def", "_index_audio_cmu", "(", "self", ",", "basename", "=", "None", ",", "replace_already_indexed", "=", "False", ")", ":", "self", ".", "_prepare_audio", "(", "basename", "=", "basename", ",", "replace_already_indexed", "=", "replace_already_indexed", ")", "for...
Merge default values with resource data .
def _merge_default_values ( self ) : values = self . _get_default_values ( ) for key , value in values . items ( ) : if not self . data . get ( key ) : self . data [ key ] = value
251,536
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L313-L318
[ "def", "upload_cbn_dir", "(", "dir_path", ",", "manager", ")", ":", "t", "=", "time", ".", "time", "(", ")", "for", "jfg_path", "in", "os", ".", "listdir", "(", "dir_path", ")", ":", "if", "not", "jfg_path", ".", "endswith", "(", "'.jgf'", ")", ":", ...
Creates a report and returns the output .
def create_report ( self , uri , timeout = - 1 ) : logger . debug ( 'Creating Report (uri = %s)' . format ( uri ) ) task , _ = self . _connection . post ( uri , { } ) if not task : raise exceptions . HPOneViewException ( RESOURCE_CLIENT_TASK_EXPECTED ) task = self . _task_monitor . get_completed_task ( task , timeout ) return task [ 'taskOutput' ]
251,537
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L471-L492
[ "def", "insert", "(", "self", ",", "storagemodel", ")", "->", "StorageTableModel", ":", "modeldefinition", "=", "self", ".", "getmodeldefinition", "(", "storagemodel", ",", "True", ")", "try", ":", "modeldefinition", "[", "'tableservice'", "]", ".", "insert_or_r...
Builds the URI from given parameters .
def build_query_uri ( self , uri = None , start = 0 , count = - 1 , filter = '' , query = '' , sort = '' , view = '' , fields = '' , scope_uris = '' ) : if filter : filter = self . make_query_filter ( filter ) if query : query = "&query=" + quote ( query ) if sort : sort = "&sort=" + quote ( sort ) if view : view = "&view=" + quote ( view ) if fields : fields = "&fields=" + quote ( fields ) if scope_uris : scope_uris = "&scopeUris=" + quote ( scope_uris ) path = uri if uri else self . _base_uri self . validate_resource_uri ( path ) symbol = '?' if '?' not in path else '&' uri = "{0}{1}start={2}&count={3}{4}{5}{6}{7}{8}{9}" . format ( path , symbol , start , count , filter , query , sort , view , fields , scope_uris ) return uri
251,538
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L523-L585
[ "def", "read", "(", "self", ")", ":", "line", "=", "self", ".", "trace_file", ".", "readline", "(", ")", "if", "line", "==", "''", ":", "if", "self", ".", "loop", ":", "self", ".", "_reopen_file", "(", ")", "else", ":", "self", ".", "trace_file", ...
Helps to build the URI from resource id and validate the URI .
def build_uri ( self , id_or_uri ) : if not id_or_uri : logger . exception ( RESOURCE_CLIENT_INVALID_ID ) raise ValueError ( RESOURCE_CLIENT_INVALID_ID ) if "/" in id_or_uri : self . validate_resource_uri ( id_or_uri ) return id_or_uri else : return self . _base_uri + "/" + id_or_uri
251,539
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L594-L611
[ "def", "benchmark_backward", "(", "self", ")", ":", "try", ":", "self", ".", "_benchmark_backward", "(", ")", "except", "RuntimeError", "as", "e", ":", "# Seems like not implemented.", "print", "(", "e", ")", "self", ".", "mod_ext", ".", "synchronize", "(", ...
Helps to build a URI with resource path and its sub resource path .
def build_subresource_uri ( self , resource_id_or_uri = None , subresource_id_or_uri = None , subresource_path = '' ) : if subresource_id_or_uri and "/" in subresource_id_or_uri : return subresource_id_or_uri else : if not resource_id_or_uri : raise exceptions . HPOneViewValueError ( RESOURCE_ID_OR_URI_REQUIRED ) resource_uri = self . build_uri ( resource_id_or_uri ) uri = "{}/{}/{}" . format ( resource_uri , subresource_path , str ( subresource_id_or_uri or '' ) ) uri = uri . replace ( "//" , "/" ) if uri . endswith ( "/" ) : uri = uri [ : - 1 ] return uri
251,540
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L613-L638
[ "def", "login_with_token", "(", "refresh_token", ",", "team", "=", "None", ")", ":", "# Get an access token and a new refresh token.", "_check_team_id", "(", "team", ")", "auth", "=", "_update_auth", "(", "team", ",", "refresh_token", ")", "url", "=", "get_registry_...
Helper method to validate URI of the resource .
def validate_resource_uri ( self , path ) : if self . _base_uri not in path : logger . exception ( 'Get by uri : unrecognized uri: (%s)' % path ) raise exceptions . HPOneViewUnknownType ( UNRECOGNIZED_URI )
251,541
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L640-L644
[ "def", "insert_seperator_results", "(", "results", ")", ":", "sepbench", "=", "BenchmarkResult", "(", "*", "[", "' '", "*", "w", "for", "w", "in", "COLUMN_WIDTHS", "]", ")", "last_bm", "=", "None", "for", "r", "in", "results", ":", "if", "last_bm", "is",...
Helps to make http request for get_all method .
def do_requests_to_getall ( self , uri , requested_count ) : items = [ ] while uri : logger . debug ( 'Making HTTP request to get all resources. Uri: {0}' . format ( uri ) ) response = self . _connection . get ( uri ) members = self . get_members ( response ) items += members logger . debug ( "Response getAll: nextPageUri = {0}, members list length: {1}" . format ( uri , str ( len ( members ) ) ) ) uri = self . get_next_page ( response , items , requested_count ) logger . debug ( 'Total # of members found = {0}' . format ( str ( len ( items ) ) ) ) return items
251,542
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L678-L697
[ "def", "create_meta_main", "(", "create_path", ",", "config", ",", "role", ",", "categories", ")", ":", "meta_file", "=", "c", ".", "DEFAULT_META_FILE", ".", "replace", "(", "\"%author_name\"", ",", "config", "[", "\"author_name\"", "]", ")", "meta_file", "=",...
Helps to make get requests
def do_get ( self , uri ) : self . validate_resource_uri ( uri ) return self . _connection . get ( uri )
251,543
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L710-L720
[ "def", "get_listing", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'listing'", ")", ":", "allEvents", "=", "self", ".", "get_allEvents", "(", ")", "openEvents", "=", "allEvents", ".", "filter", "(", "registrationOpen", "=", "True", "...
Helps to make post requests .
def do_post ( self , uri , resource , timeout , custom_headers ) : self . validate_resource_uri ( uri ) task , entity = self . _connection . post ( uri , resource , custom_headers = custom_headers ) if not task : return entity return self . _task_monitor . wait_for_task ( task , timeout )
251,544
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L722-L741
[ "def", "partition_by_vid", "(", "self", ",", "ref", ")", ":", "from", "ambry", ".", "orm", "import", "Partition", "p", "=", "self", ".", "session", ".", "query", "(", "Partition", ")", ".", "filter", "(", "Partition", ".", "vid", "==", "str", "(", "r...
Helps to make put requests .
def do_put ( self , uri , resource , timeout , custom_headers ) : self . validate_resource_uri ( uri ) task , body = self . _connection . put ( uri , resource , custom_headers = custom_headers ) if not task : return body return self . _task_monitor . wait_for_task ( task , timeout )
251,545
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L743-L761
[ "def", "get_listing", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'listing'", ")", ":", "allEvents", "=", "self", ".", "get_allEvents", "(", ")", "openEvents", "=", "allEvents", ".", "filter", "(", "registrationOpen", "=", "True", "...
Downloads the contents of the requested URI to a stream .
def download ( self , uri , file_path ) : with open ( file_path , 'wb' ) as file : return self . _connection . download_to_stream ( file , uri )
251,546
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L863-L874
[ "def", "parsedate_tz", "(", "data", ")", ":", "res", "=", "_parsedate_tz", "(", "data", ")", "if", "not", "res", ":", "return", "if", "res", "[", "9", "]", "is", "None", ":", "res", "[", "9", "]", "=", "0", "return", "tuple", "(", "res", ")" ]
Builds the URI given the parameters .
def build_query_uri ( self , start = 0 , count = - 1 , filter = '' , query = '' , sort = '' , view = '' , fields = '' , uri = None , scope_uris = '' ) : if filter : filter = self . __make_query_filter ( filter ) if query : query = "&query=" + quote ( query ) if sort : sort = "&sort=" + quote ( sort ) if view : view = "&view=" + quote ( view ) if fields : fields = "&fields=" + quote ( fields ) if scope_uris : scope_uris = "&scopeUris=" + quote ( scope_uris ) path = uri if uri else self . _uri self . __validate_resource_uri ( path ) symbol = '?' if '?' not in path else '&' uri = "{0}{1}start={2}&count={3}{4}{5}{6}{7}{8}{9}" . format ( path , symbol , start , count , filter , query , sort , view , fields , scope_uris ) return uri
251,547
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L1023-L1095
[ "def", "join_time_series", "(", "serieses", ",", "ignore_year", "=", "False", ",", "T_s", "=", "None", ",", "aggregator", "=", "'mean'", ")", ":", "if", "ignore_year", ":", "df", "=", "pd", ".", "DataFrame", "(", ")", "for", "name", ",", "ts", "in", ...
Makes a multipart request .
def upload ( self , file_path , uri = None , timeout = - 1 ) : if not uri : uri = self . _uri upload_file_name = os . path . basename ( file_path ) task , entity = self . _connection . post_multipart_with_response_handling ( uri , file_path , upload_file_name ) if not task : return entity return self . _task_monitor . wait_for_task ( task , timeout )
251,548
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L1376-L1401
[ "def", "audit_customer_subscription", "(", "customer", ",", "unknown", "=", "True", ")", ":", "if", "(", "hasattr", "(", "customer", ",", "'suspended'", ")", "and", "customer", ".", "suspended", ")", ":", "result", "=", "AUDIT_RESULTS", "[", "'suspended'", "...
This function uses get_all passing a filter .
def get_by ( self , field , value , uri = None ) : if not field : logger . exception ( RESOURCE_CLIENT_INVALID_FIELD ) raise ValueError ( RESOURCE_CLIENT_INVALID_FIELD ) if not uri : uri = self . _uri self . __validate_resource_uri ( uri ) logger . debug ( 'Get by (uri = %s, field = %s, value = %s)' % ( uri , field , str ( value ) ) ) filter = "\"{0}='{1}'\"" . format ( field , value ) results = self . get_all ( filter = filter , uri = uri ) # Workaround when the OneView filter does not work, it will filter again if "." not in field : # This filter only work for the first level results = [ item for item in results if str ( item . get ( field , '' ) ) . lower ( ) == value . lower ( ) ] return results
251,549
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/resource.py#L1457-L1490
[ "def", "create_api_call", "(", "func", ",", "settings", ")", ":", "def", "base_caller", "(", "api_call", ",", "_", ",", "*", "args", ")", ":", "\"\"\"Simply call api_call and ignore settings.\"\"\"", "return", "api_call", "(", "*", "args", ")", "def", "inner", ...
Gets the list of firmware baseline resources managed by the appliance . Optional parameters can be used to filter the list of resources returned .
def get_by ( self , field , value ) : firmwares = self . get_all ( ) matches = [ ] for item in firmwares : if item . get ( field ) == value : matches . append ( item ) return matches
251,550
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/settings/firmware_drivers.py#L73-L92
[ "def", "_sign", "(", "translator", ",", "expr", ")", ":", "op", "=", "expr", ".", "op", "(", ")", "arg", ",", "=", "op", ".", "args", "arg_", "=", "translator", ".", "translate", "(", "arg", ")", "return", "'intDivOrZero({0}, abs({0}))'", ".", "format"...
Gets the statistics from an interconnect .
def get_statistics ( self , id_or_uri , port_name = '' ) : uri = self . _client . build_uri ( id_or_uri ) + "/statistics" if port_name : uri = uri + "/" + port_name return self . _client . get ( uri )
251,551
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/interconnects.py#L75-L91
[ "def", "enable_notebook", "(", "verbose", "=", "0", ")", ":", "libs", "=", "[", "'objexporter.js'", ",", "'ArcballControls.js'", ",", "'filesaver.js'", ",", "'base64-arraybuffer.js'", ",", "'context.js'", ",", "'chemview.js'", ",", "'three.min.js'", ",", "'jquery-ui...
Gets the subport statistics on an interconnect .
def get_subport_statistics ( self , id_or_uri , port_name , subport_number ) : uri = self . _client . build_uri ( id_or_uri ) + "/statistics/{0}/subport/{1}" . format ( port_name , subport_number ) return self . _client . get ( uri )
251,552
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/interconnects.py#L93-L106
[ "def", "markdown", "(", "source", ":", "str", "=", "None", ",", "source_path", ":", "str", "=", "None", ",", "preserve_lines", ":", "bool", "=", "False", ",", "font_size", ":", "float", "=", "None", ",", "*", "*", "kwargs", ")", "->", "dict", ":", ...
Gets the named servers for an interconnect .
def get_name_servers ( self , id_or_uri ) : uri = self . _client . build_uri ( id_or_uri ) + "/nameServers" return self . _client . get ( uri )
251,553
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/interconnects.py#L108-L120
[ "def", "call_moses_detokenizer", "(", "workspace_dir", ":", "str", ",", "input_fname", ":", "str", ",", "output_fname", ":", "str", ",", "lang_code", ":", "Optional", "[", "str", "]", "=", "None", ")", ":", "detokenizer_fname", "=", "os", ".", "path", ".",...
Updates an interconnect port .
def update_port ( self , port_information , id_or_uri , timeout = - 1 ) : uri = self . _client . build_uri ( id_or_uri ) + "/ports" return self . _client . update ( port_information , uri , timeout )
251,554
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/interconnects.py#L186-L201
[ "def", "denormalize_volume", "(", "volume", ")", ":", "id", "=", "volume", ".", "get", "(", "'id'", ",", "None", ")", "res", "=", "dict", "(", ")", "res", ".", "update", "(", "volume", "[", "'metadata'", "]", ")", "denorm_attachments", "=", "list", "...
Updates the interconnect ports .
def update_ports ( self , ports , id_or_uri , timeout = - 1 ) : resources = merge_default_values ( ports , { 'type' : 'port' } ) uri = self . _client . build_uri ( id_or_uri ) + "/update-ports" return self . _client . update ( resources , uri , timeout )
251,555
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/interconnects.py#L203-L220
[ "def", "markdown", "(", "source", ":", "str", "=", "None", ",", "source_path", ":", "str", "=", "None", ",", "preserve_lines", ":", "bool", "=", "False", ",", "font_size", ":", "float", "=", "None", ",", "*", "*", "kwargs", ")", "->", "dict", ":", ...
Triggers a reset of port protection .
def reset_port_protection ( self , id_or_uri , timeout = - 1 ) : uri = self . _client . build_uri ( id_or_uri ) + "/resetportprotection" return self . _client . update_with_zero_body ( uri , timeout )
251,556
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/interconnects.py#L222-L238
[ "def", "column", "(", "self", ",", "column", ",", "option", "=", "None", ",", "*", "*", "kw", ")", ":", "config", "=", "False", "if", "option", "==", "'type'", ":", "return", "self", ".", "_column_types", "[", "column", "]", "elif", "'type'", "in", ...
Gets all interconnect ports .
def get_ports ( self , id_or_uri , start = 0 , count = - 1 ) : uri = self . _client . build_subresource_uri ( resource_id_or_uri = id_or_uri , subresource_path = "ports" ) return self . _client . get_all ( start , count , uri = uri )
251,557
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/interconnects.py#L240-L258
[ "def", "markdown", "(", "source", ":", "str", "=", "None", ",", "source_path", ":", "str", "=", "None", ",", "preserve_lines", ":", "bool", "=", "False", ",", "font_size", ":", "float", "=", "None", ",", "*", "*", "kwargs", ")", "->", "dict", ":", ...
Gets an interconnect port .
def get_port ( self , id_or_uri , port_id_or_uri ) : uri = self . _client . build_subresource_uri ( id_or_uri , port_id_or_uri , "ports" ) return self . _client . get ( uri )
251,558
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/interconnects.py#L260-L272
[ "def", "denormalize_volume", "(", "volume", ")", ":", "id", "=", "volume", ".", "get", "(", "'id'", ",", "None", ")", "res", "=", "dict", "(", ")", "res", ".", "update", "(", "volume", "[", "'metadata'", "]", ")", "denorm_attachments", "=", "list", "...
Gets all the pluggable module information .
def get_pluggable_module_information ( self , id_or_uri ) : uri = self . _client . build_uri ( id_or_uri ) + "/pluggableModuleInformation" return self . _client . get ( uri )
251,559
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/interconnects.py#L274-L285
[ "def", "arcball_constrain_to_axis", "(", "point", ",", "axis", ")", ":", "v", "=", "np", ".", "array", "(", "point", ",", "dtype", "=", "np", ".", "float64", ",", "copy", "=", "True", ")", "a", "=", "np", ".", "array", "(", "axis", ",", "dtype", ...
Reapplies the appliance s configuration on the interconnect . This includes running the same configure steps that were performed as part of the interconnect add by the enclosure .
def update_configuration ( self , id_or_uri , timeout = - 1 ) : uri = self . _client . build_uri ( id_or_uri ) + "/configuration" return self . _client . update_with_zero_body ( uri , timeout = timeout )
251,560
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/interconnects.py#L287-L301
[ "def", "make_entity_name", "(", "name", ")", ":", "invalid_chars", "=", "\"-=!#$%^&*[](){}/~'`<>:;\"", "for", "char", "in", "invalid_chars", ":", "name", "=", "name", ".", "replace", "(", "char", ",", "\"_\"", ")", "return", "name" ]
Updates a registered Device Manager .
def update ( self , resource , id_or_uri ) : return self . _client . update ( resource = resource , uri = id_or_uri )
251,561
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/fc_sans/san_managers.py#L87-L98
[ "def", "fetch_and_create_image", "(", "self", ",", "url", ",", "image_title", ")", ":", "context", "=", "{", "\"file_url\"", ":", "url", ",", "\"foreign_title\"", ":", "image_title", ",", "}", "try", ":", "image_file", "=", "requests", ".", "get", "(", "ur...
Adds a Device Manager under the specified provider .
def add ( self , resource , provider_uri_or_id , timeout = - 1 ) : uri = self . _provider_client . build_uri ( provider_uri_or_id ) + "/device-managers" return self . _client . create ( resource = resource , uri = uri , timeout = timeout )
251,562
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/fc_sans/san_managers.py#L100-L115
[ "def", "parse_plotCorrelation", "(", "self", ")", ":", "self", ".", "deeptools_plotCorrelationData", "=", "dict", "(", ")", "for", "f", "in", "self", ".", "find_log_files", "(", "'deeptools/plotCorrelationData'", ",", "filehandles", "=", "False", ")", ":", "pars...
Gets uri for a specific provider .
def get_provider_uri ( self , provider_display_name ) : providers = self . _provider_client . get_by ( 'displayName' , provider_display_name ) return providers [ 0 ] [ 'uri' ] if providers else None
251,563
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/fc_sans/san_managers.py#L117-L128
[ "def", "unpackmar", "(", "marfile", ",", "destdir", ")", ":", "marfile", "=", "cygpath", "(", "os", ".", "path", ".", "abspath", "(", "marfile", ")", ")", "nullfd", "=", "open", "(", "os", ".", "devnull", ",", "\"w\"", ")", "try", ":", "check_call", ...
Gets default connection info for a specific provider .
def get_default_connection_info ( self , provider_name ) : provider = self . _provider_client . get_by_name ( provider_name ) if provider : return provider [ 'defaultConnectionInfo' ] else : return { }
251,564
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/fc_sans/san_managers.py#L130-L144
[ "def", "remove_unused_resources", "(", "issues", ",", "app_dir", ",", "ignore_layouts", ")", ":", "for", "issue", "in", "issues", ":", "filepath", "=", "os", ".", "path", ".", "join", "(", "app_dir", ",", "issue", ".", "filepath", ")", "if", "issue", "."...
Gets a SAN Manager by name .
def get_by_name ( self , name ) : san_managers = self . _client . get_all ( ) result = [ x for x in san_managers if x [ 'name' ] == name ] return result [ 0 ] if result else None
251,565
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/fc_sans/san_managers.py#L161-L173
[ "def", "_merge_meta_data", "(", "cls", ",", "first", ":", "\"HistogramBase\"", ",", "second", ":", "\"HistogramBase\"", ")", "->", "dict", ":", "keys", "=", "set", "(", "first", ".", "_meta_data", ".", "keys", "(", ")", ")", "keys", "=", "keys", ".", "...
Gets a SAN Manager by provider display name .
def get_by_provider_display_name ( self , provider_display_name ) : san_managers = self . _client . get_all ( ) result = [ x for x in san_managers if x [ 'providerDisplayName' ] == provider_display_name ] return result [ 0 ] if result else None
251,566
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/fc_sans/san_managers.py#L175-L187
[ "def", "cli", "(", "file1", ",", "file2", ",", "comments", ")", "->", "int", ":", "sys", ".", "exit", "(", "compare_files", "(", "file1", ",", "file2", ",", "comments", ")", ")" ]
Updates the metrics configuration with the new values . Overwrites the existing configuration .
def update_configuration ( self , configuration ) : return self . _client . update ( configuration , uri = self . URI + "/configuration" )
251,567
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/data_services/metric_streaming.py#L99-L112
[ "def", "container_unfreeze", "(", "name", ",", "remote_addr", "=", "None", ",", "cert", "=", "None", ",", "key", "=", "None", ",", "verify_cert", "=", "True", ")", ":", "container", "=", "container_get", "(", "name", ",", "remote_addr", ",", "cert", ",",...
Delete an SNMPv3 User based on User name specified in filter . The user will be deleted only if it has no associated destinations .
def delete_all ( self , filter = None , timeout = - 1 ) : return self . _client . delete_all ( filter = filter , timeout = timeout )
251,568
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/settings/appliance_device_snmp_v3_users.py#L122-L134
[ "def", "lock", "(", "self", ",", "seconds", "=", "5", ")", ":", "self", ".", "_current_application", "(", ")", ".", "lock", "(", "robot", ".", "utils", ".", "timestr_to_secs", "(", "seconds", ")", ")" ]
Updates the switch ports . Only the ports under the management of OneView and those that are unlinked are supported for update .
def update_ports ( self , ports , id_or_uri ) : ports = merge_default_values ( ports , { 'type' : 'port' } ) uri = self . _client . build_uri ( id_or_uri ) + "/update-ports" return self . _client . update ( uri = uri , resource = ports )
251,569
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/resources/networking/switches.py#L152-L170
[ "def", "_cached_results", "(", "self", ",", "start_time", ",", "end_time", ")", ":", "cached_buckets", "=", "self", ".", "_bucket_events", "(", "self", ".", "_client", ".", "get", "(", "self", ".", "_scratch_stream", ",", "start_time", ",", "end_time", ",", ...
Construct OneViewClient using a json file .
def from_json_file ( cls , file_name ) : with open ( file_name ) as json_data : config = json . load ( json_data ) return cls ( config )
251,570
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L209-L222
[ "def", "strand", "(", "s1", ",", "s2", ")", ":", "return", "\"\"", ".", "join", "(", "map", "(", "lambda", "x", ",", "y", ":", "chr", "(", "ord", "(", "x", ")", "&", "ord", "(", "y", ")", ")", ",", "s1", ",", "s2", ")", ")" ]
Construct OneViewClient using environment variables .
def from_environment_variables ( cls ) : ip = os . environ . get ( 'ONEVIEWSDK_IP' , '' ) image_streamer_ip = os . environ . get ( 'ONEVIEWSDK_IMAGE_STREAMER_IP' , '' ) api_version = int ( os . environ . get ( 'ONEVIEWSDK_API_VERSION' , OneViewClient . DEFAULT_API_VERSION ) ) ssl_certificate = os . environ . get ( 'ONEVIEWSDK_SSL_CERTIFICATE' , '' ) username = os . environ . get ( 'ONEVIEWSDK_USERNAME' , '' ) auth_login_domain = os . environ . get ( 'ONEVIEWSDK_AUTH_LOGIN_DOMAIN' , '' ) password = os . environ . get ( 'ONEVIEWSDK_PASSWORD' , '' ) proxy = os . environ . get ( 'ONEVIEWSDK_PROXY' , '' ) sessionID = os . environ . get ( 'ONEVIEWSDK_SESSIONID' , '' ) timeout = os . environ . get ( 'ONEVIEWSDK_CONNECTION_TIMEOUT' ) config = dict ( ip = ip , image_streamer_ip = image_streamer_ip , api_version = api_version , ssl_certificate = ssl_certificate , credentials = dict ( userName = username , authLoginDomain = auth_login_domain , password = password , sessionID = sessionID ) , proxy = proxy , timeout = timeout ) return cls ( config )
251,571
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L225-L254
[ "def", "render_field_error", "(", "self", ",", "obj_id", ",", "obj", ",", "exception", ",", "request", ")", ":", "if", "obj", "is", "None", ":", "msg", "=", "'No match for ID={0}'", ".", "format", "(", "obj_id", ")", "else", ":", "msg", "=", "unicode", ...
Create the Image Streamer API Client .
def create_image_streamer_client ( self ) : image_streamer = ImageStreamerClient ( self . __image_streamer_ip , self . __connection . get_session_id ( ) , self . __connection . _apiVersion , self . __connection . _sslBundle ) return image_streamer
251,572
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L292-L304
[ "def", "unmount", "(", "self", ")", ":", "self", ".", "unmount_bindmounts", "(", ")", "self", ".", "unmount_mounts", "(", ")", "self", ".", "unmount_volume_groups", "(", ")", "self", ".", "unmount_loopbacks", "(", ")", "self", ".", "unmount_base_images", "("...
Gets the Certificate Authority API client .
def certificate_authority ( self ) : if not self . __certificate_authority : self . __certificate_authority = CertificateAuthority ( self . __connection ) return self . __certificate_authority
251,573
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L307-L316
[ "def", "get_context_data", "(", "self", ",", "*", "*", "kwargs", ")", ":", "context", "=", "super", "(", "BaseEntryChannel", ",", "self", ")", ".", "get_context_data", "(", "*", "*", "kwargs", ")", "context", ".", "update", "(", "{", "'query'", ":", "s...
Gets the Connections API client .
def connections ( self ) : if not self . __connections : self . __connections = Connections ( self . __connection ) return self . __connections
251,574
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L319-L329
[ "def", "get_metadata", "(", "self", ",", "digest", ",", "content", ",", "mime_type", ")", ":", "# XXX: ad-hoc for now, refactor later", "if", "mime_type", ".", "startswith", "(", "\"image/\"", ")", ":", "img", "=", "Image", ".", "open", "(", "BytesIO", "(", ...
Gets the FcoeNetworks API client .
def fcoe_networks ( self ) : if not self . __fcoe_networks : self . __fcoe_networks = FcoeNetworks ( self . __connection ) return self . __fcoe_networks
251,575
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L352-L361
[ "def", "to_td", "(", "frame", ",", "name", ",", "con", ",", "if_exists", "=", "'fail'", ",", "time_col", "=", "None", ",", "time_index", "=", "None", ",", "index", "=", "True", ",", "index_label", "=", "None", ",", "chunksize", "=", "10000", ",", "da...
Gets the Fabrics API client .
def fabrics ( self ) : if not self . __fabrics : self . __fabrics = Fabrics ( self . __connection ) return self . __fabrics
251,576
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L374-L383
[ "def", "run", "(", "self", ")", ":", "states", "=", "open", "(", "self", ".", "states", ",", "'r'", ")", ".", "read", "(", ")", ".", "splitlines", "(", ")", "for", "state", "in", "states", ":", "url", "=", "self", ".", "build_url", "(", "state", ...
Gets the Restores API client .
def restores ( self ) : if not self . __restores : self . __restores = Restores ( self . __connection ) return self . __restores
251,577
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L386-L395
[ "def", "_custom_fields", "(", ")", ":", "# Import some commonly needed modules", "import", "os", "from", "pyrocore", ".", "torrent", "import", "engine", ",", "matching", "from", "pyrocore", ".", "util", "import", "fmt", "# PUT CUSTOM FIELD CODE HERE", "# Disk space chec...
Gets the Scopes API client .
def scopes ( self ) : if not self . __scopes : self . __scopes = Scopes ( self . __connection ) return self . __scopes
251,578
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L398-L407
[ "def", "_read_vmx_file", "(", "self", ")", ":", "try", ":", "self", ".", "_vmx_pairs", "=", "self", ".", "manager", ".", "parse_vmware_file", "(", "self", ".", "_vmx_path", ")", "except", "OSError", "as", "e", ":", "raise", "VMwareError", "(", "'Could not ...
Gets the Datacenters API client .
def datacenters ( self ) : if not self . __datacenters : self . __datacenters = Datacenters ( self . __connection ) return self . __datacenters
251,579
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L410-L419
[ "def", "clean_except_files", "(", "self", ")", ":", "if", "self", ".", "is_finalized", ":", "self", ".", "warn", "(", "\"Can't clean; bundle is finalized\"", ")", "return", "False", "self", ".", "log", "(", "'---- Cleaning ----'", ")", "self", ".", "state", "=...
Gets the NetworkSets API client .
def network_sets ( self ) : if not self . __network_sets : self . __network_sets = NetworkSets ( self . __connection ) return self . __network_sets
251,580
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L422-L431
[ "def", "revoke_session", "(", "self", ",", "sid", "=", "''", ",", "token", "=", "''", ")", ":", "if", "not", "sid", ":", "if", "token", ":", "sid", "=", "self", ".", "handler", ".", "sid", "(", "token", ")", "else", ":", "raise", "ValueError", "(...
Gets the ServerHardware API client .
def server_hardware ( self ) : if not self . __server_hardware : self . __server_hardware = ServerHardware ( self . __connection ) return self . __server_hardware
251,581
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L434-L443
[ "def", "json", "(", "self", ",", "*", "*", "kwargs", ")", ":", "body", "=", "self", ".", "_decompress", "(", "self", ".", "encoding", ")", "return", "_json", ".", "loads", "(", "body", ",", "*", "*", "kwargs", ")" ]
Gets the ServerHardwareTypes API client .
def server_hardware_types ( self ) : if not self . __server_hardware_types : self . __server_hardware_types = ServerHardwareTypes ( self . __connection ) return self . __server_hardware_types
251,582
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L446-L456
[ "def", "json", "(", "self", ",", "*", "*", "kwargs", ")", ":", "body", "=", "self", ".", "_decompress", "(", "self", ".", "encoding", ")", "return", "_json", ".", "loads", "(", "body", ",", "*", "*", "kwargs", ")" ]
Gets the IdPoolsRanges API Client for VSN Ranges .
def id_pools_vsn_ranges ( self ) : if not self . __id_pools_vsn_ranges : self . __id_pools_vsn_ranges = IdPoolsRanges ( 'vsn' , self . __connection ) return self . __id_pools_vsn_ranges
251,583
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L459-L468
[ "def", "parse_message", "(", "message", ",", "nodata", "=", "False", ")", ":", "header", "=", "read_machine_header", "(", "message", ")", "h_len", "=", "__get_machine_header_length", "(", "header", ")", "meta_raw", "=", "message", "[", "h_len", ":", "h_len", ...
Gets the IdPoolsRanges API Client for VMAC Ranges .
def id_pools_vmac_ranges ( self ) : if not self . __id_pools_vmac_ranges : self . __id_pools_vmac_ranges = IdPoolsRanges ( 'vmac' , self . __connection ) return self . __id_pools_vmac_ranges
251,584
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L471-L480
[ "def", "send", "(", "self", ",", "event", ")", ":", "try", ":", "self", ".", "collection", ".", "insert", "(", "event", ",", "manipulate", "=", "False", ")", "except", "(", "PyMongoError", ",", "BSONError", ")", ":", "# The event will be lost in case of a co...
Gets the IdPoolsRanges API Client for VWWN Ranges .
def id_pools_vwwn_ranges ( self ) : if not self . __id_pools_vwwn_ranges : self . __id_pools_vwwn_ranges = IdPoolsRanges ( 'vwwn' , self . __connection ) return self . __id_pools_vwwn_ranges
251,585
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L483-L492
[ "def", "send", "(", "self", ",", "event", ")", ":", "try", ":", "self", ".", "collection", ".", "insert", "(", "event", ",", "manipulate", "=", "False", ")", "except", "(", "PyMongoError", ",", "BSONError", ")", ":", "# The event will be lost in case of a co...
Gets the IdPoolsIpv4Ranges API client .
def id_pools_ipv4_ranges ( self ) : if not self . __id_pools_ipv4_ranges : self . __id_pools_ipv4_ranges = IdPoolsIpv4Ranges ( self . __connection ) return self . __id_pools_ipv4_ranges
251,586
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L495-L504
[ "def", "_recurmatch", "(", "path", ",", "aug", ")", ":", "if", "path", ":", "clean_path", "=", "path", ".", "rstrip", "(", "'/*'", ")", "yield", "(", "clean_path", ",", "aug", ".", "get", "(", "path", ")", ")", "for", "i", "in", "aug", ".", "matc...
Gets the IdPoolsIpv4Subnets API client .
def id_pools_ipv4_subnets ( self ) : if not self . __id_pools_ipv4_subnets : self . __id_pools_ipv4_subnets = IdPoolsIpv4Subnets ( self . __connection ) return self . __id_pools_ipv4_subnets
251,587
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L507-L516
[ "def", "transform", "(", "self", ",", "y", ",", "sr", ")", ":", "if", "sr", "!=", "self", ".", "sr", ":", "y", "=", "resample", "(", "y", ",", "sr", ",", "self", ".", "sr", ")", "return", "self", ".", "merge", "(", "[", "self", ".", "transfor...
Gets the IdPools API client .
def id_pools ( self ) : if not self . __id_pools : self . __id_pools = IdPools ( self . __connection ) return self . __id_pools
251,588
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L519-L528
[ "def", "segment", "(", "f", ",", "output", ",", "target_duration", ",", "mpegts", ")", ":", "try", ":", "target_duration", "=", "int", "(", "target_duration", ")", "except", "ValueError", ":", "exit", "(", "'Error: Invalid target duration.'", ")", "try", ":", ...
Gets the Switches API client .
def switches ( self ) : if not self . __switches : self . __switches = Switches ( self . __connection ) return self . __switches
251,589
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L531-L540
[ "def", "getCell", "(", "self", ",", "row", ",", "width", "=", "None", ")", ":", "cellval", "=", "wrapply", "(", "self", ".", "getValue", ",", "row", ")", "typedval", "=", "wrapply", "(", "self", ".", "type", ",", "cellval", ")", "if", "isinstance", ...
Gets the Roles API client .
def roles ( self ) : if not self . __roles : self . __roles = Roles ( self . __connection ) return self . __roles
251,590
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L543-L552
[ "def", "add_match", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "args", "=", "list", "(", "args", ")", "args", ".", "extend", "(", "_make_line", "(", "key", ",", "val", ")", "for", "key", ",", "val", "in", "kwargs", ".", "...
Gets the SwitchTypes API client .
def switch_types ( self ) : if not self . __switch_types : self . __switch_types = SwitchTypes ( self . __connection ) return self . __switch_types
251,591
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L555-L564
[ "def", "grep_log", "(", "self", ",", "expr", ",", "filename", "=", "'system.log'", ",", "from_mark", "=", "None", ")", ":", "matchings", "=", "[", "]", "pattern", "=", "re", ".", "compile", "(", "expr", ")", "with", "open", "(", "os", ".", "path", ...
Gets the LogicalSwitches API client .
def logical_switches ( self ) : if not self . __logical_switches : self . __logical_switches = LogicalSwitches ( self . __connection ) return self . __logical_switches
251,592
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L577-L586
[ "def", "inject_extra_args", "(", "callback", ",", "request", ",", "kwargs", ")", ":", "# TODO: this is a temporary pach, should be managed via honouring the", "# mimetype in the request header....", "annots", "=", "dict", "(", "callback", ".", "__annotations__", ")", "del", ...
Gets the Tasks API client .
def tasks ( self ) : if not self . __tasks : self . __tasks = Tasks ( self . __connection ) return self . __tasks
251,593
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L589-L598
[ "def", "_clearQuantity", "(", "self", ",", "offbids", ",", "gen", ")", ":", "# Filter out offers/bids not applicable to the generator in question.", "gOffbids", "=", "[", "offer", "for", "offer", "in", "offbids", "if", "offer", ".", "generator", "==", "gen", "]", ...
Gets the EnclosureGroups API client .
def enclosure_groups ( self ) : if not self . __enclosure_groups : self . __enclosure_groups = EnclosureGroups ( self . __connection ) return self . __enclosure_groups
251,594
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L601-L610
[ "def", "grant_revoke", "(", "grant", ",", "database", ",", "user", ",", "host", "=", "'localhost'", ",", "grant_option", "=", "False", ",", "escape", "=", "True", ",", "*", "*", "connection_args", ")", ":", "dbc", "=", "_connect", "(", "*", "*", "conne...
Gets the LogicalEnclosures API client .
def logical_enclosures ( self ) : if not self . __logical_enclosures : self . __logical_enclosures = LogicalEnclosures ( self . __connection ) return self . __logical_enclosures
251,595
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L623-L632
[ "def", "retract", "(", "args", ")", ":", "if", "not", "args", ".", "msg", ":", "return", "\"Syntax: !vote retract <pollnum>\"", "if", "not", "args", ".", "msg", ".", "isdigit", "(", ")", ":", "return", "\"Not A Valid Positive Integer.\"", "response", "=", "get...
Gets the MetricStreaming API client .
def metric_streaming ( self ) : if not self . __metric_streaming : self . __metric_streaming = MetricStreaming ( self . __connection ) return self . __metric_streaming
251,596
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L635-L644
[ "def", "diff_args", "(", "subparsers", ")", ":", "diff_parser", "=", "subparsers", ".", "add_parser", "(", "'diff'", ")", "secretfile_args", "(", "diff_parser", ")", "vars_args", "(", "diff_parser", ")", "base_args", "(", "diff_parser", ")", "thaw_from_args", "(...
Gets the Interconnects API client .
def interconnects ( self ) : if not self . __interconnects : self . __interconnects = Interconnects ( self . __connection ) return self . __interconnects
251,597
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L647-L656
[ "def", "removeApplicationManifest", "(", "self", ",", "pchApplicationManifestFullPath", ")", ":", "fn", "=", "self", ".", "function_table", ".", "removeApplicationManifest", "result", "=", "fn", "(", "pchApplicationManifestFullPath", ")", "return", "result" ]
Gets the InterconnectLinkTopologies API client .
def interconnect_link_topologies ( self ) : if not self . __interconnect_link_topologies : self . __interconnect_link_topologies = InterconnectLinkTopologies ( self . __connection ) return self . __interconnect_link_topologies
251,598
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L669-L678
[ "def", "extract_string_pairs_in_directory", "(", "directory_path", ",", "extract_func", ",", "filter_func", ")", ":", "result", "=", "{", "}", "for", "root", ",", "dirnames", ",", "filenames", "in", "os", ".", "walk", "(", "directory_path", ")", ":", "for", ...
Gets the SasInterconnectTypes API client .
def sas_interconnect_types ( self ) : if not self . __sas_interconnect_types : self . __sas_interconnect_types = SasInterconnectTypes ( self . __connection ) return self . __sas_interconnect_types
251,599
https://github.com/HewlettPackard/python-hpOneView/blob/3c6219723ef25e6e0c83d44a89007f89bc325b89/hpOneView/oneview_client.py#L681-L690
[ "def", "replace_emoticons", "(", "content", ",", "excluded_markups", ")", ":", "if", "not", "excluded_markups", ":", "return", "regexp_replace_emoticons", "(", "content", ")", "excluded_markups", "=", "excluded_markups", ".", "split", "(", "','", ")", "+", "[", ...