History log of /openbmc/bmcweb/features/redfish/lib/redfish_v1.hpp (Results 26 – 34 of 34)
Revision Date Author Comments
# 81d523a7 25-May-2022 Ed Tanous <edtanous@google.com>

Move the JsonSchemas to be generated at runtime

Generating all of these index files at compile time is kind of wasteful,
considering that it's really not that much code to generate them. This
commi

Move the JsonSchemas to be generated at runtime

Generating all of these index files at compile time is kind of wasteful,
considering that it's really not that much code to generate them. This
commit modifies the update_schemas script to generate a C++ version of
the schemas that can then be used to generate a route. This allows
deleting a LOT of fixed files, for a very small incremental binary size
increase.

This change will cause two impacts that a user could possibly notice.

Expand will now work properly on JsonSchemas tree.
Keys on the JsonSchema schemas will now be sorted alphabetically, as we
do elsewhere.

All other things should remain the same.

Tested:
Redfish service validator passes.

curl --insecure --user root:0penBmc https://192.168.7.2/redfish/v1/JsonSchemas/Triggers
Returns the same object as before with changes above.

This adds 2512 bytes to the bmcweb binary size, and interestingly, adds
3764 bytes to the overall rootfs size, despite the level of file
deletion seen in the patch. While this is debatably "worse" than
what we had before in this regard, making JsonSchemas work similar
to how the rest of the Redfish tree operates, is worth the minor
increase in code size.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ic0d568112a3784821aa6867f7bcf50705dc586db

show more ...


# 686b7093 15-Jun-2022 Nan Zhou <nanzhoumails@gmail.com>

redfish_v1: fix setUpRedfishRoute

Tested: compiles

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I91565293a1b176803df5b0811752a0dea667c324


# 8c623a96 24-May-2022 Ed Tanous <edtanous@google.com>

Handle redfish 404 with a good message

Not found 404 on redfish entries has always returned the generic, bmcweb
core driven 404, that didn't include a message. This works most of the
time, because

Handle redfish 404 with a good message

Not found 404 on redfish entries has always returned the generic, bmcweb
core driven 404, that didn't include a message. This works most of the
time, because most things have BMCWEB_ROUTE entries, but there's a whole
class of routes that bmcweb doesn't implement, that should also return
404, with a resourceNotFound message.

This commit registers a generic /redfish/<path> route that forces things
to return 404.

One compromise made is that for a given route, if we don't know what
"type" the user was expecting back, there's no way to fill in the first
argument with the Redfish type, so this patchset opts for filling it in
with empty string "". This is arguably incorrect, but still better than
what we had previously, so it seems like an acceptable compromise.

Tested:
curl -vvvv --insecure --user root:0penBmc https://192.168.7.2/redfish/v1/Systems
returns the SystemCollection resource as expected

curl -vvvv --insecure --user root:0penBmc https://192.168.7.2/redfish/v1/foo
Returns a ResourceNotFound message, as Redfish expects.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ibef1ded004a950124104cf392b6bf9b679b3c85a

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 ...


# f65fca6a 24-May-2022 Ed Tanous <edtanous@google.com>

Move redfish/v1 instantiation

Make /redfish/v1 get instantiated in the same place as the other redfish
routes, and not in main().

Tested:
curl -vvvv --insecure --user root:0penBmc https://192.168.7

Move redfish/v1 instantiation

Make /redfish/v1 get instantiated in the same place as the other redfish
routes, and not in main().

Tested:
curl -vvvv --insecure --user root:0penBmc https://192.168.7.2/redfish

returns the same value as previously.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Icb93954c00a4cf41708f1b323ddbd83e61146e5d

show more ...


# d3355c5c 11-May-2022 Ed Tanous <edtanous@google.com>

Move /redfish to free methods

Similar to the refactors done elsewhere, move the /redfish route to a
free method.

Tested:
curl /redfish/v1 returns the same payload as previously.

Signed-off-by: Ed

Move /redfish to free methods

Similar to the refactors done elsewhere, move the /redfish route to a
free method.

Tested:
curl /redfish/v1 returns the same payload as previously.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Icd7668e8e3779926508aa901959b2ca6d079c8f0

show more ...


# 1e925c84 11-May-2022 Ed Tanous <edtanous@google.com>

Add setUpRedfishRoute to /redfish/ route

Because this file originally wasn't in redfish-core when we handled this
site-wide change, it didn't get the additional redfish decorators added
to it. This

Add setUpRedfishRoute to /redfish/ route

Because this file originally wasn't in redfish-core when we handled this
site-wide change, it didn't get the additional redfish decorators added
to it. This commit adds it.

Tested:
curl /redfish returns as before.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I89a01a8fd75ab081d031de34ced6c9ae9c0ca75a

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 ...


# 4c25d66e 11-May-2022 Ed Tanous <edtanous@google.com>

Move redfish v1 into redfish-core

This file has existed for a long time, and predates redfish-core, so it
was put in an inopportune place.

Move the code to where it should be, in lib.

Tested: Code

Move redfish v1 into redfish-core

This file has existed for a long time, and predates redfish-core, so it
was put in an inopportune place.

Move the code to where it should be, in lib.

Tested: Code compiles.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I422c27563a5e0f2a5debb2b1d4713aa8db0fe331

show more ...


12