Age | Commit message (Collapse) | Author | Files | Lines |
|
As part of a EventLog refactor, extract this function into a
log_services utility.
Tested: Only code extraction. Code compiles.
Change-Id: Iaa7aa583a38587c338280af2a9fff65d3732f301
Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
|
|
This reverts commit 0775449c62385f163a207d0f0c8e1f6338de1062.
CI bumps are failing. Romulus is failing [1].
(UTC) 2025/09/07 07:28:06.903907 - 0.212714 - Executing:
get('/redfish/v1/Managers/bmc')
[1]: https://discord.com/channels/775381525260664832/855566794994221117/1414329724477636649
Change-Id: I0ff80780cf1eb2f14484fdd0a521f90cc15e914b
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
This adds getValidManagerPath() to find the valid manager dbus path and
its service name. This can be used for manager GET and PATCH operations.
Tested:
- GET /redfish/v1/Managers/bmc
- PATCH /redfish/v1/Managers/ LocationIndicatorActive
- Redfish Service Validator passes
Change-Id: Id46dd12be3050a2097364696a471b188b8167016
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
|
|
This patch enables Redfish satellite aggregation through REST API
POST requests to /redfish/v1/AggregationService/AggregationSources.
Tested successfully on ubuntu22 using multiple python redfish mockup
servers as satellite bmcs.
The previous urlHasPrefix function incorrectly assumed it would receive
a full URL path, but it actually receives individual URL segments.
Replaced with segmentHasPrefix that vastly simplifies prefix matching
in the currentAggregationSources map.
Also removed the correct duplicated route in
redfish-core/lib/aggregation_service.hpp that was causing routing
conflicts.
The hardcoded 5B247A_ fallback remains temporarily and will be
addressed in change 83181 which adds D-Bus satellite support.
Change-Id: I41920ad270abe4b228b43280ea425b80d3f14b50
Signed-off-by: Kamran Hasan <khasan@nvidia.com>
|
|
It would be useful for both testing and production if one could create
aggregation sources dynamically, rather than using detected hardware.
Redfish sources might exist outside of the physical chassis in a way
that's detectable, so giving DC software a way to set up a non-trivial
aggregation topology make this more extensible.
Note, that as documented in AGGREGATION.md, only a single satellite
is supported by this feature. This patch does not change that
behavior, and implementing an entity-manager satellite will override
a POST created AggregationSource.
Tested:
Example commands succeed, and return the expected results.
```
curl -vvvv -k --http1.1 --user "root:0penBmc" --request DELETE https://192.168.7.2/redfish/v1/AggregationService/AggregationSources/
curl -vvvv -k --http1.1 --user "root:0penBmc" https://192.168.7.2/redfish/v1/AggregationService/AggregationSources -H "Content-Type: application/json" --request POST --data '{"HostName":"https://localhost:8000"}'
```
Redfish service validator passes.
Change-Id: I15711c3075645291b5f2555eefb80bb80418e7e5
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
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>
|
|
Our includes haven't been enforced by tidy in a while. Run the script,
check in the result, minus the false positives.
Change-Id: I6a6da26f5ba5082d9b4aa17cdc9f55ebd8cd41a6
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
Add support for multi-host GET request-handling under the
/redfish/v1/Systems/{computerSystemId}/ redfish resource.
All multi-host supported redfish URIs can be found in this listing [1].
Multi-host meson options needed:
-Dexperimental-redfish-multi-computer-system=enabled
Tested: Validator passes on single-host machine and yv4 qemu emulation.
[1] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/76118
Change-Id: I67c17c3dd7a354fa9a2ebbc56d4def7a7e788909
Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
|
|
The IndicatorLED property has been deprecated by Redfish since September
2020. The Redfish Service Validator reports a WARNING for this property:
```
WARNING - IndicatorLED: The given property is deprecated: This property has been deprecated in favor of the `LocationIndicatorActive` property.
```
The LocationIndicatorActive property is now implemented in bmcweb in
all places where IndicatorLED was implemented. So a new meson option
(redfish-allow-deprecated-indicatorled) is being added to control
whether this property is part of get or patch requests. The option is
disabled by default with plans to remove the option by March 2026.
Tested:
- Built with option enabled and confirmed IndicatorLED still part of
Redfish responses and can be patched.
- Built with option disabled and confirmed Redfish Service Validator no
longer reports the warning.
- Built with option disabled and confirmed IndicatorLED no longer part
of Redfish responses and patch fails appropriately.
```
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH -d '{"IndicatorLED":"Blinking"}' https://${bmc}/redfish/v1/Systems/system
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The property IndicatorLED is not in the list of valid properties for the resource.",
"MessageArgs": [
"IndicatorLED"
],
"MessageId": "Base.1.19.PropertyUnknown",
"MessageSeverity": "Warning",
"Resolution": "Remove the unknown property from the request body and resubmit the request if the operation failed."
}
],
"code": "Base.1.19.PropertyUnknown",
"message": "The property IndicatorLED is not in the list of valid properties for the resource."
}
}
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH -d '{"IndicatorLED":"Off"}' https://${bmc}/redfish/v1/Chassis/chassis
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The property IndicatorLED is not in the list of valid properties for the resource.",
"MessageArgs": [
"IndicatorLED"
],
"MessageId": "Base.1.19.PropertyUnknown",
"MessageSeverity": "Warning",
"Resolution": "Remove the unknown property from the request body and resubmit the request if the operation failed."
}
],
"code": "Base.1.19.PropertyUnknown",
"message": "The property IndicatorLED is not in the list of valid properties for the resource."
}
}
```
Change-Id: I2c0d415a7a54aa3122b18d2a1aa69bd9259d567e
Signed-off-by: Janet Adkins <janeta@us.ibm.com>
|
|
Modify get/set of LocationIndicatorActive property for Systems to use
identifying association instead of hard-coding led group.[1]
History: Almost 5 years ago IBM added support for this property to the
Systems.[2] That original implementation assumed the system and chassis
shared the same LED and just looked at the enclosure_identify_blink and
enclosure_identify like the existing IndicatorLED property did.
IBM renamed these functions getSystemLocationIndicatorActive and
setSystemLocationIndicatorActive.[3]
The interest from other companies has mostly been around IndicatorLED
(old deprecated LED property).[4]
Today, LEDs have the association documented above and used elsewhere
like PowerSupplies, Fans, etc. Switching to this association: 1) follows
the design 2) allows multiple chassis support 3) doesn't assume your
system led is your chassis led.
This is the last caller of the getSystemLocationIndicatorActive() and
setSystemLocationIndicatorActive() functions so they are being removed.
[1] https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/58299
[2] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/36886
[3] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/57765
[4] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/27301
Tested:
- Redfish Service Validator passes
- Confirm able to set and get LED
1. Get for Systems
```
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Systems/system
{
{
"@odata.id": "/redfish/v1/Systems/system",
"@odata.type": "#ComputerSystem.v1_22_0.ComputerSystem",
...
"LocationIndicatorActive": false,
...
}
```
2. Set for Systems
```
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH -d '{"LocationIndicatorActive": true}' https://${bmc}/redfish/v1/Systems/system
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Systems/system
{
"@odata.id": "/redfish/v1/Systems/system",
"@odata.type": "#ComputerSystem.v1_22_0.ComputerSystem",
...
"LocationIndicatorActive": true,
...
}
```
Change-Id: I1c06621586148d4b299b1f8e1ee1fb0ccdc51f10
Signed-off-by: George Liu <liuxiwei@inspur.com>
Signed-off-by: Janet Adkins <janeta@us.ibm.com>
Co-authored-by: George Liu <liuxiwei@inspur.com>
|
|
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>
|
|
The change implements the getComputerSystemIndex function which
leverages the xyz.openbmc_project.ManagedHost interface to retrieve the
index corresponding to the host the request was made for, when
on a multi-host machine. On single-host the index always defaults
to 0. It is not the perfect solution, but it is a starting point
to introduce multi-host support to bmcweb, allowing for power control,
via redfish and in general something we can build from.
More efficient ways of doing things are already discussed,
but will need more time to design properly.
The implementation relies on the
experimental-redfish-multi-computer-system meson flag to give bmcweb an
indication, whether it is running on single- or multi-host and to drop
unsupported redfish resources for the time being.
Multi-host meson options needed:
-Dexperimental-redfish-multi-computer-system=enabled
-Dredfish-system-uri-name=
These helper functions are needed for the multi-host patches further
down the patch chain.
Tested: All relevant tests have been made in the following patches.
Change-Id: Ie481aa8b05903dab59f39a1134463ac0c54aa781
Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
|
|
https://github.com/nlohmann/json/issues/4475 recently changed behavior
that we rely on in a lot of places, and unit tests appear to have caught
the failure. Functionally, this changes the readJson* class of values
to attempt to read as the type requested first, then attempt to read as
the opposite int/uint type requested, with a range check.
In addition, the range check functions now need updated to handle
comparisons between non-similar value types. Luckily c++20 added
cmp_less/greater type functions that we can make use of.
Tested: unit tests pass.
Change-Id: If114bd55225a3a9948e80a407b19b69f50d048b6
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
During the transition to using phosphor-settings-defaults-native for
setting the software version, the version field may temporarily be
empty. This change lowers the log severity for that case to avoid
unnecessary warnings during expected intermediate states.
'''
Jun 20 02:41:49 bmc bmcwebd[709]: [error_messages.cpp:1248] Internal Error /usr/src/debug/bmcweb/1.0+git/redfish-core/include/utils/sw_utils.hpp(126:32) `void redfish::sw_util::afterGetProperties(const std::shared_ptr<bmcweb::AsyncResp>&, const std::string&, bool, const std::string&, const std::string&, bool, const boost::system::error_code&, const dbus::utility::DBusPropertiesMap&)`:
'''
Change-Id: I9123278f863fcf04107b42a5996ccb725c1bd870
Signed-off-by: Daniel Hsu <Daniel-Hsu@quantatw.com>
|
|
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>
|
|
Implements GET and PATCH support for ServiceIdentification in
Managers/bmc and service root.
Tested:
- Refish Service Validator passes
- Tested on romulus:
1. GET initial value
```
curl -k "https://$BMC/redfish/v1"
{
...
}
```
ServiceIdentification is not yet present in service root,
as expected
```
curl -k -H "X-Auth-Token: $XAUTH_TOKEN" "https://$BMC/redfish/v1/Managers/bmc"
{
...
"ServiceIdentification": "",
...
}
```
2. PATCH and GET with valid value
```
curl -k -X PATCH "https://$BMC/redfish/v1/Managers/bmc" -H "X-Auth-Token: $XAUTH_TOKEN" \
-H 'Content-Type: application/json' --data-raw '{"ServiceIdentification": "foo"}'
{
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The request completed successfully.",
"MessageArgs": [],
"MessageId": "Base.1.19.Success",
"MessageSeverity": "OK",
"Resolution": "None."
}
]
}
curl -k "https://$BMC/redfish/v1"
{
...
"ServiceIdentification": "foo",
...
}
curl -k -H "X-Auth-Token: $XAUTH_TOKEN" "https://$BMC/redfish/v1/Managers/bmc"
{
...
"ServiceIdentification": "foo",
...
}
```
3. PATCH and GET with invalid value
```
curl -k -X PATCH "https://$BMC/redfish/v1/Managers/bmc" -H "X-Auth-Token: $XAUTH_TOKEN" \
-H 'Content-Type: application/json' --data-raw '{"ServiceIdentification": "$$$"}'
{
"ServiceIdentification@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The value provided for the property ServiceIdentification is not valid.",
"MessageArgs": [
"ServiceIdentification"
],
"MessageId": "Base.1.19.PropertyValueError",
"MessageSeverity": "Warning",
"Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed."
}
]
}
curl -k -X PATCH "https://$BMC/redfish/v1/Managers/bmc" -H "X-Auth-Token: $XAUTH_TOKEN" \
-H 'Content-Type: application/json' --data-raw '{"ServiceIdentification": "2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222"}'
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The string 'ServiceIdentification' exceeds the length limit 99.",
"MessageArgs": [
"ServiceIdentification",
"99"
],
"MessageId": "Base.1.19.StringValueTooLong",
"MessageSeverity": "Warning",
"Resolution": "Resubmit the request with an appropriate string length."
}
],
"code": "Base.1.19.StringValueTooLong",
"message": "The string 'ServiceIdentification' exceeds the length limit 99."
}
}
curl -k "https://$BMC/redfish/v1"
{
...
"ServiceIdentification": "foo",
...
}
curl -k -H "X-Auth-Token: $XAUTH_TOKEN" "https://$BMC/redfish/v1/Managers/bmc"
{
...
"ServiceIdentification": "foo",
...
}
```
Change-Id: I5b71a73e947ec64cabb8d93c8503a18fb43b8937
Signed-off-by: Corey Ethington <cethington@coreweave.com>
|
|
The Redfish Validator fails when there is a SNMPTrap type of
subscription. The Context property is a required property and is missing
for these types of subscriptions.
```
VERBOSE1 - Context
VERBOSE1 - value: n/a <class 'str'>
VERBOSE1 - Mandatory Test: FAIL
VERBOSE1 - FAIL
ERROR - Context: Mandatory prop does not exist
VERBOSE1 - EventDestination.v1_8_0.EventDestination, Counter({'skipOptional': 15, 'pass': 6, 'passGet': 1, 'passRedfishUri': 1, 'err.Edm.String': 1, 'failMandatoryExist': 1})
curl -s https://redfish.dmtf.org/schemas/v1/EventDestination.v1_8_0.jso | jq .definitions.EventDestination.required
[
"Context",
"@odata.id",
"@odata.type",
"Id",
"Name",
"SubscriptionType"
]
Body Response of /redfish/v1/EventService/Subscriptions/snmp1:
{
"@odata.id": "/redfish/v1/EventService/Subscriptions/snmp1",
"@odata.type": "#EventDestination.v1_8_0.EventDestination",
"Destination": "snmp://X.XX.XXX.XX:XXX",
"EventFormatType": "Event",
"Id": "snmp1",
"Name": "Event Destination",
"Protocol": "SNMPv2c",
"SubscriptionType": "SNMPTrap"
}
```
The Context used to be part of the response for these subscriptions. It
was removed by the commit 4b712a29 [1]. It was removed since the code
was incorrect. The SNMP backend owns the subscription not bmcweb.
The SNMP backend does not support context, so setting the Redfish
Context property to an empty string so the validator will pass.
Tested:
- Redfish Service Validator passes
```
Body Response of /redfish/v1/EventService/Subscriptions/snmp1:
{
"@odata.id": "/redfish/v1/EventService/Subscriptions/snmp1",
"@odata.type": "#EventDestination.v1_8_0.EventDestination",
"Context": "",
"Destination": "snmp://X.XX.XXX.XX:XXX",
"EventFormatType": "Event",
"Id": "snmp1",
"Name": "Event Destination",
"Protocol": "SNMPv2c",
"SubscriptionType": "SNMPTrap"
}
INFO -
*** /redfish/v1/EventService/Subscriptions/snmp1
...
VERBOSE1 - Context
VERBOSE1 - value: <class 'str'>
VERBOSE1 - Mandatory Test: OK
DEBUG - (Edm.String, '', 'Edm.String', 'Property', 'Edm.String')
VERBOSE1 - Success
...
VERBOSE1 - ServiceRoot -> EventService -> Subscriptions -> Members#0, EventDestination.v1_8_0, EventDestination
VERBOSE1 - @odata.id PASS
VERBOSE1 - @odata.type PASS
VERBOSE1 - Context PASS
...
VERBOSE1 - EventDestination.v1_8_0.EventDestination, Counter({'skipOptional': 15, 'pass': 7, 'passGet': 1, 'passRedfishUri': 1})
...
INFO - Validation has succeeded.
```
[1] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/65720
[2] https://github.com/openbmc/bmcweb/blob/0a8823b0c27b8124018c8b084976ae350ae5cf7f/redfish-core/lib/event_service.hpp#L946
Signed-off-by: Janet Adkins <janeta@us.ibm.com>
Change-Id: I0431e390ea98e9927207e30df220465d882e84cd
|
|
A Minimum Version interface was added.[1] This is the minimum software
version that a component must have to operate. Like other interfaces it
is optional. MinimumVersion maps to Redfish's LowestSupportedVersion.[2]
"LowestSupportedVersion": {
"description": "The lowest supported version of this software.",
"longDescription": "This property shall represent the lowest
supported version of this software. This string is formatted using the
same format used for the `Version` property.",
"readonly": true,
"type": [
"string",
"null"
],
"versionAdded": "v1_1_0"
phosphor-bmc-code-mgmt has support for minimum version.[3]
phosphor-bmc-code-mgmt logs a Software Incompatible[4] error if this
minimum version is not met. Mapping this error to a Redfish error is
not done here but could be added later.
This assumes the D-Bus path is /xyz/openbmc_project/software/$id.
phosphor-bmc-code-mgmt moved this interface under $id at 72323[5]. We
assume D-Bus Path /xyz/openbmc_project/software/ + $id for other
properties already.
[1]: https://github.com/openbmc/phosphor-dbus-interfaces/commit/9012243e543abdc5851b7e878c17c991b2a2a8b7
[2]: https://redfish.dmtf.org/schemas/v1/SoftwareInventory.v1_10_2.json
[3]: https://github.com/openbmc/phosphor-bmc-code-mgmt/blob/85c71a13e0938cc4d36caf6b8e735e9740b2e351/meson.options#L100
[4]: https://github.com/openbmc/phosphor-dbus-interfaces/blob/1c140b9766a15d1cbb8546fa02d5050d772a171d/yaml/xyz/openbmc_project/Software/Version.errors.yaml#L1
[5]: https://gerrit.openbmc.org/c/openbmc/phosphor-bmc-code-mgmt/+/72323
Tested: Using an IBM p10bmc see:
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/788d20be",
"@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory",
"Description": "BMC image",
...
"LowestSupportedVersion": "fw1020.00-39.1",
...
The Redfish Validator has no new errors.
Change-Id: I17e6d64c86a7d6312726783425101775a959dc04
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
1 line change in update_schemas.py and rerun it.
See below for more info on this release [1]
Tested: Inspection only. These have not broke things in the past.
[1]: https://www.dmtf.org/sites/default/files/Redfish_Release_2025.2_Overview.pdf
Change-Id: I641bc4285fa502a5d81318ff56eaeb75c0af4762
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
During the code update, the following EBADR messages may be generated
and they can be suppressed.
During the code update, the following journal messages may be generated
due to a reason why there is a software version with EBADR because the
software app deleted the old version. The EBADR check already does not
throw an internal error and it shouldn't log to the journal either at
the error based [1].
This commit also cleans up these journal traces because logging both ec
and ec.message is redundant.
```
ay 27 20:17:04.992218 ever28bmc systemd[1]: Starting Delete image a from BMC storage...
May 27 20:17:05.205158 ever28bmc obmc-flash-bmc[2159]: 2048+0 records in
May 27 20:17:05.205158 ever28bmc obmc-flash-bmc[2159]: 2048+0 records out
May 27 20:17:05.391229 ever28bmc obmc-flash-bmc[2161]: 2048+0 records in
May 27 20:17:05.391229 ever28bmc obmc-flash-bmc[2161]: 2048+0 records out
May 27 20:17:05.403161 ever28bmc systemd[1]: obmc-flash-mmc-remove@a.service: Deactivated successfully.
May 27 20:17:05.404485 ever28bmc systemd[1]: Finished Delete image a from BMC storage.
May 27 20:17:07.974923 ever28bmc bmcweb[1176]: [ERROR sw_utils.hpp:148] error_code = Invalid request descriptor [generic:53]
May 27 20:17:07.974923 ever28bmc bmcweb[1176]: [ERROR sw_utils.hpp:150] error msg = Invalid request descriptor
May 27 20:17:07.974923 ever28bmc bmcweb[1176]: [ERROR sw_utils.hpp:148] error_code = Invalid request descriptor [generic:53]
May 27 20:17:07.974923 ever28bmc bmcweb[1176]: [ERROR sw_utils.hpp:150] error msg = Invalid request descriptor
May 27 20:17:07.974923 ever28bmc bmcweb[1176]: [ERROR sw_utils.hpp:148] error_code = Invalid request descriptor [generic:53]
May 27 20:17:07.974923 ever28bmc bmcweb[1176]: [ERROR sw_utils.hpp:150] error msg = Invalid request descriptor
May 27 20:17:07.986380 ever28bmc bmcweb[1176]: [ERROR sw_utils.hpp:148] error_code = Invalid request descriptor [generic:53]
May 27 20:17:07.986380 ever28bmc bmcweb[1176]: [ERROR sw_utils.hpp:150] error msg = Invalid request descriptor
May 27 20:17:07.988780 ever28bmc bmcweb[1176]: [ERROR sw_utils.hpp:148] error_code = Invalid request descriptor [generic:53]
```
[1] https://github.com/openbmc/bmcweb/blob/10cf50dca112b27176dc5734126983ad37ba2c04/DEVELOPING.md?plain=1#L213
Change-Id: I9454e85b299649e1a1e40663fac6256415bbfe7d
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
|
|
Since 2020, nlohmann has recognized that implicit conversions to and
from json are an issue. Many bugs have been caused at both development
time and runtime due to unexpected implicit conversions from json to
std::string/int/bool. This commit disables implicit conversions using
JSON_USE_IMPLICIT_CONVERSIONS [1]. This option will become the default
in the future. That comment was written 3 years ago at this point, so
we should prepare.
Tested:
Redfish service validator passes.
[1] https://json.nlohmann.me/api/macros/json_use_implicit_conversions/
Change-Id: Id6cc47b9bbf8889e4777fd6d77ec992f3139962c
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
This was created to port configurations forward from old systems 4 years
ago. If there are systems that haven't been incermentally moved forward
at this point, they are few and far between, and likely will never
update.
Remove the functionality.
For reference, the original commit adding this was
28afb49c480790e763b8491be0b5a8e35964dbc9
Tested: bmcweb boots. Basic functions (GET /redfish/v1) work properly.
Change-Id: I42415662cabc540b4b0a65666b755df28034be46
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
All the registry helper functions should return an object_t, given that
they're guaranteed to return an object. nlohmann::json as a type can
technically be string/int/bool/null/object/array, so it causes some
peculiarities in parsing.
Change-Id: If296477cb8d066d7f44ef0d12f17d94a5301e450
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
This is a simple refactor in handleComputerSystemCollection
to use boost::urls::format instead of the crow util function
appendUrlPieces.
Tested: Query the route with curl and check if it still responds
with a valid collection.
Change-Id: If9c5f6dc8672c00b94db296d5968f756598a05e7
Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
|
|
Added the missing copyright comment at top of the file.
Tested: Code compiles.
Change-Id: I7dfd32c9bb26223e7dafe5ab4da7aad6eabc116c
Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
|
|
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
|
|
The name property of EM satellite config will be used as prefix for
aggregation. This can help when we have multi satmc configuration and
RFA has to handle multiple prefixes
Tested
EM Configs
```
{
"Hostname": "10.0.2.2",
"Port": "8000",
"Name": "sat0",
"Type": "SatelliteController",
"AuthType": "None"
}
```
Aggregation Responses
```
curl -k -u root:0penBmc https://localhost:2443/redfish/v1/AggregationService/AggregationSources/
{
"@odata.id": "/redfish/v1/AggregationService/AggregationSources",
"@odata.type": "#AggregationSourceCollection.AggregationSourceCollection",
"Members": [
{
"@odata.id": "/redfish/v1/AggregationService/AggregationSources/sat0"
}
],
"Members@odata.count": 1,
"Name": "Aggregation Source Collection"
}
```
Resource Aggregation
```
curl -k -u root:0penBmc https://localhost:2443/redfish/v1/Systems
{
"@odata.id": "/redfish/v1/Systems",
"@odata.type": "#ComputerSystemCollection.ComputerSystemCollection",
"Members": [
{
"@odata.id": "/redfish/v1/Systems/system"
},
{
"@odata.id": "/redfish/v1/Systems/sat0_system1"
}
],
"Members@odata.count": 2,
"Name": "Computer System Collection"
}
```
Change-Id: I2e64436c9e1858825dc71fad66293144fa55f83e
Signed-off-by: Rohit PAI <ropai@nvidia.com>
|
|
Addressed the below requirements for security GAP
1) PrivilegeRegistry is now enforced for all users and all expanded
resources. If a user lacks access, the node will not be expanded.
2) If a user with Operator privilege calls '/redfish/v1?$expand',
the response includes only resources the user has access to.
3) 'ReadOnly' and 'Operator' roles can expand, but not into nodes
they lack privileges for.
4) Expand is completely disallowed without authentication. Requests
without valid credentials receive 401 Unauthorized.
Testing:
Tested and verified that users can access only authorized resources.
Unauthorized access and unauthenticated expand requests are blocked.
Change-Id: Ic1c2761f30db73a2884cdecdb8eb08168446523b
Signed-off-by: Chandramohan Harkude <chandramohan.harkude@gmail.com>
|
|
When BMC reboots or bmcweb restarts, the persistent subscriptions may
not be loaded properly but they may still be in the file.
Later on if BMC reboots or bmcweb restarts, those unloaded subscriptions
may potentially and unexpectedly cause the reload into the active
subscriptions.
The key cause is due to the compiler evaluation order for the function
arguments where the last argument is evaluated and pushed into the stack
first. As the result, the first argument `newSub->id` may already be
invalid after the last argument `std::make_shared<>(std::move(*newSub))`
is evaluated and pushed into the parameter stack [1].
This may cause the failure of `subscriptionsConfigMap.emplace()` and
results in the missing instantiation of the persistent subscriptions.
Tested:
- Create many subscriptions
- GET subscriptions
```
curl -k -X GET https://${bmc}/redfish/v1/EventService/Subscriptions
{
"@odata.id": "/redfish/v1/EventService/Subscriptions",
"@odata.type": "#EventDestinationCollection.EventDestinationCollection",
"Members": [
{
"@odata.id": "/redfish/v1/EventService/Subscriptions/1187258741"
},
...
{
"@odata.id": "/redfish/v1/EventService/Subscriptions/949306789"
}
],
"Members@odata.count": 6,
"Name": "Event Destination Collections"
}
```
- Restart bmcweb
- GET subscriptions again and check whether they are the same.
- Sometimes, none or only a few may be instantiated like
```
curl -k -X GET https://${bmc}/redfish/v1/EventService/Subscriptions
{
"@odata.id": "/redfish/v1/EventService/Subscriptions",
"@odata.type": "#EventDestinationCollection.EventDestinationCollection",
"Members": [
{
"@odata.id": "/redfish/v1/EventService/Subscriptions/1187258741"
}
],
"Members@odata.count": 1,
"Name": "Event Destination Collections"
}
```
- However, the file `/home/root/bmcweb_persistent_data.json` still has
the old entries.
- Also verify Redfish Service Validator to pass
[1] https://github.com/openbmc/bmcweb/blob/0c814aa604b36cff01b495f9c335f981c7be83be/include/persistent_data.hpp#L184
Change-Id: Ia8a3c1bd3d4f4e479b599077ba8f26e47f8d22ef
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
|
|
This change introduces a new a function similar to getCollectionMembers
but specific to computerSystem discovery.
Since more functionality will be added soon to support multi host
redfish and in general request handling with the long term goal not
using hardcoded URIs anymore, a new utility header for systems.hpp
is being introduced in this patch that will hold the rest of the
incoming definitions.
getSystemCollectionMembers supports multi-host platforms like
yosemite4. Currently we have to distinguish between single-
and multi-host platforms and handle both separate
from each other, thus cannot use the generic getCollectionMembers from
collection.hpp. However, this should change sometime in the future.
It should be mentioned, that functionalitywise the newly introduced
function shares almost all of the code used in getCollectionMembers from
collection.hpp. Only simplification has been done, since this function
only serves a single usecase.
In order to create the collection for a multi-host platform, the
collection handler looks for the ManagedHost dbus interface via the
ObjectMapper and adds everything it gets from a getSubTree call
to the collection.
Single-host systems do not populate this interface, so an empty result
from the ObjectMapper is treated as the request came from a single-host
system.
Testing: Full redfish service validator has been ran on a
romulus image with and without the changes, representative for a
single-host system. No regression has been observed.
A yosemite4 image has been validated constraining the validator
to only check the collection url without following sub uris.
Validation also succeeded.
In addition, the collection url has been curled manually on both
images to check the correct members are added to the collection.
curl -w "@curl-format.txt" -c cjar -b cjar -k -X GET \
'https://'"${BMC}"':4443/redfish/v1/Systems \
-H 'X-Auth-Token: '"$BMCWEB_SESSION_TOKEN"''
romulus output:
{
"@odata.id": "/redfish/v1/Systems",
"@odata.type": "#ComputerSystemCollection.ComputerSystemCollection",
"Members": [
{
"@odata.id": "/redfish/v1/Systems/system"
}
],
"Members@odata.count": 1,
"Name": "Computer System Collection"
}
yosemite4 output:
{
"@odata.id": "/redfish/v1/Systems",
"@odata.type": "#ComputerSystemCollection.ComputerSystemCollection",
"Members": [
{
"@odata.id":
"/redfish/v1/Systems/Yosemite_4_Sentinel_Dome_Slot_1_Chassis"
},
{
"@odata.id":
"/redfish/v1/Systems/Yosemite_4_Sentinel_Dome_Slot_2_Chassis"
},
{
"@odata.id":
"/redfish/v1/Systems/Yosemite_4_Sentinel_Dome_Slot_3_Chassis"
},
{
"@odata.id":
"/redfish/v1/Systems/Yosemite_4_Sentinel_Dome_Slot_4_Chassis"
},
{
"@odata.id":
"/redfish/v1/Systems/Yosemite_4_Sentinel_Dome_Slot_5_Chassis"
},
{
"@odata.id":
"/redfish/v1/Systems/Yosemite_4_Sentinel_Dome_Slot_6_Chassis"
},
{
"@odata.id":
"/redfish/v1/Systems/Yosemite_4_Sentinel_Dome_Slot_7_Chassis"
},
{
"@odata.id":
"/redfish/v1/Systems/Yosemite_4_Sentinel_Dome_Slot_8_Chassis"
}
],
"Members@odata.count": 8,
"Name": "Computer System Collection"
}
Change-Id: I82d59487b7c17b22cd638acd8f687f31c96ca156
Signed-off-by: Oliver Brewka <mox669.dev@gmail.com>
|
|
is_object doesn't throw, but generally is_object is used in some kind of
pattern of.
if (x.is_object()){
x["thing"];
}
operator[] technically throws if it's the wrong type, which bloats
binary sizes.
Replace these with the equivalent get_ptr<object_t>
Change-Id: If3734d7920f0a6f81efa10b3a2d91595e9e0af5a
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
This commit is fixing coverity issues reported for copy in stead of
move.
Tested: redfish service validator passes
Change-Id: I97e755830f28390e7c4bfaba6f3f947898a21423
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
After the connection max-retry with the policy of
"TerminateAfterRetries", coredump may have been occurred although it
seems rare.
Stack frame of One occurrency indicates that an invalid memory access
happened inside deleteSubscription().
1) http_client is waiting for async_read() to handle
sendEventToSubscriber().
```
- recvMessage via async_read() [hold Connection with shared_from_this()] --> call afterRead().
- afterRead() find the invalid response (i.e. probably disconnected from the other end?), and call waitAndRetry()
- waitAndRetry() detects the maxRetryAttempts (with the policy of "TerminateAfterRetries"),
and invokes callback callback is ConnectionPool::afterSendData().
```
2) Meanwhile, the subscription is explicitly requested to delete via
Redfish API.
```
BMCWEB_ROUTE(app, "/redfish/v1/EventService/Subscriptions/<str>/")
...
.methods(boost::beast::http::verb::delete_)(
...
if (!event.deleteSubscription(param))
```
3) Later on, http_client invokes resHandler() but this resHandler() is
bound with its own subscription object like this.
```
bool Subscription::sendEventToSubscriber(std::string&& msg)
{
client->sendDataWithCallback(
std::move(msg), userSub->destinationUrl,
static_cast<ensuressl::VerifyCertificate>(
userSub->verifyCertificate),
httpHeadersCopy, boost::beast::http::verb::post,
std::bind_front(&Subscription::resHandler, this)); <==
```
As the result, if the subscription object is already deleted outside
(i.e. Redfish API delete), resHandler() which is from async_read
callback may be accessing the invalid object.
```
void Subscription::resHandler(const crow::Response& res)
{
...
if (client->isTerminated())
{
hbTimer.cancel();
if (deleter)
{
deleter(); --> This invokes deleteSubscription()
}
}
}
```
Quick summary of stack frame:
```
0 __GI_memcmp (s1=<optimized out>, s2=<optimized out>, len=<optimized out>)
at memcmp.c:342
warning: 342 memcmp.c: No such file or directory
at memcmp.c:342
at /usr/include/c++/13.2.0/bits/basic_string.h:3177
...
this=0x814fa8 <redfish::EventServiceManager::getInstance(boost::asio::io_context*)::handler>, id=...)
at /usr/src/debug/bmcweb/1.0+git/redfish-core/include/event_service_manager.hpp:537
resHandler=..., keepAlive=false, connId=0, res=...)
at /usr/src/debug/bmcweb/1.0+git/http/http_client.hpp:803
...
at /usr/src/debug/bmcweb/1.0+git/http/http_client.hpp:461
at /usr/src/debug/bmcweb/1.0+git/http/http_client.hpp:440
bytesTransferred=<optimized out>)
at /usr/src/debug/bmcweb/1.0+git/http/http_client.hpp:398
```
So, we would need to hold the subscription object until resHandler() is
completed by holding up using `shared_from_this()` for
sendEventToSubscriber()..
```
bool Subscription::sendEventToSubscriber(std::string&& msg)
{
client->sendDataWithCallback(
...
std::bind_front(&Subscription::resHandler, this, shared_from_this())); <===
```
Tested:
- Compiles
- Event Listener works
- Attempt to delete subscriptions
Change-Id: I5172c96e9d1bd2f03831916a95167e0ea532e9f2
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
|
|
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/74513 moved most places
over to SPDX but forgot a few, fix the ones found with grep.
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: Ie4c2ea53f7bc8d902bf87fef6df2a67c6b1de613
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
TypeDefinition was not supported by generate_schema_enums.py, this
change is to support the 'TypeDefinition' generation from schema.
Tested:
'TypeDefinition' fields in schema can be generated in generated files
with the change
Change-Id: Ibe61f65b905f2089f9e17a26fbd27e3ff1753166
Signed-off-by: Chandramohan Harkude <chandramohan.harkude@gmail.com>
|
|
Add support of upper and lower fatal threshold settings. The fatal
thresholds use the `xyz.openbmc_project.Sensor.Threshold.HardShutdown`
interface as the source of threshold value.
Tested on catalina:
```
{
"@odata.id": "/redfish/v1/Chassis/NVIDIA_HMC/Sensors/temperature_HGX_GPU_0_TEMP_0",
"@odata.type": "#Sensor.v1_2_0.Sensor",
"Id": "temperature_HGX_GPU_0_TEMP_0",
"Name": "HGX GPU 0 TEMP 0",
"Reading": 81.34375,
"ReadingRangeMax": 127.0,
"ReadingRangeMin": -128.0,
"ReadingType": "Temperature",
"ReadingUnits": "Cel",
"Status": {
"Health": "OK",
"State": "Enabled"
},
"Thresholds": {
"UpperCaution": {
"Reading": 82.0
},
"UpperCritical": {
"Reading": 84.0
},
"UpperFatal": {
"Reading": 87.0
}
}
}
```
```
{
"@odata.id": "/redfish/v1/Chassis/NVIDIA_HMC/Sensors/temperature_HGX_GPU_0_TEMP_1",
"@odata.type": "#Sensor.v1_2_0.Sensor",
"Id": "temperature_HGX_GPU_0_TEMP_1",
"Name": "HGX GPU 0 TEMP 1",
"Reading": 5.4375,
"ReadingRangeMax": 127.0,
"ReadingRangeMin": -128.0,
"ReadingType": "Temperature",
"ReadingUnits": "Cel",
"Status": {
"Health": "OK",
"State": "Enabled"
},
"Thresholds": {
"LowerCaution": {
"Reading": -0.05
},
"LowerCritical": {
"Reading": -4.0
},
"LowerFatal": {
"Reading": -5.0
}
}
}
```
Change-Id: Ida54d663efdb042d21ea433d9c198c1ee4890173
Signed-off-by: Potin Lai <potin.lai@quantatw.com>
|
|
Extension of OEM route infra to support registration of handlers for OEM
patch requests. When patch request is made on a redfish resource, first
the main route handler will be called and if request patch payload
contains any OEM fragments then, registered OEM patch handler will be
called.
Tested
1. UT passes with new test cases added for OEM patch handling
2. Patch on FAN OEM property works as expected
```
Step 1: Creating new fan controller...
Create PATCH data:
{
"Oem": {
"OpenBmc": {
"Fan": {
"FanControllers": {
"Fan_TEST_391715": {
"FFGainCoefficient": 2.0,
"Zones": [
{
"@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanZones/Zone_1"
}
]
}
}
}
}
}
}
HTTP Response Code (PATCH /redfish/v1/Managers/bmc): 200
HTTP Response Code (GET /redfish/v1/Managers/bmc): 200
✓ Fan controller created successfully
Step 2: Updating the fan controller...
Update PATCH data:
{
"Oem": {
"OpenBmc": {
"Fan": {
"FanControllers": {
"Fan_TEST_391715": {
"FFGainCoefficient": 3.0
}
}
}
}
}
}
HTTP Response Code (PATCH /redfish/v1/Managers/bmc): 200
HTTP Response Code (GET /redfish/v1/Managers/bmc): 200
Final Configuration:
{
"@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanControllers/Fan_TEST_391715",
"@odata.type": "#OpenBMCManager.v1_0_0.Manager.FanController",
"FFGainCoefficient": 3.0,
"Zones": [
{
"@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanZones/Zone_1"
}
]
}
✓ Fan controller updated successfully
```
Test Summary
```
[+] Tests DateTime update after NTP disable. Payload: {DateTime: <date-string>}. Expects: 204 success, validates date matches update.: PASSED
[-] Tests invalid property in request. Payload: {InvalidProperty: 'value', DateTime: <date-string>}. Expects: 400 PropertyUnknown error, validates DateTime unchanged.: PASSED
[-] Tests fan controller with invalid property. Payload: Oem/OpenBmc/Fan/FanControllers with InvalidProperty. Expects: 400 PropertyUnknown error, fan not created.: PASSED
[-] Tests empty PATCH request. Payload: {}. Expects: 400 MalformedJSON error.: PASSED
[-] Tests malformed fan controller JSON. Payload: Fan property as string instead of object. Expects: 400 PropertyValueTypeError error.: PASSED
[-] Tests DateTime with wrong type. Payload: {DateTime: 12345}. Expects: 400 PropertyValueTypeError error, DateTime unchanged.: PASSED
[-] Tests PATCH to invalid manager path. Payload: Valid DateTime and fan update to /invalid_bmc. Expects: 404 ResourceNotFound error.: PASSED
[+] Tests fan controller creation. Payload: Oem/OpenBmc/Fan/FanControllers with FFGainCoefficient and Zones. Expects: 200 success with success message.: PASSED
[-] Tests fan controller without required Zones. Payload: Oem/OpenBmc/Fan/FanControllers with only FFGainCoefficient. Expects: 500 InternalError, fan not created.: PASSED
[+] Tests combined DateTime and fan update. Payload: DateTime and Oem/OpenBmc/Fan/FanControllers. Expects: 200 success with success message.: PASSED
[-] Tests PATCH with wrong Content-Type header. Payload: Valid DateTime update with text/plain content-type. Expects: 400 UnrecognizedRequestBody error.: PASSED
[+] Tests fan controller creation and update. Payload: Create with FFGainCoefficient=2.0, then update to 3.0. Expects: 200 success for both operations, verifies all properties.: PASSED
```
Change-Id: Ib2498b6a4db0343d5d4a405a5a8e4d78f615bed8
Signed-off-by: Rohit PAI <rohitpai77@gmail.com>
|
|
Initial copy was done to avoid request object going out of scope before
OEM handler are invoked.
The MR avoids the whole copy of the request object and create a sub
route object which contains elements required for OEM route handling.
Tested
- Service Validator Passes
- OpenBMC OEM properties and rendered well.
Change-Id: I3ef80a130afe6ab764a13704a8b672f5b0635126
Signed-off-by: Rohit PAI <ropai@nvidia.com>
|
|
Adding async_method_call in dbus utility gives us a place where we can
intercept method call requests from dbus to potentially add
logging/caching.
An example of logging is in the later commit:
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/78265/
We already do this for setProperty, this moves the method calls to
follow a similar pattern.
Tested: Redfish service validator passes.
Change-Id: I6d2c96e2b6b6a023ed2138106a55faebca161592
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
608ad2cc0e17bf62ff34bae7ceb499816fe13fbb
and
c1a75ebc267a78853fb26a3da8c6b3388e6ee07c
Collided. Fix the build error.
Change-Id: I683ea7a7b21b2297ab93010815b01e04373e1cea
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
It is currently too easy to accidentally make copies of the Request
object. Ideally code would parse out the Request in the first handler,
then no longer require an async copy. There is one case in the redfish
query things where we actually need a copy of the request object, so we
need these constructors, but we should make them explicit.
This commit moves the Request constructor to be private, and adds a new
method called copy() for explicitly making a copy. Ironcially, this
finds one place where we were actually making a copy of the request
object unintentionally, so fix that to only capture the value
required,the user session.
Tested:
- Compiles
- Run GET/PATCH related curl or If-Match like PATCH Account
- Redfish Service Validator runs and passes
Change-Id: I19255981f42757ed736112c003201e3f758735ac
Signed-off-by: Ed Tanous <ed@tanous.net>
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
|
|
Goal of the MR is to provide infrastructure support in bmcweb to manage
the OEM fragment handling separately. OEM schema are vendor defined and
per DMTF resource we could have multiple vendor defined OEM schema to be
enabled.
The feature allows registration of route handler per schema per OEM
namespace.
Example
```
REDFISH_SUB_ROUTE<"/redfish/v1/Managers/<str>/#/Oem/OpenBmc">(service,
HttpVerb::Get)(oemOpenBmcCallback);
REDFISH_SUB_ROUTE<"/redfish/v1/Managers/<str>/#/Oem/Nvidia">(service,
HttpVerb::Get)(oemNidiaCallback);
```
We can have separate vendor defined route handlers per resource. Each of
these route handlers can populate their own vendor specific OEM data.
The OEM code can be better organized and enabled/disabled as per the
platform needs. The current MR has the code changes related to handling
GET requests alone. The feature only supports requests
where the response payload is JSON.
Tests
- All UT cases passes
- New UT added for RF OEM router passes
- Service Validator passes on qemu
- GET Response on Manager/bmc resource contains the OEM fragment
```
curl -c cjar -b cjar -k -X GET https://127.0.0.1:2443/redfish/v1/Managers/bmc
{
"@odata.id": "/redfish/v1/Managers/bmc",
"@odata.type": "#Manager.v1_14_0.Manager",
"Oem": {
"OpenBmc": {
"@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc",
"@odata.type": "#OpenBMCManager.v1_0_0.Manager",
"Certificates": {
"@odata.id": "/redfish/v1/Managers/bmc/Truststore/Certificates"
}
}
},
"UUID": "40575e98-90d7-4c10-9eb5-8d8a7156c9b9"
}
```
Change-Id: Ic82aa5fe760eda31e2792fbdfb6884ac3ea613dc
Signed-off-by: Rohit PAI <rohitpai77@gmail.com>
|
|
Some (e.g. IBM) do not use the
`xyz.openbmc_project.Inventory.Item.Board` interface for chassis
objects. To handle the use pattern easier, this refactors the Chassis
interface into one location and it is referenced from the needed places
(e.g. `getValidChassisPath()`).
Moreover, this part is repeated many times, which goes against best
practices.
Tested:
- GET Chassis related API and check they are the same as before
- Redfish Service Validator passes
Change-Id: Id4a51986262892c5dc81b1a3bc46fa5be7c0e9da
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
|
|
1 line change in update_schemas.py and rerun it.
See below for more info on this release:
https://www.dmtf.org/content/redfish-release-20251-now-available
Tested: Inspection only. These have not broke things in the past.
Change-Id: I8d386725b364e2bc7c91c869e519e5e7bfbf11f9
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
When pressure [1] and liquidflow [2] were added to
phosphor-dbus-interfaces, bmcweb's unit-handling code and list of dbus
sensor paths weren't updated accordingly; let's add them now.
Tested: pressure and liquidflow sensors on dbus now appear (including
appropriate units) in the redfish hierarchy and on the webui-vue sensors
page.
[1] https://github.com/openbmc/phosphor-dbus-interfaces/commit/69d821b0368b8c6943a91c7f96528e2c0047f432
[2] https://github.com/openbmc/phosphor-dbus-interfaces/commit/6a8507d06e172d8d29c0459f0a0d078553d2ecc7
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: I1dbe869d6c642eaeebad8605adad50315c52ad3d
|
|
New version includes Leak related messages we need.
Testing:
Redfish service validator passing
Change-Id: Ieca3e5a7bb785ef7fcffb05f86b88bdbf23a3d99
Signed-off-by: Igor Kanyuka <ifelmail@gmail.com>
|
|
readJsonHelper existed back before the distinction between
nlohmann::json and nlohmann::json::object_t was understood. This commit
cleans up our sub-value parsing by removing readJsonHelper that accepts
a nlohmann::json overload, and always accepting via an object_t
overload. Functionally, these two are identical, given that
readJsonHelper only did a type check that was redundant.
Tested: Unit tests pass. Good coverage of these methods.
Change-Id: I734d956dd4bc2ddb14f6e3c735e15adf1f7e00a0
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Redfish specification states:
```
The value of the id field shall be the same as the Id property in the
event payload. The value of the Id property in the event payload should
be the same as the EventId property of the last event record in the
Events array. The value of the EventId property for an event record
should be a positive integer value and should be generated in a
sequential manner.
```
The event service code did not implement that correctly. So:
1. Add ID fields for all events.
2. Remove the per-sse connection id field and rely solely on
EventServiceManager.
3. Make sure all paths, (including metric report) are generating an
event id that's based on the eventservice event id
Tested: Redfish event listener now sees events populated.
LastEventId when sent to the SSE socket now sees a contiguous id.
```
uri=$(curl -s --user "root:0penBmc" -k "https://192.168.7.2/redfish/v1/EventService" | jq -r .ServerSentEventUri)
curl -u root:0penBmc -vvv -k -N -H "Accept: text/event-stream" -H "Last-Event-Id: 0" "https://192.168.7.2$uri"
```
Change-Id: Ic32e036f40a53a9b2715639ae384d7891c768260
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
When array/vector object is expected in JSON patch the error info does
not contain the actual wrong property instead shows "null". Fix is to
correct the value in the error info.
Tested
- add new test case to verify this
- unit tests are passing.
Change-Id: Ica26ac9e501b5a34a5b118769cc1917eeab30524
Signed-off-by: rohitpai <rohitpai77@gmail.com>
|
|
Copy the latest format file from the docs repository and apply.
Change-Id: I2f0b9d0fb6e01ed36a2f34c750ba52de3b6d15d1
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|