Add lib keyword to get system power limit
Changes:
- Added redfish call to get the system power limit
Tested:
- Currently this code is not use, but wrote a sample test code
to call this keyword and tested.
Change-Id: I2ddb7dc286f86210912e95a420b194b859de35a2
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/energy_scale_utils.robot b/lib/energy_scale_utils.robot
index d0839bd..9397520 100755
--- a/lib/energy_scale_utils.robot
+++ b/lib/energy_scale_utils.robot
@@ -7,9 +7,28 @@
Resource ../lib/ipmi_client.robot
Library ../lib/var_funcs.py
+*** Variables ***
+
+${power_cap_uri} /redfish/v1/Chassis/${CHASSIS_ID}/EnvironmentMetrics
*** Keywords ***
+Get System Power Cap Limit
+ [Documentation] Get the allowed MAX and MIN power limit of the chassis.
+
+ # GET request of /redfish/v1/Chassis/chassis/EnvironmentMetrics | grep -A5 Power
+ # "PowerLimitWatts": {
+ # "AllowableMax": 2488,
+ # "AllowableMin": 1778,
+ # "ControlMode": "Disabled",
+ # "SetPoint": 2488
+ # }
+
+ ${power_limit_watts}= Redfish.Get Attribute ${power_cap_uri} PowerLimitWatts
+
+ [return] ${power_limit_watts}
+
+
DCMI Power Get Limits
[Documentation] Run dcmi power get_limit and return values as a
... dictionary.