Add GetSupportedFirmwareUpdateMethods to redfish_facts/Update commands (#54268)

* Add GetSupportedFirmwareUpdateMethods to update category commands list

* Add condition when command == GetSupportedFirmwareUpdateMethods to call the forthcoming rf_utils function get_supported_firmware_update_methods

* Implement get_supporte_firmware_update_methods() in redfish_utils

* rename command to GetFirmwareUpdateCapabilities

* rename comand get_firmware_update_capabilities()

* Rename command get_firmware_update_capabilities()

* Group update protocols by the type of Action they are associated with.

* remove trailing whitespace

* Use safer method to get 'title' for each action type and its allowablevalues

* Add example to docstring for using GetFirmwareUpdateCapabilities

* fix line too long

* fix line too long and trailing whitespace

* Update redfish_utils.py

* remove trailing whitespace

* fix overindent

* Use self.update_uri instead of hard-coding '/redfish/v1' in get_firmware_update_capabilities()
This commit is contained in:
Xander Madsen 2019-04-30 08:53:54 -04:00 committed by John R Barker
commit 8cfc9e6d22
2 changed files with 42 additions and 5 deletions

View file

@ -137,6 +137,14 @@ EXAMPLES = '''
username: "{{ username }}"
password: "{{ password }}"
- name: Get firmware update capability information
redfish_facts:
category: Update
command: GetFirmwareUpdateCapabilities
baseuri: "{{ baseuri }}"
username: "{{ username }}"
password: "{{ password }}"
- name: Get all information available in all categories
redfish_facts:
category: all
@ -164,7 +172,7 @@ CATEGORY_COMMANDS_ALL = {
"GetBiosAttributes", "GetBootOrder"],
"Chassis": ["GetFanInventory", "GetPsuInventory", "GetChassisThermals"],
"Accounts": ["ListUsers"],
"Update": ["GetFirmwareInventory"],
"Update": ["GetFirmwareInventory", "GetFirmwareUpdateCapabilities"],
"Manager": ["GetManagerNicInventory", "GetLogs"],
}
@ -293,6 +301,8 @@ def main():
for command in command_list:
if command == "GetFirmwareInventory":
result["firmware"] = rf_utils.get_firmware_inventory()
elif command == "GetFirmwareUpdateCapabilities":
result["firmware_update_capabilities"] = rf_utils.get_firmware_update_capabilities()
elif category == "Manager":
# execute only if we find a Manager service resource