summaryrefslogtreecommitdiff
path: root/http
diff options
context:
space:
mode:
authorLakshmi Yadlapati <lakshmiy@us.ibm.com>2023-06-08 12:37:18 +0300
committerEd Tanous <ed@tanous.net>2023-12-18 23:06:24 +0300
commit70c4d545817d83819f7f0cd571e0160bacb51d11 (patch)
tree3a513d1af3e29aa908c4d85fd161a87e0622d5b4 /http
parent75e8e218cbf9539144ee8f6aea01e158d0a9e190 (diff)
downloadbmcweb-70c4d545817d83819f7f0cd571e0160bacb51d11.tar.xz
Refactor PCIeDeviceList to use getCollectionMembers
This commit refactors the code in the PCIeDeviceList function to use the getCollectionMembers function for retrieving collection members. Additionally, a new function getCollectionToKey() is added to handle the retrieval of collection members with custom key name. Tested: Validator passed ''' Test1: Redfish query of PCI devices on a system that does not have any PCIe devices curl -k https://$bmc/redfish/v1/Systems/system/PCIeDevices { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices", "@odata.type": "#PCIeDeviceCollection.PCIeDeviceCollection", "Description": "Collection of PCIe Devices", "Members": [], "Members@odata.count": 0, "Name": "PCIe Device Collection" } Test2: Redfish query of PCIe devices on a system that has PCIe devices curl -k https://$bmc/redfish/v1/Systems/system/PCIeDevices { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices", "@odata.type": "#PCIeDeviceCollection.PCIeDeviceCollection", "Description": "Collection of PCIe Devices", "Members": [ { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/drive0" }, ....... { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card1" }, { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card2" }, ....... { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card12" } ], "Members@odata.count": 22, "Name": "PCIe Device Collection" } Test3: Redfish query of system with PCIe devices curl -k https://$bmc/redfish/v1/Systems/system { "@odata.id": "/redfish/v1/Systems/system", "@odata.type": "#ComputerSystem.v1_16_0.ComputerSystem", "Actions": { "#ComputerSystem.Reset": { "@Redfish.ActionInfo": "/redfish/v1/Systems/system/ResetActionInfo", "target": "/redfish/v1/Systems/system/Actions/ComputerSystem.Reset" } }, ...... "PCIeDevices": [ { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/drive0" }, ....... { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card1" }, .... ], "PCIeDevices@odata.count": 22, "PartNumber": "", .... "SubModel": "S0", "SystemType": "Physical" } ''' Change-Id: Icb38945a2c7bc5219ff3917fbbc8a9986c9c6155 Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
Diffstat (limited to 'http')
0 files changed, 0 insertions, 0 deletions