History log of /openbmc/bmcweb/features/redfish/lib/power_supply.hpp (Results 1 – 25 of 25)
Revision Date Author Comments
# f7e62c14 07-Sep-2025 Myung Bae <myungbae@us.ibm.com>

Use getAssetInfo util function

This commit is to use getAssetInfo utility function for GET AssetInfo in
various places like

- Chassis
- FabricAdapter
This will also include `Manufacturer` propert

Use getAssetInfo util function

This commit is to use getAssetInfo utility function for GET AssetInfo in
various places like

- Chassis
- FabricAdapter
This will also include `Manufacturer` property if available on dbus.
- Fan
- PCIeDevice
- PowerSupply
- Storage
- System

Tested:
- GET the above schemas
- Redfish Service Validator passes

Change-Id: I9d01d583212fe4916d5fdd144d2b8e52ad865d16
Signed-off-by: Myung Bae <myungbae@us.ibm.com>

show more ...


# 7066dc58 20-Aug-2024 Myung Bae <myungbae@us.ibm.com>

Implement LocationIndicatorActive for PowerSupplies

Implement LocationIndicatorActive for PowerSupplies schema to set/get
the status of the location LED for each power supply.[1] When working
with R

Implement LocationIndicatorActive for PowerSupplies

Implement LocationIndicatorActive for PowerSupplies schema to set/get
the status of the location LED for each power supply.[1] When working
with Redfish to get or set the "LocationIndicatorActive" property, the
initial step involves locating the corresponding LED group through the
"identifying" association.[2][3][4] Following this, we can proceed to
either get or set the "Asserted" property.[5]

[1] https://redfish.dmtf.org/schemas/v1/PowerSupply.v1_5_0.json
[2] https://github.com/openbmc/phosphor-dbus-interfaces/tree/master/yaml/xyz/openbmc_project/Led#dbus-interfaces-for-led-groups
[3] https://github.com/openbmc/docs/blob/master/architecture/LED-architecture.md#redfish
[4] https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/58299
[5] https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Led/Group.interface.yaml

Tested:
- Validator passes.
- Tested on p10bmc hardware simulator

1) Get LocationIndicatorActive
```
$ 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",
"LocationIndicatorActive": false,
...
}
```

We will see the powersupply0 identify led is false too.
```
$ busctl get-property xyz.openbmc_project.LED.GroupManager /xyz/openbmc_project/led/groups/powersupply0_identify xyz.openbmc_project.Led.Group Asserted
b false
```

2) Set LocationIndicatorActive to true
```
$ curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH -d '{"LocationIndicatorActive":true}' https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply0
```

Then we will see the powersupply0 location LED lit up, and the value
becomes true:
```
$ 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",
"LocationIndicatorActive": true,
...
}

$ busctl get-property xyz.openbmc_project.LED.GroupManager /xyz/openbmc_project/led/groups/powersupply0_identify xyz.openbmc_project.Led.Group Asserted
b true
```

3) Use set-property to change the value back to false
```
$ busctl set-property xyz.openbmc_project.LED.GroupManager /xyz/openbmc_project/led/groups/powersupply0_identify xyz.openbmc_project.Led.Group Asserted b false
$ busctl get-property xyz.openbmc_project.LED.GroupManager /xyz/openbmc_project/led/groups/powersupply0_identify xyz.openbmc_project.Led.Group Asserted
b false
```

Then we will see the value reflected in the Redfish query:
```
$ 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",
"LocationIndicatorActive": false,
...
}
```

4) Error returned when trying to set the value to non-boolean:
```
$ curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH -d '{"LocationIndicatorActive":"unknown"}' https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply0
{
"LocationIndicatorActive@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The value '\"unknown\"' for the property LocationIndicatorActive is not a type that the property can accept.",
"MessageArgs": [
"\"unknown\"",
"LocationIndicatorActive"
],
"MessageId": "Base.1.19.PropertyValueTypeError",
"MessageSeverity": "Warning",
"Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed."
}
]
}
```

5) Error returned when specifying a unknown power supply:
```
$ curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH -d '{"LocationIndicatorActive":true}' https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupplyBAD
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The requested resource of type PowerSupplies named 'powersupplyBAD' was not found.",
"MessageArgs": [
"PowerSupplies",
"powersupplyBAD"
],
"MessageId": "Base.1.19.ResourceNotFound",
"MessageSeverity": "Critical",
"Resolution": "Provide a valid resource identifier and resubmit the request."
}
],
"code": "Base.1.19.ResourceNotFound",
"message": "The requested resource of type PowerSupplies named 'powersupplyBAD' was not found."
}
}

6) Forced no LED group to test failure paths for GET/PATCH
/* GET succeeds with no LocationIndicatorActive */
$ curl -k -H "X-Auth-Token: $token" 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",
"EfficiencyRatings": [
{
"EfficiencyPercent": 90
}
],
"FirmwareVersion": "313033323330",
"Id": "powersupply0",
"Location": {
"PartLocation": {
"ServiceLabel": "U78DA.ND0.1234567-E0"
}
},
"Manufacturer": "",
"Model": "51E9",
"Name": "Power Supply",
"PartNumber": "revisio",
"SerialNumber": "YL10K serial",
"SparePartNumber": "c ",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}

/* PATCH fails when no LocationIndicatorActive property exists for
* object
*/
$ curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH -d '{"LocationIndicatorActive":true}' https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply0
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The property LocationIndicatorActive is not in the list of valid properties for the resource.",
"MessageArgs": [
"LocationIndicatorActive"
],
"MessageId": "Base.1.19.PropertyUnknown",
"MessageSeverity": "Warning",
"Resolution": "Remove the unknown property from the request body and resubmit the request if the operation failed."
}
],
"code": "Base.1.19.PropertyUnknown",
"message": "The property LocationIndicatorActive is not in the list of valid properties for the resource."
}
}
```

Signed-off-by: Chicago Duan <duanzhijia01@inspur.com>
Change-Id: Id0c30fa3d7c1e7ed4ff7f8fd1d5951d24053fbde
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
Signed-off-by: Janet Adkins <janeta@us.ibm.com>

show more ...


# 193582b6 31-Mar-2025 Myung Bae <myungbae@us.ibm.com>

Handle NotFound error for GetSubTreeById

Currently, PowerSupplies handling is done via `GetSubTreeById` and it
returns the success with the empty collection, even if the given chassis
is invalid.
``

Handle NotFound error for GetSubTreeById

Currently, PowerSupplies handling is done via `GetSubTreeById` and it
returns the success with the empty collection, even if the given chassis
is invalid.
```
GET /redfish/v1/Chassis/INVALID/PowerSubsystem/PowerSupplies
```

Once phosphor-objmgr is fixed by [1], the above URI will cause an
internalError.

This commit is to handle the case as NotFound error for the invalid
chassis with [1], and fixes the common error [2].

Tested:
- GET /redfish/v1/Chassis/INVALID/PowerSubsystem/PowerSupplies with
NotFound.
- Redfish Service Validator passes

[1] https://gerrit.openbmc.org/c/openbmc/phosphor-objmgr/+/79311
[2] https://github.com/openbmc/bmcweb/blob/master/COMMON_ERRORS.md#11-not-responding-to-404

Change-Id: I1d2d19b7da6c0ad3b6a8d3090eb035732ec2e3ca
Signed-off-by: Myung Bae <myungbae@us.ibm.com>

show more ...


# 3f95a277 13-Mar-2024 Myung Bae <112663928+baemyung@users.noreply.github.com>

Refactor chassisInterfaces into chassis_utils

Some (e.g. IBM) do not use the
`xyz.openbmc_project.Inventory.Item.Board` interface for chassis
objects. To handle the use pattern easier, this refactor

Refactor chassisInterfaces into chassis_utils

Some (e.g. IBM) do not use the
`xyz.openbmc_project.Inventory.Item.Board` interface for chassis
objects. To handle the use pattern easier, this refactors the Chassis
interface into one location and it is referenced from the needed places
(e.g. `getValidChassisPath()`).

Moreover, this part is repeated many times, which goes against best
practices.

Tested:
- GET Chassis related API and check they are the same as before
- Redfish Service Validator passes

Change-Id: Id4a51986262892c5dc81b1a3bc46fa5be7c0e9da
Signed-off-by: Myung Bae <myungbae@us.ibm.com>

show more ...


# 504af5a0 03-Feb-2025 Patrick Williams <patrick@stwcx.xyz>

clang-format: update latest spec and reformat

Copy the latest format file from the docs repository and apply.

Change-Id: I2f0b9d0fb6e01ed36a2f34c750ba52de3b6d15d1
Signed-off-by: Patrick Williams <p

clang-format: update latest spec and reformat

Copy the latest format file from the docs repository and apply.

Change-Id: I2f0b9d0fb6e01ed36a2f34c750ba52de3b6d15d1
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# d7857201 28-Jan-2025 Ed Tanous <etanous@nvidia.com>

Fix includes

Clang-tidy misc-include-cleaner appears to now be enforcing
significantly more headers than previously. That is overall a good
thing, but forces us to fix some issues. This commit is

Fix includes

Clang-tidy misc-include-cleaner appears to now be enforcing
significantly more headers than previously. That is overall a good
thing, but forces us to fix some issues. This commit is largely just
taking the clang-recommended fixes and checking them in. Subsequent
patches will fix the more unique issues.

Note, that a number of new ignores are added into the .clang-tidy file.
These can be cleaned up over time as they're understood. The majority
are places where boost includes a impl/x.hpp and x.hpp, but expects you
to use the later. include-cleaner opts for the impl, but it isn't clear
why.

Change-Id: Id3fdd7ee6df6c33b2fd35626898523048dd51bfb
Signed-off-by: Ed Tanous <etanous@nvidia.com>
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>

show more ...


# 40e9b92e 10-Sep-2024 Ed Tanous <etanous@nvidia.com>

Use SPDX identifiers

SPDX identifiers are simpler, and reduce the amount of cruft we have in
code files. They are recommended by linux foundation, and therefore we
should do as they allow.

This pa

Use SPDX identifiers

SPDX identifiers are simpler, and reduce the amount of cruft we have in
code files. They are recommended by linux foundation, and therefore we
should do as they allow.

This patchset does not intend to modify any intent on any existing
copyrights or licenses, only to standardize their inclusion.

[1] https://www.linuxfoundation.org/blog/blog/copyright-notices-in-open-source-software-projects

Change-Id: I935c7c0156caa78fc368c929cebd0f068031e830
Signed-off-by: Ed Tanous <etanous@nvidia.com>

show more ...


# deae6a78 11-Nov-2024 Ed Tanous <etanous@nvidia.com>

Move getProperty calls to utility

Having all dbus calls run through the same utility reduces the amount of
generated code, and more importantly, gives us a place where we can log
the requests and re

Move getProperty calls to utility

Having all dbus calls run through the same utility reduces the amount of
generated code, and more importantly, gives us a place where we can log
the requests and responses to help with debugging.

Tested: Redfish service validator passes.

Change-Id: Ic1bf45130b5069cd57f7af26e12c8d3159c87c67
Signed-off-by: Ed Tanous <etanous@nvidia.com>

show more ...


# d8e2b618 08-Oct-2024 Myung Bae <myungbae@us.ibm.com>

Fix PowerSupply GET error

The commit 3e42a3290ae35f05b30fa1863f44e95845577420[1] mistakenly
handled a check of then given powersupply id, and caused Redfish Service
Validator error.

Tested:
- Verif

Fix PowerSupply GET error

The commit 3e42a3290ae35f05b30fa1863f44e95845577420[1] mistakenly
handled a check of then given powersupply id, and caused Redfish Service
Validator error.

Tested:
- Verify GET
```
curl -k https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply0
```

- Redfish Service Validator on PowerSupplies passes
```
python3 RedfishServiceValidator.py --auth Session -i https://${bmc} -u ${user} -p ${password} \
--payload Tree /redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies
```

[1] https://github.com/openbmc/bmcweb/commit/3e42a3290ae35f05b30fa1863f44e95845577420

Change-Id: I9abfadc5f1ad5a0fd05e596190678aa804259045
Signed-off-by: Myung Bae <myungbae@us.ibm.com>

show more ...


# b5190062 10-Jul-2024 Hieu Huynh <hieuh@os.amperecomputing.com>

Support ProductionDate report

DSP0268 Redfish Data Model Specification provides ProductionDate
property for various schema. phosphor-dbus-interface [1] also
supports BuildDate property which we can

Support ProductionDate report

DSP0268 Redfish Data Model Specification provides ProductionDate
property for various schema. phosphor-dbus-interface [1] also
supports BuildDate property which we can map from FRU data, like
`Board Manufacturer Date`.
This adds code to support which gets the date from BuildDate
property and report via Redfish.

[1] https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Inventory/Decorator/Asset.interface.yaml#L16

Tested: Redfish Validator passes

Signed-off-by: Hieu Huynh <hieuh@os.amperecomputing.com>
Change-Id: Ie4ae564fa00218e7896f04ec61941fa92b23b912

show more ...


# 3e42a329 26-Jun-2024 Lakshmi Yadlapati <lakshmiy@us.ibm.com>

Refactor mapper calls to use getAssociatedSubTreePathsById

This commit refactors power_supply to use the new ObjectMapper method
`getAssociatedSubTreePathsById`. Replaced the two separate mapper cal

Refactor mapper calls to use getAssociatedSubTreePathsById

This commit refactors power_supply to use the new ObjectMapper method
`getAssociatedSubTreePathsById`. Replaced the two separate mapper calls
`getValidChassisPath` and `getAssociatedSubTreePaths` with one call to
`getAssociatedSubTreePathsById`.

Tested: Validator passed
1. List Powersupplies in the system

```
curl -k https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies
{
"@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies",
"@odata.type": "#PowerSupplyCollection.PowerSupplyCollection",
"Description": "The collection of PowerSupply resource instances.",
"Members": [
{
"@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply0"
},
{
"@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply1"
},
{
"@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply2"
},
{
"@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply3"
}
],
"Members@odata.count": 4,
"Name": "Power Supply Collection"
}
```

2. List powersupply0 properties

```
curl -k 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",
"EfficiencyRatings": [
{
"EfficiencyPercent": 90
}
],
"FirmwareVersion": "030303030303",
"Id": "powersupply0",
"Location": {
"PartLocation": {
"ServiceLabel": "U78DB.ND0.WZS002U-E0"
}
},
"LocationIndicatorActive": false,
"Manufacturer": "",
"Model": "2B1E",
"Name": "Power Supply",
"PartNumber": "03FP729",
"SerialNumber": "YL30NH1BN229",
"SparePartNumber": "03FP728",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
```

3. Error condition, list unknown powersupply

```
curl -k https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply8
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The requested resource of type PowerSupplies named 'powersupply8' was not found.",
"MessageArgs": [
"PowerSupplies",
"powersupply8"
],
"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 PowerSupplies named 'powersupply8' was not found."
}
}
```

4. Error condition, list unknown invalid chassis
```
curl -k https://${bmc}/redfish/v1/Chassis/InvalidChassis/PowerSubsystem/PowerSupplies/powersupply0
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The requested resource of type Chassis named 'InvalidChassis' was not found.",
"MessageArgs": [
"Chassis",
"InvalidChassis"
],
"MessageId": "Base.1.18.1.ResourceNotFound",
"MessageSeverity": "Critical",
"Resolution": "Provide a valid resource identifier and resubmit the request."
}
],
"code": "Base.1.18.1.ResourceNotFound",
"message": "The requested resource of type Chassis named 'InvalidChassis' was not found."
}
}
```

Change-Id: I07043b15cbfa0ac9a44cbf155fad3315eeacc859
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
Signed-off-by: Myung Bae <myungbae@us.ibm.com>

show more ...


# bd79bce8 16-Aug-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda forma

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

Change-Id: Iceec1dc95b6c908ec6c21fb40093de9dd18bf11a
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 539d8c6b 19-Jun-2024 Ed Tanous <ed@tanous.net>

Consistently use generated enumerations

This commit causes all of Redfish to use generated enum values for enum
types. Using generated code prevents problems, and makes it more clear
what types are

Consistently use generated enumerations

This commit causes all of Redfish to use generated enum values for enum
types. Using generated code prevents problems, and makes it more clear
what types are allowed.

Doing this found two places where we had structs that didn't fulfill the
schema. They have been commented, but will be fixed with a breaking
change at some point in the future.

Tested: WIP

Change-Id: I5fdd2f2dfb6ec05606a522e1f4e331f982c8e476
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# 5a39f77a 20-Oct-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: I2f9540cf0d545a2da4d6289fc87b754f684bc9a7
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 62598e31 17-Jul-2023 Ed Tanous <ed@tanous.net>

Replace logging with std::format

std::format is a much more modern logging solution, and gives us a lot
more flexibility, and better compile times when doing logging.

Unfortunately, given its level

Replace logging with std::format

std::format is a much more modern logging solution, and gives us a lot
more flexibility, and better compile times when doing logging.

Unfortunately, given its level of compile time checks, it needs to be a
method, instead of the stream style logging we had before. This
requires a pretty substantial change. Fortunately, this change can be
largely automated, via the script included in this commit under
scripts/replace_logs.py. This is to aid people in moving their
patchsets over to the new form in the short period where old patches
will be based on the old logging. The intention is that this script
eventually goes away.

The old style logging (stream based) looked like.

BMCWEB_LOG_DEBUG << "Foo " << foo;

The new equivalent of the above would be:
BMCWEB_LOG_DEBUG("Foo {}", foo);

In the course of doing this, this also cleans up several ignored linter
errors, including macro usage, and array to pointer deconstruction.

Note, This patchset does remove the timestamp from the log message. In
practice, this was duplicated between journald and bmcweb, and there's
no need for both to exist.

One design decision of note is the addition of logPtr. Because the
compiler can't disambiguate between const char* and const MyThing*, it's
necessary to add an explicit cast to void*. This is identical to how
fmt handled it.

Tested: compiled with logging meson_option enabled, and launched bmcweb

Saw the usual logging, similar to what was present before:
```
[Error include/webassets.hpp:60] Unable to find or open /usr/share/www/ static file hosting disabled
[Debug include/persistent_data.hpp:133] Restored Session Timeout: 1800
[Debug redfish-core/include/event_service_manager.hpp:671] Old eventService config not exist
[Info src/webserver_main.cpp:59] Starting webserver on port 18080
[Error redfish-core/include/event_service_manager.hpp:1301] inotify_add_watch failed for redfish log file.
[Info src/webserver_main.cpp:137] Start Hostname Monitor Service...
```
Signed-off-by: Ed Tanous <ed@tanous.net>

Change-Id: I86a46aa2454be7fe80df608cb7e5573ca4029ec8

show more ...


# ddceee07 05-Oct-2022 George Liu <liuxiwei@inspur.com>

Add efficiency percent for PowerSupply

This commit is to add EfficiencyRatings/EfficiencyPercent information
according to the Redfish PowerSupply schema.

In the PDI model, it is assumed that all po

Add efficiency percent for PowerSupply

This commit is to add EfficiencyRatings/EfficiencyPercent information
according to the Redfish PowerSupply schema.

In the PDI model, it is assumed that all power supplies have the same
Efficiency Rating. This implementation uses the
xyz.openbmc_project.Control.PowerSupplyAttributes interface for all
power supplies, similar to power.hpp.

ref: http://redfish.dmtf.org/schemas/v1/PowerSupply.v1_5_0.json

Tested: Validator passes
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",
"EfficiencyRatings": [
{
"EfficiencyPercent": 90
}
],
"FirmwareVersion": "383239323732",
"Id": "powersupply0",
"Location": {
"PartLocation": {
"ServiceLabel": "U78DA.ND0.WZS00F6-E0"
}
},
"Manufacturer": "",
"Model": "51E9",
"Name": "powersupply0",
"PartNumber": "03KP466",
"SerialNumber": "YL10KY26E073",
"SparePartNumber": "03FP378",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ic782676f9efb8434f1076e726ff0656d1c27d310
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>

show more ...


# 788fe6cf 21-Jun-2023 Lakshmi Yadlapati <lakshmiy@us.ibm.com>

Refactor powerSupplyPath association retrieval

Improved functionality for retrieving powered_by association endpoints
with the "xyz.openbmc_project.Inventory.Item.PowerSupply" interface.

This commi

Refactor powerSupplyPath association retrieval

Improved functionality for retrieving powered_by association endpoints
with the "xyz.openbmc_project.Inventory.Item.PowerSupply" interface.

This commit introduces an enhanced approach for obtaining the powered_by
association endpoints that specifically have the
"xyz.openbmc_project.Inventory.Item.PowerSupply" interface. The code now
utilizes the getAssociatedSubTreePaths() function, ensuring that only
endpoints representing power supplies are retrieved.

This updated functionality provides a more accurate and efficient method
for retrieving the relevant associations, filtering out any endpoints
that do not correspond to power supplies. This approach is particularly
beneficial in cases where the powered_by association may be used by
entities other than power supplies.

Refactor powerSupply list handling in powerSupply subsystem.

Tested: Validator Passed

'''
curl -k https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies
{
"@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies",
"@odata.type": "#PowerSupplyCollection.PowerSupplyCollection",
"Description": "The collection of PowerSupply resource instances.",
"Members": [
{
"@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply2"
},
{
"@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply3"
}
],
"Members@odata.count": 2,
"Name": "Power Supply Collection"
}
'''

Change-Id: Icb56621b578460e65380a633028269a7023c4674
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>

show more ...


# 44845e5f 05-Oct-2022 George Liu <liuxiwei@inspur.com>

Add ServiceLabel information for PowerSupply

This commit is to add Location/PartLocation/ServiceLabel information
according to the Redfish PowerSupply schema.
If the `xyz.openbmc_project.Inventory.D

Add ServiceLabel information for PowerSupply

This commit is to add Location/PartLocation/ServiceLabel information
according to the Redfish PowerSupply schema.
If the `xyz.openbmc_project.Inventory.Decorator.LocationCode`
interface does not exist, the ServiceLabel information property is
not displayed.

ref: http://redfish.dmtf.org/schemas/v1/PowerSupply.v1_5_0.json

Tested: Validator passes
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",
"FirmwareVersion": "383239323732",
"Id": "powersupply0",
"Location": {
"PartLocation": {
"ServiceLabel": "U78DA.ND0.WZS00F6-E0"
}
},
"Manufacturer": "",
"Model": "51E9",
"Name": "powersupply0",
"PartNumber": "03KP466",
"SerialNumber": "YL10KY26E073",
"SparePartNumber": "03FP378",
"Status": {
"Health": "OK"
}
}

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Icd0c21719bb01f481a8cd4c56bdb1a9ee047b047

show more ...


# a0dba87b 05-Oct-2022 George Liu <liuxiwei@inspur.com>

Add FirmwareVersion For PowerSupply

This commit is to add firmware version information according to the
Redfish PowerSupply schema.
If the `xyz.openbmc_project.Software.Version` interface does not
e

Add FirmwareVersion For PowerSupply

This commit is to add firmware version information according to the
Redfish PowerSupply schema.
If the `xyz.openbmc_project.Software.Version` interface does not
exist, the firmware version information property is not displayed.

ref: http://redfish.dmtf.org/schemas/v1/PowerSupply.v1_5_0.json

Tested: Validator passes
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",
"FirmwareVersion": "383239323732",
"Id": "powersupply0",
"Manufacturer": "",
"Model": "51E9",
"Name": "powersupply0",
"PartNumber": "03KP466",
"SerialNumber": "YL10KY26E073",
"SparePartNumber": "03FP378",
"Status": {
"Health": "OK"
}
}

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I3ced467faf49d08c46a8b9bb2aa722f35353c811

show more ...


# 2b45fb3b 05-Oct-2022 George Liu <liuxiwei@inspur.com>

Add asset information for PowerSupply

This commit is to add asset information according to the Redfish
PowerSupply schema.
If the `xyz.openbmc_project.Inventory.Decorator.Asset` interface does
not e

Add asset information for PowerSupply

This commit is to add asset information according to the Redfish
PowerSupply schema.
If the `xyz.openbmc_project.Inventory.Decorator.Asset` interface does
not exist, the asset information property is not displayed.

ref: http://redfish.dmtf.org/schemas/v1/PowerSupply.v1_5_0.json

Tested: Validator passes
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",
"Manufacturer": "",
"Model": "51E9",
"Name": "powersupply0",
"PartNumber": "03KP466",
"SerialNumber": "YL10KY26E073",
"SparePartNumber": "03FP378",
"Status": {
"Health": "OK"
}
}

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I83f1a9375f83e3470089cb2b5207db9665cc69df

show more ...


# 34dfcb94 05-Oct-2022 George Liu <liuxiwei@inspur.com>

Add Status information for Power Supply

This commit is to add PowerSupply State/Health status according to the
Redfish PowerSupply schema.

If the `xyz.openbmc_project.Inventory.Item`
interface does

Add Status information for Power Supply

This commit is to add PowerSupply State/Health status according to the
Redfish PowerSupply schema.

If the `xyz.openbmc_project.Inventory.Item`
interface does not exist, the state status property is set to
default "Present".

If the `xyz.openbmc_project.State.Decorator.OperationalStatus`
interface does not exist, the health status property is set to
default "OK".

ref: http://redfish.dmtf.org/schemas/v1/PowerSupply.v1_5_0.json

Code that updates the OperationalStatus for all the inventory
https://github.com/openbmc/openpower-vpd-parser/blob/ \
3fb026386546cfd288ab4f86156c9aa0ffa145d6/ibm_vpd_app.cpp#L620

Tested: Validator passes
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",
"Status": {
"Health": "OK"
"State": "Enabled"
}
}

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I121b665a4e605024644cc7c9392f88a71703481e
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>

show more ...


# 00ef5dc6 05-Oct-2022 George Liu <liuxiwei@inspur.com>

Implements PowerSupply schema

This commit implements the Redfish PowerSupply schema and populates
the PowerSupplyCollection members. The PowerSupply is a grandchild
of the PowerSubsystem. PowerSuppl

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>

show more ...


# ef4c65b7 24-Apr-2023 Ed Tanous <edtanous@google.com>

Boost::urls::format

Boost 1.82 dropped a lovely new toy, boost::urls::format, which is a lot
like our urlFromPieces method, but better in that it makes the resulting
uris more readable, and allows d

Boost::urls::format

Boost 1.82 dropped a lovely new toy, boost::urls::format, which is a lot
like our urlFromPieces method, but better in that it makes the resulting
uris more readable, and allows doing things like fragments in a single
line instead of multiple. We should prefer it in some cases.

Tested:
Redfish service validator passes.
Spot checks of URLs work as expected.
Unit tests pass.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ia7b38f0a95771c862507e7d5b4aa68aa1c98403c

show more ...


# 7a2bb2c9 10-Apr-2023 George Liu <liuxiwei@inspur.com>

Fix PowerSubsystem/PowerSupplies causing validator to fail

In the following commit[1], the member of Members was removed by
mistake, causing the validator to fail. This commit fixes this
problem.

R

Fix PowerSubsystem/PowerSupplies causing validator to fail

In the following commit[1], the member of Members was removed by
mistake, causing the validator to fail. This commit fixes this
problem.

Redfish validator failing with the following:

ERROR - Members: Mandatory prop does not exist

1 failMandatoryExist errors in
/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies
1 failMandatoryExist errors in
/redfish/v1/Chassis/motherboard/PowerSubsystem/PowerSupplies

[1] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/57668/26..29//COMMIT_MSG#b15

Tested: Validator passes

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I814e07d860422c5dce0fbb6267cb58dc07a74c31

show more ...


# a7210020 05-Oct-2022 George Liu <liuxiwei@inspur.com>

Implements PowerSupplies schema

This commit implements the Redfish PowerSupplyCollection at
/redfish/v1/Chassis/<chassis Id>/PowerSubsystem/PowerSupplies.
It shall contain an array of links to resou

Implements PowerSupplies schema

This commit implements the Redfish PowerSupplyCollection at
/redfish/v1/Chassis/<chassis Id>/PowerSubsystem/PowerSupplies.
It shall contain an array of links to resources of type PowerSupply
that represent the power supplies that provide power to this chassis.
For the association between power supply and chassis, refer to[1].

Also, the members property is implemented in the next commit with the
PowerSupply implementation, this is so the validator will pass.

[1] https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/57428

Tested: Validator passes
1. curl -k -H "X-Auth-Token: $token" -X GET
https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/
PowerSupplies
{
"@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/
PowerSupplies"
"@odata.type": "#PowerSupplyCollection.PowerSupplyCollection",
"Description": "The collection of PowerSupply resource instances
chassis",
"Members": [
],
"Members@odata.count": 0,
"Name": "Power Supply Collection"
}

2. Bad chassisId
curl -k -H "X-Auth-Token: $token" -X GET
https://${bmc}/redfish/v1/Chassis/chassisError/PowerSubsystem/
PowerSupplies
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The requested resource of type Chassis named
'chassisError' was not found.",
"MessageArgs": [
"Chassis",
"chassisError"
],
"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 Chassis named
'chassisError' was not found."
}
}

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I48e087d6fb52013e3a96b44391cc4d86049ac176

show more ...