diff options
author | George Liu <liuxiwei@inspur.com> | 2022-10-05 11:27:52 +0300 |
---|---|---|
committer | Lakshmi Yadlapati <lakshmiy@us.ibm.com> | 2023-05-18 17:10:08 +0300 |
commit | 00ef5dc6d410ab83302529f23919b3d91a35b5e3 (patch) | |
tree | c9fbcbb028401841bcebca9c1bee68afb2dace37 /redfish-core/include/redfish.hpp | |
parent | 78e3900f9156f056d7f9f5c9e2b6ae0abd2c6b0f (diff) | |
download | bmcweb-00ef5dc6d410ab83302529f23919b3d91a35b5e3.tar.xz |
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 <liuxiwei@inspur.com>
Change-Id: I7b7c0e40c090a3f253f1a778edbe36be9b4317b0
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
Diffstat (limited to 'redfish-core/include/redfish.hpp')
-rw-r--r-- | redfish-core/include/redfish.hpp | 1 |
1 files changed, 1 insertions, 0 deletions
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 |