summaryrefslogtreecommitdiff
path: root/redfish-core/src
AgeCommit message (Collapse)AuthorFilesLines
2026-09-03Simplify dump routes registryOliver Brewka1-17/+2
Instead of registering each route separately, register all routes in a single function call for systems dump, manager dump and manager faultlog. Tested: Code compiles. Unit tests pass. Validator passed. Change-Id: I335ef22873137743eade4d3c0119ad38c6a68a83 Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
2026-09-03Break out dump / faultlog log servicesOliver Brewka1-0/+2
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-01Implement SubProcessors for processor collectionGeorge Liu1-0/+2
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-17Update GenerateSecretKeyRequired response_codeJishnu CM1-1/+0
Currently, GenerateSecretKeyRequired is treated as 403 Forbidden, which would incorrectly imply the session was not created, when it should be treated as an informational message accompanying a successful session creation (with 201 response code), exactly like PasswordChangeRequired. According to the Redfish spec [1], page 202, 203 (Section 13.5.5): * "Shall allow a session login without the Token property and include the @Message.ExtendedInfo in the response containing the GenerateSecretKeyRequired message. This indicates to the client that their session is restricted to performing only the GenerateSecretKey action on their ManagerAccount resource before access is granted." * "Shall allow a POST operation on the VerifyTimeBasedOneTimePassword" action on the ManagerAccount resource associated with the account." * "Shall allow a DELETE operation on Session resources representing open sessions associated with the account." * "May allow GET operations on unauthenticated resources, such as the ServiceRoot resource." * "For all other operations, the service shall respond with the HTTP 403 Forbidden status code and an error response with the GenerateSecretKeyRequired message from the Base Message Registry." Reference: [1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0266_1.24.0.pdf#page=202&zoom=100,0,789 Tested By: * Enabled Multi-Factor Authentication (system-wide option) * When user tries to login with username and password, session is created (201 is returned), with GenerateSecretKeyRequired message in "@Message.ExtendedInfo" * Any operations on restricted resources returned GenerateSecretKeyRequired with 403 Forbidden error code. Change-Id: Iec6c925f04584b2cdd93aec743b04d6a8dbde4bc Signed-off-by: Jishnu CM <jishnunambiarcm@duck.com>
2026-06-25Change a few message responses as errorsMyung Bae2-30/+12
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-25Fix event log timestamp parse errorHaiyue Wang1-1/+8
The comment from 'getEventLogParams()' says: The redfish log format is "<Timestamp> <MessageId>,<MessageArgs>" And in the OpenBMC main tree, the 'rsyslog.conf' from vendor defines: # Template for Redfish messages # "<timestamp> <MessageId>,<MessageArgs>" template(name="RedfishTemplate" type="list") { property(name="timereported" dateFormat="rfc3339") constant(value=" ") property(name="$!REDFISH_MESSAGE_ID") constant(value=",") property(name="$!REDFISH_MESSAGE_ARGS") constant(value="\n") } # If the journal entry has a Redfish MessageId, save as a Redfish # event if ($!REDFISH_MESSAGE_ID != "") then { action(type="omfile" file="/var/log/redfish" template="RedfishTemplate") } The commit aa2dfd26a514 ("Remove static variables") removed extraction of timestamp data from the whole event log entry, 'dateStringToEpoch()' will reject this kind of timestamp with trailing text. Fixes: aa2dfd26a514 ("Remove static variables") Change-Id: Id59af476e56a913a02a9f56a8c5f38c4ada7ccbf Signed-off-by: Haiyue Wang <haiyuewa@163.com>
2026-06-24Reuse timezone helper in getDateTimeOffsetNowJoel P J1-11/+6
Refactor getDateTimeOffsetNow() to reuse the existing details::getTimeZone() helper instead of calling std::chrono::current_zone() directly. This keeps timezone lookup and error logging in one place, while the caller only handles the null case and returns empty strings when the timezone cannot be resolved. Also simplify two return sites by using braced return syntax in getDateTimeOffsetNow() and getDateTimeIso8601() for readability. Change-Id: I8737debe6b9fad34847d9aa53de01ec31d765f93 Signed-off-by: Joel P J <joelpj@ami.com>
2026-06-19sdbusplus: use shorter type aliasesPatrick Williams1-6/+5
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-03Fix sd-bus headerEd Tanous1-1/+1
Not clear when this header changed. But tidy flags it. Fix it. Change-Id: Ie55980b081de8526966b90cefed3e8a107b63275 Signed-off-by: Ed Tanous <etanous@nvidia.com>
2026-05-12Fix PayloadTooLarge to return HTTP 413Rajeev Ranjan1-1/+1
Previously, PayloadTooLarge errors incorrectly returned HTTP 400 Bad Request. This change fixes the HTTP status to 413 Payload Too Large per RFC 7231 so the response code matches the Base.PayloadTooLarge message the service already emits. Root cause: scripts/parse_registries.py is the generator that produces redfish-core/src/error_messages.cpp. Its get_response_code() lookup table did not list PayloadTooLarge, so the generator emitted the default boost::beast::http::status::bad_request. Adding "PayloadTooLarge": "payload_too_large" to the table fixes the generator. Change-Id: I6583b1156ffa4a6b4c99b8a5c82fdcb76ca3a13c Signed-off-by: Rajeev Ranjan <ranjan.rajeev1609@gmail.com>
2026-04-28log_services: Fix AdditionalDataURI link to retrieve logsJohn Chung1-0/+1
The System Dump entry provides an AdditionalDataURI. This change fixes the link to allow logs to be downloaded via the AdditionalDataURI. Log download feature was introduced in commit [1]. However, it was removed in commit [2]. And partially added in commit [3], which added back only requestRoutesBMCDumpEntryDownload. [1] https://github.com/openbmc/bmcweb/commit/0657843a00da62c3a076dacbf6203867a4fb5eb5 [2] https://github.com/openbmc/bmcweb/commit/d206b437e3fb79a89205a9fbe748b017d312ddfa [3] https://github.com/openbmc/bmcweb/commit/168d1b1ac9dac748ea57f7038d0abebfef7462a2 Tested: - redfish-service-validator passed - Download log from AdditionalDataURI link ``` > curl -k -u root:0penBmc -X GET https://192.168.122.10/redfish/v1/Systems/system/LogServices/Dump/Entries/ { "@odata.id": "/redfish/v1/Systems/system/LogServices/Dump/Entries", "@odata.type": "#LogEntryCollection.LogEntryCollection", "Description": "Collection of System Dump Entries", "Members": [ { "@odata.id": "/redfish/v1/Systems/system/LogServices/Dump/Entries/1", "@odata.type": "#LogEntry.v1_11_0.LogEntry", "AdditionalDataSizeBytes": 1198, "AdditionalDataURI": "/redfish/v1/Systems/system/LogServices/Dump/Entries/1/attachment", "Created": "2024-12-19T21:36:24.679117+00:00", "DiagnosticDataType": "OEM", "EntryType": "Event", "Id": "1", "Name": "System Dump Entry", "OEMDiagnosticDataType": "System" } ], "Members@odata.count": 1, "Name": "System Dump Entries" } > curl -k -u root:0penBmc -X GET https://192.168.122.10/redfish/v1/Systems/system/LogServices/Dump/Entries/1/attachment ``` Change-Id: Ifa3e82c53d692229a49dbe571b5a8951de9f4902 Signed-off-by: John Chung <john.chung@arm.com>
2026-04-21Remove static variablesEd Tanous2-22/+21
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-21Remove time_tEd Tanous1-5/+6
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 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: * 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-13Remove now unused functionEd Tanous1-19/+0
After the prior patches, this is unused. Remove it Tested: Code builds Change-Id: I937984c9cb98f8f8f0f515394d9cf2960409512c Signed-off-by: Ed Tanous <etanous@nvidia.com>
2026-04-11Expose date/time in local timezoneIgor Kanyuka3-102/+108
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-10Remove old gcc-13 backportsEd Tanous1-131/+0
This block of code implemented pre-gcc-13 support for time parsing. gcc-13 is now required, so remove it. Change-Id: I266042db97ebe4cdf52c4c62d693efab021ae16f Signed-off-by: Ed Tanous <etanous@nvidia.com>
2026-04-02Implement depth parsing in filter parserEd Tanous1-1/+15
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-31Encapsulate sd-journalEd Tanous1-0/+141
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-23bmcweb: Return HTTP 409 for resource conflict errorsChristian Walter1-2/+2
Change ResourceAlreadyExists from HTTP 400 Bad Request to HTTP 409 Conflict. While the Redfish specification (DSP0266 v1.23.1) does not explicitly mandate to return 409 it makes more sense because: - HTTP 400 implies a malformed request which this is clearly not - HTTP 409 is defined in Table 13 of DSP0266 as Creation or update request could not be completed because it causes a conflict in the current state of the resource which is what happens. Also mapping ResourceCreationConflict to 409 for the same reason even even though its currently not used in the codebase. Tested: POST to create a duplicate user account now returns HTTP 409 with ResourceAlreadyExists message instead of HTTP 400. The ResourceCreationConflict message is not used in the codebase and can not be tested. Change-Id: Id482e5e4f7b3d6ca56228f9d763c95aa50c9856f Signed-off-by: Christian Walter <christian.walter@9elements.com>
2026-03-20Allow to set Manager TZ and show its time in localIgor Kanyuka2-40/+138
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-20Use non-throwing json dump in logging pathsDavy Marrero2-3/+7
json::dump() throws on invalid UTF-8. Two debug log calls were using the default throwing form; switch them to the error_handler_t::replace overload that the rest of the codebase uses. The systems.hpp call passed modeValue.dump() into propertyValueNotInList, which accepts nlohmann::json directly. Removed the unnecessary dump call. Tested: ast-grep scan --error exits 0. Change-Id: I9f9dcb422f51cb1fa3484788c7791311aea95437 Signed-off-by: Davy Marrero <dmarrero@nvidia.com>
2026-03-12NetworkAdapter: add support for Network Adapter Port MetricsHarshit Aghera1-0/+2
This patch enables support for Nvidia ConnectX network cards. Network adapter schemas are restricted to a single URI path format: /redfish/v1/Chassis/{ChassisId}/NetworkAdapters/{NetworkAdaptersId}/. [1] And thus, the port URI follows this structure /redfish/v1/Chassis/{ChassisId}/NetworkAdapters/{NetworkAdaptersId}/ Ports/{PortId}. [2] Route handler for collections and each individual components are added in this patch for each URI resource under /redfish/v1/Chassis/{ChassisId}/NetworkAdapters. Association between Chassis and NetworkAdapter is `containing` and `contained_by`. Association between NetworkAdapter and Port is `connecting` and `connected_to`. This patch enable support for following properties for Port Metrics URI of a Network Port. [3] - TXBytes - RXBytes - RXMulticastFrames - TXMulticastFrames - RXUnicastFrames - TXUnicastFrames - RXBroadcastFrames - TXBroadcastFrames - RXFCSErrors - RXFrameAlignmentErrors - RXFalseCarrierErrors - RXUndersizeFrames - RXOversizeFrames - RXPauseXONFrames - RXPauseXOFFFrames - TXPauseXONFrames - TXPauseXOFFFrames - TXSingleCollisions - TXMultipleCollisions - TXLateCollisions - TXExcessiveCollisions The patch uses "xyz.openbmc_project.Metric.Value" Interface for Network Port Metrics properties. Association between a Metric and a Port is `measuring` and `measured_by`. PDI patch - https://gerrit.openbmc.org/c/openbmc/bmcweb/+/84629 dbus-sensors patches - https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/84520 Tested: Build an image for nvl32-obmc machine with the following patch cherry picked. https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/84520 https://gerrit.openbmc.org/c/openbmc/openbmc/+/85490 The openbmc patch cherry-picks the following patches that are currently under review. ``` 1. device tree https://lore.kernel.org/all/aRbLqH8pLWCQryhu@molberding.nvidia.com/ 2. mctpd patches https://github.com/CodeConstruct/mctp/pull/85 3. u-boot changes https://lore.kernel.org/openbmc/20251121-msx4-v1-0-fc0118b666c1@nvidia.com/T/#t 4. kernel changes as specified in the openbmc patch (for espi) 5. entity-manager changes https://gerrit.openbmc.org/c/openbmc/entity-manager/+/85455 6. platform-init changes https://gerrit.openbmc.org/c/openbmc/platform-init/+/85456 7. spi changes https://lore.kernel.org/all/20251121-w25q01jv_fixup-v1-1-3d175050db73@nvidia.com/ ``` redfish service validator is passing. ``` $ curl -s -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Chassis/Nvidia_IMGX_ConnectX8_SuperNIC_Switch/NetworkAdapters { "@odata.id": "/redfish/v1/Chassis/Nvidia_IMGX_ConnectX8_SuperNIC_Switch/NetworkAdapters", "@odata.type": "#NetworkAdapterCollection.NetworkAdapterCollection", "Members": [ { "@odata.id": "/redfish/v1/Chassis/Nvidia_IMGX_ConnectX8_SuperNIC_Switch/NetworkAdapters/Nvidia_ConnectX_0" }, { "@odata.id": "/redfish/v1/Chassis/Nvidia_IMGX_ConnectX8_SuperNIC_Switch/NetworkAdapters/Nvidia_ConnectX_1" }, { "@odata.id": "/redfish/v1/Chassis/Nvidia_IMGX_ConnectX8_SuperNIC_Switch/NetworkAdapters/Nvidia_ConnectX_2" }, { "@odata.id": "/redfish/v1/Chassis/Nvidia_IMGX_ConnectX8_SuperNIC_Switch/NetworkAdapters/Nvidia_ConnectX_3" } ], "Members@odata.count": 4, "Name": "Nvidia_IMGX_ConnectX8_SuperNIC_Switch Network Adapter Collection" }% $ curl -s -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Chassis/Nvidia_IMGX_ConnectX8_SuperNIC_Switch/NetworkAdapters/Nvidia_ConnectX_1 { "@odata.id": "/redfish/v1/Chassis/Nvidia_IMGX_ConnectX8_SuperNIC_Switch/NetworkAdapters/Nvidia_ConnectX_1", "@odata.type": "#NetworkAdapter.v1_11_0.NetworkAdapter", "Id": "Nvidia_ConnectX_1", "Name": "Nvidia_ConnectX_1 Network Adapter", "Ports": { "@odata.id": "/redfish/v1/Chassis/Nvidia_IMGX_ConnectX8_SuperNIC_Switch/NetworkAdapters/Nvidia_ConnectX_1/Ports" }, "Status": { "Health": "OK", "HealthRollup": "OK", "State": "Enabled" } }% $ curl -s -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Chassis/Nvidia_IMGX_ConnectX8_SuperNIC_Switch/NetworkAdapters/Nvidia_ConnectX_1/Ports { "@odata.id": "/redfish/v1/Chassis/Nvidia_IMGX_ConnectX8_SuperNIC_Switch/NetworkAdapters/Nvidia_ConnectX_1/Ports", "@odata.type": "#PortCollection.PortCollection", "Members": [ { "@odata.id": "/redfish/v1/Chassis/Nvidia_IMGX_ConnectX8_SuperNIC_Switch/NetworkAdapters/Nvidia_ConnectX_1/Ports/Port_0" }, { "@odata.id": "/redfish/v1/Chassis/Nvidia_IMGX_ConnectX8_SuperNIC_Switch/NetworkAdapters/Nvidia_ConnectX_1/Ports/Port_1" } ], "Members@odata.count": 2, "Name": "Nvidia_ConnectX_1 Port Collection" }% $ curl -s -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Chassis/Nvidia_IMGX_ConnectX8_SuperNIC_Switch/NetworkAdapters/Nvidia_ConnectX_1/Ports/Port_0/ { "@odata.id": "/redfish/v1/Chassis/Nvidia_IMGX_ConnectX8_SuperNIC_Switch/NetworkAdapters/Nvidia_ConnectX_1/Ports/Port_0", "@odata.type": "#Port.v1_9_0.Port", "Id": "Port_0", "Metrics": { "@odata.id": "/redfish/v1/Chassis/Nvidia_IMGX_ConnectX8_SuperNIC_Switch/NetworkAdapters/Nvidia_ConnectX_1/Ports/Port_0/Metrics" }, "Name": "Nvidia_ConnectX_1 Port_0 Port", "Status": { "Health": "OK", "HealthRollup": "OK", "State": "Enabled" } }% $ curl -s -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Chassis/Nvidia_IMGX_ConnectX8_SuperNIC_Switch/NetworkAdapters/Nvidia_ConnectX_1/Ports/Port_0/Metrics/ { "@odata.id": "/redfish/v1/Chassis/Nvidia_IMGX_ConnectX8_SuperNIC_Switch/NetworkAdapters/Nvidia_ConnectX_1/Ports/Port_0/Metrics", "@odata.type": "#PortMetrics.v1_7_0.PortMetrics", "Id": "Metrics", "Name": "Nvidia_ConnectX_1 Port_0 Port Metrics", "Networking": { "RXBroadcastFrames": 0, "RXFCSErrors": 0, "RXFalseCarrierErrors": 0, "RXFrameAlignmentErrors": 0, "RXMulticastFrames": 0, "RXOversizeFrames": 0, "RXPauseXOFFFrames": 0, "RXPauseXONFrames": 0, "RXUndersizeFrames": 0, "RXUnicastFrames": 0, "TXBroadcastFrames": 0, "TXExcessiveCollisions": 0, "TXLateCollisions": 0, "TXMulticastFrames": 0, "TXMultipleCollisions": 0, "TXPauseXOFFFrames": 0, "TXPauseXONFrames": 0, "TXSingleCollisions": 0, "TXUnicastFrames": 0 }, "RXBytes": 0, "TXBytes": 0 }% ``` [1]: https://redfish.dmtf.org/schemas/v1/NetworkAdapter_v1.xml [2]: https://redfish.dmtf.org/schemas/v1/Port_v1.xml [3]: https://redfish.dmtf.org/schemas/v1/PortMetrics_v1.xml Change-Id: I73c5a39b12f8f0a40026fb50c2ded53e0b225f67 Signed-off-by: Harshit Aghera <haghera@nvidia.com>
2026-03-09Remove redundant is_method_error() checksGeorge Liu1-6/+0
The handlers registered through sdbusplus::bus::match_t only receive D-Bus signals. Signal messages are never sent as method-error replies, and therefore message.is_method_error() can never be true in these callbacks. This change removes all unnecessary is_method_error() checks from signal handlers to simplify the code and avoid confusion. Change-Id: I280c94c074b8a30eaf8edaf7fb36edaa8a3c3ef5 Signed-off-by: George Liu <liuxiwei@ieisystem.com>
2026-02-24Fix spelling mistakes using codespellGeorge Liu2-2/+2
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: If170e53077bc150d0062cd441394daea71f842b1
2026-02-24Be more paranoid in json parsingEd Tanous1-4/+2
When taking json directly from a user, we should set some limits on parsing depth as well as total number of value elements. Value elements are considered any individual value, the start of an array, the start of a dictionary, or null. This is to prevent flooding type attacks creating large number of objects, while still keeping under the depth 10 cap. This commit makes use of the nlohmann sax parse to handle this by injecting a new error handler in between that will impose new limits. Currently this sets the depth limit to 10 and the total number of keys to 500; These are intentionally high, and could be tuned or expanded on in the future. Tested: Unit tests pass. Change-Id: I789543679e22b0b0ce0b2b0b71f31377b0759cd7 Signed-off-by: Ed Tanous <etanous@nvidia.com>
2026-02-03Fabric: add support for PCIe Switch Port URIHarshit Aghera1-0/+4
This patch enable support for following properties for Port of a PCIe Switch. [1] - PortProtocol - PortType - CurrentSpeedGbps - ActiveWidth One of the devices that gets enabled with this patch is Nvidia ConnectX devices, which are network cards featuring an integrated PCIe switch. These devices combine both PCIe ports and network ports in a single unit. Since such devices don't strictly qualify as Fabric Adapters, the Switch URI is used instead of the FabricAdapter URI. Port schema only allows certain URIs as Port URI. URI /redfish/v1/Fabrics/{FabricId}/Switches/{SwitchId}/Ports/{PortId} seems most appropriate choice for PCIe Switch Port. [1] The Fabric resource is modeled similarly to the System resource, meaning that only one Fabric resource will exist for each BMC. Route handler for collections and each individual components are added in this patch for each URI resource under /redfish/v1/Fabrics. DBus Interface "xyz.openbmc_project.Inventory.Item.PCIeSwitch" is used to identify the Switch resources. Association between Switch and Port is `connecting` and `connected_to`. Feature like Port Metrics properties (for PCIe Error Counters) can be added in future at Port Metric URI. dbus-sensors patches - https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/84079 https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/83202 Tested: Build an image for nvl32-obmc machine with the following patch cherry picked. https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/84079 https://gerrit.openbmc.org/c/openbmc/openbmc/+/85490 The openbmc patch cherry-picks the following patches that are currently under review. ``` 1. device tree https://lore.kernel.org/all/aRbLqH8pLWCQryhu@molberding.nvidia.com/ 2. mctpd patches https://github.com/CodeConstruct/mctp/pull/85 3. u-boot changes https://lore.kernel.org/openbmc/20251121-msx4-v1-0-fc0118b666c1@nvidia.com/T/#t 4. kernel changes as specified in the openbmc patch (for espi) 5. entity-manager changes https://gerrit.openbmc.org/c/openbmc/entity-manager/+/85455 6. platform-init changes https://gerrit.openbmc.org/c/openbmc/platform-init/+/85456 7. spi changes https://lore.kernel.org/all/20251121-w25q01jv_fixup-v1-1-3d175050db73@nvidia.com/ ``` redfish service validator is passing. ``` $ curl -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Fabrics/ { "@odata.id": "/redfish/v1/Fabrics", "@odata.type": "#FabricCollection.FabricCollection", "Members": [ { "@odata.id": "/redfish/v1/Fabrics/fabric" } ], "Members@odata.count": 1, "Name": "Fabric Collection" }% $ curl -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Fabrics/fabric/ { "@odata.id": "/redfish/v1/Fabrics/fabric", "@odata.type": "#Fabric.v1_2_0.Fabric", "Id": "fabric", "Name": "fabric Fabric", "Switches": { "@odata.id": "/redfish/v1/Fabrics/fabric/Switches" } }% $ curl -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Fabrics/fabric/Switches/ { "@odata.id": "/redfish/v1/Fabrics/fabric/Switches", "@odata.type": "#SwitchCollection.SwitchCollection", "Members": [ { "@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0" }, { "@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_1" }, { "@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_2" }, { "@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_3" } ], "Members@odata.count": 4, "Name": "fabric Switch Collection" }% $ curl -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0 { "@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0", "@odata.type": "#Switch.v1_7_0.Switch", "Id": "Nvidia_ConnectX_0", "Name": "Nvidia_ConnectX_0", "Ports": { "@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports" }, "Status": { "Health": "OK", "State": "Enabled" } }% $ curl -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/ { "@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports", "@odata.type": "#PortCollection.PortCollection", "Members": [ { "@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/DOWN_0" }, { "@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/DOWN_1" }, { "@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/UP_0" } ], "Members@odata.count": 3, "Name": "Nvidia_ConnectX_0 Port Collection" }% $ curl -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/UP_0/ { "@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/UP_0", "@odata.type": "#Port.v1_4_0.Port", "ActiveWidth": 8, "CurrentSpeedGbps": 32.0, "Id": "UP_0", "Metrics": { "@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/UP_0/Metrics" }, "Name": "Nvidia_ConnectX_0 UP_0 Port", "PortProtocol": "PCIe", "PortType": "UpstreamPort", "Status": { "Health": "OK", "State": "Enabled" } }% ``` [1]: https://redfish.dmtf.org/schemas/v1/Port_v1.xml Change-Id: I52f4ca62b4953f6196c589e340602a0d7885d9c1 Signed-off-by: Harshit Aghera <haghera@nvidia.com>
2026-01-30Remove usages of nlohmann::json::begin()Ed Tanous1-16/+30
nlohmann::json::begin() throws an uncaught exception. Tested: Redfish service validator passes. Signed-off-by: Ed Tanous <ed@tanous.net> Change-Id: I08244b0787cd4d6e592b0731196490a5160aba62
2025-12-18Implement modernize-use-rangesEd Tanous1-2/+2
This tidy check can transform code to use std::ranges. Enable the check, apply the fixes it proposes. Tested: Redfish service validator passes in qemu Change-Id: I3f21b27d3d30277f71b9c8a2c584a22bc16865e9 Signed-off-by: Ed Tanous <etanous@nvidia.com>
2025-12-02Use boost::urls::formatEd Tanous1-3/+2
boost::urls::format is specifically meant for URL construction. It handles encoding like percentage encoding which std::format does not. Change-Id: Ib6e6bc8bcf30b138b93111577d9f2150709dda5c Signed-off-by: Ed Tanous <etanous@nvidia.com>
2025-11-26Combine handlers for systems eventlogOliver Brewka1-7/+2
Following patch 85522 [1], combine the handlers in systems eventlog. Tested: Unit tests pass. [1] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/85522 Change-Id: Ib1649de83e64abb289e0379139d0a75466e15257 Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
2025-11-26Combine handlersEd Tanous1-4/+1
Fix one comment made on [1] to combine method calls into a single one. Tested: Unit tests pass, @Oliver Brewka need your help to sanity check this. [1] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/83355 Change-Id: Iad90d57c6cd0fe3926186f238aba887b88e99c12 Signed-off-by: Ed Tanous <etanous@nvidia.com>
2025-11-24redfish-core: Refactor storage.hppChristopher Meis1-5/+3
This change splits out storage controller and storage drive route setup and code into new files and unifies the call of route setup for storage, storage controller and storage drive collection and single storage controller properties. Tested: CI ran through without errors, build testing succeeded. Change-Id: I234eb034205b7e6c3a5f307172019d53d42de6e3 Signed-off-by: Christopher Meis <christopher.meis@9elements.com>
2025-11-23Rename Systems EventLog route handlerOliver Brewka1-7/+7
Rename the route handler to clearly indicate, that the handler handles the ComputerSystem redfish resource. Tested: Code compiles. Change-Id: Ib722427ab53f35b2270fe6e102614f21fe28ffcb Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
2025-11-23Add DBus EventLog to ManagerOliver Brewka1-1/+12
In order to get access to the EventLog on multi-host platforms, add Journal EventLog to Manager. This implementation is based on the discussion we had on patch 76319 [1]. TLDR: On multi-host, we technically would have to split the event log on a per host node basis, so that each host node has its own specific event log. However, this is currently not supported so we had to decide, whether we put it on a specific ComputerSystem, or refactor the current implementation of the EventLog, to allow for the EventLog LogService to be part of the Managers resource. We chose the latter one, because a), it is not clear on which ComputerSystem to put the EventLog, as long as we aren't splitting the event log per host node, and b), if that particular ComputerSystem is not existing at runtime, there would be no access to the EventLog at all. This feature can be enabled with the redfish-eventlog-location meson option. By default it is set to 'systems', which translates to the EventLog being under the Systems resource. To enable the EventLog under the Managers resource set ``` -Dredfish-eventlog-location=managers ``` This in turn, disables the EventLog under the ComputerSystem resource. Tested: Redfish validation succeeded for both ComputerSystem and Managers tree. Patch LogEntry: ``` $ curl -k -X PATCH 'https://'"${BMC}"':'"${BMC_WEBPORT}"'/redfish/v1/Managers/bmc/LogServices/EventLog/Entries/4444' \ -H 'X-Auth-Token: '"$BMCWEB_SESSION_TOKEN"'' \ -H "Content-Type: application/json" -d "{"Resolved":true}" $ busctl introspect xyz.openbmc_project.Logging /xyz/openbmc_project/logging/entry/4444 NAME TYPE SIGNATURE RESULT/VALUE FLAGS ... xyz.openbmc_project.Logging.Entry interface - - - .GetEntry method - h - .AdditionalData property a{ss} 5 "CALLOUT_INVENTORY_PATH" "/xyz/open... emits-change writable .EventId property s "" emits-change writable .Id property u 4444 emits-change writable .Message property s "xyz.openbmc_project.Sensor.Threshold... emits-change writable .Resolution property s "" emits-change writable .Resolved property b true emits-change writable ``` Delete LogEntry: ``` $ busctl tree xyz.openbmc_project.Logging ... | |- /xyz/openbmc_project/logging/entry/6498 | |- /xyz/openbmc_project/logging/entry/6499 | |- /xyz/openbmc_project/logging/entry/6500 | |- /xyz/openbmc_project/logging/entry/6501 ... $ curl -k -X DELETE 'https://'"${BMC}"':4443/redfish/v1/Managers/bmc/LogServices/EventLog/Entries/6500' \ -H 'X-Auth-Token: '"$BMCWEB_SESSION_TOKEN"'' \ -H "Content-Type: application/json" | |- /xyz/openbmc_project/logging/entry/6498 | |- /xyz/openbmc_project/logging/entry/6499 | |- /xyz/openbmc_project/logging/entry/6501 ``` ClearLog action: ``` $ curl -k -X POST 'https://'"${BMC}"':4443/redfish/v1/Managers/bmc/LogServices/EventLog/Actions/LogService.ClearLog' \ -H 'X-Auth-Token: '"$BMCWEB_SESSION_TOKEN"'' \ -H "Content-Type: application/json" { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The request completed successfully.", "MessageArgs": [], "MessageId": "Base.1.19.Success", "MessageSeverity": "OK", "Resolution": "None." } ] } ``` [1] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/76319 Change-Id: Ie619af8e10a723aef2e02ef03796851511b05008 Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
2025-11-21Add Journal EventLog to ManagerOliver Brewka1-17/+26
In order to get access to the EventLog on multi-host platforms, add Journal EventLog to Manager. This implementation is based on the discussion we had on patch 76319 [1]. TLDR: On multi-host, we technically would have to split the event log on a per host node basis, so that each host node has its own specific event log. However, this is currently not supported so we had to decide, whether we put it on a specific ComputerSystem, or refactor the current implementation of the EventLog, to allow for the EventLog LogService to be part of the Managers resource. We chose the latter one, because a), it is not clear on which ComputerSystem to put the EventLog, as long as we aren't splitting the event log per host node, and b), if that particular ComputerSystem is not existing at runtime, there would be no access to the EventLog at all. This feature can be enabled with the redfish-eventlog-location meson option. By default it is set to 'systems', which translates to the EventLog being under the Systems resource. To enable the EventLog under the Managers resource set ``` -Dredfish-eventlog-location=managers ``` This in turn, disables the EventLog under the ComputerSystem resource. Tested: Redfish validation succeeded for both ComputerSystem and Managers tree. ``` curl command: curl -w "@curl-format.txt" -c cjar -b cjar -k -X GET 'https://'"${BMC}"':4443/redfish/v1/'"$ROUTE"'' \ -H 'X-Auth-Token: '"$BMCWEB_SESSION_TOKEN"'' GET /redfish/v1/Managers/bmc/LogServices { "@odata.id": "/redfish/v1/Managers/bmc/LogServices", "@odata.type": "#LogServiceCollection.LogServiceCollection", "Description": "Collection of LogServices for this Manager", "Members": [ { "@odata.id": "/redfish/v1/Managers/bmc/LogServices/Journal" }, { "@odata.id": "/redfish/v1/Managers/bmc/LogServices/EventLog" } ], "Members@odata.count": 2, "Name": "Open BMC Log Services Collection" } GET /redfish/v1/Managers/bmc/LogServices/EventLog { "@odata.id": "/redfish/v1/Managers/bmc/LogServices/EventLog", "@odata.type": "#LogService.v1_2_0.LogService", "Actions": { "#LogService.ClearLog": { "target": "/redfish/v1/Managers/bmc/LogServices/EventLog/Actions/LogService.ClearLog" } }, "DateTime": "2025-09-24T15:22:36+00:00", "DateTimeLocalOffset": "+00:00", "Description": "Manager Event Log Service", "Entries": { "@odata.id": "/redfish/v1/Managers/bmc/LogServices/EventLog/Entries" }, "Id": "EventLog", "Name": "Event Log Service", "OverWritePolicy": "WrapsWhenFull" } GET /redfish/v1/Managers/bmc/LogServices/EventLog/Entries { "@odata.id": "/redfish/v1/Managers/bmc/LogServices/EventLog/Entries", "@odata.type": "#LogEntryCollection.LogEntryCollection", "Description": "Collection of Manager Event Log Entries", "Members": [ { "@odata.id": "/redfish/v1/Managers/bmc/LogServices/EventLog/Entries/1730009576", "@odata.type": "#LogEntry.v1_9_0.LogEntry", "Created": "2024-10-27T06:12:56+00:00", "EntryType": "Event", "Id": "1730009576", "Message": "Host system DC power is off", "MessageArgs": [], "MessageId": "OpenBMC.0.1.DCPowerOff", "Name": "Manager Event Log Entry", "Severity": "OK" }, ... ], "Members@odata.count": 2820, "Members@odata.nextLink": "/redfish/v1/Managers/bmc/LogServices/EventLog/Entries?$skip=1000", "Name": "Manager Event Log Entries" } GET /redfish/v1/Managers/bmc/LogServices/EventLog/Entries/1730009576 { "@odata.id": "/redfish/v1/Managers/bmc/LogServices/EventLog/Entries/1730009576", "@odata.type": "#LogEntry.v1_9_0.LogEntry", "Created": "2024-10-27T06:12:56+00:00", "EntryType": "Event", "Id": "1730009576", "Message": "Host system DC power is off", "MessageArgs": [], "MessageId": "OpenBMC.0.1.DCPowerOff", "Name": "Manager Event Log Entry", "Severity": "OK" } ``` ClearLog action: Log files are being successfully deleted from /var/log [1] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/76319 Change-Id: If5b4fe10151b6bfd28a1b49c41f8cfcec1b9132c Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
2025-11-18Correct the version of Message IdThang Tran2-17/+50
Applications are logging Redfish Message ID to journal, but the version of some message ID are different with the definition of bmcweb. E.g: - psusensor is defining version of OpenBMC registry is "0.1" as [1]. - The bmcweb defines the version of OpenBMC registry is "0.5" as [2]. It makes the "MessageId" property of Event log's enties has different version with definition in the /redfish/v1/Registries. This commit corrects the version of Message ID. [1]: https://github.com/openbmc/dbus-sensors/blob/6b7123225fc4a5180faf89190e9f64a7e248e697/src/psu/PSUEvent.cpp#L121 [2]: https://github.com/openbmc/bmcweb/blob/master/redfish-core/include/registries/openbmc.json#L1678 Tested: Verify the version of Events are the same the version of Registries that are defined in the bmcweb. Change-Id: Ib862c8d0a62cae63082436cb4646a9ca45207872 Signed-off-by: Thang Tran <thuutran@amperecomputing.com>
2025-11-14redfish/lib: simplify memory.hppChristopher Meis1-1/+0
This change simplify the routes and route setup for memory functions. Change-Id: I13d66fbda48672032bb4a037743ad6f074783620 Signed-off-by: Christopher Meis <christopher.meis@9elements.com>
2025-11-12Refactor LogService collection handlerOliver Brewka1-2/+2
The route handler for Systems LogService collection consisted of a huge lambda. Extract the code and put it into a separate function. Also, rename the route handler, to align with the Redfish resource identifiers and reorder the placement of the functions, so that requestRoutes functions are at the bottom of the file. Tested: Code compiles. Change-Id: Ifb9b27a5648870e5691777e7b031ff464a657b42 Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
2025-11-12Dynamic EventLogService handlerOliver Brewka1-1/+1
In order to reuse the handler for the EventLogService under Managers, extract the logic from the handler and put it into a separate function in the eventlog util. Add an additional argument that specifies the redfish resource, so we can handle Systems and Managers resource with the same handler. Tested: Code compiles. Redfish validation succeeds. Additionally the curl output with and without the changes has been diffed. No differences observed. Change-Id: I48825b55b41afeafa02283dc91cf4cb1cd4cd7c3 Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
2025-11-10Parse number types from the base registryEd Tanous2-18/+24
Rather than maintaining a list of arguments that are numbers (which is error prone), update the script to just trust that the few parameters labeled in Redfish as numbers should in fact show up in the API as numbers. Functionally this changes the APIs for only a few error messages, only one of which (StringValueTooShort) is used and that usage was added recently. Tested: SRV passes. Change-Id: I580523ecc0263688738bcb7f7925913e40e2a113 Signed-off-by: Ed Tanous <etanous@nvidia.com>
2025-11-10redfish-core: Unify fan routingChristopher Meis1-1/+0
This change unifies fan collection and fan property get route setup. Change-Id: Ib09a3b7b667ee551df74f2483babf4d0526e26dd Signed-off-by: Christopher Meis <christopher.meis@9elements.com>
2025-11-03PasswordChangeRequired: Fix error messageJoey Berkovitz1-1/+1
The PasswordChangeRequired error was incorrectly formatted. Per the spec, it should be an error response and 403 on all requests except for session creation, which is just a `@Message.ExtendedInfo` annotation. See [1]. This is a follow-up to 1c651ee12ad55ab6626c2baf3754aecda305ba43 which accidentally only broke out the password change logic for session creation. This change adjusts the non-session-creation error response for PasswordChangeRequired to return a proper error. Tested: - Built a romulus image - Ran `passwd --expire root` - curl to Managers and session creation ``` ╰─○ curl -kv --user "$BMC_USER:$BMC_PASS" https: //localhost:2443/redfish/v1/Managers < HTTP/2 403 { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The password provided for this account must be changed before access is granted. PATCH the Password property for this account located at the target URI '/redfish/v1/AccountService/Accounts/root' to complete this process.", "MessageArgs": [ "/redfish/v1/AccountService/Accounts/root" ], "MessageId": "Base.1.19.PasswordChangeRequired", "MessageSeverity": "Critical", "Resolution": "Change the password for this account using a PATCH to the Password property at the URI provided." } ], "code": "Base.1.19.PasswordChangeRequired", "message": "The password provided for this account must be changed before access is granted. PATCH the Password property for this account located at the target URI '/redfish/v1/AccountService/Accounts/root' to complete this process." } } ╰─○ curl -kv -X POST -H 'Content-Type: application/json' -d '{"UserName": "root", "Password": "..."}' https://localhost:2443/redfish/v1/SessionService/Sessions < HTTP/2 201 { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The password provided for this account must be changed before access is granted. PATCH the Password property for this account located at the target URI '/redfish/v1/AccountService/Accounts/root' to complete this process.", "MessageArgs": [ "/redfish/v1/AccountService/Accounts/root" ], "MessageId": "Base.1.19.PasswordChangeRequired", "MessageSeverity": "Critical", "Resolution": "Change the password for this account using a PATCH to the Password property at the URI provided." } ], "@odata.id": "/redfish/v1/SessionService/Sessions/klDQdHSMME", "@odata.type": "#Session.v1_7_0.Session", "ClientOriginIPAddress": "0.0.0.0", "Description": "Manager User Session", "Id": "klDQdHSMME", "Name": "User Session", "Roles": [ "Administrator" ], "UserName": "root" } ``` [1]: https://www.dmtf.org/sites/default/files/standards/documents/DSP0266_1.22.1.html#password-change-required-handling Change-Id: I0ab50b4e2298d13ae00f84bc7891c2a14610e1b2 Signed-off-by: Joey Berkovitz <joey@berkovitz.us>
2025-10-21Add back include cleanerEd Tanous6-7/+20
Include cleaner helps the code review process. Add it back, by ignoring some of the more recent boost headers. Change-Id: I6eddd0e67cd9f469c93fbb344cc1ab46231e450f Signed-off-by: Ed Tanous <etanous@nvidia.com>
2025-10-07Inventory properties via Assembly schemaSunnySrivastava19841-0/+3
This commit implements Redfish Assembly schema. This schema will be used to publish inventory data for FRUs which are attached to a given Chassis and does not map to any specific schema definition. The properties which are published in this commit are LocationCode, SparePartNumber, Model, SerialNumber and PartNumber. One of the major use case to publish these properties via redfish is for anyone to identify the inventory and its location in the system, which in turn will help them in repair/replacement related to that FRU. The validator has been executed on the change and no error has been found. As this has been tested on a development image some fields are empty in the below pasted output for which warning was thrown by validator but no errors. Sample Output with [1]: ``` { "@odata.id": "/redfish/v1/Chassis/chassis/Assembly", "@odata.type": "#Assembly.v1_5_1.Assembly", "Assemblies": [ { "@odata.id": "/redfish/v1/Chassis/chassis/Assembly#/Assemblies/0", "@odata.type": "#Assembly.v1_5_1.AssemblyData", "Location": { "PartLocation": { "ServiceLabel": "U78DA.ND0.1234567-D0" } }, "Manufacturer": "", "MemberId": "0", "Model": "", "Name": "base_op_panel_blyth", "PartNumber": "", "SerialNumber": "", "Status": { "Health": "OK", "State": "Absent" } }, { "@odata.id": "/redfish/v1/Chassis/chassis/Assembly#/Assemblies/1", "@odata.type": "#Assembly.v1_5_1.AssemblyData", "Location": { "PartLocation": { "ServiceLabel": "U78DA.ND0.1234567-D1" } }, "Manufacturer": "", "MemberId": "1", "Model": "6B86", "Name": "lcd_op_panel_hill", "PartNumber": "PN12345", "SerialNumber": "YL6B86010000", "Status": { "Health": "OK", "State": "Enabled" } } ], "Assemblies@odata.count": 2, "Id": "Assembly", "Name": "Assembly Collection" } ``` [1] https://gerrit.openbmc.org/c/openbmc/openbmc/+/83907 Change-Id: I2d462340fe1a0b0eb387697f0ff70fcafde3f8d9 Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com> Signed-off-by: Ninad Palsule <ninad@linux.ibm.com> Signed-off-by: Myung Bae <myungbae@us.ibm.com>
2025-10-06lib/processor.hpp: Clean upChristopher Meis1-2/+1
Clean up route generation and remove large lambda functions. Also separate processor from processor operating configuration functions into two files. Change-Id: I2b72f8663105b6a89612e6e7bc1e7e0812b81eae Signed-off-by: Christopher Meis <christopher.meis@9elements.com>
2025-10-01Break out DBus EventLogOliver Brewka1-0/+1
As part of a EventLog refactor, break out all code used for Systems DBus EventLog, in order to make the code base more maintainable in the long run. Tested: Only code extraction. Code compiles. Change-Id: I94de7bf3171fd3963eebec6608438f8d07cee44c Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
2025-09-15Break out Journal EventLogOliver Brewka1-0/+1
As part of a EventLog refactor, break out all code used for Systems Journal EventLog, in order to make the code base more maintainable in the long run. Tested: Only code extraction. Code compiles. Change-Id: I855c8c680d3de68944b0ae03ff7f181e6790c456 Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
2025-09-12Implement Fabric PortCollection and Port schemasGeorge Liu1-0/+2
This implements 2 schemas for FabricAdapters [1][2]. The implementation uses `GetAssociatedSubTreePathsById` & `GetAssociatedSubTreeById`. - https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/69999 The association is defined via - https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/62881. The backend port examples are also committed via - https://gerrit.openbmc.org/c/openbmc/openpower-vpd-parser/+/66540 - https://gerrit.openbmc.org/c/openbmc/openpower-vpd-parser/+/70888 - https://gerrit.openbmc.org/c/openbmc/openbmc/+/66541 The current submission only implements the basic properties of Port (e.g. Id, Name etc) as a foundation of the future additional properties. - Location - LocationIndicatorActive - Status One example of Ports is this cable card for the i/o expansion drawers and modeling the 2 ports on the cable card [3]. These ports have an identify led, a location code, and a status. Tested: - Redfish Validator passes - perform GET methods like these: ``` curl -k -X GET https://${bmc}/redfish/v1/Systems/system/FabricAdapters/disk_backplane0 { "@odata.id": "/redfish/v1/Systems/system/FabricAdapters/disk_backplane0", "@odata.type": "#FabricAdapter.v1_4_0.FabricAdapter", "Id": "disk_backplane0", ... "Ports": { "@odata.id": "/redfish/v1/Systems/system/FabricAdapters/disk_backplane0/Ports" }, ... } ``` ``` curl -k -X GET https://${bmc}/redfish/v1/Systems/system/FabricAdapters/disk_backplane0/Ports { "@odata.id": "/redfish/v1/Systems/system/FabricAdapters/disk_backplane0/Ports", "@odata.type": "#PortCollection.PortCollection", "Members": [ { "@odata.id": "/redfish/v1/Systems/system/FabricAdapters/disk_backplane0/Ports/dp0_connector4" }, { "@odata.id": "/redfish/v1/Systems/system/FabricAdapters/disk_backplane0/Ports/dp0_connector5" } ], "Members@odata.count": 2, "Name": "Port Collection" } ``` ``` curl -k -X GET https://${bmc}:18080/redfish/v1/Systems/system/FabricAdapters/disk_backplane0/Ports/dp0_connector4 { "@odata.id": "/redfish/v1/Systems/system/FabricAdapters/disk_backplane0/Ports/dp0_connector4", "@odata.type": "#Port.v1_7_0.Port", "Id": "dp0_connector4", "Name": "dp0_connector4" }% ``` Also try the invalid port like ``` curl -k -X GET https://${bmc}:18080/redfish/v1/Systems/system/FabricAdapters/io_module1/Ports/INVALID { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type Port named 'INVALID' was not found.", "MessageArgs": [ "Port", "INVALID" ], "MessageId": "Base.1.16.0.ResourceNotFound", "MessageSeverity": "Critical", "Resolution": "Provide a valid resource identifier and resubmit the request." } ], "code": "Base.1.16.0.ResourceNotFound", "message": "The requested resource of type Port named 'INVALID' was not found." } }% ``` [1] https://redfish.dmtf.org/schemas/v1/PortCollection_v1.xml [2] https://redfish.dmtf.org/schemas/v1/Port_v1.xml [3] https://www.ibm.com/docs/en/power10?topic=details-pcie4-cable-adapter-fc-ej24-ccin-6b92 Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I8c64c16764e85c0716e264263708b18f897a2c0c Signed-off-by: Myung Bae <myungbae@us.ibm.com>
2025-08-27Move common structuresEd Tanous2-2/+2
It's ideal if the various BMCWEB_ROUTE lib calls do not call from one another. This reduces the amount of code that's compiled each time separately. Tested: Code compiles. Change-Id: I4822ce66c122f261cc6aa34bbd99371b7eff48c8 Signed-off-by: Ed Tanous <etanous@nvidia.com>