#
b2c7e208
|
| 16-May-2022 |
Ed Tanous <edtanous@google.com> |
Fix regression in ComputerSystem
Despite the pseudo non-plural name "Links.Chassis", the Redfish schema states that Chassis is an array of chassis, not a singular chassis. While odd, we should obey
Fix regression in ComputerSystem
Despite the pseudo non-plural name "Links.Chassis", the Redfish schema states that Chassis is an array of chassis, not a singular chassis. While odd, we should obey the specification.
This resolves the regression introduced by 1476687de
Tested: Code compiles, code inspection looks correct.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I4d6d0554865e412137c44562d173a6efe3f88f4a
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 ...
|
#
550a6bf8
|
| 26-Apr-2022 |
Jiaqing Zhao <jiaqing.zhao@intel.com> |
system: Handle PATCH request with multi-depth readJson
This reduces readJson calls and makes the code more readable, and saves ~164 bytes of compressed image size.
Tested: Verified PATCH /redfish/v
system: Handle PATCH request with multi-depth readJson
This reduces readJson calls and makes the code more readable, and saves ~164 bytes of compressed image size.
Tested: Verified PATCH /redfish/v1/Systems/system is handled as expected.
Change-Id: I90dd5e0d4b0b055ee370288ad159d26e5bb40281 Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
show more ...
|
#
49328a2b
|
| 22-Apr-2022 |
Jiaqing Zhao <jiaqing.zhao@intel.com> |
system: Fix incorrect WatchdogTimer PATCH handler
Changes the incorrect WatchdogTimer property name to HostWatchdogTimer in PATCH /redfish/v1/Systems/system handler to match the Redfish spec.
Teste
system: Fix incorrect WatchdogTimer PATCH handler
Changes the incorrect WatchdogTimer property name to HostWatchdogTimer in PATCH /redfish/v1/Systems/system handler to match the Redfish spec.
Tested: Updating HostWatchdogTimer with PATCH request is handled properly.
Change-Id: Ic7c9c72e3fd43fb738f4fc21eb39e335aa8d1bcd Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
show more ...
|
#
83c835fb
|
| 06-Apr-2022 |
Jiaqing Zhao <jiaqing.zhao@intel.com> |
Remove unused modeString in translatePowerMode()
In systems.hpp:translatePowerMode(), modeString is defined but never used. Compiler also doesn't give a warning. Remove it.
Tested: Build pass.
Cha
Remove unused modeString in translatePowerMode()
In systems.hpp:translatePowerMode(), modeString is defined but never used. Compiler also doesn't give a warning. Remove it.
Tested: Build pass.
Change-Id: Ic48c77f74a398bf74a2c874d6a6969efdd440a5f Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
show more ...
|
#
45ca1b86
|
| 25-Mar-2022 |
Ed Tanous <edtanous@google.com> |
Add setUpRedfishRoute to all nodes in redfish
For better or worse, the series ahead of this is making use of setUpRedfishRoute to do the common "redfish specified" things that need to be done for a
Add setUpRedfishRoute to all nodes in redfish
For better or worse, the series ahead of this is making use of setUpRedfishRoute to do the common "redfish specified" things that need to be done for a connection, like header checking, filtering, and other things. In the current model, where BMCWEB_ROUTE is a common function for all HTTP routes, this means we need to propagate this injection call into the whole tree ahead of the requests being handled.
In a perfect world, we would invent something like a REDFISH_ROUTE macro, but because macros are discouraged, the routes take a variadic template of parameters, and each call to the route has a .privileges() call in the middle, there's no good way to effect this change in a less costly manner. This was messaged both in the prior reviews, and on discord sourcing improvements on this pattern, to which none arose.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Id29cc799e214edad41e48fc7ce6eed0521f90ecb
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 ...
|
#
b9d36b47
|
| 26-Feb-2022 |
Ed Tanous <edtanous@google.com> |
Consitently use dbus::utility types
This saves about 4k on the binary size
Tested: Redfish service validator passes.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I9546227a19c691b1aecb
Consitently use dbus::utility types
This saves about 4k on the binary size
Tested: Redfish service validator passes.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I9546227a19c691b1aecb80e80307889548c0293f
show more ...
|
#
4ed47cb8
|
| 03-Mar-2022 |
Matthew Barth <msbarth@us.ibm.com> |
redfish:systems: Handle power restore policy of "None"
On the Control.Power.RestorePolicy interface, a value of "None" is allowed on the PowerRestorePolicy property and Redfish should handle this va
redfish:systems: Handle power restore policy of "None"
On the Control.Power.RestorePolicy interface, a value of "None" is allowed on the PowerRestorePolicy property and Redfish should handle this value instead of throwing an internal error. Until support of "None" as a one time parameter is included into the Redfish schema, return "AlwaysOff" to align with the dbus interface.
Tested: Set PowerRestorePolicy to "None" enum value Verified `PowerRestorePolicy` value is "AlwaysOff" thru Redfish Set PowerRestorePolicy to "AlwaysOff" enum value Verified `PowerRestorePolicy` value is "AlwaysOff" thru Redfish Ran Redfish validator:
Elapsed time: 0:02:47 invalidPropertyValue: 44 metadataNamespaces: 2390 pass: 4384 passAction: 10 passGet: 212 passRedfishUri: 170 repeat: 1 skipNoSchema: 3 skipOptional: 4530 warnDeprecated: 319 warningPresent: 64 Validation has succeeded.
Signed-off-by: Matthew Barth <msbarth@us.ibm.com> Change-Id: Idb5b16ae797527b9d35a58aa3c26f6527aa5436d
show more ...
|
#
55f79e6f
|
| 25-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable readability checks
clang-tidy readability checks are overall a good thing, and help us to write consistent and readable code, even if it doesn't change the result.
All changes done by the ro
Enable readability checks
clang-tidy readability checks are overall a good thing, and help us to write consistent and readable code, even if it doesn't change the result.
All changes done by the robot.
Tested: Code compiles, inspection only (changes made by robot)
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Iee4a0c74a11eef9f158f0044eae675ebc518b549
show more ...
|
#
15ed6780
|
| 14-Dec-2021 |
Willy Tu <wltu@google.com> |
json_utils: Add support jsonRead Patch/Action
Added support for readJson for Patch and Action. The only difference is that Patch does not allow empty json input while Action does. Action with empty
json_utils: Add support jsonRead Patch/Action
Added support for readJson for Patch and Action. The only difference is that Patch does not allow empty json input while Action does. Action with empty input will use the default value based on the implementation and return 200 OK response code.
readJsonPatch will replace the existing readJson and be used for path requests. It will not allow empty json input and all requested keys are required in the json input.
readJsonAction will be used for Action requests where it is possible for all of the properties to be optional and allow empty request. The optional properties are determined by the requested values type.
All current Action readJson are replaced with readJsonAction. It does not change the existing behavior since it needs `std::optional`. This will have to be updated later as we define the default behavior.
Tested: Added unit tests and readJsonAction allows empty empty json object.
No Change to Redfish Tree.
Change-Id: Ia5e1f81695c528a20f1dc985aee19c920d8adaea Signed-off-by: Willy Tu <wltu@google.com>
show more ...
|
#
e662eae8
|
| 25-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable readability-implicit-bool-conversion checks
These checks ensure that we're not implicitly converting ints or pointers into bools, which makes the code easier to read.
Tested: Ran series thro
Enable readability-implicit-bool-conversion checks
These checks ensure that we're not implicitly converting ints or pointers into bools, which makes the code easier to read.
Tested: Ran series through redfish service validator. No changes observed. UUID failing in Qemu both before and after.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I1ca0be980d136bd4e5474341f4fd62f2f6bbdbae
show more ...
|
#
e05aec50
|
| 25-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Add readability-redundant-* checks
There's a number of redundancies in our code that clang can sanitize out. Fix the existing problems, and enable the checks.
Signed-off-by: Ed Tanous <edtanous@go
Add readability-redundant-* checks
There's a number of redundancies in our code that clang can sanitize out. Fix the existing problems, and enable the checks.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ie63d7b7f0777b702fbf1b23a24e1bed7b4f5183b
show more ...
|
#
22228c28
|
| 31-Jan-2022 |
Andrew Geissler <geissonator@yahoo.com> |
host-state: do not return anything if unavailable
The host state information is provided by the xyz.openbmc_project.State.Host service. There is no guarantee that this service will be up and running
host-state: do not return anything if unavailable
The host state information is provided by the xyz.openbmc_project.State.Host service. There is no guarantee that this service will be up and running by the time bmcweb needs it. Returning an InternalError simply because a service is not yet running is not very user friendly to our clients. In most situations, a client will ignore all data returned when a 500 is returned.
Instead of putting systemd Wants/Before type relationships on everything possibly needed by bmcweb, the design point is to simply return what bmcweb can get at that instant in time. With this change, the majority of the redfish system object data can be returned and used by the client.
This scenario has been seen a few times on our p10bmc machine.
Tested: - Verified that when xyz.openbmc_project.State.Host was unavailable, a call to redfish/v1/Systems/system returned what was available without error. - Verified that redfish validator passed - Verified that redfish validator passed when xyz.openbmc_project.State.Host.service was unavailable
Change-Id: I22c6942d2c81083bf90fa4180e95b1fa19221374 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
show more ...
|
#
26f6976f
|
| 25-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable readability-container-size-empty tests
This one is a little trivial, but it does help in readability.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I5366d4eec8af2f781b3bad804131a
Enable readability-container-size-empty tests
This one is a little trivial, but it does help in readability.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I5366d4eec8af2f781b3bad804131ae2eb806e3aa
show more ...
|
#
543f4400
|
| 06-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable init checker
clang-tidy added cppcoreguidelines-init-variables as a check, which is something we already enforce to some extent, but getting CI to enforce it will help reviews move faster.
T
Enable init checker
clang-tidy added cppcoreguidelines-init-variables as a check, which is something we already enforce to some extent, but getting CI to enforce it will help reviews move faster.
Tested: Code compiles. Noop changes.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I7e10950de617b1d3262265572b1703f2e60b69d0
show more ...
|
#
914e2d5d
|
| 07-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enforce const correctness
For all async calls, we should be consistently capturing non trivial objects by const reference. This corrects bmcweb to be consistent and capture errors by const value, a
Enforce const correctness
For all async calls, we should be consistently capturing non trivial objects by const reference. This corrects bmcweb to be consistent and capture errors by const value, and objects by const reference.
Tested: Code compiles. Trivial changes.
This saves about 300 bytes on our compressed binary size.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ib3e0b6edef9803a1c480701556949488406305d4
show more ...
|
#
6e3b67ec
|
| 05-Jan-2022 |
AppaRao Puli <apparao.puli@intel.com> |
Convert VariantType to DbusVariantType
All bmcweb code is now converted to use DbusVariantType to reduce the image size.
Its missed in one place where the code is under compiler flag BMCWEB_ENABLE_
Convert VariantType to DbusVariantType
All bmcweb code is now converted to use DbusVariantType to reduce the image size.
Its missed in one place where the code is under compiler flag BMCWEB_ENABLE_REDFISH_PROVISIONING_FEATURE. This commit convert missed types to DbusVariantType.
Tested: After conversion, image builds fine with compiler flag enabled. Also tested the PFR provisioned dbus calls and it works fine.
Change-Id: Idcef956a18a6f822c44399ef867e26551dd8124f Signed-off-by: AppaRao Puli <apparao.puli@intel.com>
show more ...
|
#
e43914b3
|
| 06-Jan-2022 |
Andrew Geissler <geissonator@yahoo.com> |
boot-progress: move dbus-to-redfish logic to function
This logic has grown enough to deserve its own function.
Tested: - Validated BootProgress returned as expected via Redfish API - Redfish valida
boot-progress: move dbus-to-redfish logic to function
This logic has grown enough to deserve its own function.
Tested: - Validated BootProgress returned as expected via Redfish API - Redfish validator passed
Change-Id: I798841a79b40b0fb60fdd21b95430958e20c2a03 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
show more ...
|
#
9ec65efb
|
| 05-Jan-2022 |
Andrew Geissler <geissonator@yahoo.com> |
boot-progress: add support for SetupEntered
The following phosphor-dbus-interfaces commit introduced a new BootProgress value: https://github.com/openbmc/phosphor-dbus-interfaces/commit/d01d1f841918
boot-progress: add support for SetupEntered
The following phosphor-dbus-interfaces commit introduced a new BootProgress value: https://github.com/openbmc/phosphor-dbus-interfaces/commit/d01d1f84191894ad605a9ba5b546280bcfc64f7d
Add support for this to the Redfish API provided by bmcweb.
Tested: - Manually set BootProgress D-Bus property to SystemSetup and verify busctl set-property xyz.openbmc_project.State.Host /xyz/openbmc_project/state/host0 xyz.openbmc_project.State.Boot.Progress BootProgress s xyz.openbmc_project.State.Boot.Progress.ProgressStages.SystemSetup
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Systems/system "BootProgress": { "LastState": "SetupEntered" },
- Verified validator passed when LastState was "SetupEntered"
Change-Id: Ie966766b88d2923bc0d10d89370713c7b17df14b Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
show more ...
|
#
1e1e598d
|
| 11-Jun-2021 |
Jonathan Doman <jonathan.doman@intel.com> |
Using sdbusplus::asio::getProperty
It simplifies a lot of code and after changing sdbusplus implementation slightly reduces binary size if used together with:
https://gerrit.openbmc-project.xyz/c/o
Using sdbusplus::asio::getProperty
It simplifies a lot of code and after changing sdbusplus implementation slightly reduces binary size if used together with:
https://gerrit.openbmc-project.xyz/c/openbmc/sdbusplus/+/49467
* Uncompressed size: 3033148 -> 3012164, -20984 B * gzip compressed size: 1220586 -> 1214625, -5961 B
Tested: - Redfish validator output is the same before and after the change
Change-Id: Ibe3227d3f4230de2363ba3d9396e51130c8240a5 Signed-off-by: Jonathan Doman <jonathan.doman@intel.com> Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
show more ...
|
#
168e20c1
|
| 13-Dec-2021 |
Ed Tanous <edtanous@google.com> |
Move to common variant
This saves approximately 34kB in the compressed binary size of bmcweb due to reduced template instantiations. This amounts to a 2.5% reduction in the overall size.
Note, the
Move to common variant
This saves approximately 34kB in the compressed binary size of bmcweb due to reduced template instantiations. This amounts to a 2.5% reduction in the overall size.
Note, there were a few places where we broke const-correctness in the form of pulling a non-const reference out of a const variant. This new variant now requires const correctness, so some consts are added where required.
Tested: Code compiles.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I6a60c8881c1268627eedb4ffddf16689dc5f6ed2
show more ...
|
#
1d8782e7
|
| 30-Nov-2021 |
Nan Zhou <nanzhoumails@gmail.com> |
fix the year 2038 problem in getDateTime
The existing codes cast uint64_t into time_t which is int32_t in most 32-bit systems. It results overflow if the timestamp is larger than INT_MAX. time_t wil
fix the year 2038 problem in getDateTime
The existing codes cast uint64_t into time_t which is int32_t in most 32-bit systems. It results overflow if the timestamp is larger than INT_MAX. time_t will be 64 bits in future releases of glibc. See https://sourceware.org/bugzilla/show_bug.cgi?id=28182.
This change workarounds the year 2038 problem via boost's ptime. std::chrono doesn't help since it is still 32 bits.
Tested on QEMU. Example output for certificate: { "Name": "HTTPS Certificate", "Subject": null, "ValidNotAfter": "2106-01-28T20:40:31Z", "ValidNotBefore": "2106-02-06T18:28:16Z" } Previously, the format is like "1969-12-31T12:00:00+00:00". Note that the ending "+00:00" is the time zone, not ms.
Tested the schema on QEMU. No new Redfish Service Validator errors.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I8ef0bee3d724184d96253c23f3919447828d3f82
show more ...
|
#
0fda0f12
|
| 15-Nov-2021 |
George Liu <liuxiwei@inspur.com> |
Update clang-format
refer: https://github.com/openbmc/docs/blob/master/style/cpp/.clang-format `Don't break long string literals`
Tested: built bmcweb successfully and RedfishValidator Passed.
Sig
Update clang-format
refer: https://github.com/openbmc/docs/blob/master/style/cpp/.clang-format `Don't break long string literals`
Tested: built bmcweb successfully and RedfishValidator Passed.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Ib58f7c942fd3838592e043c57e0b6ffcdc3d963b
show more ...
|
#
f6674220
|
| 13-Nov-2021 |
Ed Tanous <edtanous@google.com> |
Fix build on clang
New code was missing an inline parameter on a method.
Tested: Code now compiles on clang.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I1256c70d37df82c92080667531e9
Fix build on clang
New code was missing an inline parameter on a method.
Tested: Code now compiles on clang.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I1256c70d37df82c92080667531e98c49b35e7d0b
show more ...
|