#
bf2ddede
|
| 09-Aug-2023 |
Carson Labrado <clabrado@google.com> |
Reduce some Error log severities
There are instances of ERROR logs that would work better as WARNING or DEBUG since they do not actually result in bailing early and returning an error response.
Sig
Reduce some Error log severities
There are instances of ERROR logs that would work better as WARNING or DEBUG since they do not actually result in bailing early and returning an error response.
Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: I1e7bca0bb38487b26a4642ab72ce475170bb53c6
show more ...
|
#
62598e31
|
| 17-Jul-2023 |
Ed Tanous <ed@tanous.net> |
Replace logging with std::format
std::format is a much more modern logging solution, and gives us a lot more flexibility, and better compile times when doing logging.
Unfortunately, given its level
Replace logging with std::format
std::format is a much more modern logging solution, and gives us a lot more flexibility, and better compile times when doing logging.
Unfortunately, given its level of compile time checks, it needs to be a method, instead of the stream style logging we had before. This requires a pretty substantial change. Fortunately, this change can be largely automated, via the script included in this commit under scripts/replace_logs.py. This is to aid people in moving their patchsets over to the new form in the short period where old patches will be based on the old logging. The intention is that this script eventually goes away.
The old style logging (stream based) looked like.
BMCWEB_LOG_DEBUG << "Foo " << foo;
The new equivalent of the above would be: BMCWEB_LOG_DEBUG("Foo {}", foo);
In the course of doing this, this also cleans up several ignored linter errors, including macro usage, and array to pointer deconstruction.
Note, This patchset does remove the timestamp from the log message. In practice, this was duplicated between journald and bmcweb, and there's no need for both to exist.
One design decision of note is the addition of logPtr. Because the compiler can't disambiguate between const char* and const MyThing*, it's necessary to add an explicit cast to void*. This is identical to how fmt handled it.
Tested: compiled with logging meson_option enabled, and launched bmcweb
Saw the usual logging, similar to what was present before: ``` [Error include/webassets.hpp:60] Unable to find or open /usr/share/www/ static file hosting disabled [Debug include/persistent_data.hpp:133] Restored Session Timeout: 1800 [Debug redfish-core/include/event_service_manager.hpp:671] Old eventService config not exist [Info src/webserver_main.cpp:59] Starting webserver on port 18080 [Error redfish-core/include/event_service_manager.hpp:1301] inotify_add_watch failed for redfish log file. [Info src/webserver_main.cpp:137] Start Hostname Monitor Service... ``` Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: I86a46aa2454be7fe80df608cb7e5573ca4029ec8
show more ...
|
#
e002dbc0
|
| 31-Jan-2023 |
Carson Labrado <clabrado@google.com> |
Aggregation: Add satellite only links
Allows the aggregator to insert links to top level collections which are only supported by the satellite bmc.
Tested: Links were added to responses for collect
Aggregation: Add satellite only links
Allows the aggregator to insert links to top level collections which are only supported by the satellite bmc.
Tested: Links were added to responses for collections which are not currently supported by BMCWeb. Also verified that top level collections and satellite resources were still aggregated correctly.
curl localhost/redfish/v1 { ... "Fabrics": { "@odata.id": "/redfish/v1/Fabrics" }, ... }
curl localhost/redfish/v1/UpdateService { ... "SoftwareInventory": { "@odata.id": "/redfish/v1/UpdateService/SoftwareInventory" } }
The following $expand queries also returned as expected curl -s 'localhost/redfish/v1?$expand=.($levels=1)' curl -s 'localhost/redfish/v1/UpdateService?$expand=.($levels=1)'
Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: Ie755f67bd28f81f6677670c09c9a210935ae0af9
show more ...
|
#
5eb468da
|
| 20-Jun-2023 |
George Liu <liuxiwei@inspur.com> |
Refactor getManagedObjects method
Since the getManagedObjects method has been implemented in dbus_utility and this commit is to integrate all the places where the GetManagedObjects method is obtaine
Refactor getManagedObjects method
Since the getManagedObjects method has been implemented in dbus_utility and this commit is to integrate all the places where the GetManagedObjects method is obtained, and use the method in dbus_utility uniformly.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Ic13f2bef7b30f805cd3444a75d7df17b031f2eb0
show more ...
|
#
5e44e3d8
|
| 16-Mar-2021 |
AppaRao Puli <apparao.puli@linux.intel.com> |
Add SSE style subscription support to eventservice
This commit adds the SSE style eventservice subscription style event Using this, end user can subscribe for Redfish event logs using GET on SSE uri
Add SSE style subscription support to eventservice
This commit adds the SSE style eventservice subscription style event Using this, end user can subscribe for Redfish event logs using GET on SSE uris from browser.
Tested: - From Browser did GET on above SSE URI and generated some Redfish event logs(power cycle) and saw redfish event logs streaming on browser. - After SSE registration, Check Subscription collections and GET on individual subscription and saw desired response. - Ran RedfishValidation and its passed.
Change-Id: I7f4b7a34974080739c4ba968ed570489af0474de Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com> Signed-off-by: P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com> Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
#
f8ca6d79
|
| 28-Jun-2022 |
Ed Tanous <edtanous@google.com> |
Allow async resolver to be optional
This commit adds a meson option to allow selecting which dns resolver bmcweb uses. There are use cases, like Open Compute Project Inband Management Agent, that w
Allow async resolver to be optional
This commit adds a meson option to allow selecting which dns resolver bmcweb uses. There are use cases, like Open Compute Project Inband Management Agent, that would require not using dbus, which would require us to fall back to the asio resolver. This commit makes the existing asio resolver constructor, and async_resolve methods match the equivalents in asio (which we intended to do anyway), then adds a macro and configure option for being able to select which resolver backend to rely on.
Tested: Code can now compile without sdbusplus.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I3220214367179f131a60082bdfaf7e725d35c125
show more ...
|
#
b2ba3072
|
| 12-May-2023 |
Patrick Williams <patrick@stwcx.xyz> |
fix more push vs emplace calls
It seems like clang-tidy doesn't catch every place that an emplace could be used instead of a push. Use a few grep/sed pairs to find and fix up some common patterns.
fix more push vs emplace calls
It seems like clang-tidy doesn't catch every place that an emplace could be used instead of a push. Use a few grep/sed pairs to find and fix up some common patterns.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I93eaec26b8e3be240599e92b66cf54947073dc4c
show more ...
|
#
89492a15
|
| 10-May-2023 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest .clang-format from the docs repository and reformat the repository.
Change-Id: I75f89d2959b0f1338c20d72ad669fbdc1d720835 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
46b30283
|
| 13-Feb-2023 |
Carson Labrado <clabrado@google.com> |
Aggregation: Process subordinate top collections
Adds a function to process responses from URIs that are uptree from a top level collection. A follow-up patch will hook this into the aggregation co
Aggregation: Process subordinate top collections
Adds a function to process responses from URIs that are uptree from a top level collection. A follow-up patch will hook this into the aggregation code to allow adding links to top level collections which are only supported by satellite BMCs.
Adds test cases to validate this function is working correctly.
Tested: New test cases pass
Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: I7f0fd6c3955398e2fde136c1d3b37a6bf4bf06b9
show more ...
|
#
8fd333d6
|
| 03-Jan-2023 |
Carson Labrado <clabrado@google.com> |
Aggregation: Check for subordinate collection
Adds a search function which is able to determine if a passed URI is a top level collection, is uptree from a top level collection, or both. The type be
Aggregation: Check for subordinate collection
Adds a search function which is able to determine if a passed URI is a top level collection, is uptree from a top level collection, or both. The type being searched for depends on a second argument passed to the function.
Each of these searches are used to add links to top level collections which are only supported by a satellite BMC. They all use similar steps so rolling them into a single function cuts down on redundant code.
Adds test cases to verify the implementation is correct.
Tested: New test cases pass
Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: I72ae7442d5f314656b57a73aee544bca516fa7c2
show more ...
|
#
b27e1cbe
|
| 17-Mar-2023 |
Carson Labrado <clabrado@google.com> |
Aggregation: Prefix fix HttpHeaders property
The "HttpHeaders" property in a response is an array of HTTP headers. We perform prefix fixing on the "Location" header from responses so we should also
Aggregation: Prefix fix HttpHeaders property
The "HttpHeaders" property in a response is an array of HTTP headers. We perform prefix fixing on the "Location" header from responses so we should also fix any "Location" headers which are contained by "HttpHeaders" in an aggregated response. This requires special handling since each header is represented as a single string in the response.
Added testcase for HttpHeaders property
Tested: All unit tests pass
Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: I3040c4ea52b2bebcb6e206bb50585c6a75538f0a
show more ...
|
#
d14a48ff
|
| 21-Feb-2023 |
Carson Labrado <clabrado@google.com> |
Aggregation: Increase response read limit to 50MB
With Redfish aggregation, responses from satellite BMCs can be on the order of MBs due to use cases like logging or binary payloads. Offloading $exp
Aggregation: Increase response read limit to 50MB
With Redfish aggregation, responses from satellite BMCs can be on the order of MBs due to use cases like logging or binary payloads. Offloading $expand could similar result in responses that exceed the current read limit of 128 KB.
Splits the connection pools used for aggregation and EventService so that the response read limit is 50MB for responses associated with aggregation. Pools used by EventService keep the current limit of 2^17 bytes or 128 KB. It also propogates a ConnectionPolicy object that gets instantiated within HttpClient, which allows per-client policies for retry/byte limits. This allows EventService and aggregation to have different policies.
Tested: With aggregation enabled I was able to return a response from a satellite BMC which was than 2MB. Ran the Redfish Mockup Creator and it was able to successfully query all aggregated resources as part of walking the tree. Also verified that HTTP push events still work with EventListener.
Change-Id: I91de6f82aadf8ad6f7bc3f58dfa0d14c0759dd47 Signed-off-by: Carson Labrado <clabrado@google.com> Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
#
8b2521a5
|
| 17-Feb-2023 |
Carson Labrado <clabrado@google.com> |
Implement AggregationSource
Adds an AggregationSource resource for each satellite config present on dbus.
Adds the AggregationSource schema which we had previously ignored.
Tested: Querying an Agg
Implement AggregationSource
Adds an AggregationSource resource for each satellite config present on dbus.
Adds the AggregationSource schema which we had previously ignored.
Tested: Querying an AggregationSource returned the expected information.
curl localhost/redfish/v1/AggregationService/AggregationSources/5B247A { "@odata.id": "/redfish/v1/AggregationService/AggregationSources/5B247A", "@odata.type": "#AggregationSource.v1_3_1.AggregationSource", "HostName": "http://122.111.11.1:80", "Id": "5B247A", "Name": "Aggregation source", "Password": null, }
Service Validator passed. The Service Validator also passed after removing the satellite config from the system such that /redfish/v1/AggregationService/AggregationSources returns an empty Members array.
Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: I88b5fbc15f27cddd330ec22a25427fd8b18cf766
show more ...
|
#
39662a3b
|
| 06-Feb-2023 |
Ed Tanous <edtanous@google.com> |
Make url by value in Request
There's some tough-to-track-down safety problems in http Request. This commit is an attempt to make things more safe, even if it isn't clear how the old code was wrong.
Make url by value in Request
There's some tough-to-track-down safety problems in http Request. This commit is an attempt to make things more safe, even if it isn't clear how the old code was wrong.
Previously, the old code took a url_view from the target() string for a given URI. This was effectively a pointer, and needed to be updated in custom move/copy constructors that were error prone to write.
This commit moves to taking the URI by non-view, which involves a copy, but allows us to use the default move and copy constructors, as well as have no internal references within Request, which should improve the safety and reviewability.
There's already so many string copies in bmcweb, that this is unlikely to show up as any sort of performance regression, and simple code is much better in this case.
Note, because of a bug in boost::url, we have to explicitly construct a url_view in any case where we want to use segments() or query() on a const Request. This has been reported to the boost maintainers, and is being worked for a long term solution.
https://github.com/boostorg/url/pull/704
Tested: Redfish service validator passed on last commit in series.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I49a7710e642dff624d578ec1dde088428f284627
show more ...
|
#
98fe740b
|
| 14-Feb-2023 |
Ed Tanous <edtanous@google.com> |
Remove fields member from Request
Per cpp core guidelines, we should be returning this via a function call, not a direct member variable. Doing this also improves the safety, as we don't have to re
Remove fields member from Request
Per cpp core guidelines, we should be returning this via a function call, not a direct member variable. Doing this also improves the safety, as we don't have to remember to move the references over in a move.
Tested: Tested as part of top patch in series.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I837d6fd277ffa076ba5425003d6e6ee79204d014
show more ...
|
#
5e7e2dc5
|
| 16-Feb-2023 |
Ed Tanous <edtanous@google.com> |
Take boost error_code by reference
By convention, we should be following boost here, and passing error_code by reference, not by value. This makes our code consistent, and removes the need for a co
Take boost error_code by reference
By convention, we should be following boost here, and passing error_code by reference, not by value. This makes our code consistent, and removes the need for a copy in some cases.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Id42ea4a90b6685a84818b87d1506c11256b3b9ae
show more ...
|
#
26ccae32
|
| 16-Feb-2023 |
Ed Tanous <edtanous@google.com> |
Pass string views by value
string_view should always be passed by value; This commit is a sed replace of the code to make all string_views pass by value, per general coding guidelines[1].
[1] http
Pass string views by value
string_view should always be passed by value; This commit is a sed replace of the code to make all string_views pass by value, per general coding guidelines[1].
[1] https://quuxplusone.github.io/blog/2021/11/09/pass-string-view-by-value/
Tested: Code compiles.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I55b342a29a0fbfce0a4ed9ea63db6014d03b134c
show more ...
|
#
24dadc88
|
| 17-Feb-2023 |
Carson Labrado <clabrado@google.com> |
Aggregation: Fix cppcheck errors
Corrections style complaints in the aggregator code.
Tested: Jenkins output did not show any style complaints
Signed-off-by: Carson Labrado <clabrado@google.com> C
Aggregation: Fix cppcheck errors
Corrections style complaints in the aggregator code.
Tested: Jenkins output did not show any style complaints
Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: I87426fcf2a48448a62152e0ad4a6c3aa54a7fc45
show more ...
|
#
0af78d5a
|
| 23-Jan-2023 |
Khang Kieu <khangk@google.com> |
Aggregation: Fix up aggregated response header URIs
The aggregator did not propagate header's fields from aggregated responses. This change will take into account of response code other than 200, wh
Aggregation: Fix up aggregated response header URIs
The aggregator did not propagate header's fields from aggregated responses. This change will take into account of response code other than 200, which will modify a field called "Location". The Location field in the response's header will point to where the response data can be read from. This "Location" field in response Header will now contain the correct URI with the prefix appended.
We will also copy over other Header Values to aggregated response. These header values include "Content-Type", "Allow", "Retry-After", and also the response's body
Added some test cases for the above fixes.
Tested: Unit Tests pass. Queries reponse that returns other result than 200 that has Location field and the response received is as expected.
Signed-off-by: Khang Kieu <khangk@google.com> Change-Id: I77c7dae32a103fbec3015fe14b51a3ed0022143e
show more ...
|
#
43e14d38
|
| 08-Nov-2022 |
Carson Labrado <clabrado@google.com> |
Aggregation: Better handle dropped requests
It's possible for HTTP client's request buffer to become full (especially when $expand is used). Instead of ignoring the requests we should provide a 429
Aggregation: Better handle dropped requests
It's possible for HTTP client's request buffer to become full (especially when $expand is used). Instead of ignoring the requests we should provide a 429 Too Many Requests response for the provided callback to process.
The aggregator's response handling also needs to account for this possibility so that it only completely overwrites the asyncResp object when it receives a response from a satellite.
Also added more test cases for the response processing functions.
Tested: Unit tests passed Flooded aggregator with requests for satellite resources. Requests began returning 429 Too Many Requests errors after the request buffer became full.
Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: Ib052dc0454d759de7fae761977ca26d6b8d208e5
show more ...
|
#
d4413c5b
|
| 27-Jan-2023 |
George Liu <liuxiwei@inspur.com> |
Fix some warnings by cppcheck
Warning message: redfish-core/include/redfish_aggregator.hpp:800:21: style: The scope of the variable 'collectionItem' can be reduced. [variableScope] std::stri
Fix some warnings by cppcheck
Warning message: redfish-core/include/redfish_aggregator.hpp:800:21: style: The scope of the variable 'collectionItem' can be reduced. [variableScope] std::string collectionItem; ^ redfish-core/lib/power.hpp:279:33: style: The scope of the variable 'value' can be reduced. [variableScope] nlohmann::json& value = ^
Tested: Verify that there are no such warnings in local CI.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Ie379dcb04a22a00b495f9ab3948d97e2e537f395
show more ...
|
#
7c4c52cb
|
| 28-Nov-2022 |
Carson Labrado <clabrado@google.com> |
Aggregation: Aggregate top level collections
Adds aggregation support for all top level collections which do not follow the usual form of /redfish/v1/<collection>.
As part of this change we no long
Aggregation: Aggregate top level collections
Adds aggregation support for all top level collections which do not follow the usual form of /redfish/v1/<collection>.
As part of this change we no longer forward all requests that fit the above format such as /redfish/v1/UpdateService. We now skip the forwarding rather than sending a request. Previously we forwarded all potential collection requests and then relied on the lack of a "Members" array in the response to denote that the request was not actually for a valid collection.
Tested: We aggregate or try to aggregate these URIs as collections: /redfish/v1/Chassis /redfish/v1/Chassis/ /redfish/v1/Fabrics /redfish/v1/Fabrics/ /redfish/v1/TelemetryService/MetricReports /redfish/v1/TelemetryService/MetricReports/
We aggregate or try to aggregate these URIs as satellite resources /redfish/v1/Chassis/5B247A_<chassisID> /redfish/v1/TelemetryService/MetricReports/5B247A_reportID /redfish/v1/UpdateService/FirmwareInventory/5B247A_firmwareID
We do not attempt to aggregate these URIs at all: /redfish/v1/Fake /redfish/v1/Fake/ /redfish/v1/Fake/5B247A_fakeID /redfish/v1/TelemetryService /redfish/v1/TelemetryService/ /redfish/v1/TelemetryService/5B247A_fakeID
Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: I133503ab3e4df7777df094768786e511880ca70f
show more ...
|
#
32d7d8eb
|
| 10-Jan-2023 |
Carson Labrado <clabrado@google.com> |
Aggregation: Fix and forward all responses
We only attempt prefix matching when we receive a 200 response. For the retry policy we consider 2XX and 404 to be valid codes. Instead we should forward
Aggregation: Fix and forward all responses
We only attempt prefix matching when we receive a 200 response. For the retry policy we consider 2XX and 404 to be valid codes. Instead we should forward all responses to the client and let them decide what action they want to take. As part of that we should always attempt to do prefix fixing on the response.
Also fixes an oversight where we attempt to do prefix fixing on "OriginOfCondition" properties. That property is only a URI when it is an Action parameter in a SubmitTestEvent request. It is an object when it appears as a response property.
Adds test cases for the above fixes.
Tested: Tests pass. Queries to top level collections and aggregated URIs still return expected results with added prefixes.
Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: Ic76324ceab618160061be5f3c687af20a857fa25
show more ...
|
#
3ccb3adb
|
| 13-Jan-2023 |
Ed Tanous <edtanous@google.com> |
Fix a boatload of #includes
Most of these missing includes were found by running clang-tidy on all files, including headers. The existing scripts just run clang-tidy on source files, which doesn't
Fix a boatload of #includes
Most of these missing includes were found by running clang-tidy on all files, including headers. The existing scripts just run clang-tidy on source files, which doesn't catch most of these.
Tested: Code compiles
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ic741fbb2cc9e5e92955fd5a1b778a482830e80e8
show more ...
|
#
11987af6
|
| 23-Nov-2022 |
Carson Labrado <clabrado@google.com> |
Aggregation: Improve prefix fixup matching
Utilize the new array of top level collection URIs to determine if a given URI in the response needs to have the aggregation prefix added. This removes the
Aggregation: Improve prefix fixup matching
Utilize the new array of top level collection URIs to determine if a given URI in the response needs to have the aggregation prefix added. This removes the need to check for specific collections like /redfish/v1/UpdateService/FirmwareInventory which do not fit the generic format of /redfish/v1/<collection>.
Future patches will use this same approach to improve the logic for initially determining if and how a request should be aggregated.
This patch also adds a series of unit tests for the function responsible for adding a prefix to a given URI. Cases covered include valid URIs that involve a selection of aggregated resources, top level collection URIs, other invalid URIs, and URIs with a trailing "/".
Tested: Unit tests pass.
Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: I676983d3c77ae3126c04e9f57ad8698c51df2675
show more ...
|