From 00ef5dc6d410ab83302529f23919b3d91a35b5e3 Mon Sep 17 00:00:00 2001 From: George Liu Date: Wed, 5 Oct 2022 16:27:52 +0800 Subject: Implements PowerSupply schema This commit implements the Redfish PowerSupply schema and populates the PowerSupplyCollection members. The PowerSupply is a grandchild of the PowerSubsystem. PowerSupply is part of the new PowerSubsystme/ThermalSubsystem schemas, released in Redfish Version 2020.4. This commit only displays the PowerSupplies in the chassis with common fields like odata.id, odata.type, Id, and Name. Future commits will add PowerSupply properties like FirmwareVersion, LocationIndicatorActive, Status, and Asset information like SerialNumber, PartNumber, Model. This commit looks at the powered_by association from Inventory.Item.Chassis to Inventory.Item.PowerSupply to find a PowerSupply [1]. [1] https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/58609 Tested: Validator passes 1. curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/ PowerSupplies/powersupply0 { "@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/ PowerSupplies/powersupply0", "@odata.type": "#PowerSupply.v1_5_0.PowerSupply", "Id": "powersupply0", "Name": "powersupply0" } 2. Bad power supply name curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/ PowerSupplies/ERROR { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type PowerSupply named 'ERROR' was not found.", "MessageArgs": [ "PowerSupply", "ERROR" ], "MessageId": "Base.1.13.0.ResourceNotFound", "MessageSeverity": "Critical", "Resolution": "Provide a valid resource identifier and resubmit the request." } ], "code": "Base.1.13.0.ResourceNotFound", "message": "The requested resource of type PowerSupply named 'ERROR' was not found." } } Signed-off-by: George Liu Change-Id: I7b7c0e40c090a3f253f1a778edbe36be9b4317b0 Signed-off-by: Lakshmi Yadlapati --- redfish-core/include/redfish.hpp | 1 + 1 file changed, 1 insertion(+) (limited to 'redfish-core/include/redfish.hpp') diff --git a/redfish-core/include/redfish.hpp b/redfish-core/include/redfish.hpp index ce09531c42..2bf0f4578e 100644 --- a/redfish-core/include/redfish.hpp +++ b/redfish-core/include/redfish.hpp @@ -91,6 +91,7 @@ class RedfishService #ifdef BMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM requestRoutesEnvironmentMetrics(app); requestRoutesPowerSubsystem(app); + requestRoutesPowerSupply(app); requestRoutesPowerSupplyCollection(app); requestRoutesThermalSubsystem(app); #endif -- cgit v1.2.3