commit | fb54610544f97b989b549d8fc94518e2d38c9467 | [log] [tgz] |
---|---|---|
author | Myung Bae <myungbae@us.ibm.com> | Tue Oct 29 10:21:26 2024 -0500 |
committer | Ed Tanous <ed@tanous.net> | Fri Dec 06 21:53:00 2024 +0000 |
tree | 022a7ff48ccb70c08c0a19ada638b09c490a4f79 | |
parent | 5064a25bc6d64424d716652c10f4fce953e0991a [diff] |
Implement Subscription Heartbeat Logic This implements the subscription heartbeat logic which will send the message `RedfishServiceFunctional` periodically with the interval of `HeartbeatIntervalMinutes` specified in subscription property [1][2], if `SendHeartbeat` is enabled.. Note the heartbeat enablement is per event destination as DMTF specifies [3] like ``` ... This message shall only be sent if specifically requested by an event destination during the creation of a subscription... ``` This also add `HeartbeatEvent` to supported registry prefixes like ``` curl -k -X GET https://${bmc}/redfish/v1/EventService/ { ... "RegistryPrefixes": [ "Base", "OpenBMC", "TaskEvent", "HeartbeatEvent" ], "ResourceTypes": [ "Task", "Heartbeat" ], ``` Tested: 1) A single subscription and heartbeat via Redfish Event Listener - Create a subscription via Redfish Event Listener - PATCH `SendHeartbeat=true` and `HeartbeatIntervalMinutes` like ``` curl -k -X PATCH https://${bmc}/redfish/v1/EventService/Subscriptions/${SUBID} \ -H "Content-Type: application/json" \ -d '{"SendHeartbeat":true, "HeartbeatIntervalMinutes":1}' ``` - Monitor the Redfish Event Listener and check the following heartbeat messages periodically (per HeartbeatIntervalMinutes) ``` response_type: POST headers: {'Host': '9.3.62.209', 'Content-Length': '230'} response={ "@odata.type": "#Event.v1_4_0.Event", "Events": [ { "@odata.type": "#Message.v1_1_1.Message", "EventId": "HeartbeatId", "EventTimestamp": "2024-11-21T12:21:47+00:00", "MemberId": "0", "Message": "Redfish service is functional.", "MessageArgs": [], "MessageId": "HeartbeatEvent.1.0.1.RedfishServiceFunctional", "MessageSeverity": "OK", "OriginOfCondition": "/redfish/v1/EventService/Subscriptions/1521743607", "Resolution": "None." } ], "Id": "HeartbeatId", "Name": "Event Log" } ``` - Change `SendHeartbeat` to false and see whether the heartbeat message is stopped. 2) Multiple sbscribers with the different heartbeat setups - create 2 event listeners with 2 different destinations (e.g., port 8080 and 8081). - Patch sendheartbeat=true to only one subscriber. - Check whether the only subscriber that enables `SendHeartbeat` is receiving the heartbeat messages. 3) Redfish Service Validator passes [1] https://github.com/openbmc/bmcweb/blob/02ea923f13de196726ac2f022766a6f80bee1c0a/redfish-core/schema/dmtf/json-schema/EventDestination.v1_15_0.json#L356 [2] https://redfish.dmtf.org/registries/HeartbeatEvent.1.0.1.json [3] https://github.com/DMTF/Redfish/blob/d9e54fc8393d8930bd42e8b134741f5051a2680f/registries/HeartbeatEvent.1.0.1.json#L14 Change-Id: I8682e05f4459940913ba189f1ed016874e38dd4a Signed-off-by: Myung Bae <myungbae@us.ibm.com>
This component attempts to be a "do everything" embedded webserver for OpenBMC.
The webserver implements a few distinct interfaces:
bmcweb at a protocol level supports http and https. TLS is supported through OpenSSL.
Bmcweb supports multiple authentication protocols:
Each of these types of authentication is able to be enabled or disabled both via runtime policy changes (through the relevant Redfish APIs) or via configure time options. All authentication mechanisms supporting username/password are routed to libpam, to allow for customization in authentication implementations.
All authorization in bmcweb is determined at routing time, and per route, and conform to the Redfish PrivilegeRegistry.
*Note: Non-Redfish functions are mapped to the closest equivalent Redfish privilege level.
bmcweb is configured per the meson build files. Available options are documented in meson_options.txt
meson setup builddir ninja -C builddir
If any of the dependencies are not found on the host system during configuration, meson will automatically download them via its wrap dependencies mentioned in bmcweb/subprojects
.
bmcweb relies on some on-system data for storage of persistent data that is internal to the process. Details on the exact data stored and when it is read/written can seen from the persistent_data
namespace.
When SSL support is enabled and a usable certificate is not found, bmcweb will generate a self-signed a certificate before launching the server. Please see the bmcweb source code for details on the parameters this certificate is built with.
bmcweb is capable of aggregating resources from satellite BMCs. Refer to AGGREGATION.md for more information on how to enable and use this feature.