mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 12:21:26 -07:00
* Add GetManagerInventory command to redfish_info
Adding GetManagerInventory command to redfish_info, similar to
GetSystemInventory to report Manager specific information like:
- FirmwareVersion
- Model
- ManagerType
Fixes #4899
* Update changelogs/fragments/4899-add-GetManagerInventory-for-redfish_info.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 93dcd3f54d
)
Co-authored-by: Jacob Yundt <jyundt@gmail.com>
This commit is contained in:
parent
b78c0cf64f
commit
91fe881226
3 changed files with 36 additions and 1 deletions
|
@ -3029,3 +3029,26 @@ class RedfishUtils(object):
|
|||
if not result["entries"]:
|
||||
return {'ret': False, 'msg': "No HostInterface objects found"}
|
||||
return result
|
||||
|
||||
def get_manager_inventory(self, manager_uri):
|
||||
result = {}
|
||||
inventory = {}
|
||||
# Get these entries, but does not fail if not found
|
||||
properties = ['FirmwareVersion', 'ManagerType', 'Manufacturer', 'Model',
|
||||
'PartNumber', 'PowerState', 'SerialNumber', 'Status', 'UUID']
|
||||
|
||||
response = self.get_request(self.root_uri + manager_uri)
|
||||
if response['ret'] is False:
|
||||
return response
|
||||
result['ret'] = True
|
||||
data = response['data']
|
||||
|
||||
for property in properties:
|
||||
if property in data:
|
||||
inventory[property] = data[property]
|
||||
|
||||
result["entries"] = inventory
|
||||
return result
|
||||
|
||||
def get_multi_manager_inventory(self):
|
||||
return self.aggregate_managers(self.get_manager_inventory)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue