blob: 7f67df01037853afb5d41f921f37e97a11b01d4b [file] [log] [blame]
*** Settings ***
Documentation BMC redfish utils.
Resource resource.robot
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