Redfish power operation
Added:
- Resource variables paths.
- Keyword to accept valid boot options.
Change-Id: Id49db5c351520116475971cda40c3d5ee32ed20d
Signed-off-by: Sridevi Ramesh <sridevra@in.ibm.com>
diff --git a/lib/bmc_redfish_utils.robot b/lib/bmc_redfish_utils.robot
new file mode 100644
index 0000000..b178f55
--- /dev/null
+++ b/lib/bmc_redfish_utils.robot
@@ -0,0 +1,36 @@
+*** Settings ***
+Documentation BMC redfish utils.
+
+Resource resource.txt
+Resource bmc_redfish_resource.robot
+
+
+*** Keywords ***
+
+Redfish Power Operation
+ [Documentation] Do Redfish power operation.
+ [Arguments] ${reset_type}
+ # Description of arguments:
+ # reset_type Type of power operation.
+ # (e.g. On/ForceOff/GracefulRestart/GracefulShutdown)
+
+ # Example:
+ # "Actions": {
+ # "#ComputerSystem.Reset": {
+ # "ResetType@Redfish.AllowableValues": [
+ # "On",
+ # "ForceOff",
+ # "GracefulRestart",
+ # "GracefulShutdown"
+ # ],
+ # "target": "/redfish/v1/Systems/motherboard/Actions/ComputerSystem.Reset"
+ # }}
+
+ redfish.Login
+ ${payload}= Create Dictionary ResetType=${reset_type}
+ ${resp}= redfish.Post Systems/1/Actions/ComputerSystem.Reset body=&{payload}
+ Should Be Equal As Strings ${resp.status} ${HTTP_OK}
+ redfish.Logout
+
+
+