#
25991f7d |
| 13-Jun-2024 |
Ed Tanous <ed@tanous.net> |
Add filter parameter support
$filter is a parameter documented in the Redfish specification, section 7.3.4. It defines a mechanism for filtering arbitrary collections of parameters based on a set o
Add filter parameter support
$filter is a parameter documented in the Redfish specification, section 7.3.4. It defines a mechanism for filtering arbitrary collections of parameters based on a set of arbitrary language expressions.
From the specification, it supports the following language operators:
() Precedence grouping operator. (Status/State eq 'Enabled' and Status/Health eq 'OK') or SystemType eq 'Physical'
and Logical and operator. ProcessorSummary/Count eq 2 and MemorySummary/TotalSystemMemoryGiB gt 64
eq Equal comparison operator. ProcessorSummary/Count eq 2
ge Greater than or equal to comparison operator. ProcessorSummary/Count ge 2
gt Great than comparison operator. ProcessorSummary/Count gt 2
le Less than or equal to comparison operator MemorySummary/TotalSystemMemoryGiB le 64
lt Less than comparison operator. MemorySummary/TotalSystemMemoryGiB lt 64
ne Not equal comparison operator. SystemType ne 'Physical'
not Logical negation operator. not (ProcessorSummary/Count eq 2)
or Logical or operator. ProcessorSummary/Count eq 2 or ProcessorSummary/Count eq 4
Support for these operators have been added in previous commits. This commit enables them behind the insecure-enable-redfish-query meson option. This is an arbitrary language, so the likelihood there's some improper implementation in the patch is high. This gives folks the ability to test it.
Tested: Lots of unit tests included in this patch.
Functionally tested the basic operators: ``` GET /redfish/v1/Managers/bmc/LogServices/Journal/Entries?\$filter=EntryType+eq+'Oem' GET /redfish/v1/Managers/bmc/LogServices/Journal/Entries?\$filter=EntryType+ne+'Oem' ```
Function as expected, producing multiple results or no results respectively.
GET /redfish/v1 reports "FilterQuery": true
Redfish service validator passes.
Change-Id: Id568acc5dcfce868af12da5ee16c4f0caae8060a Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
253f11b8 |
| 16-May-2024 |
Ed Tanous <ed@tanous.net> |
Allow configuring "bmc" and "system"
In the early days of bmcweb, we made two pretty critical assumptions; First, is that a given platform would only have a single BMC instance (represented as "bmc"
Allow configuring "bmc" and "system"
In the early days of bmcweb, we made two pretty critical assumptions; First, is that a given platform would only have a single BMC instance (represented as "bmc") and a single host instance (represented as "system"). Second we assumed that, given that Redfish suggests against hardcoding URIs in client implementation and leaves them freeform, clients would code to the standard.
Our own webui-vue hardcodes Redfish URIs [1], and the documentation is littered with examples of hardcoded curl examples of hardcoding these URIs. That bug was filed in 2020, and the issue has only gotten worse over time.
This patchset is an attempt to give a target that we can start solving these issues, without trying to boil the ocean and fix all clients in parallel.
This commit adds the meson options redfish-manager-uri-name and redfish-system-uri-name
These are used to control the "name" that bmcweb places in the fixed locations in the ManagerCollection and ComputerSystemCollection schemas.
Note, managers is added, but is not currently testable. It will be iterated on over time.
Tested: Changed the URL options to "edsbmc" and "edssystem" in meson options.
Redfish service validator passes. URLs appear changed when walking the tree.
[1] https://github.com/openbmc/webui-vue/issues/43
Change-Id: I4b44685067051512bd065da8c2e3db68ae5ce23a Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
25b54dba |
| 17-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Bring consistency to config options
The configuration options that exist in bmcweb are an amalgimation of CROW options, CMAKE options using #define, pre-bmcweb ifdef mechanisms and meson options usi
Bring consistency to config options
The configuration options that exist in bmcweb are an amalgimation of CROW options, CMAKE options using #define, pre-bmcweb ifdef mechanisms and meson options using a config file. This history has led to a lot of different ways to configure code in the codebase itself, which has led to problems, and issues in consistency.
ifdef options do no compile time checking of code not within the branch. This is good when you have optional dependencies, but not great when you're trying to ensure both options compile.
This commit moves all internal configuration options to: 1. A namespace called bmcweb 2. A naming scheme matching the meson option. hyphens are replaced with underscores, and the option is uppercased. This consistent transform allows matching up option keys with their code counterparts, without naming changes. 3. All options are bool true = enabled, and any options with _ENABLED or _DISABLED postfixes have those postfixes removed. (note, there are still some options with disable in the name, those are left as-is) 4. All options are now constexpr booleans, without an explicit compare.
To accomplish this, unfortunately an option list in config/meson.build is required, given that meson doesn't provide a way to dump all options, as is a manual entry in bmcweb_config.h.in, in addition to the meson_options. This obsoletes the map in the main meson.build, which helps some of the complexity.
Now that we've done this, we have some rules that will be documented. 1. Runtime behavior changes should be added as a constexpr bool to bmcweb_config.h 2. Options that require optionally pulling in a dependency shall use an ifdef, defined in the primary meson.build. (note, there are no options that currently meet this class, but it's included for completeness.)
Note, that this consolidation means that at configure time, all options are printed. This is a good thing and allows direct comparison of configs in log files.
Tested: Code compiles Server boots, and shows options configured in the default build. (HTTPS, log level, etc)
Change-Id: I94e79a56bcdc01755036e4e7278c7e69e25809ce Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
01a89a1f |
| 05-Aug-2022 |
Ed Tanous <edtanous@google.com> |
Fix regression in @odata failure paths
5b224921d765a93c5f93a6012109a9a748ef7cd4 and a1e0871d2425b3f42d0e5893d548593e5ed576b
Added code to handle links looked correct in review, but the deduplicatio
Fix regression in @odata failure paths
5b224921d765a93c5f93a6012109a9a748ef7cd4 and a1e0871d2425b3f42d0e5893d548593e5ed576b
Added code to handle links looked correct in review, but the deduplication of the HEAD methods now causes the return code of setUpRedfishRoute to be ignored. This means that query parameter or other header failures don't stop the request, which is bad.
Tested:
GET /redfish/v1 (ie ServiceRoot) returns the correct header.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Iec01051221550747a7b99da5eb7713e18394d530
show more ...
|
#
c16e292c |
| 15-Jul-2022 |
Ed Tanous <edtanous@google.com> |
Update RedfishVersion to 1.17.0
The latest version of the specification is 1.17.0, and arguably, we should be updating this every time we pull in any new feature, but that hasn't happened.
So far a
Update RedfishVersion to 1.17.0
The latest version of the specification is 1.17.0, and arguably, we should be updating this every time we pull in any new feature, but that hasn't happened.
So far as I'm aware, there are no tools that actually look at this parameter to make branching decisions in the client about supported features, so the likelihood this has impact is basically nil.
Tested: GET /redfish/v1 returns RedfishVersion of 1.17.0
Redfish service validator passes.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I055b6010329599b7b39c587fa85faf51a38c9b57
show more ...
|
#
e68d1be0 |
| 27-Jan-2023 |
Ed Tanous <edtanous@google.com> |
Add ManagerProvidingService implementation
This property was added in Redfish 2022.3 to allow clients to determine which manager is hosting the ServiceRoot, such that they can find uptime statistics
Add ManagerProvidingService implementation
This property was added in Redfish 2022.3 to allow clients to determine which manager is hosting the ServiceRoot, such that they can find uptime statistics, and other metrics from that resource, without needing to attach them directly to serviceroot.
Tested: Redfish service validator passes. GET /redfish/v1/Managers/bmc returns the expected response.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: If2b78528d1499fbdae46120e1a1792ecf7ceb1d3
show more ...
|
#
6c068982 |
| 07-Feb-2023 |
Ed Tanous <edtanous@google.com> |
Implement AggregationService
AggregationService is used to inform a client that some of the results might be aggregated, and to allow setting up aggregation sources. Today, this resource only contai
Implement AggregationService
AggregationService is used to inform a client that some of the results might be aggregated, and to allow setting up aggregation sources. Today, this resource only contains the basic fields, as well as "Enabled", which informs the client of the fact that the service is aggregation enabled.
AggregationService was one of the schemas we ignored, so this adds it to the supported list.
Tested: Redfish service validator passes.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ifb16a86ff81e387f01016a83f9e69240c8928614
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 ...
|
#
07ffa4e8 |
| 09-Aug-2022 |
Nan Zhou <nanzhoumails@gmail.com> |
query: make $select true by default
The most outstanding concerns for $select query have been resolved. We added a set of restrictions: character set, property length, # of properties, which makes t
query: make $select true by default
The most outstanding concerns for $select query have been resolved. We added a set of restrictions: character set, property length, # of properties, which makes this feature safe to use.
This commit takes $select out of the insecure flag, so every system can start to use it. This decision has been made in Discord, available at
[1] https://discord.com/channels/775381525260664832/994314752102760559/1006650821569675355
Tested: 1. unit test passed 2. no new service validator failure on hardware
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I1f669cd35afcc1a65473a3ed665768e172a423bc
show more ...
|
#
0553fb57 |
| 05-Aug-2022 |
Nan Zhou <nanzhoumails@gmail.com> |
query: set only to true
Only parameter is considered safe, and is not behind the flag in the query handler codes. This change sets |OnlyMemberQuery| to true all the time.
Tested: 1. unit test passe
query: set only to true
Only parameter is considered safe, and is not behind the flag in the query handler codes. This change sets |OnlyMemberQuery| to true all the time.
Tested: 1. unit test passed
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I967912ec6c3103531b4c6556710a2b8924e3ac4f
show more ...
|
#
f252a6a7 |
| 05-Aug-2022 |
Ed Tanous <edtanous@google.com> |
Advertise select query param
We seem to have missed this in the $select review. Similar to other query params that have been turned on, advertise our support in ServiceRoot.
Tested: Redfish query_
Advertise select query param
We seem to have missed this in the $select review. Similar to other query params that have been turned on, advertise our support in ServiceRoot.
Tested: Redfish query_parameters usecase checker passes.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I35ac52f745f813cc1f0ecfcae8759ae6a8fe3dee
show more ...
|
#
5b224921 |
| 22-Jun-2022 |
Ed Tanous <edtanous@google.com> |
ServiceRoot Support Link header
The Redfish standard in section 8.2 states: A Link header containing rel=describedby shall be returned on GET and HEAD requests for Redfish resources. If the referenc
ServiceRoot Support Link header
The Redfish standard in section 8.2 states: A Link header containing rel=describedby shall be returned on GET and HEAD requests for Redfish resources. If the referenced JSON Schema is a versioned schema, it shall match the version contained in the value of the @odata.type property returned in this resource.
This commit attempts to add this capability to ServiceRoot. Future similar patches will start adding this across the tree.
To do this, a few things happen. First, this removes the implicit HEAD handling in the router. Because we now need explicit HEAD handling per-route with specific headers, there's no good way to make this generic. Next, it rearranges the code such that handleServiceRootGet can first call handleServiceRootHead, to avoid duplicating the addHeader call.
Tested: Redfish protocol validator passes the RESP_HEADERS_REL_LINK_DESCRIBED_BY check for ServiceRoot.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I92248089a3545432c14f551309ea62332e554647
show more ...
|
#
3ba00073 |
| 06-Jun-2022 |
Carson Labrado <clabrado@google.com> |
Expose AsyncResp shared_ptr when handling response
For Redfish Aggregation, we need a common point to check the D-Bus for satellite configs. If they are available then we perform the aggregation op
Expose AsyncResp shared_ptr when handling response
For Redfish Aggregation, we need a common point to check the D-Bus for satellite configs. If they are available then we perform the aggregation operations. The functions in query.hpp are used by all endpoints making them the logical location. The aggregation code requires a shared_ptr to the AsyncResp so these functions need to be able to supply that.
This patch is broken out of a future patch for routing Redfish Aggregation requests https://gerrit.openbmc.org/c/openbmc/bmcweb/+/53310
The follow commands can be used to perform most of the replacements: find . -type f | xargs sed -i 's/setUpRedfishRoute(app, req, asyncResp->res/setUpRedfishRoute(app, req, asyncResp/g' find . -type f | xargs sed -i 's/setUpRedfishRouteWithDelegation(app, req, asyncResp->res/setUpRedfishRouteWithDelegation(app, req, asyncResp/g'
Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: I4f4f9f22cdcfb14a3bd94b9a8f3d64aae34e57bc
show more ...
|
#
002d39b4 |
| 31-May-2022 |
Ed Tanous <edtanous@google.com> |
Try to fix the lambda formatting issue
clang-tidy has a setting, LambdaBodyIndentation, which it says: "For callback-heavy code, it may improve readability to have the signature indented two levels
Try to fix the lambda formatting issue
clang-tidy has a setting, LambdaBodyIndentation, which it says: "For callback-heavy code, it may improve readability to have the signature indented two levels and to use OuterScope."
bmcweb is very callback heavy code. Try to enable it and see if that improves things. There are many cases where the length of a lambda call will change, and reindent the entire lambda function. This is really bad for code reviews, as it's difficult to see the lines changed. This commit should resolve it. This does have the downside of reindenting a lot of functions, which is unfortunate, but probably worth it in the long run.
All changes except for the .clang-format file were made by the robot.
Tested: Code compiles, whitespace changes only.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ib4aa2f1391fada981febd25b67dcdb9143827f43
show more ...
|
#
1476687d |
| 15-Mar-2022 |
Ed Tanous <edtanous@google.com> |
Remove brace initialization of json objects
Brace initialization of json objects, while quite interesting from an academic sense, are very difficult for people to grok, and lead to inconsistencies.
Remove brace initialization of json objects
Brace initialization of json objects, while quite interesting from an academic sense, are very difficult for people to grok, and lead to inconsistencies. This patchset aims to remove a majority of them in lieu of operator[]. Interestingly, this saves about 1% of the binary size of bmcweb.
This also has an added benefit that as a design pattern, we're never constructing a new object, then moving it into place, we're always adding to the existing object, which in the future _could_ make things like OEM schemas or properties easier, as there's no case where we're completely replacing the response object.
Tested: Ran redfish service validator. No new failures.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Iae409b0a40ddd3ae6112cb2d52c6f6ab388595fe
show more ...
|
#
7cf436c9 |
| 23-Mar-2022 |
Ed Tanous <edtanous@google.com> |
Implement Expand
Section 7.3 of the Redfish specification lays out a feature called "expand" that allows users to expand portions of the Redfish tree automatically on the server side. This commit i
Implement Expand
Section 7.3 of the Redfish specification lays out a feature called "expand" that allows users to expand portions of the Redfish tree automatically on the server side. This commit implements them to the specification.
To accomplish this, a new class, MultiAsyncResp is created, that allows RAII objects to handle lifetime properly. When an expand query is generated, a MultiAsyncResp object is instantiated, which allows "new" requests to attach themselves to the multi object, and keep the request alive until they all complete. This also allows requests to be created, while requests are in flight, which is required for queries above depth=1.
Negatives: Similar to the previous $only commit, this requires that all nodes redfish nodes now capture App by reference. This is common, but does interfere with some of our other patterns, and attempts to improve the syntactic sugar for this proved unworkable.
This commit only adds the above to service root and Computer systems, in hopes that we find a better syntax before this merges.
Left to future patches in series: Merging the error json structures in responses.
The Redfish spec isn't very clear on how errors propagate for expanded queries, and in a conforming we shouldn't ever hit them, but nonetheless, I suspect the behavior we have is sub-optimal (attaching an error node to every place in the tree that had an issue) and we should attempt to do better in the future.
Tested (on previous patch):
curl --insecure --user root:0penBmc https://localhost:18080/redfish/v1\?\$expand\=.\(\$levels\=255\) Returns the full tree
Setting $levels=1 query returns only a depth of 1 tree being returned.
Unit tests passing
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I874aabfaa9df5dbf832a80ec62ae65369284791d
show more ...
|
#
f4c99e70 |
| 04-Oct-2021 |
Ed Tanous <edtanous@google.com> |
Redfish: Query parameters: Only
Add the query parameter "only" for redfish. The specification is based on DSP0266_1.8.0.
This commit is inspired by the commit that carries the same title, but is la
Redfish: Query parameters: Only
Add the query parameter "only" for redfish. The specification is based on DSP0266_1.8.0.
This commit is inspired by the commit that carries the same title, but is largely unique, namely, in that it adds the core feature to be able to recall handle with a new Response object, and make sure the result gets to the connection. It does this by swapping the handlers and implementing move semantics on the Response object. It definitely needs broken up into a few smaller patches, but it does pass the below tests without any apparent seg faults or ownership issues.
It implements a number of cleanups that deserve their own patches, and will be split up accordingly, but for the moment, I think this is a good start to getting filter and expand support in the future.
Tested: Validator passes (on previous patchset) ~$ curl -i -k -H "X-Auth-Token: $token" -X GET "https://${bmc}/redfish/v1/Systems"
~$ curl -i -k -H "X-Auth-Token: $token" -X GET "https://${bmc}/redfish/v1/Systems?only"
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I123d8ab8bcd88a0b63ff131f6b98548951989755
show more ...
|
#
9629907d |
| 23-Mar-2022 |
Nan Zhou <nanzhoumails@gmail.com> |
service root: add ProtocolFeaturesSupported
This commits adds a dummy ProtocolFeaturesSupported object in the service root. It indicates that none of the Query Parameter is supported. Future commits
service root: add ProtocolFeaturesSupported
This commits adds a dummy ProtocolFeaturesSupported object in the service root. It indicates that none of the Query Parameter is supported. Future commits will add supports for OnlyMemberQuery, ExpandQuery, and so on.
Tested: 1. unit test 2. passed QEMU Redfish (which contains Redfish Validator) test
This commit is split from these changes: https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/38952 https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/47474 Credits to maxiaochao@inspur.com, ed@tanous.net, and zhanghch05@inspur.com.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I81ff856514528f63a462558a8f18fefe4369edae
show more ...
|
#
104f09c9 |
| 25-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable readability-named-parameter checks
We don't have too many violations here, probably because we don't have many optional parameters. Fix the existing instances, and enable the check.
Signed-
Enable readability-named-parameter checks
We don't have too many violations here, probably because we don't have many optional parameters. Fix the existing instances, and enable the check.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I4d512f0ec90b060fb60a42fe3cd6ba72fb6c6bcb
show more ...
|
#
9c929bea |
| 16-Dec-2021 |
Shantappa Teekappanavar <sbteeks@yahoo.com> |
Implement Cable schema
This commit implements Cable and Cable collection schema on bmcweb.
Testing: Validator: @odata.id /redfish/v1/Cables odata Exists PASS @odata.type #CableCol
Implement Cable schema
This commit implements Cable and Cable collection schema on bmcweb.
Testing: Validator: @odata.id /redfish/v1/Cables odata Exists PASS @odata.type #CableCollection.CableCollection odata Exists PASS Members@odata.count 2 odata Exists PASS Members Array (size: 2) links: Cable Yes ... Members[0] Link: /redfish/v1/Cables/dp0_cable0 link: Cable Yes PASS Members[1] Link: /redfish/v1/Cables/dp0_cable1 link: Cable Yes PASS Description Collection of Cable Entries none Yes PASS Name Cable Collection none Yes PASS Oem - Resource.Oem No Optional
Property Name Value Type Exists Result @odata.id /redfish/v1/Cables/dp0_cable0 odata Exists PASS @odata.type #Cable.v1_0_0.Cable odata Exists PASS CableType string Yes PASS LengthMeters - number No Optional Id dp0_cable0 none Yes PASS Name Cable none Yes PASS
Property Name Value Type Exists Result @odata.id /redfish/v1/Cables/dp0_cable1 odata Exists PASS @odata.type #Cable.v1_0_0.Cable odata Exists PASS CableType string Yes PASS LengthMeters - number No Optional Id dp0_cable1 none Yes PASS Name Cable none Yes PASS
Note: Removed some of the fields that are optional to reduce commit msg
Tesing with Curl commands: $ curl -k -X GET https://{$bmc}/redfish/v1/Cables { "@odata.id": "/redfish/v1/Cables", "@odata.type": "#CableCollection.CableCollection", "Description": "Collection of Cable Entries", "Members": [ { "@odata.id": "/redfish/v1/Cables/dp0_cable0" }, { "@odata.id": "/redfish/v1/Cables/dp0_cable1" } ], "Members@odata.count": 2, "Name": "Cable Collection" }
$ curl -k -X GET https://{$bmc}/redfish/v1/Cables/dp0_cable0 { "@odata.id": "/redfish/v1/Cables/dp0_cable0", "@odata.type": "#Cable.v1_0_0.Cable", "CableType": "", "Id": "dp0_cable0", "Name": "Cable" }
$ curl -k -X GET https://{$bmc}/redfish/v1/Cables/dp0_cable1 { "@odata.id": "/redfish/v1/Cables/dp0_cable1", "@odata.type": "#Cable.v1_0_0.Cable", "CableType": "", "Id": "dp0_cable1", "Name": "Cable" }
Set Length property to 1.5 meters using busctl, and check the properties busctl set-property xyz.openbmc_project.Inventory.Manager \ /xyz/openbmc_project/inventory/cables/dp0_cable0 \ xyz.openbmc_project.Inventory.Item.Cable Length d 1.5
$ curl -k -X GET https://{$bmc}/redfish/v1/Cables/dp0_cable0 { "@odata.id": "/redfish/v1/Cables/dp0_cable0", "@odata.type": "#Cable.v1_0_0.Cable", "CableType": "", "Id": "dp0_cable0", "LengthMeters": 1.5, "Name": "Cable" }
Signed-off-by: Shantappa Teekappanavar <sbteeks@yahoo.com> Change-Id: I832ff1c1053f4d8100d04a42cc8046a61e8c1613
show more ...
|
#
8338891a |
| 29-Jun-2021 |
John Edward Broadbent <jebr@google.com> |
Refactor callback to free function: Service root This change will allow for unit testing of the free function. There are no changes to logic in the service root response. This is a d
Refactor callback to free function: Service root This change will allow for unit testing of the free function. There are no changes to logic in the service root response. This is a demo change, if it looks good similar changes can be made to all the redfish responses. Also adds missing include (persistent_data.hpp). Tested: ran curl against qemu machine, looked good. $ curl -vvvv --insecure "https://192.168.7.2:18080/redfish/v1" Signed-off-by: John Edward Broadbent <jebr@google.com> Change-Id: Ie056c64e841a2708d3189a55036385b8c905a7f4
show more ...
|
#
ed398213 |
| 09-Jun-2021 |
Ed Tanous <edtanous@google.com> |
Automate PrivilegeRegistry to code This commit attempts to automate the creation of our privileges structures from the redfish privilege registry. It accomplishes this by updating p
Automate PrivilegeRegistry to code 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
show more ...
|
#
83f01297 |
| 10-Jun-2021 |
John Edward Broadbent <jebr@google.com> |
Remove duplicate Managers field It appears that the managers field was duplicated in the service root response. Tested: There was no change in the follow curl request curl -
Remove duplicate Managers field It appears that the managers field was duplicated in the service root response. Tested: There was no change in the follow curl request curl -c cjar -b cjar -k -H "Content-Type: application/json" -X GET https://192.168.7.2:443/redfish/v1/ { "@odata.id": "/redfish/v1", "@odata.type": "#ServiceRoot.v1_5_0.ServiceRoot", "AccountService": { "@odata.id": "/redfish/v1/AccountService" }, "CertificateService": { "@odata.id": "/redfish/v1/CertificateService" }, "Chassis": { "@odata.id": "/redfish/v1/Chassis" }, "EventService": { "@odata.id": "/redfish/v1/EventService" }, "Id": "RootService", "JsonSchemas": { "@odata.id": "/redfish/v1/JsonSchemas" }, "Links": { "Sessions": { "@odata.id": "/redfish/v1/SessionService/Sessions" } }, "Managers": { "@odata.id": "/redfish/v1/Managers" }, "Name": "Root Service", "RedfishVersion": "1.9.0", "Registries": { "@odata.id": "/redfish/v1/Registries" }, "SessionService": { "@odata.id": "/redfish/v1/SessionService" }, "Systems": { "@odata.id": "/redfish/v1/Systems" }, "Tasks": { "@odata.id": "/redfish/v1/TaskService" }, "TelemetryService": { "@odata.id": "/redfish/v1/TelemetryService" }, "UUID": "0d1ead49-71e5-47e2-943d-165635d7cf60", "UpdateService": { "@odata.id": "/redfish/v1/UpdateService" } } Signed-off-by: John Edward Broadbent <jebr@google.com> Change-Id: Icc06d74fccf9efff6d36ef36559064dbab530ae6
show more ...
|
#
7e860f15 |
| 08-Apr-2021 |
John Edward Broadbent <jebr@google.com> |
Remove Redfish Node class Reduces the total number of lines and will allow for easier testing of the redfish responses. A main purpose of the node class was to set app.routeDyna
Remove Redfish Node class Reduces the total number of lines and will allow for easier testing of the redfish responses. A main purpose of the node class was to set app.routeDynamic(). However now app.routeDynamic can handle the complexity that was once in critical to node. The macro app.routeDynamic() provides a shorter cleaner interface to the unerlying app.routeDyanic call. The old pattern set permissions for 6 interfaces (get, head, patch, put, delete_, and post) even if only one interface is created. That pattern creates unneeded code that can be safely removed with no effect. Unit test for the responses would have to mock the node the class in order to fully test responses. see https://github.com/openbmc/bmcweb/issues/181 The following files still need node to be extracted. virtual_media.hpp account_service.hpp redfish_sessions.hpp ethernet.hpp The files above use a pattern that is not trivial to address. Often their responses call an async lambda capturing the inherited class. ie (https://github.com/openbmc/bmcweb/blob/ffed87b5ad1797ca966d030e7f979770 28d258fa/redfish-core/lib/account_service.hpp#L1393) At a later point I plan to remove node from the files above. Tested: I ran the docker unit test with the following command. WORKSPACE=$(pwd) UNIT_TEST_PKG=bmcweb ./openbmc-build-scripts/run-unit-test-docker.sh I ran the validator and this change did not create any issues. python3 RedfishServiceValidator.py -c config.ini Signed-off-by: John Edward Broadbent <jebr@google.com> Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I147a0289c52cb4198345b1ad9bfe6fdddf57f3df
show more ...
|
#
8d1b46d7 |
| 31-Mar-2021 |
zhanghch05 <zhanghch05@inspur.com> |
Using AsyncResp everywhere Get the core using AsyncResp everywhere, and not have each individual handler creating its own object.We can call app.handle() without fear of the response
Using AsyncResp everywhere Get the core using AsyncResp everywhere, and not have each individual handler creating its own object.We can call app.handle() without fear of the response getting ended after the first tree is done populating. Don't use res.end() anymore. Tested: 1. Validator passed. Signed-off-by: zhanghaicheng <zhanghch05@inspur.com> Change-Id: I867367ce4a0caf8c4b3f4e07e06c11feed0782e8
show more ...
|