Lines Matching +full:self +full:- +full:power

20     def __init__(self):  argument
25 self.__inited__ = False
27 self._redfish_ = BuiltIn().get_library_instance("redfish")
36 self.__inited__ = True
39 self._redfish_.login()
40 self.__inited__ = True
42 def get_redfish_session_info(self): argument
52 "key": self._redfish_.get_session_key(),
53 "location": self._redfish_.get_session_location(),
57 def get_attribute(self, resource_path, attribute, verify=None): argument
67 resp = self._redfish_.get(resource_path)
70 "get_attribute: JSONDecodeError, re-trying"
72 resp = self._redfish_.get(resource_path)
84 def get_properties(self, resource_path): argument
93 resp = self._redfish_.get(resource_path)
96 def get_members_uri(self, resource_path, attribute): argument
112 resource_path_list = self.get_member_list(resource_path)
118 # ['/redfish/v1/Chassis/foo/Power','/redfish/v1/Chassis/bar/Power']
119 child_path_list = self.list_request(path_idx)
129 if self.get_attribute(child_path_idx, attribute):
135 def get_endpoint_path_list(self, resource_path, end_point_prefix): argument
141 end_point_prefix Name of the endpoint (e.g. 'Power').
144 /redfish/v1/Chassis/<foo>/Power
145 /redfish/v1/Chassis/<bar>/Power
148 end_point_list = self.list_request(resource_path)
151 regex = ".*/" + end_point_prefix + "[_]?[0-9]*$"
154 def get_target_actions(self, resource_path, target_attribute): argument
180 resp_dict = self.get_attribute(resource_path, "Actions")
186 self.get_key_value_nested_dict(resp_dict, "target")
190 attribute_in_uri = target.rsplit("/", 1)[-1]
197 def get_member_list(self, resource_path): argument
216 resp_list_dict = self.get_attribute(resource_path, "Members")
225 def list_request(self, resource_path): argument
235 self.__pending_enumeration = set()
236 self._rest_response_ = self._redfish_.get(
241 if self._rest_response_.status != 200:
242 return self.__pending_enumeration
243 self.walk_nested_dict(self._rest_response_.dict)
244 if not self.__pending_enumeration:
246 for resource in self.__pending_enumeration.copy():
247 self._rest_response_ = self._redfish_.get(
251 if self._rest_response_.status != 200:
253 self.walk_nested_dict(self._rest_response_.dict)
254 return list(sorted(self.__pending_enumeration))
257 self, resource_path, return_json=1, include_dead_resources=False argument
280 self.__result = {}
284 self.__pending_enumeration = set()
286 self.__pending_enumeration.add(resource_path)
314 self._rest_response_ = self._redfish_.get(
319 "enumerate_request: JSONDecodeError, re-trying"
321 self._rest_response_ = self._redfish_.get(
327 if self._rest_response_.status != 200:
330 dead_resources[self._rest_response_.status].append(
334 dead_resources[self._rest_response_.status] = [
339 self.walk_nested_dict(self._rest_response_.dict, url=resource)
343 self.__pending_enumeration - enumerated_resources
350 self.__result,
359 self.__result,
366 return self.__result, dead_resources
368 return self.__result
370 def walk_nested_dict(self, data, url=""): argument
382 self.walk_nested_dict(value)
389 self.__pending_enumeration.add(memberDict)
394 self.__pending_enumeration.add(
398 self.__pending_enumeration.add(memberDict[1])
404 self.__result[url] = data
407 self.__pending_enumeration.add(value)
409 def get_key_value_nested_dict(self, data, key): argument
420 self.get_key_value_nested_dict(v, key)