summaryrefslogtreecommitdiff
path: root/redfish-core/include
AgeCommit message (Collapse)AuthorFilesLines
17 hoursutils: add PrettyName utility functionAkash Arunkumar1-0/+93
Create a reusable utility function getPrettyName() in utils/name_utils.hpp that can retrieve the PrettyName property from the D-Bus xyz.openbmc_project.Inventory.Item interface. The function accepts a JSON pointer parameter, allowing it to set the PrettyName at any location in the response (e.g. within arrays or nested objects). This makes it reusable across multiple components (Drives, Processors, Memory, Chassis, etc.). Relates-to: https://github.com/openbmc/bmcweb/issues/204 Tested: - Built bmcweb with meson/ninja successfully - Tested with https://gerrit.openbmc.org/c/openbmc/bmcweb/+/90364 and verified that PrettyName appears in the response - Falls back to default name when PrettyName is empty Change-Id: Iebd31b523797152b0e8e7ea8852f86b292fb5f55 Signed-off-by: Akash Arunkumar <mirrorghost007@gmail.com> Signed-off-by: Justin Nguyen <justinnanguyen@gmail.com>
23 hoursredfish-core: Refactor getSnmpTrapClient lambdaYuvakumar Selvamani1-38/+40
Extract the long D-Bus GetManagedObjects callback lambda in getSnmpTrapClient() into a named function, afterGetSnmpTrapClient(), per the <10 line lambda coding standard in docs/COMMON_ERRORS.md. Call it via dbus::utility::getManagedObjects() and std::bind_front(), matching the pattern used by other GetManagedObjects call sites in the codebase. afterGetSnmpTrapClient() takes the GetManagedObjects result by const reference (const dbus::utility::ManagedObjectType& resp), since the callback only reads it. Tested on AST2600 SoC (live D-Bus tested, phosphor-snmp installed). - `GET /redfish/v1/EventService/Subscriptions/snmpbogus` (no matching D-Bus object) Expected: HTTP 404 Base.1.19.ResourceNotFound Actual: HTTP 404 Base.1.19.ResourceNotFound - `POST /redfish/v1/EventService/Subscriptions` with `{"Destination": "snmp://192.168.1.77:162", "Protocol": "SNMPv2c", "SubscriptionType": "SNMPTrap"}`, creating a real SNMP trap client on D-Bus (id snmp1) Expected: HTTP 201 Base.1.19.Created Actual: HTTP 201 Base.1.19.Created - `GET /redfish/v1/EventService/Subscriptions/snmp1` Expected: HTTP 200 with Destination matching the created client Actual: HTTP 200, "Destination": "snmp://192.168.1.77:162" - confirms afterGetSnmpTrapClient() correctly walks the real GetManagedObjects result (now via const&) and matches the id. - Redfish Service Validator: 5840 Pass / 353 Warn / 0 Fail Change-Id: I661d147f4639b05b87b586d3b1322a9ad3912958 Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
12 daysRefactor eventlog_utils respHandler lambdasYuvakumar Selvamani1-42/+50
The dBusEventLogEntryDelete and dBusLogServiceActionsClear functions each contained an inline respHandler lambda that triggered the long-lambda ast-grep rule, requiring an inline suppression (// ast-grep-ignore: long-lambda). This commit extracts each lambda into a separate named function, afterDBusEventLogEntryDelete and afterDBusLogServiceActionsClear respectively, and uses std::bind_front to handle the asynchronous callback. This aligns the code with the preferred bmcweb pattern for D-Bus callbacks, improves readability, and allows the removal of the static analysis suppressions. Tested on AST2600 SoC (with PACKAGECONFIG `redfish-dbus-log` enabled; disabled by default). - `DELETE .../EventLog/Entries/1` (real entry) Expected: HTTP 200 Base.1.19.Success, entry removed Actual: HTTP 200 Base.1.19.Success, entry removed - `DELETE .../EventLog/Entries/999` (nonexistent) Expected: HTTP 404 Base.1.19.ResourceNotFound Actual: HTTP 404 Base.1.19.ResourceNotFound - `POST .../EventLog/Actions/LogService.ClearLog` Expected: HTTP 200 Base.1.19.Success, all entries cleared Actual: HTTP 200 Base.1.19.Success, all entries cleared - RSV: 5845 Pass / 353 Warn / 0 Fail Change-Id: I323a0813fef4f04622a71f27258fe9b1930ec6cd Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
14 dayssubprocessor: Add Status.State/Health to coresGeorge Liu1-0/+62
Populate Redfish Status.Health and Status.State for processor core resources resource_utils::getResourceState() and getResourceHealth() are extended to accept MapperServiceMap and use the first service implementing the required interface. This avoids duplicate requests when multiple services advertise the same interface for a core object This commit also changes the iterator name in HEAD and GET path from `it` to `coreIt` for better readability as well as passing coreId by reference to avoid copies Tested: ``` curl -k -X GET https://${bmc}/redfish/v1/Systems/system/Processors/cpu0/SubProcessors/core0 { ... "Status": { "Health": "OK", "State": "Enabled" } } ``` - Where "State" can be "Present", "Available", "Enabled" - Redfish Validator Passed Change-Id: I5833541dceb9627b56b96e8235afcde78a09081f Signed-off-by: Myung Bae <myungbae@us.ibm.com> Signed-off-by: Justin Nguyen <justinnanguyen@gmail.com>
2026-09-09Refactor remaining lambdas in dump utilityOliver Brewka1-221/+231
Remove all remaining lambdas violating the lambda length rule. Tested: Code compiles. Validator was run on romulus in qemu with phosphor-debug-collector ibm extension enabled to get access to /xyz/openbmc_project/dump/system. Via the 'CreateDump' method empty dump entries were manually created for: /xyz/openbmc_project/dump/system /xyz/openbmc_project/dump/bmc /xyz/openbmc_project/dump/faultlog ``` busctl call xyz.openbmc_project.Dump.Manager /xyz/openbmc_project/dump/bmc \ xyz.openbmc_project.Dump.Create CreateDump a{sv} 0 > o "/xyz/openbmc_project/dump/bmc/entry/1" busctl tree xyz.openbmc_project.Dump.Manager `- /xyz `- /xyz/openbmc_project `- /xyz/openbmc_project/dump |- /xyz/openbmc_project/dump/bmc | `- /xyz/openbmc_project/dump/bmc/entry | `- /xyz/openbmc_project/dump/bmc/entry/1 |- /xyz/openbmc_project/dump/faultlog | `- /xyz/openbmc_project/dump/faultlog/entry | `- /xyz/openbmc_project/dump/faultlog/entry/1 |- /xyz/openbmc_project/dump/resource `- /xyz/openbmc_project/dump/system `- /xyz/openbmc_project/dump/system/entry `- /xyz/openbmc_project/dump/system/entry/1 ``` Overwrite OperationStatus of /xyz/openbmc_project/dump/system/entry/1 for the entry to be added to the collection: ``` busctl set-property xyz.openbmc_project.Dump.Manager \ /xyz/openbmc_project/dump/system/entry/1 \ xyz.openbmc_project.Common.Progress Status \ s xyz.openbmc_project.Common.Progress.OperationStatus.Completed \ ``` Systems/Dump Validating /redfish/v1/Systems/system/LogServices/Dump... - Pass: 14, Warn: 0, Fail: 0, Skip: 9 Validating /redfish/v1/Systems/system/LogServices/Dump/Entries... - Pass: 17, Warn: 0, Fail: 0, Skip: 30 Validating /redfish/v1/Systems/system/LogServices/Dump/Entries/1... - Pass: 10, Warn: 0, Fail: 0, Skip: 26 +--------------+--------------+--------------+--------------+ | PASS | WARN | FAIL | NOT TESTED | +--------------+--------------+--------------+--------------+ | 41 | 0 | 0 | 65 | +--------------+--------------+--------------+--------------+ Managers/Dump Validating /redfish/v1/Managers/bmc/LogServices/Dump... - Pass: 14, Warn: 0, Fail: 0, Skip: 9 Validating /redfish/v1/Managers/bmc/LogServices/Dump/Entries... - Pass: 26, Warn: 0, Fail: 0, Skip: 58 Validating /redfish/v1/Managers/bmc/LogServices/Dump/Entries/1... - Pass: 9, Warn: 0, Fail: 0, Skip: 27 Validating /redfish/v1/Managers/bmc/LogServices/Dump/Entries/2... - Pass: 9, Warn: 0, Fail: 0, Skip: 27 +--------------+--------------+--------------+--------------+ | PASS | WARN | FAIL | NOT TESTED | +--------------+--------------+--------------+--------------+ | 58 | 0 | 0 | 121 | +--------------+--------------+--------------+--------------+ Managers/FaultLog Validating /redfish/v1/Managers/bmc/LogServices/FaultLog... - Pass: 12, Warn: 0, Fail: 0, Skip: 9 Validating /redfish/v1/Managers/bmc/LogServices/FaultLog/Entries... - Pass: 13, Warn: 0, Fail: 0, Skip: 34 Validating /redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/1... - Pass: 6, Warn: 0, Fail: 0, Skip: 30 +--------------+--------------+--------------+--------------+ | PASS | WARN | FAIL | NOT TESTED | +--------------+--------------+--------------+--------------+ | 31 | 0 | 0 | 73 | +--------------+--------------+--------------+--------------+ Change-Id: Iaac0b9b14b898b079765eb18f513aaea3c417740 Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
2026-09-07Inline dump util functionOliver Brewka1-1/+1
It should be avoided using static for header only functions. Tested: Code compiles. Change-Id: Icb944588fc6f64c663960bf40da29e2de9e0b8bd Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
2026-09-07Fix createDump progress logicOliver Brewka1-4/+2
The current logic in createDump always sets the isProgressIntfPresent flag to true, even if it is not present at all. It breaks out of the search loop on the first interface that may not be xyz.openbmc_project.Common.Progress. This can cause a task to time out and not be handled properly since completion is only reported when the Progress interface a) exists and b) reports Status=Completed. Tested: Manually tested on romulus running in qemu with ibm dump extension enabled. POST request to Managers/Dump action ``` curl -v -k POST 'https://localhost:44443/redfish/v1/Managers/bmc/ LogServices/Dump/Actions/LogService.CollectDiagnosticData' \ -H 'X-Auth-Token: '"$BMCWEB_SESSION_TOKEN_ROML"'' \ -H "Content-Type: application/json" -d \ '{"DiagnosticDataType":"Manager", \ "OEMDiagnosticDataType":"Manager"}' { "@odata.id": "/redfish/v1/TaskService/Tasks/2", "@odata.type": "#Task.v1_4_3.Task", "HidePayload": false, "Id": "2", "Messages": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The task with Id '2' has started.", "MessageArgs": [ "2" ], "MessageId": "TaskEvent.1.0.TaskStarted", "MessageSeverity": "OK", "Resolution": "None." } ], "Name": "Task 2", "Payload": { "HttpHeaders": [ "user-agent: curl/8.20.0", "accept: */*", "content-length: 66" ], "HttpOperation": "POST", "JsonBody": "{\"DiagnosticDataType\":\"Manager\",\"OEMDiagnosticDataType\":\"Manager\"}", "TargetUri": "/redfish/v1/Managers/bmc/LogServices/Dump/Actions/LogService.CollectDiagnosticData" }, "PercentComplete": 0, "StartTime": "2026-09-07T15:10:26+00:00", "TaskMonitor": "/redfish/v1/TaskService/TaskMonitors/2", "TaskState": "Running", "TaskStatus": "OK" * Connection #1 to host localhost:44443 left intact } ``` dbus tree dump manager ``` busctl tree xyz.openbmc_project.Dump.Manager `- /xyz `- /xyz/openbmc_project `- /xyz/openbmc_project/dump |- /xyz/openbmc_project/dump/bmc | `- /xyz/openbmc_project/dump/bmc/entry | |- /xyz/openbmc_project/dump/bmc/entry/1 | |- /xyz/openbmc_project/dump/bmc/entry/2 | `- /xyz/openbmc_project/dump/bmc/entry/3 |- /xyz/openbmc_project/dump/faultlog |- /xyz/openbmc_project/dump/resource `- /xyz/openbmc_project/dump/system `- /xyz/openbmc_project/dump/system/entry |- /xyz/openbmc_project/dump/system/entry/1 `- /xyz/openbmc_project/dump/system/entry/2 ``` bmcweb debug log ``` Sep 07 15:11:02 romulus bmcweb[200]: [dump_utils.hpp:655] /xyz/openbmc_project/dump/bmc/entry/3: Dump creation task is in progress Sep 07 15:11:02 romulus bmcweb[200]: [dump_utils.hpp:655] /xyz/openbmc_project/dump/bmc/entry/3: Dump creation task is in progress Sep 07 15:11:02 romulus bmcweb[200]: [dump_utils.hpp:679] /xyz/openbmc_project/dump/bmc/entry/3: Dump creation task completed ``` Systems/Dump Set machine state to Quiesced ``` busctl set-property xyz.openbmc_project.State.Host0 \ /xyz/openbmc_project/state/host0 \ xyz.openbmc_project.State.Host CurrentHostState \ s "xyz.openbmc_project.State.Host.HostState.Quiesced" ``` POST request to Systems/Dump action ``` curl -v -k POST 'https://localhost:44443/redfish/v1/Systems/system/ LogServices/Dump/Actions/LogService.CollectDiagnosticData' \ -H 'X-Auth-Token: '"$BMCWEB_SESSION_TOKEN_ROML"'' \ -H "Content-Type: application/json" -d \ '{"DiagnosticDataType":"OEM", \ "OEMDiagnosticDataType":"Systems"}' { "@odata.id": "/redfish/v1/TaskService/Tasks/3", "@odata.type": "#Task.v1_4_3.Task", "HidePayload": false, "Id": "3", "Messages": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The task with Id '3' has started.", "MessageArgs": [ "3" ], "MessageId": "TaskEvent.1.0.TaskStarted", "MessageSeverity": "OK", "Resolution": "None." } ], "Name": "Task 3", "Payload": { "HttpHeaders": [ "user-agent: curl/8.20.0", "accept: */*", "content-length: 61" ], "HttpOperation": "POST", "JsonBody": "{\"DiagnosticDataType\":\"OEM\",\"OEMDiagnosticDataType\":\"System\"}", "TargetUri": "/redfish/v1/Systems/system/LogServices/Dump/Actions/LogService.CollectDiagnosticData" }, "PercentComplete": 0, "StartTime": "2026-09-07T15:14:53+00:00", "TaskMonitor": "/redfish/v1/TaskService/TaskMonitors/3", "TaskState": "Running", "TaskStatus": "OK" * Connection #1 to host localhost:44443 left intact } busctl tree xyz.openbmc_project.Dump.Manager `- /xyz `- /xyz/openbmc_project `- /xyz/openbmc_project/dump |- /xyz/openbmc_project/dump/bmc | `- /xyz/openbmc_project/dump/bmc/entry | |- /xyz/openbmc_project/dump/bmc/entry/1 | |- /xyz/openbmc_project/dump/bmc/entry/2 | |- /xyz/openbmc_project/dump/bmc/entry/3 | `- /xyz/openbmc_project/dump/bmc/entry/4 |- /xyz/openbmc_project/dump/faultlog |- /xyz/openbmc_project/dump/resource `- /xyz/openbmc_project/dump/system `- /xyz/openbmc_project/dump/system/entry |- /xyz/openbmc_project/dump/system/entry/1 |- /xyz/openbmc_project/dump/system/entry/2 `- /xyz/openbmc_project/dump/system/entry/3 ``` Set /xyz/openbmc_project/dump/system/entry/3 status to Completed ``` busctl set-property xyz.openbmc_project.Dump.Manager \ /xyz/openbmc_project/dump/system/entry/3 \ xyz.openbmc_project.Common.Progress Status \ s "xyz.openbmc_project.Common.Progress.OperationStatus.Completed" journalctl -u bmcewb Sep 07 15:17:24 romulus bmcweb[200]: [dump_utils.hpp:679] /xyz/openbmc_project/dump/system/entry/3: Dump creation task completed ``` Change-Id: I8efc2588e31d9b838b6a4bf1d33f08b589ed5808 Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
2026-09-07Refactor createDump functionOliver Brewka1-169/+176
The function as well as the task callback consisted of multiple lambdas that exceeded the lambda length rule. Extract each lambda into separate functions. Tested: Code compiles. Manually tested on romulus running in qemu with ibm dump extension enabled. POST Managers/bmc ``` curl -v -k POST 'https://localhost:44443/redfish/v1/Managers/bmc/ LogServices/Dump/Actions/LogService.CollectDiagnosticData' \ -H 'X-Auth-Token: '"$BMCWEB_SESSION_TOKEN_ROML"'' \ -H "Content-Type: application/json" -d \ '{"DiagnosticDataType":"Manager", \ "OEMDiagnosticDataType":"Manager"}' { "@odata.id": "/redfish/v1/TaskService/Tasks/0", "@odata.type": "#Task.v1_4_3.Task", "HidePayload": false, "Id": "0", "Messages": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The task with Id '0' has started.", "MessageArgs": [ "0" ], "MessageId": "TaskEvent.1.0.TaskStarted", "MessageSeverity": "OK", "Resolution": "None." } ], "Name": "Task 0", "Payload": { "HttpHeaders": [ "user-agent: curl/8.20.0", "accept: */*", "content-length: 68" ], "HttpOperation": "POST", "JsonBody": "{\"DiagnosticDataType\":\"Manager\", \"OEMDiagnosticDataType\":\"Manager\"}", "TargetUri": "/redfish/v1/Managers/bmc/LogServices/Dump/Actions/ LogService.CollectDiagnosticData" }, "PercentComplete": 0, "StartTime": "2026-09-01T03:39:42-07:00", "TaskMonitor": "/redfish/v1/TaskService/TaskMonitors/0", "TaskState": "Running", "TaskStatus": "OK" * Connection #1 to host localhost:4343 left intact } ``` bmcweb log output: ``` Sep 01 14:58:28 romulus bmcweb[200]: [dump_utils.hpp:720] Dump Created. Path: /xyz/openbmc_project/dump/bmc/entry/2 ... Sep 01 14:58:53 romulus bmcweb[200]: [dump_utils.hpp:564] /xyz/ openbmc_project/dump/bmc/entry/2: Dump creation task is in progress Sep 01 14:58:53 romulus bmcweb[200]: [dump_utils.hpp:564] /xyz/ openbmc_project/dump/bmc/entry/2: Dump creation task is in progress Sep 01 14:58:53 romulus bmcweb[200]: [dump_utils.hpp:588] /xyz/ openbmc_project/dump/bmc/entry/2: Dump creation task completed ``` dump/bmc tree after two POST request ``` busctl tree xyz.openbmc_project.Dump.Manager `- /xyz `- /xyz/openbmc_project `- /xyz/openbmc_project/dump |- /xyz/openbmc_project/dump/bmc | `- /xyz/openbmc_project/dump/bmc/entry | |- /xyz/openbmc_project/dump/bmc/entry/1 | |- /xyz/openbmc_project/dump/bmc/entry/2 |- /xyz/openbmc_project/dump/faultlog |- /xyz/openbmc_project/dump/resource `- /xyz/openbmc_project/dump/system ``` POST Systems/system CreateDump only works if the host is either in "Running", "Quiesced" or "TransitioningToOff" state. ``` busctl set-property xyz.openbmc_project.State.Host0 /xyz/openbmc_project/state/host0 \ xyz.openbmc_project.State.Host \ CurrentHostState \ s "xyz.openbmc_project.State.Host.HostState.Quiesced" ``` ``` curl -v -k POST 'https://localhost:44443/redfish/v1/Systems/system/ LogServices/Dump/Actions/LogService.CollectDiagnosticData' \ -H 'X-Auth-Token: '"$BMCWEB_SESSION_TOKEN_ROML"'' \ -H "Content-Type: application/json" -d \ '{"DiagnosticDataType":"OEM", "OEMDiagnosticDataType":"System"}' { "@odata.id": "/redfish/v1/TaskService/Tasks/2", "@odata.type": "#Task.v1_4_3.Task", "HidePayload": false, "Id": "2", "Messages": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The task with Id '2' has started.", "MessageArgs": [ "2" ], "MessageId": "TaskEvent.1.0.TaskStarted", "MessageSeverity": "OK", "Resolution": "None." } ], "Name": "Task 2", "Payload": { "HttpHeaders": [ "user-agent: curl/8.20.0", "accept: */*", "content-length: 62" ], "HttpOperation": "POST", "JsonBody": "{\"DiagnosticDataType\":\"OEM\", \"OEMDiagnosticDataType\":\"System\"}", "TargetUri": "/redfish/v1/Systems/system/LogServices/Dump/Actions/ LogService.CollectDiagnosticData" }, "PercentComplete": 0, "StartTime": "2026-09-01T03:54:01-07:00", "TaskMonitor": "/redfish/v1/TaskService/TaskMonitors/2", "TaskState": "Running", "TaskStatus": "OK" * Connection #1 to host localhost:4343 left intact } ``` Set system dump entry to completed: ``` busctl set-property xyz.openbmc_project.Dump.Manager /xyz/ openbmc_project/dump/system/entry/1 \ xyz.openbmc_project.Common.Progress Status \ s "xyz.openbmc_project.Common.Progress.OperationStatus.Completed" ``` bmcweb log output: ``` Sep 02 11:26:44 romulus bmcweb[200]: [dump_utils.hpp:804] Dump Created. Path: /xyz/openbmc_project/dump/system/entry/1 ... Sep 02 11:28:13 romulus bmcweb[200]: [dump_utils.hpp:672] /xyz/ openbmc_project/dump/system/entry/1: Dump creation task completed ``` busctl tree xyz.openbmc_project.Dump.Manager ``` `- /xyz `- /xyz/openbmc_project `- /xyz/openbmc_project/dump |- /xyz/openbmc_project/dump/bmc | `- /xyz/openbmc_project/dump/bmc/entry | |- /xyz/openbmc_project/dump/bmc/entry/1 | |- /xyz/openbmc_project/dump/bmc/entry/2 |- /xyz/openbmc_project/dump/faultlog |- /xyz/openbmc_project/dump/resource `- /xyz/openbmc_project/dump/system `- /xyz/openbmc_project/dump/system/entry `- /xyz/openbmc_project/dump/system/entry/1 ``` Change-Id: Id48b4643fcb634405b06db928e9a5c9d951f3ee4 Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
2026-09-03Fix unchecked optional value in dump createTaskOliver Brewka1-2/+10
In order to silence clang-tidy, check payload value. Tested: Code compiles. clang-tidy runs through. Change-Id: Ib9db2552b0c9f8974728b8afe909a138d948b278 Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
2026-09-03Break out dump / faultlog log servicesOliver Brewka1-0/+922
Similar to how other log services got broken out into own header files, do the same for dump / faultlog. A new dump utility header has been created, request handler and route register function went into manager / systems log service header files respectively. Code logic stays untouched in this patch. Tested: Code compiles. Unit test runs through. Validator was run on romulus in qemu with phosphor-debug-collector ibm extension enabled to get access to /xyz/openbmc_project/dump/system. Via the 'CreateDump' method empty dump entries were manually created for: /xyz/openbmc_project/dump/system /xyz/openbmc_project/dump/bmc /xyz/openbmc_project/dump/faultlog ``` busctl call xyz.openbmc_project.Dump.Manager \ /xyz/openbmc_project/dump/bmc \ xyz.openbmc_project.Dump.Create \ CreateDump a{sv} 0 > o "/xyz/openbmc_project/dump/bmc/entry/1" busctl tree xyz.openbmc_project.Dump.Manager `- /xyz `- /xyz/openbmc_project `- /xyz/openbmc_project/dump |- /xyz/openbmc_project/dump/bmc | `- /xyz/openbmc_project/dump/bmc/entry | |- /xyz/openbmc_project/dump/bmc/entry/1 | |- /xyz/openbmc_project/dump/bmc/entry/2 | |- /xyz/openbmc_project/dump/bmc/entry/3 | |- /xyz/openbmc_project/dump/bmc/entry/4 | |- /xyz/openbmc_project/dump/bmc/entry/5 | `- /xyz/openbmc_project/dump/bmc/entry/6 |- /xyz/openbmc_project/dump/faultlog | `- /xyz/openbmc_project/dump/faultlog/entry | `- /xyz/openbmc_project/dump/faultlog/entry/1 |- /xyz/openbmc_project/dump/resource `- /xyz/openbmc_project/dump/system `- /xyz/openbmc_project/dump/system/entry `- /xyz/openbmc_project/dump/system/entry/1 ``` Overwrite OperationStatus of /xyz/openbmc_project/dump/system/entry/1 for the entry to be added to the collection: ``` busctl set-property xyz.openbmc_project.Dump.Manager \ /xyz/openbmc_project/dump/system/entry/1 \ xyz.openbmc_project.Common.Progress Status \ s xyz.openbmc_project.Common.Progress.OperationStatus.Completed \ ``` Systems/Dump Validating /redfish/v1/Systems/system/LogServices/Dump... - Pass: 14, Warn: 0, Fail: 0, Skip: 9 Validating /redfish/v1/Systems/system/LogServices/Dump/Entries... - Pass: 17, Warn: 0, Fail: 0, Skip: 30 Validating /redfish/v1/Systems/system/LogServices/Dump/Entries/1... - Pass: 10, Warn: 0, Fail: 0, Skip: 26 +--------------+--------------+--------------+--------------+ | PASS | WARN | FAIL | NOT TESTED | +--------------+--------------+--------------+--------------+ | 41 | 0 | 0 | 65 | +--------------+--------------+--------------+--------------+ Managers/Dump Validating /redfish/v1/Managers/bmc/LogServices/Dump... - Pass: 14, Warn: 0, Fail: 0, Skip: 9 Validating /redfish/v1/Managers/bmc/LogServices/Dump/Entries... - Pass: 70, Warn: 0, Fail: 0, Skip: 162 Validating /redfish/v1/Managers/bmc/LogServices/Dump/Entries/1... - Pass: 11, Warn: 0, Fail: 0, Skip: 25 Validating /redfish/v1/Managers/bmc/LogServices/Dump/Entries/2... - Pass: 11, Warn: 0, Fail: 0, Skip: 25 Validating /redfish/v1/Managers/bmc/LogServices/Dump/Entries/3... - Pass: 9, Warn: 0, Fail: 0, Skip: 27 Validating /redfish/v1/Managers/bmc/LogServices/Dump/Entries/4... - Pass: 9, Warn: 0, Fail: 0, Skip: 27 Validating /redfish/v1/Managers/bmc/LogServices/Dump/Entries/5... - Pass: 9, Warn: 0, Fail: 0, Skip: 27 Validating /redfish/v1/Managers/bmc/LogServices/Dump/Entries/6... - Pass: 9, Warn: 0, Fail: 0, Skip: 27 +--------------+--------------+--------------+--------------+ | PASS | WARN | FAIL | NOT TESTED | +--------------+--------------+--------------+--------------+ | 142 | 0 | 0 | 329 | +--------------+--------------+--------------+--------------+ Managers/FaultLog Validating /redfish/v1/Managers/bmc/LogServices/FaultLog... - Pass: 12, Warn: 0, Fail: 0, Skip: 9 Validating /redfish/v1/Managers/bmc/LogServices/FaultLog/Entries... - Pass: 13, Warn: 0, Fail: 0, Skip: 34 Validating /redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/1... - Pass: 6, Warn: 0, Fail: 0, Skip: 30 +--------------+--------------+--------------+--------------+ | PASS | WARN | FAIL | NOT TESTED | +--------------+--------------+--------------+--------------+ | 31 | 0 | 0 | 73 | +--------------+--------------+--------------+--------------+ Change-Id: I6379f877149c545b3b3bfcda8510c6ee1085dcf9 Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
2026-08-28Refactor location_utils getLocationCode lambdaYuvakumar Selvamani1-19/+23
getLocationCode() used an inline lambda for the D-Bus async response callback. The lambda body was long enough to trigger the long-lambda ast-grep rule, which required an inline suppression comment (// ast-grep-ignore: long-lambda). Extract the lambda into a named afterGetLocationCode() function and bind it with std::bind_front() instead. This matches the existing bmcweb pattern for D-Bus response callbacks, improves readability, and removes the need for the ast-grep suppression. Also change the EBADR log message from BMCWEB_LOG_ERROR to BMCWEB_LOG_WARNING. Tested: - Tested on an AST2600 SoC platform. - Redfish Service Validator passed with no new errors or warnings. Change-Id: I3ffa51b1f6bb4bc7bd31e0b2f361294c8aa36978 Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
2026-08-26clang-tidy fixes for log services headerOliver Brewka2-16/+14
Silent clang-tidy warnings: - remove unused header includes - switch <systemd/sd_bus.h> to <systemd/sd-bus-protocol> for sd_bus_error usage - change str.find usage to str.contains Tested: Code compiles. Change-Id: I814239d47e1586ebc28bccc00c08e41f711b9beb Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
2026-08-21redfish-core: Refactor sw_utils lambdasYuvakumar Selvamani1-52/+55
The getSwMinimumVersion and getSwStatus functions each contained an inline lambda that triggered the long-lambda ast-grep rule, requiring an inline suppression (// ast-grep-ignore: long-lambda). This commit extracts each lambda into a separate named function, afterGetSwMinimumVersion and afterGetSwStatus respectively, and uses std::bind_front to handle the asynchronous callback. This aligns the code with the preferred bmcweb pattern for D-Bus callbacks, improves readability, and allows the removal of the static analysis suppressions. Tested: - No other functional change. - Tested on an AST2600 SoC platform. - Redfish Service Validator passed with no new errors or warnings introduced. Change-Id: I5557501b1af6506ebd23301110899b324b94d867 Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
2026-08-21Refactor asset_utils getAssetInfo lambdaYuvakumar Selvamani1-17/+23
The getAssetInfo function contained an inline lambda that triggered the long-lambda ast-grep rule, requiring an inline suppression (// ast-grep-ignore: long-lambda). This commit extracts the lambda into a separate afterGetAssetInfo function and uses std::bind_front to handle the asynchronous callback. This aligns the code with the preferred bmcweb pattern for D-Bus callbacks, improves readability, and allows the removal of the static analysis suppression. Tested: - No other functional change. - Tested on an AST2600 SoC platform. - Redfish Service Validator passed with no new errors or warnings introduced. Change-Id: I471ab2402be00c81e629e965994a650024e120c4 Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
2026-08-21redfish-core: Refactor getManagedHostPropertyYuvakumar Selvamani1-13/+19
The getManagedHostProperty function contained an inline lambda that triggered the long-lambda ast-grep rule, requiring an inline suppression (// ast-grep-ignore: long-lambda). This commit extracts the lambda into a separate afterGetManagedHostProperty function and uses std::bind_front to handle the asynchronous callback. This aligns the code with the preferred bmcweb pattern for D-Bus callbacks, improves readability, and allows the removal of the static analysis suppression. Tested: - No other functional change. - Tested on an AST2600 SoC platform. - Redfish Service Validator passed with no new errors or warnings introduced. Change-Id: I8e1fe0aae26b07a4f84c1d41aef536627f7051ac Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
2026-08-19utils: Map Available to UnavailableOfflineJustin Nguyen1-0/+165
- State `Available` will be mapped to `UnavailableOffline` for Status.State for resources that are present but unavailable - Added a utility function to reduce code duplication for retrieving resource's Status.State (`getResourceState`) and Status.Health (`getResourceHealth`) Tested: - Compiles and builds - Unit tests pass Change-Id: I1164a9412cbd4e1ab8938366ffc7ea9c7fe58786 Signed-off-by: Justin Nguyen <justinnanguyen@gmail.com>
2026-08-17Refactor fan_utils getFanPaths lambdaYuvakumar Selvamani1-16/+20
The getFanPaths function contained an inline lambda that triggered the long-lambda ast-grep rule, requiring an inline suppression (// ast-grep-ignore: long-lambda). This commit extracts the lambda into a separate afterGetFanPaths function and uses std::bind_front to handle the asynchronous callback. This aligns the code with the preferred bmcweb pattern for D-Bus callbacks, improves readability, and allows the removal of the static analysis suppression. Change-Id: Ibb72a939590077f1f8b4f19dfc5809d3411d0742 Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
2026-08-11Use enums for State and Health propertiesVinothkumar Shanmugavel2-12/+13
Several utility functions return State and Health values as std::string literals, which lacks compile-time type safety. This can lead to typos or invalid values that are only caught at runtime. Convert these functions to return resource::State and resource::Health enums instead. These enums are already defined in resource.hpp with NLOHMANN_JSON_SERIALIZE_ENUM mappings and are used extensively throughout the codebase. The enums automatically serialize to the same JSON strings, so there is no functional change. This provides compile-time type checking. Tested: - No functional change. - Verified State and Health properties serialize to identical JSON values. - Redfish Service Validator: PASS: 5788, WARN: 353, FAIL: 0, NOT TESTED: 4878 Change-Id: I590fc3dddac6f126c26814b549d2fea961409170 Signed-off-by: Vinothkumar Shanmugavel <vinothkumars@ami.com>
2026-08-11snmp: Handle duplicate client creationVijaysankar Ravi1-0/+10
afterSnmpClientCreate() had no handler for ObjectAlreadyExists from the D-Bus Network.Client.Create method. When phosphor-snmp detected a duplicate SNMP client (same address and port), it threw ObjectAlreadyExists (errno EEXIST). Since EEXIST != EBADR, the existing fallthrough logic incorrectly returned PropertyValueOutOfRange with "SNMPv2c"/"Protocol" instead of reporting the actual cause. Add an explicit check for ObjectAlreadyExists before the EBADR check and map it to the correct Redfish response (resourceAlreadyExists). Related: https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/90890 https://gerrit.openbmc.org/c/openbmc/phosphor-snmp/+/92218 Change-Id: Ia038795366bf7bf6acf9adcd09ae24d4c56e7172 Signed-off-by: Vijaysankar Ravi <vijaysankarr@ami.com>
2026-08-01Implement SubProcessors for processor collectionGeorge Liu1-0/+4
The SubProcessors is a collection under the processor collection schema. The association objects, (containing, contained_by), are used to link the processor. The association between processor and core have been documented in phosphor-dbus-interfaces [1] [1] https://github.com/openbmc/phosphor-dbus-interfaces/commit/8c79b1dc0270d01c0b713a345c8ec39533c542e4 Tested: - GET cpu and cpu subprocessors ``` curl -k -X GET https://${bmc}/redfish/v1/Systems/system/Processors/cpu0 { "@odata.id": "/redfish/v1/Systems/system/Processors/cpu0", "@odata.type": "#Processor.v1_18_0.Processor", "Id": "cpu0", ... "SubProcessors": { "@odata.id": "/redfish/v1/Systems/system/Processors/cpu0/SubProcessors" }, ... } ``` ``` curl -k -X GET https://${bmc}/redfish/v1/Systems/system/Processors/cpu0/SubProcessors { "@odata.id": "/redfish/v1/Systems/system/Processors/cpu0/SubProcessors", "@odata.type": "#ProcessorCollection.ProcessorCollection", "Members": [ { "@odata.id": "/redfish/v1/Systems/system/Processors/cpu0/SubProcessors/core0" }, { "@odata.id": "/redfish/v1/Systems/system/Processors/cpu0/SubProcessors/core1" }, ... ], "Members@odata.count": 4, "Name": "SubProcessor Collection" } ``` - Verified that below return a link header - GET /redfish/v1/Systems/system/Processors/cpu0/SubProcessors - HEAD /redfish/v1/Systems/system/Processors/cpu0/SubProcessors - Redfish Validator Passed Change-Id: If155b97b0c782d82541c00ecf5ee70cb0180f71f Signed-off-by: George Liu <liuxiwei@ieisystem.com> Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com> Signed-off-by: Myung Bae <myungbae@us.ibm.com>
2026-07-28bmcweb: share processor inventory interfacesJacky Huang1-0/+16
Move the common processor D-Bus interface list into processor_utils.hpp and use it for processor, chassis, PCIe, and environment metrics. This avoids duplicate lists drifting apart. Tested: Only code extraction. Verified Processor responses are unchanged. Change-Id: I952c9985c393a903d2949dc3c7b5b592381e4b7f Signed-off-by: Jacky Huang <jackyhuang@nvidia.com>
2026-07-24Remove final IWYU hintsEd Tanous2-6/+1
IWYU is not a tool we have seen results from in some time. I very much suspect that these few comments are not enough to get a clean build. Clean them up. If we want to turn this tool back on in the future, this patch can be reverted. Tested: Comment only change. Review only. Change-Id: I45ff737800f9d8b1b63db2f482e59f815d7126a2 Signed-off-by: Ed Tanous <ed@tanous.net>
2026-07-24Add logging for invalid SNMP Trap ID requestsShivraj Toravi1-14/+22
Log invalid SNMP Trap ID requests to improve troubleshooting and runtime diagnostics. Since EBADR results in a ResourceNotFound response, it represents an invalid client request rather than an internal server error. Log this condition at WARNING level while reserving ERROR level logging for actual internal failures. No functional behavior changes Change-Id: I9462f86137c4522842d45bfe41b31acb7de60e1d Signed-off-by: Shivraj Toravi <shivrajnt@ami.com>
2026-07-23bmcweb: map PCIe Gen6 generationEnder Hsieh1-0/+5
Add Gen6 to redfishPcieGenerationFromDbus so a Gen6 device reports PCIeType Gen6 instead of failing as an unknown generation. The Gen6 value was added to the PCIeSlot generations in phosphor-dbus-interfaces: https://github.com/openbmc/phosphor-dbus-interfaces/commit/8d09e7d Tested: Built for nvl32-obmc; a Gen6 GPU now reports PCIeType "Gen6". Change-Id: I8b51d407887e57a3479b8a39cbbe08aa2993e8b2 Signed-off-by: Ender Hsieh <andhsieh@nvidia.com>
2026-07-22Return JSON instead of base64 for EventLog entry attachment downloadArchit Mehrotra1-2/+3
After this change [1] log entry attachment returns a JSON instead of a binary blob, it is no longer required to be base-64 encoded. Return the JSON as-is and modify the response header to reflect the new format. Tested: - Unit tests pass - Built an image with my code, ran it in QEMU: 1. Injected a log entry with command: [2]. 2. Verified LogEntry data [3]. 3. Verified Attachment returns JSON data which is no longer base-64 encoded with expected header [4]. 4. Verified Attachment returns 400 with octet-stream header which was previously accepted [5]. [1] https://gerrit.openbmc.org/c/openbmc/phosphor-logging/+/89777 [2] Command to inject a log entry and its output: ``` log-create xyz.openbmc_project.Sensor.Threshold.ReadingAboveUpperCriticalThreshold --json '{ "SENSOR_NAME": "TEST_SENSOR", "READING_VALUE": 99.5, "UNITS": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", "THRESHOLD_VALUE": 8.0 }' <3> OPENBMC_MESSAGE_ID={"severity":2,"xyz.openbmc_project.Sensor.Threshold.ReadingAboveUpperCriticalThreshold":{"READING_VALUE":99.5,"SENSOR_NAME":"TEST_SENSOR","THRESHOLD_VALUE":8.0,"UNITS":"xyz.openbmc_project.Sensor.Value.Unit.DegreesC","_SOURCE":{"COLUMN":45,"FILE":"/usr/src/debug/phosphor-logging/1.0+git/log_create_main.cpp","FUNCTION":"int generate_event(const std::string&, const nlohmann::json_abi_v3_12_0::json&, std::optional<int>)","LINE":35,"PID":9445}}} /xyz/openbmc_project/logging/entry/40 ``` [3] Logservices request and output ``` curl -ks -u root:0penBmc -H "Content-Type: application/json" https://${bmc}/localhost/redfish/v1/Managers/bmc/LogServices/EventLog/Entries/40 { "@odata.id": "/redfish/v1/Managers/bmc/LogServices/EventLog/Entries/40", "@odata.type": "#LogEntry.v1_9_0.LogEntry", "AdditionalDataURI": "/redfish/v1/Managers/bmc/LogServices/EventLog/Entries/40/attachment", "Created": "2026-06-23T09:45:05.600-07:00", "EntryType": "Event", "Id": "40", "Message": "Sensor 'TEST_SENSOR' reading of 99.5 (xyz.openbmc_project.Sensor.Value.Unit.DegreesC) is above the 8.0 upper critical threshold.", "MessageArgs": [ "TEST_SENSOR", "99.5", "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", "8.0" ], "MessageId": "SensorEvent.1.0.ReadingAboveUpperCriticalThreshold", "Modified": "2026-06-23T09:45:05.600-07:00", "Name": "Manager Event Log Entry", "Resolution": "Check the condition of the resources listed in RelatedItem.", "Resolved": false, "Severity": "Critical" } ``` [4] LogEntry Attachment ``` curl -ks -u root:0penBmc -H "Accept: application/json" -D - https://localhost/redfish/v1/Managers/bmc/LogServices/EventLog/Entries/40/attachment HTTP/1.1 200 OK Allow: GET OData-Version: 4.0 Content-Type: application/json Strict-Transport-Security: max-age=31536000; includeSubdomains Pragma: no-cache Cache-Control: no-store, max-age=0 X-Content-Type-Options: nosniff Date: Tue, 23 Jun 2026 18:07:51 GMT Content-Length: 814 { "additionalData": { "READING_VALUE": "99.5", "SENSOR_NAME": "TEST_SENSOR", "THRESHOLD_VALUE": "8.0", "UNITS": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", "_CODE_FILE": "/usr/src/debug/phosphor-logging/1.0+git/log_create_main.cpp", "_CODE_FUNC": "int generate_event(const std::string&, const nlohmann::json_abi_v3_12_0::json&, std::optional<int>)", "_CODE_LINE": "35", "_PID": "9445" }, "associations": [], "eventId": "", "id": 40, "jsonVersion": 1, "message": "xyz.openbmc_project.Sensor.Threshold.ReadingAboveUpperCriticalThreshold", "resolution": "", "resolved": false, "severity": 2, "timestamp": 1782233105600, "updateTimestamp": 1782233105600, "version": "catalina-47de2434c3a-dirty" } ``` [5] Verify that the octet-stream header is rejected ```curl -ks -u root:0penBmc -H "Accept: application/octet-stream" -D - https://localhost/redfish/v1/Managers/bmc/LogServices/EventLog/Entries/40/attachment HTTP/1.1 400 Bad Request Allow: GET OData-Version: 4.0 Content-Type: application/json Strict-Transport-Security: max-age=31536000; includeSubdomains Pragma: no-cache Cache-Control: no-store, max-age=0 X-Content-Type-Options: nosniff Date: Tue, 23 Jun 2026 17:03:06 GMT Content-Length: 814 { "additionalData": { "READING_VALUE": "99.5", "SENSOR_NAME": "TEST_SENSOR", "THRESHOLD_VALUE": "8.0", "UNITS": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", "_CODE_FILE": "/usr/src/debug/phosphor-logging/1.0+git/log_create_main.cpp", "_CODE_FUNC": "int generate_event(const std::string&, const nlohmann::json_abi_v3_12_0::json&, std::optional<int>)", "_CODE_LINE": "35", "_PID": "9445" }, "associations": [], "eventId": "", "id": 40, "jsonVersion": 1, "message": "xyz.openbmc_project.Sensor.Threshold.ReadingAboveUpperCriticalThreshold", "resolution": "", "resolved": false, "severity": 2, "timestamp": 1782233105600, "updateTimestamp": 1782233105600, "version": "catalina-47de2434c3a-dirty" } ``` Change-Id: Ic6019b80ca6ea32783ae2ffe711adeb5ef2eb157 Signed-off-by: Archit Mehrotra <architmehrotra@meta.com>
2026-07-22sensor: add frequency type supportVishnunithyasoundhar S1-0/+8
Add Frequency ReadingType and Hz units mapping for sensors exposed under /sensors/frequency. Ref to gerrit PR introducing the same in PDI: https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/83009 Change-Id: I7b2dc504682863cc3243cb7ccf0dbaf4db1e3e55 Signed-off-by: Vishnunithyasoundhar S <vishnunithyasoundhar.s@intel.com>
2026-07-11redfish: Return empty DBus EventLog collectionJoel Pullokaran Jesin1-1/+9
When the DBus-backed EventLog entry collection is unavailable, return an empty Redfish collection instead of an internal error for expected absence cases. Treat EBADR and host_unreachable from GetManagedObjects as optional backend unavailability. In those cases, populate Members with an empty array and set Members@odata.count to 0, while continuing to surface unexpected DBus errors as internal errors. Tested: - ninja -C build bmcweb Change-Id: Iffff05231927f8d2239b25bbbb98960d7b5d71e0 Signed-off-by: Joel Pullokaran Jesin <joelpj@ami.com>
2026-07-01Flag long lambdasEd Tanous9-0/+13
Long lambdas have been documented as an anti-pattern for some time.[1] Despite this being generally understood, bmcweb has a long ways to go cleaning these up, and routinely code is submitted in violation of this anti-pattern. Invent an ast-grep rule that can identify when new examples of this anti-pattern are added, and ignore the existing 200+ examples that are in the codebase already using ast-grep ignore. These flags will give us something to search for as we clean this up, and will help to prevent new instances from being added unintentionally. [1] https://github.com/openbmc/docs/blob/master/anti-patterns.md#very-long-lambda-callbacks Tested: Comment only change. ast-grep passes. Manually removing an ast-grep ignore flag shows as a failure in ast-grep scan Change-Id: I77d634a393884969f184d2c39c02cc08288d5a29 Signed-off-by: Ed Tanous <etanous@nvidia.com>
2026-06-26fix 'Chassis' property in oem schemaAlexander Hansen1-0/+28
`redfish-core/schema/oem/openbmc/` oem schema defines 'Chassis' property for fan zones but the implementation forms invalid chassis links. Affected options: redfish-oem-manager-fan-data=enabled (default) Using following configuration, plus a few fans and pid controller (a typical single-host 2U server with 3 fans, Tyan S8030 board) ``` { "FailSafePercent": 100, "MinThermalOutput": 10, "Name": "Zone0", "Type": "Pid.Zone" }, ``` It is straightforward to get a response like below ``` ... "FanZones": { "@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanZones", "@odata.type": "#OpenBMCManager.v1_0_0.Manager.FanZones", "Zone0": { "@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanZones/Zone0", "@odata.type": "#OpenBMCManager.v1_0_0.Manager.FanZone", "Chassis": { "@odata.id": "/redfish/v1/Chassis/Zone0" }, "FailSafePercent": 100.0, "MinThermalOutput": 10.0 } }, ... ``` when querying ``` curl --insecure --user root:root https://${bmc}/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan ``` For reference, the chassis collection ``` { "@odata.id": "/redfish/v1/Chassis", "@odata.type": "#ChassisCollection.ChassisCollection", "Members": [ { "@odata.id": "/redfish/v1/Chassis/MBX_1_57_Chassis" }, { "@odata.id": "/redfish/v1/Chassis/Tyan_S8030_Baseboard" } ], "Members@odata.count": 2, "Name": "Chassis Collection" } ``` Since that configuration is representative of various boards and the bug has been seen by others before [1] (in terms of a fan zone and chassis sharing the same name, suggesting ill-formed link), fix the implementation to use the result of GetManagedObjects call and find valid chassis path there. This is to allow redfish validator to pass with default meson options and a common system configuration. Since it's a config dependent failure it would be great for others to test and share their result. Inspection of the code causing validation failure: ``` auto pids = std::make_shared<GetPIDValues>(asyncResp); pids->run(); then run(); returns and `~GetPIDValues()` is called which calls processingComplete which calls asyncPopulatePid ``` Inside `asyncPopulatePid` it does `dbus::utility::getManagedObjects` and iterates over the results ``` 112 for (const auto& pathPair : managedObj) 113 { 114 for (const auto& intfPair : pathPair.second) ``` then checks for an interface ``` 180 if (intfPair.first == pidZoneConfigurationIface) 181 { 182 sdbusplus::message::object_path pidPath( 183 pathPair.first.str); 184 std::string chassis = pidPath.filename(); 185 if (chassis.empty()) 186 { 187 chassis = "#IllegalValue"; 188 } ``` and simply uses the object path from PID Zone config interface to extract the leaf and insert that as the chassis link. It can only work in case the Board/Chassis interface is on the same object path which is unlikely. Tested: on Tyan S8030. Result after the change, the optional property now contains the correct chassis link. ``` ... "FanZones": { "@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanZones", "@odata.type": "#OpenBMCManager.v1_0_0.Manager.FanZones", "Zone0": { "@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanZones/Zone0", "@odata.type": "#OpenBMCManager.v1_0_0.Manager.FanZone", "Chassis": { "@odata.id": "/redfish/v1/Chassis/MBX_1_57_Chassis" }, "FailSafePercent": 100.0, "MinThermalOutput": 10.0 } }, ... ``` ``` /tmp/rsv-venv/bin/rf_service_validator \ --auth Session -i https://${bmc}:443 \ -u ${username} -p ${password} --payload 'Tree' /redfish/v1/Managers/bmc ... Elapsed time: 0:00:32 Listing any warnings and errors: Results Summary: Pass: 766, Fail: 0, Warning: 0 Validation has succeeded. ``` RF validator Tree validation errors are reduced compared to previous. References: [1] https://discordapp.com/channels/775381525260664832/1449737223493910559/1450273124804333598 Change-Id: I2a2db456f42c5dafa451f69362b1d9c8a094e86e Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com> Signed-off-by: Ed Tanous <etanous@nvidia.com>
2026-06-25Change a few message responses as errorsMyung Bae1-4/+0
Some of messages are not currently reported as errors, although they are the results as Redfish request errors. Those include - PropertyDuplicate - ResourceAlreadyExists - CreateFailedMissingReqProperties - PropertyValueFormatError - PropertyValueNotInList - PropertyValueTypeError - PropertyValueError - PropertyNotWritable - PropertyValueModified - PropertyMissing For example, PropertyValueFormatError is currently not treated as an error. It shows like ``` curl -k -X PATCH "${bmc}/redfish/v1/AccountService/Accounts/admin" \ -H "Content-Type: application/json" \ -d '{ "Password": "" }' "Password@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The value 'null' for the property Password is not a format that the property can accept.", "MessageArgs": [ "null", "Password" ], "MessageId": "Base.1.19.PropertyValueFormatError", "MessageSeverity": "Warning", "Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed." } ] ``` After making it as an error, it will be like ``` { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The value 'null' for the property Password is not a format that the property can accept.", "MessageArgs": [ "null", "Password" ], "MessageId": "Base.1.19.PropertyValueFormatError", "MessageSeverity": "Warning", "Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed." } ], "code": "Base.1.19.PropertyValueFormatError", "message": "The value 'null' for the property Password is not a format that the property can accept." } } ``` Tested: - Check those response messages Change-Id: I746c55e42e8f0cde205a3800e3da17cd78cf7e34 Signed-off-by: Myung Bae <myungbae@us.ibm.com>
2026-06-19sdbusplus: use shorter type aliasesPatrick Williams1-2/+2
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are for: * exception_t * manager_t * match * match_rules * message_t * object_t * slot_t Change-Id: Iaf2a83fb67d57a6fafb664d27b349add17a96bcd Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
2026-06-12sensor: add charge type supportJagpal Singh Gill1-0/+8
Add ChargeAh ReadingType and Ah units mapping for charge sensors exposed under /sensors/charge/ D-Bus path. This enables battery backup unit remaining and full charge sensors to appear in Redfish. Unit test added for charge sensor type. Tested: 1. Sensor Query using curl - ``` { "@odata.id": "/redfish/v1/Chassis/BBU_SHELF_1/Sensors/charge_BBU_SHELF_1_BBU5_REMAINING_CHARGE_AH", "@odata.type": "#Sensor.v1_11_1.Sensor", "Id": "charge_BBU_SHELF_1_BBU5_REMAINING_CHARGE_AH", "Name": "BBU SHELF 1 BBU5 REMAINING CHARGE AH", "Reading": 10477.0, "ReadingType": "ChargeAh", "ReadingUnits": "Ah", "Status": { "Health": "OK", "State": "Enabled" }, ... } ``` 2. Redfish Validation passed using Redfish Validator. Signed-off-by: Jagpal Singh Gill <paligill@gmail.com> Change-Id: I9b7180cb8597378a1b42f9da73335ca96b20d55a
2026-06-04PCIE: add DeviceType to PCIeDeviceEric Liu1-0/+35
Map the Inventory.Item.PCIeDevice.DeviceType D-Bus property into the Redfish PCIeDevice schema's DeviceType property. When the D-Bus value is the PDI default (Unknown), the Redfish field is omitted; otherwise the enum is rendered. The implementation maps D-Bus to Redfish as follows: - Inventory.Item.PCIeDevice.DeviceTypes.SingleFunction -> PCIeDevice.DeviceType.SingleFunction - Inventory.Item.PCIeDevice.DeviceTypes.MultiFunction -> PCIeDevice.DeviceType.MultiFunction - Inventory.Item.PCIeDevice.DeviceTypes.Simulated -> PCIeDevice.DeviceType.Simulated - Inventory.Item.PCIeDevice.DeviceTypes.Retimer -> PCIeDevice.DeviceType.Retimer - Inventory.Item.PCIeDevice.DeviceTypes.Unknown / empty -> field omitted Key changes: - redfish-core/include/utils/pcie_util.hpp: add redfishPcieDeviceTypeFromDbus() that maps the D-Bus DeviceTypes enum strings to pcie_device::DeviceType. - redfish-core/lib/pcie.hpp: unpack the DeviceType property in addPCIeDeviceProperties() and set jsonValue["DeviceType"] using the mapper. Tested: Built an image for nvl32-obmc with the following patches cherry-picked: ``` 1. Align with upstream u-boot dts tree: https://gerrit.openbmc.org/c/openbmc/openbmc/+/89932 2. U-Boot change phy mode (in-flight on mailing list): https://lore.kernel.org/openbmc/20260504044702.2613879-1-\ andhsieh@nvidia.com/T/#t 3. Kernel device tree add mac mode (in-flight on mailing list): https://lore.kernel.org/linux-aspeed/20260505050541.\ 3031447-1-andhsieh@nvidia.com/T/#t 4. platform-init enable LCLK and espiCLK: https://gerrit.openbmc.org/c/openbmc/platform-init/+/89900 5. mctpd configuration: https://gerrit.openbmc.org/c/openbmc/openbmc/+/87390 6. Enable nvidia-gpu sensor: https://gerrit.openbmc.org/c/openbmc/openbmc/+/89933 ``` Deployed the rebuilt bmcweb onto Alon8-GBT-20. ``` $ curl -sk -u <credentials> \ https://${BMC}/redfish/v1/Systems/system/PCIeDevices/\ GPU_0_0 { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/\ GPU_0_0", "@odata.type": "#PCIeDevice.v1_19_0.PCIeDevice", "DeviceType": "SingleFunction", ... } $ curl -sk -u <credentials> \ https://${BMC}/redfish/v1/Systems/system/PCIeDevices/\ Nvidia_ConnectX_0_PCIe { ... (no DeviceType field; D-Bus property not registered) } ``` 1. Verified the Redfish DeviceType field is rendered as SingleFunction on the GPU PCIeDevice resource. 2. Verified the field is omitted when the D-Bus property is not registered (ConnectX path), so the Redfish output remains consistent with the PDI default behavior. 3. Redfish Service Validator: pass. Change-Id: I13a6214f71e9a06b5f2ab9ca8abef6663a856da2 Signed-off-by: Eric Liu <liuer@nvidia.com>
2026-05-19Move to Redfish 2026.1Gunnar Mills17-16/+192
One line change and rerun the script. 2026.1 includes new properties. The overview is at [1]. [1]: https://www.dmtf.org/sites/default/files/Redfish_Release_2026.1_Overview.pdf Tested: Inspection only. Change-Id: I007f074128e278fb267ee4de3b9cbab22d6336df Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2026-05-17Add uint64_t fallback when unpacking float valuesSwaroop Aradhya N M1-0/+9
nlohmann/json v3.11.3 changed behavior (issue #4475) where positive integer values are now stored internally as uint64_t instead of int64_t. The floating-point unpack path in unpackValueWithErrorCode() only attempted double* and int64_t* fallbacks. As a result, PATCH requests with integer values targeting a double field were rejected with invalidType, while float values continued to work. This was a partial fix introduced in commit 8d9cf72d ("Work around nlohmann changes"), which correctly added uint64_t fallbacks for the signed/unsigned integer unpack paths but missed the floating- point path. Adding a uint64_t* fallback in the is_floating_point_v branch, mirroring the pattern used in the signed integer branch, so that integer JSON values are safely cast to double and accepted. Tested: PATCH method with both integer and float Reading values succeeds as expected Change-Id: Id8eac85820b70fc41ae52b5d31236b541a8c3d92 Signed-off-by: Utkarsh Kumar <utkarshx.kumar@intel.com> Signed-off-by: Swaroop Aradhya N M <swaroopx.aradhya.n.m@intel.com>
2026-04-21Add helper function for Location and `LocationType`Ed Tanous1-0/+80
The location_util::getLocation is used to find the `LocationCode` interface used for `ServiceLabel`. Also added logic to look for the Inventory.Connector.X interfaces to populate `LocationType`. The helper function is added to serve as the common location helper and remove the same method call in each individual resource files. For example, `Inventory.Connector.Embedded` means LocationType of Embedded type. Currently only support LocationType of - Slot - Embedded Tested: No changes to redfish tree yet Added unit tests Change-Id: I7f2a8d6172e37dd72881fbfb5a9dfeaf83b2db09 Signed-off-by: Zhenwei Chen <zhenweichen0207@gmail.com> Signed-off-by: Willy Tu <wltu@google.com> Signed-off-by: Ed Tanous <etanous@nvidia.com>
2026-04-21Remove static variablesEd Tanous3-5/+12
These static variables have the potential to cause reentrancy issues. In practice, the conditions to cause issues would require someone to basically write incorrect code, but it makes sense to wrap this into a state tracker anyway to clean up the code. While we're here, convert to using std::chrono. Note, this changes the behavior such that the values produced are now no longer dependent on timezone. Functionally, Redfish only recently got the ability to set a timezone, so this is not expected to have any user facing impact, even though the unit tests need to change. Tested: RSV Passes Change-Id: Icb7cff1d289ae23790a5fb1db6604abd73dd68fd Signed-off-by: Ed Tanous <etanous@nvidia.com>
2026-04-21Deduplicate functionEd Tanous2-45/+5
These two functions differ in only one minor thing, how the first entry is handled. event_log::getUniqueEntryID is better unit tested, so move to it for all uses. Next commit will move the static variables out so the behavior of these two methods is identical. Tested: in next commit Change-Id: I7a27d3506a6fec1f62fe8f584dbceb0ac34893ac Signed-off-by: Ed Tanous <etanous@nvidia.com>
2026-04-21Remove time_tEd Tanous1-2/+1
time_t is less specific than using the equivalents in std::chono. In practice, most of the time we end up converting the time_t to some std::chrono class anyway. Avoid the intermediate conversion and just use the std::chrono version of time. Tested: Unit tests pass. Good Coverage Change-Id: I2e3eca78760e158feaaf4b91793631343e417f15 Signed-off-by: Ed Tanous <etanous@nvidia.com>
2026-04-15sdbusplus: use shorter type aliasesPatrick Williams11-50/+44
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are for: * bus_t * exception_t * manager_t * match_t * message_t * object_t * slot_t * object_path Change-Id: Iace20f9ad26e8d9dc234979e7a4087d599da2641 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
2026-04-11Expose date/time in local timezoneIgor Kanyuka4-26/+18
BMC now exposes DateTime property under the Manager/<ID> in timezone configured on the BMC (local TZ) and not in UTC, but the other date time properties are still in UTC. Convert date time fields to local timezone. Tested: 1. Redfish service validator 2. Built Facebook's Catalina image with this change, ran in QEMU and checked manually varioius endpoints. 3. Ran automated tests [1] from openbmc-test-automation repo. 4. Unit tests [1] https://gerrit.openbmc.org/c/openbmc/openbmc-test-automation/+/88659 Change-Id: I8e587c7a1030deff8e6a550651c5e62719fe5299 Signed-off-by: Igor Kanyuka <ifelmail@gmail.com> Signed-off-by: Ed Tanous <ed@tanous.net>
2026-04-06Correct a confusing debug message about AggregationAbiola Asojo1-1/+1
The previous message indicated that Aggregation is not enabled. It is a case where aggregation is enabled, but there are no satellite BMCs. The new debug message indicates that. Change-Id: I1aebfd6f771ae81ceb30a506c9bdd8fcc35c77d1 Signed-off-by: Abiola Asojo <abiola.asojo@ibm.com>
2026-04-02Implement depth parsing in filter parserEd Tanous1-3/+50
In certain debug scenarios, there were cases where we would hit recursion depth limits. These do not appear in conventional scenarios, but could pop up in debug builds while running fuzzing. To fix this, implement two checks. First, limit $filter expressions to 1000 characters or less. This is largely arbitrary. Second, implement a depth checker to ensure that stack depth doesn't exceed 10 frames. 10 is intended to be an order of magnitude more than anyone will ever use. Most examples use 1 or 2 parens. Tested: Unit tests pass. New unit tests added for this case. Change-Id: I2c95e2fc8c0a3b94ab2a7f882ac6e1805bb7ebd5 Signed-off-by: Ed Tanous <etanous@nvidia.com>
2026-03-31Port nlohmann::json::parse uses to saxEd Tanous1-17/+17
We should have a single entry point where we do json parsing. There are configurations for nlohmmann that we had previously documented, but were not well enforced. Move all uses to using the helper parse functions. Tested: Unit tests pass. Redfish service validator passes. Change-Id: I2a8aed9327b6b15219dc9b4d6db146b69bcd8eb3 Signed-off-by: Ed Tanous <etanous@nvidia.com>
2026-03-31Encapsulate sd-journalEd Tanous2-67/+88
It would be better if the larger compile units didn't have to pull in the sd-journal header. At the same time, there's C handling of a number of resources that could be moved to an RAII class, and unit tests that we can add. This commit does all those things. Note, vacuum.journal is a file created with ``` journalctl --rotate && sleep 1 && journalctl --rotate ```` And contains a few log entries. Note, while this file is 8MB, the majority are zeros, so git should compress it just fine. Tested: Unit tests updated. Redfish service validator passes Change-Id: If578316bcd1d0162b7ecdcca27c1c7818ce2b6fa Signed-off-by: Ed Tanous <etanous@nvidia.com>
2026-03-25Upgrade to Boost 1.90Ed Tanous1-2/+1
Boost seems to have removed some of the enums that were previously in the enumeration[1]. We relied on two of these Http2-Settings and Content-Tranfer-Encoding. It's not clear why they were removed, but move those to using inline strings. [1] https://github.com/boostorg/beast/pull/3042/changes/db31a880525fe84b0e17b80015049363106c5b61 Change-Id: I233f103531de1361f903bae5c2981845143983d1 Signed-off-by: Ed Tanous <etanous@nvidia.com>
2026-03-20Allow to set Manager TZ and show its time in localIgor Kanyuka3-4/+17
Current code always return Date time in UTC, despite local timezone may differ. This change allows to set manager timezone via redfish and show manager's TZ and offset in manager's local timezone. When the DateTime is being patched, the provided date time gets converted from the provided TZ to the local timezone, but configured TZ does not get changed. A user must explicitly patch TimeZoneName to change Manager's TZ. Tested: 1. Built an image, ran in QEMU, changed TZ to PST8PDT (negative offset), UTC (0 offset), and Tokyo (positive offset). Made sure the patch works and all the touched fields have correct values. See [1]. 2. Unit tests 3. Redfish validator [1] ``` $ curl -s -k -H 'Content-type: application/json' -u root:0penBmc https://localhost:8443/redfish/v1/Managers/bmc | jq '.DateTime, .DateTimeLocalOffset, .TimeZoneName' "2026-03-19T11:03:16-07:00" "-07:00" "PST8PDT" $ curl -i -k -H 'Content-type: application/json' -u root:0penBmc -d '{"TimeZoneName": "UTC"}' -X PATCH https://localhost:8443/redfish/v1/Managers/bmc HTTP/1.1 204 No Content Allow: GET, PATCH OData-Version: 4.0 Strict-Transport-Security: max-age=31536000; includeSubdomains Pragma: no-cache Cache-Control: no-store, max-age=0 X-Content-Type-Options: nosniff Date: Thu, 19 Mar 2026 18:03:28 GMT Content-Length: 0 $ curl -s -k -H 'Content-type: application/json' -u root:0penBmc https://localhost:8443/redfish/v1/Managers/bmc | jq '.DateTime, .DateTimeLocalOffset, .TimeZoneName' "2026-03-19T18:03:53+00:00" "+00:00" "UTC" $ curl -i -k -H 'Content-type: application/json' -u root:0penBmc -d '{"TimeZoneName": "Asia/Tokyo"}' -X PATCH https://localhost:8443/redfish/v1/Managers/bmc HTTP/1.1 204 No Content Allow: GET, PATCH OData-Version: 4.0 Strict-Transport-Security: max-age=31536000; includeSubdomains Pragma: no-cache Cache-Control: no-store, max-age=0 X-Content-Type-Options: nosniff Date: Thu, 19 Mar 2026 18:04:20 GMT Content-Length: 0 $ curl -s -k -H 'Content-type: application/json' -u root:0penBmc https://localhost:8443/redfish/v1/Managers/bmc | jq '.DateTime, .DateTimeLocalOffset, .TimeZoneName' "2026-03-20T03:04:32+09:00" "+09:00" "Asia/Tokyo" $ curl -i -k -H 'Content-type: application/json' -u root:0penBmc -d '{"DateTime": "2026-01-02T11:03:16-07:00"}' -X PATCH https://localhost:8443/redfish/v1/Managers/bmc HTTP/1.1 204 No Content Allow: GET, PATCH OData-Version: 4.0 Strict-Transport-Security: max-age=31536000; includeSubdomains Pragma: no-cache Cache-Control: no-store, max-age=0 X-Content-Type-Options: nosniff Date: Fri, 02 Jan 2026 18:03:16 GMT Content-Length: 0 $ curl -s -k -H 'Content-type: application/json' -u root:0penBmc https://localhost:8443/redfish/v1/Managers/bmc | jq '.DateTime, .DateTimeLocalOffset, .TimeZoneName' "2026-01-03T03:03:21+09:00" "+09:00" "Asia/Tokyo" $ curl -s -k -H 'Content-type: application/json' -u root:0penBmc https://localhost:8443/redfish/v1/Managers/bmc/LogServices/Journal/Entries | jq '.Members[0]' { "@odata.id": "/redfish/v1/Managers/bmc/LogServices/Journal/Entries/cz0zNTMzMTVkMTBjYWQ0ZTg5ODJiYjliZGVmOTc2NDE2MDtpPTE7Yj00YzU5NzY1NzQ0M2M0N2IzOWZjYTZiNzU1ZWVlY2NjOTttPTFlZjc1Yzg7dD02MzY0OGQxOTFhZTE0O3g9ZDU5MjYwNzJkZTgzMWYzYw==", "@odata.type": "#LogEntry.v1_9_0.LogEntry", "Created": "2025-05-29T16:30:41.794580+00:00", "EntryType": "Oem", "Id": "cz0zNTMzMTVkMTBjYWQ0ZTg5ODJiYjliZGVmOTc2NDE2MDtpPTE7Yj00YzU5NzY1NzQ0M2M0N2IzOWZjYTZiNzU1ZWVlY2NjOTttPTFlZjc1Yzg7dD02MzY0OGQxOTFhZTE0O3g9ZDU5MjYwNzJkZTgzMWYzYw==", "Message": "kernel: Booting Linux on physical CPU 0xf00", "Name": "BMC Journal Entry", "OemRecordFormat": "BMC Journal Entry", "Severity": "OK" } ``` Change-Id: I5a4567b9ca6a0f56dd9d1b971d418a19bf625a10 Signed-off-by: Igor Kanyuka <ifelmail@gmail.com>
2026-03-19sensor_utils: Assume non-finite values as unpopulatedAmithash Prasad1-6/+21
Threshold property pairs such as LowerCritical, UpperCritical when not defined by the service will now be represented as null. ReadingRangeMax and ReadingRangeMin properties will be absent if they are undefined by the service. Depending on the configuration many sensors might not specify values and these properties on DBus would default to inf/-inf. Examples of these properties are MinValue, MaxValue along with Thresholds where only one of the tuple (upper/lower) is populated. This change will reflect this in output and interpret inf/-inf as "unpopulated" and set to null for thresholds which may be changed by the users and skipped for Min/Max values. This is done by keeping a list of allowed values and inferring it to determine what needs to be done. Tested: Tested changes on a Ventura BMC. Ensured that `journalctl -f -u bmcweb` no longer has a flood of entries with `Sensor value for MaxValue was unexpectedly inf`. Also ensure the output of curl matches new expectation Missing Min/Max Value results in missing ReadingRangeMin/Max values: ``` curl https://$BMC/redfish/v1/Chassis/Ventura_Fan_Board_0/Sensors/current_FCB_0_FAN_1_CURR_A { "@odata.id": "/redfish/v1/Chassis/Ventura_Fan_Board_0/Sensors/current_FCB_0_FAN_1_CURR_A", "@odata.type": "#Sensor.v1_11_1.Sensor", "Id": "current_FCB_0_FAN_1_CURR_A", "Name": "FCB 0 FAN 1 CURR A", "Reading": 0.3793103448275862, "ReadingType": "Current", "ReadingUnits": "A", "Status": { "Health": "OK", "State": "Enabled" } } ``` Ensure that when one tuple of the range is missing we insert null ``` curl https://$BMC/redfish/v1/Chassis/Ventura_RMC/Sensors/power_RMC_HSC_PWR_W { "@odata.id": "/redfish/v1/Chassis/Ventura_RMC/Sensors/power_RMC_HSC_PWR_W", "@odata.type": "#Sensor.v1_11_1.Sensor", "Id": "power_RMC_HSC_PWR_W", "Name": "RMC HSC PWR W", "Reading": 35.602771994768936, "ReadingRangeMax": 3000.0, "ReadingRangeMin": 0.0, "ReadingType": "Power", "ReadingUnits": "W", "Status": { "Health": "OK", "State": "Enabled" }, "Thresholds": { "LowerCritical": { "Reading": null }, "UpperCritical": { "Reading": 580.0 } } } ``` Executed redfish service validator on a QEMU instance with an external sensor with missing lower critical/warning sensors. ``` *** Validating /redfish/v1/Chassis/MyCoolBoard/Sensors/temperature_HostDevTemp Type (Sensor.v1_11_0.Sensor), GET SUCCESS (time: 0:00:00.000026) PASS ``` Change-Id: I78c0529cd52f7703af6346b239ecb7519479b70d Signed-off-by: Amithash Prasad <amithash@meta.com>
2026-03-18Fix collection Members io_error regressionTony Ao1-0/+3
Keep existing Members on local I/O failures in the generic collection path, and ensure empty collections still return mandatory Members and Members@odata.count properties. Add a reusable JSON array helper and use it in both collection building and aggregator merge logic to avoid clearing the response on transient failures. Fixes common error #13.[1] [1] https://github.com/openbmc/bmcweb/blob/master/docs/COMMON_ERRORS.md#13-complete-replacement-of-the-response-object Tested: unit test passed; validator passed on empty collection URIs. Change-Id: I8e144f55b99e3f8017abcebb11c409fffebf38ad Signed-off-by: Tony Ao <tao@nvidia.com>
2026-03-17Collection: keep Members stable on io_error; add array helperTony Ao2-11/+31
The generic collection path could clear the "Members" array on a local I/O error, which breaks aggregated responses and can trigger Common Error #13 [1]. The aggregator merge logic also needed a small reusable helper to ensure a JSON value is an array. Add a generic JSON array "ensure" helper in utils/collection.hpp and use it from both the local collection builder and the aggregator merge path. This avoids resetting Members on transient failures and avoids relying on transitive includes for the helper. [1] https://github.com/openbmc/bmcweb/blob/master/docs/COMMON_ERRORS.md#13-complete-replacement-of-the-response-object Tested: Unit tests passed. Change-Id: Iddaa608916af661f75989b4aeae9b557d09eebe3 Signed-off-by: Tony Ao <tao@nvidia.com>