summaryrefslogtreecommitdiff
path: root/redfish-core/include/registries
AgeCommit message (Collapse)AuthorFilesLines
2025-08-18Generate update registryAlexander Hansen1-12/+67
Generate the update registry, needed to return correct error messages from update service. Change-Id: Ifaa699cad8531070aea47d2476c1834df7c61e08 Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
2025-07-11Add SubordinateOverrides & Fix Log_services privilegesAbhishek Patel1-0/+114
SubordinateOverrides: This commit automates the creation of SubordinateOverrides privileges structures from the redfish privilege registry. In addition, it enhances the function of parse_registries.py. It reads SubordinateOverrides privilege registry from DMTF and generates const defines SubordinateOverrides for all the privilege registry entries in the same format that the Privileges struct accepts. Moreover, it generates unique const defines for all SubordinateOverrides target levels. Ex: EthernetInterface SubordinateOverrides has two "Targets": ["Manager", "EthernetInterfaceCollection"]. So parse_registries.py generates two unique const 1) Subordinate override for Manager -> EthernetInterface 2) Subordinate override for Manager -> EthernetInterfaceCollection -> EthernetInterface Note: if SubordinateOverrides privilege gets changed, then it automatically updates that route privilege, but if SubordinateOverrides target gets changed, then the user needs to update that manually. Fix Log_services privileges: In Log_services, some of the privileges not following the Redfish_1.1.0_PrivilegeRegistry registry. This commit contains the following LogServices privileges. 1) POST method ``` ComputerSystem -> LogServiceCollection -> LogService - POST /redfish/v1/Systems/<str>/LogServices/EventLog/Actions/LogService.ClearLog/ - POST /redfish/v1/Systems/<str>/LogServices/Dump/Actions/LogService.CollectDiagnosticData/ - POST /redfish/v1/Systems/<str>/LogServices/Dump/Actions/LogService.ClearLog/ - POST /LogServices/PostCodes/Actions/LogService.ClearLog/ ``` 2) DELETE method ``` ComputerSystem -> LogServiceCollection -> LogService -> LogEntryCollection -> LogEntry - DELETE /redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/ ``` This commit also changes the current privilege 1) ConfigureManager to ConfigureComponents. ``` DELETE /redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str> ``` 2) ConfigureCompnents -> ConfigureManager ``` POST /redfish/v1/Systems/<str>/LogServices/Dump/Actions/LogService.ClearLog/ POST /redfish/v1/Systems/<str>/LogServices/EventLog/Actions/LogService.ClearLog/ POST /redfish/v1/Systems/<str>/LogServices/Dump/Actions/LogService.CollectDiagnosticData/ ``` Tested: manually tested on Witherspoon system, there is no change in output. Run Redfish validator, with all different Privileges; Error Get: UUID: String '' does not match pattern '' this commit doesn't affect UUID Email sent to openbmc list: https://lists.ozlabs.org/pipermail/openbmc/2021-August/027232.html Change-Id: I37d8a2882f1cfaa59a482083f180fdd0805e2e7d Signed-off-by: Abhishek Patel <Abhishek.Patel@ibm.com> Signed-off-by: Myung Bae <myungbae@us.ibm.com>
2025-05-20registries: make registration dynamicPatrick Williams19-95/+247
Rather than having to manually hook code for registries, add a small registration function to the registry header and use this registration results throughout the registry interactions. Tested: Confirmed registries have same behavior. ``` $ curl -s -k https://localhost:18080/redfish/v1/Registries/ | jq '.Members | map(."@odata.id")' [ "/redfish/v1/Registries/Base", "/redfish/v1/Registries/HeartbeatEvent", "/redfish/v1/Registries/OpenBMC", "/redfish/v1/Registries/ResourceEvent", "/redfish/v1/Registries/TaskEvent", "/redfish/v1/Registries/Telemetry" ] ``` ``` $ curl -s -k https://localhost:18080/redfish/v1/Registries/TaskEvent/TaskEvent | jq ".Messages | keys" [ "TaskAborted", "TaskCancelled", "TaskCompletedOK", "TaskCompletedWarning", "TaskPaused", "TaskProgressChanged", "TaskRemoved", "TaskResumed", "TaskStarted" ] ``` Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Iaa355420736a2587d9da4e995208d579443ca9b8
2025-02-27Update Environmental registry version to 1.1.0Igor Kanyuka1-24/+861
New version includes Leak related messages we need. Testing: Redfish service validator passing Change-Id: Ieca3e5a7bb785ef7fcffb05f86b88bdbf23a3d99 Signed-off-by: Igor Kanyuka <ifelmail@gmail.com>
2025-01-20Use SPDX identifiersEd Tanous20-0/+40
SPDX identifiers are simpler, and reduce the amount of cruft we have in code files. They are recommended by linux foundation, and therefore we should do as they allow. This patchset does not intend to modify any intent on any existing copyrights or licenses, only to standardize their inclusion. [1] https://www.linuxfoundation.org/blog/blog/copyright-notices-in-open-source-software-projects Change-Id: I935c7c0156caa78fc368c929cebd0f068031e830 Signed-off-by: Ed Tanous <etanous@nvidia.com>
2024-12-27Use raw content URLMilton D. Miller II1-1/+1
Replace the message registry URL with the official GitHub raw download URL to give the json content not a web SCM GUI. Change-Id: I0ac800ee3803c9bef3a6a799b20887df84c3c173 Signed-off-by: Milton Miller <mdmii@outlook.com>
2024-12-16Fix URI warning in RSVEd Tanous1-1/+1
Redfish service valitator warns: WARNING - PublicationUri: Empty string found - Services should omit properties if not supported This commit adds to our registry the url to the openbmc registry file. Tested: Redfish Service validator no longer returns a warning. Change-Id: Ia54be175490b4e7e00e3c0c4ab8c60dce1b96863 Signed-off-by: Ed Tanous <etanous@nvidia.com>
2024-12-10Make message registries use 2 digit versionsEd Tanous19-38/+57
Redfish specification, section 9.5.11.2 says: The MessageId property value shall be in the format: <MessageRegistryPrefix>.<MajorVersion>.<MinorVersion>.<MessageKey> bmcweb in certain places has incorrectly used the 3 digit version instead of the 2 digit version. This commit fixes that by modifying the parse_registries script to generate 3 separate struct entries to represent the registry version, and parse them where appropriate. MessageRegistryFileCollection uses the 3 digit version. No behavior changes. Message/event log entries use the 2 digit version. This will cause a MessageId change from: Base.1.19.0.InternalError to Base.1.19.InternalError This is a breaking change, so a new option to allow the old behavior is provided. Tested: Redfish Service validator passes. Heartbeat events on EventService show 2 digit versions. Change-Id: I4165e994f73e200f13bed8ea76cb58bee2b69faa Signed-off-by: Ed Tanous <etanous@nvidia.com>
2024-10-01Bump base registry to 1.19.0Jishnu CM1-87/+111
Adds GenerateSecretKeyRequired registry to the Base for MFA Change-Id: Ia690639b4bebbbd265b223bd626b0eb814103f99 Signed-off-by: Jishnu CM <jishnunambiarcm@duck.com>
2024-08-28Add message registry for power button long pressChanh Nguyen2-61/+80
When the power button is pressed, it depends on how long the press takes to cause which event to happen [1]. Add a message registry for the power button long press event. [1] https://github.com/openbmc/phosphor-buttons/blob/master/README.md#power-button Tested: 1. Redfish Validator passed. 2. Verify in Redfish log. ''' GET: /redfish/v1/Systems/system/LogServices/EventLog/Entries Response: { "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries", "@odata.type": "#LogEntryCollection.LogEntryCollection", "Description": "Collection of System Event Log Entries", "Members": [ { "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/1724214823", "@odata.type": "#LogEntry.v1_9_0.LogEntry", "Created": "2024-08-21T04:33:43+00:00", "EntryType": "Event", "Id": "1724214823", "Message": "Power Button Long Pressed.", "MessageArgs": [], "MessageId": "OpenBMC.0.1.PowerButtonLongPressed.OK", "Name": "System Event Log Entry", "Severity": "OK" } ], "Members@odata.count": 1, "Name": "System Event Log Entries" } ''' Change-Id: I772c444303c784d086af69e1eab22d9446658d4b Signed-off-by: Chanh Nguyen <chanh@os.amperecomputing.com>
2024-07-22Fix markdownlint issuesEd Tanous1-5/+4
Markdownlint flags a number of issues, mostly around using bare urls. Fix all reported issues. Tested: Markdownlint builds now run without warnings. Change-Id: I11631c6e038dcbefc231fdbaa92431f0913a571e Signed-off-by: Ed Tanous <etanous@nvidia.com>
2024-06-18Bump base registry to 1.18.1Gunnar Mills1-173/+201
72169 points out a mistake in 1.16 which is fixed in 1.18. Let's pull 1.18.1 in. 1.18.1 is the latest. Changed 1 line in parse_registries.py and reran it. Tested: None. In the past bumping these hasn't caused problems. Change-Id: I79b135b8366d9b423f789c34802b1c0366d4e8a5 Signed-off-by: Gunnar Mills <gmills@us.ibm.com> Signed-off-by: Ed Tanous <ed@tanous.net>
2024-04-16Update Privilege Registry from 1.3.0 to 1.5.0Gunnar Mills1-2/+395
Change 1 line in scripts/parse_registries.py and rerun the script. Long term OpenBMC/bmcweb need more direction here on the Privilege Registry, but for now continue with the current direction of using the Privilege Registry and taking it from the DMTF. There is new entries in 1.4/1.5 that are needed for future development. Tested: It builds. Change-Id: I4337dc44e794c58f00f7307ea0508b84f14e8c8f Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2024-04-11Pull in all registriesGunnar Mills15-0/+4317
Before Redfish put all messages in Base, but as the Messages became more specific Redfish started creating new registries. Redfish might have went a little registry happy. HeartbeatEvent just has 1 message and all these new ones registries each just have a handful of messages. Add the remaining 15 registries: composition, environmental, ethernetfabric, fabric, heartbeat_event, job_event, license, logservice, networkdevice, platform, power, sensor_event, storage_device, telemetry, update. Some of these are wanted for both current development and future development but it is hard to decide which ones so just added them all. power, fabric, telemetry, update are all things we support today. Having a UpdateInProgress or UpdateSuccessful makes a lot of sense and this enables that. Put these alphabetically. Use a new for loop to do this. Make changes to scripts/parse_registries.py and run the tool. No difference in size. Before: 66928640 Apr 10 13:32 obmc-phosphor-image-p10bmc-20240410183051.ext4.mmc.tar After: 66928640 Apr 10 13:18 obmc-phosphor-image-p10bmc-20240410181439.ext4.mmc.tar Tested: bmcweb builds. "./scripts/parse_registries.py --registries license,update" works. Change-Id: I43b4d041531cf338e9e7e621714ca7d95f6b01a5 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2023-09-21Generate OpenBMC registryEd Tanous3-1864/+3801
We haven't been very good about maintaining this file, so lets generate it like we do everything else. This commit takes the existing, manually built openbmc_message_registry.hpp and copies the generated json from a working system, then hooks it into the parse_registries script to generate the hpp file. This results in a couple changes, and somewhat proves how bad our ability to manage this file manually is.. Tested: Looking for input on if this is the right direction. Change-Id: I5dc03021d194f0674e4a8f41421096b211462a0a Signed-off-by: Ed Tanous <edtanous@google.com>
2023-08-14Fix FanRemoved MessageArgs numberJason M. Bills1-1/+1
FanRemoved MessageArgs was mistakenly changed from 1 to 0. This changes it back to 1 to fix getting Internal Server Error on events. Tested: Confirmed that FanRemoved events can be retrieved without getting a 500 error code. Change-Id: I9a2a55a5ee3d2bea073d7d55ed9fe53dc2aaee9d Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
2023-08-11Fix for PowerSupplyPowerRestored MessageArgsJayaprakash Mutyala1-1/+1
Redfish event PowerSupplyPowerRestored has MessageArgs as 0 instead of 1. Due to this redfish events are not populated and getting Internal Server Error. So updated MessageArgs to 1. Tested: 1. Redfish validator - passed for this new change 2. Verified GET /redfish/v1/Systems/system/LogServices/EventLog/Entries. Able to populate Redfish event as expected. Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> Change-Id: I9a2450cba5ff668ff495b7f2ba3b86b856581fff
2023-06-01Update base registriesEd Tanous2-116/+299
Update Base registry to 1.16.0, and Resource Event registry to 1.3.0 Patch was generated automatically. Tested: Code builds. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ie9c15a657459cf7ec7fa5b4bf89460049fbce554
2022-09-21registries: iwyuNan Zhou5-5/+16
Made the auto-generated headers and the openbmc registry include what they use. Also alligned the include style. Tested: code compiles. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I6577d5e12bc02da3bd7bf5780f89a4860b314e19
2022-09-21privilege registry: simplify writing headersNan Zhou4-5/+5
This patch reused similar patterns in |REGISTRY_HEADER| so that the python code is more readable. It also moved the clang-format off macro and warning a bit in so they are all consistent with each other. Tested: code compiles. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: If18de0d9f89088f9b5732613ecf59520650bb11a
2022-08-01Document OpenBMC message registry requirementsEd Tanous1-0/+41
We get lots of patches to this file, and in general most tend to break these implicit rules on their first patchset. Lets try to document in this file the expectations. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Icb988adb27a1a1fab77c30e7f6119eaef48aa60d
2022-06-26registry: Base: Upgrade 1.11.0 -> 1.13.0Jiaqing Zhao1-96/+232
Tested: Build pass. Change-Id: Ic985b7fc15214a1e8cfa855ce2fb9a6557201c4e Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2022-06-22Update Privilege Registry from 1.2.0 to 1.3.0Sui Chen1-0/+7
This change updates the privilege registry .json file from version 1.2.0 to 1.3.0. The change in privilege_registry is generated by executing the parse_registries.py script. Tested: The build completes. Signed-off-by: Sui Chen <suichen@google.com> Change-Id: Id36fa21df1b8fbd38a3b9aaad952773b0a1a0208
2022-05-02Add OpenBMC.1.0.ServiceStarted to registrySui Chen1-2/+11
This change adds OpenBMC.1.0.ServiceStarted to the registry, and adds a test case for getMessage and getMessageFromRegistry. The getMessageFromRegistry function is moved to a .cpp file so it can be called from the test. Unit test passes. When tested in QEMU: With https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/52591 applied, restarting a service generates a corresponding log entry. bmc# systemctl restart rsyslogd host$ wget -q -O - \ http://localhost:10080/redfish/v1/Systems/system/LogServices/EventLog/Entries/ ... { "@odata.id": /redfish/v1/Systems/system/LogServices/EventLog/Entries/47441_1", "@odata.type": "#LogEntry.v1_8_0.LogEntry", "Created": "1970-01-01T13:10:41+00:00", "EntryType": "Event", "Id": "47441_1", "Message": "Service rsyslog.service has started successfully.", "MessageArgs": [ "rsyslog.service" ], "MessageId": "OpenBMC.1.0.ServiceStarted", "Name": "System Event Log Entry", "Severity": "OK" }, Signed-off-by: Sui Chen <suichen@google.com> Change-Id: Iea6fa6e3ea8591853169043c1c04f5a7cf00b2f6
2022-04-08registries: remove hardcoded size of MessageEntry arraysJason M. Bills5-8/+8
The latest C++ no longer requires the size of the array to be hardcoded. This removes the hardcoded size to simplify changes to the message arrays. Tested: Confirmed that event Messages are still correctly generated. Signed-off-by: Jason M. Bills <jason.m.bills@intel.com> Change-Id: I29e6a4a02c247865c275cf4ff71587bc188d5957
2022-04-08Add BIOSAttributesChanged message entrySnehalatha Venkatesh1-1/+10
When BIOS attributes are changed via OOB (using Redfish PATCH operation) No Redfish event is logged. Added a Message Registry entry to inform that a set of BIOS attributes are changed via OOB. It will be logged after BIOS reset, during which attributes are re-populated with patched values. Changing the BIOS attributes via OOB is possible only through Redfish PATCH operation currently and not supported through IPMI. This event is implemented for the following review. https://gerrit.openbmc-project.xyz/c/openbmc/intel-ipmi-oem/+/52320 Tested: 1. Redfish validator - passed for this new addition. 2. Enable "BMC Remote Setup" and Set BIOS admin password. 3. Do BIOS reset. 4. Check for the attributes in redfish uri GET: /redfish/v1/Systems/system/Bios Response: Success 5. Patch any attribute. PATCH: /redfish/v1/Systems/system/Bios/Settings Body: { "data": { "serialDebugMsgLvl": "0x2" }} Response: Success 6. Do BIOS reset. 7. Verified in Redfish, Biosattribute change message populated. GET: /redfish/v1/Systems/system/LogServices/EventLog/Entries Response: { "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/32635", "@odata.type": "#LogEntry.v1_8_0.LogEntry", "Created": "1970-01-01T09:03:55+00:00", "EntryType": "Event", "Id": "32635", "Message": "Set of BIOS Attributes changed.", "MessageArgs": [], "MessageId": "OpenBMC.0.1.BIOSAttributesChanged", "Name": "System Event Log Entry", "Severity": "OK" } Signed-off-by: Snehalatha Venkatesh <snehalathax.v@intel.com> Change-Id: Id5c41a40e996b36ab63c7b0cae7fb024f71914fe
2022-03-08Drop message severityEd Tanous4-318/+2
In the way we store the message registry, we store both Severity and MessageSeverity. Severity as a field is deprecated, and in every case in every registry both fields have the same value. We shouldn't duplicate data in that way. This commit changes the parse_registries.py script to stop producing the Severity field into the struct. The few uses we have left are moved over to use MessageRegistry. Tested: Redfish service validator shows no errors on the /redfish/v1/Registries tree. Other errors present that were there previously and are unchanged. This saves a trivial amount: about 1kB on our compressed binary size. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ibbaf533dc59eb08365d6ed309aba16b54bc40ca1
2022-03-08Change message_registries namespace to registriesEd Tanous4-8/+8
The message_registries namespace is overly wordy, and results in very long defines. Doing this one minor change reduces the code by 50 lines. This seems worthwhile. Tested: Unit tests pass. Namespace change only. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ib1401580b3fa47596eb56cdc86e60eeeb1c2f952
2022-03-07Make generated warning more prominent and helpfulEd Tanous4-4/+28
A number of reviews have been submitted that ignore this warning. While we now have 01caf624211197a993dbbd186149293f7053f9d8 which will catch these violations at CI time, that is arguably already too late, and developers will have wasted their time. This commit changes the warning to be multiple lines, with a caps header, such that it's less likely to be ignored. It also adds suggestions on how to proceed. As a note, this also standardizes privilege registry to use the same warning as the other files, which it didn't previously. Tested: Comment changes only, no functional changes. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I3224130dbf581dc962187b2fde4dc98ae26de082
2022-03-07Make parse_registries do whitespace properlyEd Tanous4-1545/+1430
Previously, parse_registries was not very careful about generating readable files, and relied on clang-format to "fix" them after the fact. Given they're generated, this is unforunate, and leads to some inconsistencies in reading the generated code. This commit changes the script to no longer rely on clang-format, and wrap the whole file in a clang-format off bracket. This means that our message registry generation will be consistent. As an added bonus, different versions of clang-format like to format these structures differently, so this removes one possible barrier to people updating these. This was initiated by the next patch in the series, which made a seemingly minor change to a comment, which caused a significant change in this file because of clang-format versioning. Tested: ran parse_registries.py and saw build passing. Whitespace changes only. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Id48bb43dd9d8ecc83de1840f2f1045a87e2ff796
2022-03-07Remove a component word from base messageHardik Panchal1-4/+4
Removed "component" from base message because actual component name is defined from redfish message argument. Tested: 1. Redfish validator - passed for this new addition 2. Verified in Redfish, ComponentOverTemperature event logged properly. GET: https:/<BMC-IP>/redfish/v1/Systems/system/LogServices/EventLog/Entries { "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/ Entries/1646193775", "@odata.type": "#LogEntry.v1_8_0.LogEntry", "Created": "2022-03-02T04:02:55+00:00", "EntryType": "Event", "Id": "1646193775", "Message": "CPU 1 memory over temperature and being throttled.", "MessageArgs": [ "CPU 1 memory" ], "MessageId": "OpenBMC.0.1.ComponentOverTemperature", "Name": "System Event Log Entry", "Severity": "Critical" } Signed-off-by: Hardik Panchal <hardikx.panchal@intel.com> Change-Id: I17aa3b98b6f4c126c2a2d99d703349dc6d82b228
2022-02-28Generate indexes for message registriesEd Tanous3-3/+136
Being able to index into the message registry constexpr arrays will be useful in the future, so update the parse_registries script to generate an Index enum class, that allows directly indexing into the constexpr table when necessary. These indexes are used in the patchset here: https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/50950 to avoid a binary search lookup for each entry. Tested: No-op change, code inspection only. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I345cc26a2b17b5bcd8cfb0055642f4ae443caad4
2022-02-17Add message registry entry for Memhot eventJayaprakash Mutyala1-3/+14
Add "ComponentOverTemperature" event message entry in RedFish for Memhot monitor to log based on the MEMHOT pins. Tested: 1. Redfish validator - passed for this new addition 2. Verified in Redfish, ComponentOverTemperature event logged properly. GET: https:/<BMC-IP>/redfish/v1/Systems/system/LogServices/EventLog/Entries { "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/ Entries/1644553991", "@odata.type": "#LogEntry.v1_8_0.LogEntry", "Created": "2022-02-11T04:33:11+00:00", "EntryType": "Event", "Id": "1644553991", "Message": "CPU 1 component over temperature and being throttled.", "MessageArgs": [ "CPU 1" ], "MessageId": "OpenBMC.0.1.ComponentOverTemperature", "Name": "System Event Log Entry", "Severity": "Critical" } Signed-off-by: Hardik Panchal <hardikx.panchal@intel.com> Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> Change-Id: I6f5f42111ae7db39a4618b2b1ba8c864f9f55824
2022-02-08Rerun parse_registries.pyEd Tanous4-1634/+1332
After the last string wrapping rule change, we never re-ran the script to regenerate, which puts all of these strings on their own line. While this is non-ideal for reading comprehension, it's the rule we have at the moment, so we should be consistent. 12778e61c281b8f8c0f976dec225fb0c30edcb47 appears to have incorrectly checked in a bad version of the privilege registry, which this commit diffs out again. I have inspected https://redfish.dmtf.org/registries/Redfish_1.2.0_PrivilegeRegistry.json by hand, and verified that those overrides are not present. Tested: Whitespace changes only Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I517a7cf13eba2dfd3211491c08ecce69ee68257f
2022-01-10Bump up privilege_registry to Redfish_1.2.0Shantappa Teekappanavar1-14/+361
Testing: - The privilege_registry.hpp was generated successfully after running the parse_registries script - bmcweb was built with newly generated privilege registry file Signed-off-by: Shantappa Teekappanavar <sbteeks@yahoo.com> Change-Id: I84b5f3eccbbb2c4f12b326b99fb41192b12d245a
2021-09-30Add message registry entry for FirmwareResiliencyErrorChalapathi Venkataramashetty1-1/+13
Add an event log in redfish when firmware update failed due to FirmwareResiliencyError. The existing message entries BMCFirmwareResiliencyError(for BMC update failures) and BIOSFirmwareResiliencyError(for BIOS update failures) are not useful for the new platform. The new platform's CPLD report common error code for BMC, PCH or CPLD firmware update failures. Hence a common message entry is required to capture the firmware update failure events. This event is Implemented in the following review. https://gerrit.openbmc-project.xyz/c/openbmc/pfr-manager/+/43281 Tested: Redfish Service Validator passed for this change. Update BMC firmware with mismatched SVN POST: https://<BMC_IP>/redfish/v1/UpdateService/ with <BMC_Update_Capsule> binary file After BMC reboots check for Event log in Redfish Command: GET: https://<BMC_IP>/redfish/v1/Systems/system/LogServices/ EventLog/Entries Response: { "@odata.id": "/redfish/v1/Systems/system/LogServices/ EventLog/Entries/1621435142_1", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "2021-05-19T14:39:02+00:00", "EntryType": "Event", "Id": "1621435142_1", "Message": "Firmware resiliency error. Error reason: Firmware update failed(MinorCode:0x02).", "MessageArgs": [ "Firmware update failed(MinorCode:0x02)" ], "MessageId": "OpenBMC.0.1.FirmwareResiliencyError", "Name": "System Event Log Entry", "Severity": "Critical" }, Signed-off-by: Chalapathi Venkataramashetty <chalapathix.venkataramashetty@intel.com> Change-Id: Id13a29ecc160b8e9e1c0b926f6caf882fa746567
2021-09-23Bump up base_message_registry to version Base.1.11.0Sunitha Harish1-5/+92
Tested by: Code compiles Signed-off-by: Sunitha Harish <sunharis@in.ibm.com> Change-Id: I229e5662eb20889e6da5575de31dc3c27c63ecd2
2021-07-13Make code compile with clang-13Ed Tanous1-960/+1060
Clang-13 rightfully warns that the hasWebuiRoute variable isn't declared as static. This commit resolves that, and adds the static keyword so it can be used in multiple compile units. It also adds the static keyword to the privilege registry, and the inline keyword to many methods that now need it. clang-format is also updated to version 12 in parse_registies.py, as that's what CI uses, and what most people have installed. Tested: Followed clang-tidy instructions in README.md "bitbake bmcweb" step now succeeds. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Id43b13606754cb37a404799fce155599ac3a3240
2021-07-08Generated files should not be copyrightEd Tanous3-45/+3
Because these files are generated, there is no copyright that makes sense, as these are "derivative works". sdbusplus does not include these in its generated files, bmcweb should do the same. Tested: Code compiles. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I3c729f8c03176770b31b4f54ebdbdab92daae163
2021-07-08Automate PrivilegeRegistry to codeEd Tanous1-0/+1342
This commit attempts to automate the creation of our privileges structures from the redfish privilege registry. It accomplishes this by updating parse_registries.py to also pull down the privilege registry from DMTF. The script then generates privilege_registry.hpp, which include const defines for all the privilege registry entries in the same format that the Privileges struct accepts. This allows new clients to simply reference the variable to these privilege structures, instead of having to manually (ie error pronely) put the privileges in themselves. This commit updates all the routes. For the moment, override and OEM schemas are not considered. Today we don't have any OEM-specific Redfish routes, so the existing ones inherit their parents schema. Overrides have other issues, and are already incorrect as Redfish defines them. Binary size remains unchanged after this patchset. Tested: Ran redfish service validator Ran test case from f9a6708c4c6490257e2eb6a8c04458f500902476 to ensure that the new privileges constructor didn't cause us to regress the brace construction initializer. Checked binary size with: gzip -c $BBPATH/tmp/work/s7106-openbmc-linux-gnueabi/obmc-phosphor-image/1.0-r0/rootfs/usr/bin/bmcweb | wc -c 1244048 (tested on previous patchset) Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ideede3d5b39d50bffe7fe78a0848bdbc22ac387f
2021-06-10Update registriesEd Tanous2-153/+352
We've had some fields get updated in the base registry that didn't seem to run the script. This commit updates us to the latest base and TaskEvent Registries. This should have no impact. Tested: Code compiles. No functional impact. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Iea4ee79fc798b57efa0e915195f72711858c61b9
2021-05-04Change the word TS to Time Stamp & add time unitManojkiran Eda1-12/+13
- The Message argument in the BIOSPOSTCode Message Entry uses short form wording for TS (Time Stamp) & without any time unit. - As the Message argument is directly displayed on OpenBMC GUI as it is, word "TS" would create customer confusion due to it not being a well known acronym. Also a field like this that captures a physical quantity(time) should have units. - Redfish clients should not be parsing the message argument, so changing this wording should not break them. - Also, this commit changes ":" to ";" in the Message argument to makes things look consistent. - As we changed the content of Message in the Message Entry, we had to bump up the minor version of the Message registry. Tested By: 1. Redfish Validator Passed. Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com> Change-Id: I17924c2dfdcf34563f8f8cd325011e13cb70e476
2020-09-09Add MutualExclusiveProperties registryAppaRao Puli1-1/+17
Add MutualExclusiveProperties message registry entry and error message. As per redfish specification, "RegistryPrefixes" and "MessageIds" are mutually exclusive. So add check for same in EventService and return MutualExclusiveProperties error message. Tested: - Create subscription failed with error(bad request) when the request body contain both "RegistryPrefixes" and "MessageIds". Change-Id: I4c14f946977bce2ced8a7f96eb85855117fde9a8 Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-08-27Add firmware activation messages to the registryJason M. Bills1-1/+32
In some situations a firmware requires activation rather than update. These messages are intended to cover those situations. Tested: Logged these events and confirmed that they appear correctly in Redfish. Change-Id: I6171b9584626e049349a26c414146f37c04768c7 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2020-08-24Add BMCBootReason Redfish messageJonathan Doman1-6/+19
In order to demarcate separate FW boots within a continuous stream of Redfish event logs, add a BMCBootReason message which is logged during every BMC FW bootup. This message also provides the current FW version string, as well as a reason describing why the boot happened (e.g. power loss, user request, watchdog timeout). Tested: Inserted message into journal using logger-systemd and observed Redfish event at redfish/v1/Systems/system/LogServices/EventLog/Entries. Change-Id: I0f0a10ebf300e1a9f2e18bb6735d95e96aeb8473 Signed-off-by: Jonathan Doman <jonathan.doman@intel.com>
2020-08-03Add message registry entry for successful fw update stagingChalapathi Venkataramashetty1-1/+11
Add an event log in redfish when fw completed writing to staging area during firmware update. Tested: Update BMC firmware POST: https://<BMC_IP>/redfish/v1/UpdateService/ with <BMC_Update_Capsule> binary file After BMC reboots with successful update check for Event log in Redfish Command: GET: https://<BMC_IP>/redfish/v1/Systems/system/LogServices/ EventLog/Entries Response: { "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/ Entries/1595803968", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "2020-07-26T22:52:48+00:00", "EntryType": "Event", "Id": "1595803968", "Message": "BMC firmware update to version 00.74 staged successfully.", "MessageArgs": [ "BMC", "00.74" ], "MessageId": "OpenBMC.0.1.FirmwareUpdateStaged", "Name": "System Event Log Entry", "Severity": "OK" }, Signed-off-by: Chalapathi Venkataramashetty <chalapathix.venkataramashetty@intel.com> Change-Id: I62aad007c7fc8d311a351d1c5ec4e84d6b4a77ad
2020-07-30EventService: Add ResourceEvent registriesSunitha Harish1-0/+310
This commit adds new files for DMTF resource registry and corresponding json message definitions. Tested by: 1. GET https://${bmc}/redfish/v1/Registries 2. GET https://${bmc}/redfish/v1/Registries/ResourceEvent 3. GET https://${bmc}/redfish/v1/Registries/ResourceEvent/ResourceEvent 4. Redfish Validator passed ( giving out messages as == Severity: The given property is deprecated by revision: This property has been deprecated in favor of MessageSeverity, which ties the values to the enumerations defined for the Health property within Status.) Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: Iacbedaeca85c0dcfc955bcf9b10973c0d47c98e0
2020-07-13Move registries to v1_4_0.MessageRegistryGunnar Mills3-42/+515
This implements the MessageSeverity property which tools and users should use instead of the deprecated Severity property. Since the registries use common infrastructure, easiest if just bumped together and now allows grabbing the latest when implementing a new registry, e.g. ResourceEvent. Implement this new required property, MessageSeverity, in the openbmc registry. Follow Redfish registries in having both MessageSeverity and Severity. Modified parse_registries.py to look at latest Base and TaskEvent registries and ran parse_registries.py. Tested: Built and validator passes. See new registries: curl -k https://$bmc/redfish/v1/Registries/Base { "@odata.id": "/redfish/v1/Registries/Base", "@odata.type": "#MessageRegistryFile.v1_1_0.MessageRegistryFile", "Description": "DMTF Base Message Registry File Location", "Id": "Base", "Languages": [ "en" ], "Languages@odata.count": 1, "Location": [ { "Language": "en", "PublicationUri": "https://redfish.dmtf.org/registries/Base.1.8.1.json", "Uri": "/redfish/v1/Registries/Base/Base" } ], ... curl -k https://$bmc/redfish/v1/Registries/Base/Base { "@Redfish.Copyright": "Copyright 2014-2020 DMTF. All rights reserved.", "@odata.type": "#MessageRegistry.v1_4_0.MessageRegistry", "Description": "This registry defines the base messages for Redfish", "Id": "Base.1.8.1", "Language": "en", "Messages": { "AccessDenied": { "Description": "Indicates that while attempting to access, connect to or transfer to/from another resource, the service denied access.", "Message": "While attempting to establish a connection to %1, the service denied access.", "MessageSeverity": "Critical", "NumberOfArgs": 1, "ParamTypes": [ "string" ], "Resolution": "Attempt to ensure that the URI is correct and that the service has the appropriate credentials.", " ... Change-Id: I6495af0e02036ea527036d942d6b6b5f55178bb2 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-06-29openbmc_message_registry: update failure reason in FirmwareUpdateFailedChalapathi Venkataramashetty1-3/+3
Update the failure reason in FirmwareUpdateFailed redfish message entry. Tested: 1. Update the corrupted image so that fw update fails. POST: https://<BMC_IP>/redfish/v1/UpdateService/ with <Corrupted_Update_Capsule> binary file Check event logs in redfish. Command: GET: https://<BMC_IP>/redfish/v1/Systems/system/LogServices/ EventLog/Entries Response: { "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/ Entries/1591111739", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "2020-06-02T15:28:59+00:00", "EntryType": "Event", "Id": "1591111739", "Message": "BMC firmware update to version 00.59 started.", "MessageArgs": [ "BMC", "00.59", "" ], "MessageId": "OpenBMC.0.1.FirmwareUpdateStarted", "Name": "System Event Log Entry", "Severity": "OK" }, { "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/ Entries/1591111742", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "2020-06-02T15:29:02+00:00", "EntryType": "Event", "Id": "1591111742", "Message": "BMC firmware update to version 00.59 failed: due to image verification error.", "MessageArgs": [ "BMC", "00.59", "due to image verification error" ], "MessageId": "OpenBMC.0.1.FirmwareUpdateFailed", "Name": "System Event Log Entry", "Severity": "Warning" }, Signed-off-by: Chalapathi Venkataramashetty <chalapathix.venkataramashetty@intel.com> Change-Id: I79e9509f129a3b87fb21e961e7b7bd78809ca1e2
2020-06-27Update Service: Change error message based on error logsJames Feist1-1/+10
THis adds support for better error responses based on the logs generated by phosphor-software-manager. Tested: Got 400 error with different messages based on failure type { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "Invalid file uploaded to /redfish/v1/UpdateService: Invalid archive.", "MessageArgs": [ "/redfish/v1/UpdateService", "invalid archive" ], "MessageId": "OpenBMC.0.1.0.InvalidUpload", "Resolution": "None.", "Severity": "Warning" } ], "code": "OpenBMC.0.1.0.InvalidUpload", "message": "Invalid file uploaded to /redfish/v1/UpdateService: Invalid archive." } } { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "Invalid file uploaded to /redfish/v1/UpdateService: Invalid image format.", "MessageArgs": [ "/redfish/v1/UpdateService", "invalid image format" ], "MessageId": "OpenBMC.0.1.0.InvalidUpload", "Resolution": "None.", "Severity": "Warning" } ], "code": "OpenBMC.0.1.0.InvalidUpload", "message": "Invalid file uploaded to /redfish/v1/UpdateService: Invalid image format." } } { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_0_0.Message", "Message": "The resource /redfish/v1/UpdateService was unable to satisfy the request due to unavailability of resources.", "MessageArgs": [ "/redfish/v1/UpdateService" ], "MessageId": "Base.1.4.0.ResourceExhaustion", "Resolution": "Ensure that the resources are available and resubmit the request.", "Severity": "Critical" } ], "code": "Base.1.4.0.ResourceExhaustion", "message": "The resource /redfish/v1/UpdateService was unable to satisfy the request due to unavailability of resources." } } Change-Id: Ida9a23c10aedbf9a48c96f4050a04e06bddff284 Signed-off-by: James Feist <james.feist@linux.intel.com>