Sridevi Ramesh | 0047de8 | 2019-02-01 06:33:08 -0600 | [diff] [blame] | 1 | *** Settings *** |
George Keishing | b10eaca | 2019-02-24 05:07:30 -0600 | [diff] [blame] | 2 | Documentation BMC and host redfish utility keywords. |
Sridevi Ramesh | 0047de8 | 2019-02-01 06:33:08 -0600 | [diff] [blame] | 3 | |
George Keishing | 2db7bca | 2019-02-14 13:03:08 -0600 | [diff] [blame] | 4 | Resource resource.robot |
Sridevi Ramesh | 0047de8 | 2019-02-01 06:33:08 -0600 | [diff] [blame] | 5 | Resource bmc_redfish_resource.robot |
| 6 | |
| 7 | |
| 8 | *** Keywords *** |
| 9 | |
| 10 | Redfish Power Operation |
George Keishing | b10eaca | 2019-02-24 05:07:30 -0600 | [diff] [blame] | 11 | [Documentation] Do Redfish host power operation. |
Sridevi Ramesh | 0047de8 | 2019-02-01 06:33:08 -0600 | [diff] [blame] | 12 | [Arguments] ${reset_type} |
| 13 | # Description of arguments: |
| 14 | # reset_type Type of power operation. |
| 15 | # (e.g. On/ForceOff/GracefulRestart/GracefulShutdown) |
| 16 | |
| 17 | # Example: |
| 18 | # "Actions": { |
| 19 | # "#ComputerSystem.Reset": { |
| 20 | # "ResetType@Redfish.AllowableValues": [ |
| 21 | # "On", |
| 22 | # "ForceOff", |
| 23 | # "GracefulRestart", |
| 24 | # "GracefulShutdown" |
| 25 | # ], |
George Keishing | 2deec3c | 2019-02-26 09:20:10 -0600 | [diff] [blame] | 26 | # "target": "/redfish/v1/Systems/system/Actions/ComputerSystem.Reset" |
| 27 | # } |
| 28 | # } |
Sridevi Ramesh | 0047de8 | 2019-02-01 06:33:08 -0600 | [diff] [blame] | 29 | |
| 30 | redfish.Login |
George Keishing | c2b176e | 2019-03-02 23:31:30 -0600 | [diff] [blame] | 31 | ${target}= redfish_utils.Get Target Actions /redfish/v1/Systems/system/ ComputerSystem.Reset |
Sridevi Ramesh | 0047de8 | 2019-02-01 06:33:08 -0600 | [diff] [blame] | 32 | ${payload}= Create Dictionary ResetType=${reset_type} |
George Keishing | c2b176e | 2019-03-02 23:31:30 -0600 | [diff] [blame] | 33 | ${resp}= redfish.Post ${target} body=&{payload} |
Sridevi Ramesh | 0047de8 | 2019-02-01 06:33:08 -0600 | [diff] [blame] | 34 | Should Be Equal As Strings ${resp.status} ${HTTP_OK} |
| 35 | redfish.Logout |
| 36 | |
| 37 | |
George Keishing | b10eaca | 2019-02-24 05:07:30 -0600 | [diff] [blame] | 38 | Redfish BMC Reset Operation |
| 39 | [Documentation] Do Redfish BMC reset operation. |
Sridevi Ramesh | 0047de8 | 2019-02-01 06:33:08 -0600 | [diff] [blame] | 40 | |
George Keishing | b10eaca | 2019-02-24 05:07:30 -0600 | [diff] [blame] | 41 | # Example: |
| 42 | # "Actions": { |
| 43 | # "#Manager.Reset": { |
| 44 | # "ResetType@Redfish.AllowableValues": [ |
| 45 | # "GracefulRestart" |
| 46 | # ], |
| 47 | # "target": "/redfish/v1/Managers/bmc/Actions/Manager.Reset" |
| 48 | # } |
| 49 | |
| 50 | redfish.Login |
George Keishing | c2b176e | 2019-03-02 23:31:30 -0600 | [diff] [blame] | 51 | ${target}= redfish_utils.Get Target Actions /redfish/v1/Managers/bmc/ Manager.Reset |
George Keishing | b10eaca | 2019-02-24 05:07:30 -0600 | [diff] [blame] | 52 | ${payload}= Create Dictionary ResetType=GracefulRestart |
George Keishing | c2b176e | 2019-03-02 23:31:30 -0600 | [diff] [blame] | 53 | ${resp}= redfish.Post ${target} body=&{payload} |
George Keishing | b10eaca | 2019-02-24 05:07:30 -0600 | [diff] [blame] | 54 | Should Be Equal As Strings ${resp.status} ${HTTP_OK} |
| 55 | redfish.Logout |