WDC Redfish support for setting the power mode. (#5145) (#5223)

* WDC Redfish support for setting the power mode.

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

* Add change fragment.

* Add extension to changelog fragment.

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 2a449eb163)

Co-authored-by: Mike Moerk <michael.moerk@wdc.com>
This commit is contained in:
patchback[bot] 2022-09-03 12:51:31 +02:00 committed by GitHub
parent 73ee9702db
commit b32b69742b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 164 additions and 13 deletions

View file

@ -170,6 +170,18 @@ EXAMPLES = '''
username: "{{ username }}"
password: "{{ password }}"
- name: Set chassis to Low Power Mode
community.general.wdc_redfish_command:
category: Chassis
resource_id: Enclosure
command: PowerModeLow
- name: Set chassis to Normal Power Mode
community.general.wdc_redfish_command:
category: Chassis
resource_id: Enclosure
command: PowerModeNormal
'''
RETURN = '''
@ -191,7 +203,9 @@ CATEGORY_COMMANDS_ALL = {
],
"Chassis": [
"IndicatorLedOn",
"IndicatorLedOff"
"IndicatorLedOff",
"PowerModeLow",
"PowerModeNormal",
]
}
@ -304,6 +318,8 @@ def main():
for command in command_list:
if command.startswith("IndicatorLed"):
result = rf_utils.manage_chassis_indicator_led(command)
elif command.startswith("PowerMode"):
result = rf_utils.manage_chassis_power_mode(command)
if result['ret'] is False:
module.fail_json(msg=to_native(result['msg']))