mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 10:51:24 -07:00
[PR #9837/abe4e5ce backport][stable-10] Redfish: implement setting PowerRestorePolicy (#9878)
Redfish: implement setting PowerRestorePolicy (#9837)
This property ("The desired power state of the system when power is
restored after a power loss.") was added in ComputerSystem.v1_6_0 which
became part of 2018.3 Redfish release.
Tested against an OpenBMC system running bmcweb Redfish server making sure the
policy is updated only when needed and that errors and messages are propogated
properly.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
(cherry picked from commit abe4e5ce95
)
Co-authored-by: Paul Fertser <fercerpav@gmail.com>
This commit is contained in:
parent
cee6c98d2a
commit
2583152512
3 changed files with 32 additions and 1 deletions
|
@ -3983,3 +3983,7 @@ class RedfishUtils(object):
|
|||
|
||||
def get_multi_power_restore_policy(self):
|
||||
return self.aggregate_systems(self.get_power_restore_policy)
|
||||
|
||||
def set_power_restore_policy(self, policy):
|
||||
body = {'PowerRestorePolicy': policy}
|
||||
return self.patch_request(self.root_uri + self.systems_uri, body, check_pyld=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue