#
4e338b23
|
| 14-Jun-2024 |
Jagpal Singh Gill <paligill@gmail.com> |
update service: remove tftp simple update flow
Remove the flow for tftp simple update as this is an insecure method and there is no active user for this.
Redfish service validator passing: ``` Elap
update service: remove tftp simple update flow
Remove the flow for tftp simple update as this is an insecure method and there is no active user for this.
Redfish service validator passing: ``` Elapsed time: 0:04:33 metadataNamespaces: 3727 pass: 5184 passAction: 16 passGet: 213 passRedfishUri: 205 skipNoSchema: 3 skipOptional: 3535 unvalidated: 1 warnDeprecated: 5 warningPresent: 6 ```
Change-Id: I466dcb09be4ee806451abe91ab86d8b3b001a333 Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
show more ...
|
#
539d8c6b
|
| 19-Jun-2024 |
Ed Tanous <ed@tanous.net> |
Consistently use generated enumerations
This commit causes all of Redfish to use generated enum values for enum types. Using generated code prevents problems, and makes it more clear what types are
Consistently use generated enumerations
This commit causes all of Redfish to use generated enum values for enum types. Using generated code prevents problems, and makes it more clear what types are allowed.
Doing this found two places where we had structs that didn't fulfill the schema. They have been commented, but will be fixed with a breaking change at some point in the future.
Tested: WIP
Change-Id: I5fdd2f2dfb6ec05606a522e1f4e331f982c8e476 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
08f61d53
|
| 17-Jul-2024 |
Jagpal Singh Gill <paligill@gmail.com> |
update service: simplify object path lookup
Simplify the object path lookup for the update interface by placing it at the same object path as the version interface. This involves moving the update i
update service: simplify object path lookup
Simplify the object path lookup for the update interface by placing it at the same object path as the version interface. This involves moving the update interface to /xyz/openbmc_project/software/<swId> rather than /xyz/openbmc_project/software/<deviceX>. This change is based on - https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/65738 https://gerrit.openbmc.org/c/openbmc/docs/+/65739
Related Commit from phosphor-bmc-code-mgmt - https://gerrit.openbmc.org/c/openbmc/phosphor-bmc-code-mgmt/+/70668
Tested - FirmwareInventory as TargetURI: ``` > curl -k -H "X-Auth-Token: $token" -H "Content-Type:multipart/form-data" -X POST -F UpdateParameters="{\"Targets\":[\"/redfish/v1/UpdateService/FirmwareInventory/3c956be0\"],\"@Redfish.OperationApplyTime\":\"Immediate\"};type=application/json" -F "UpdateFile=@obmc-phosphor-image-romulus-20240529184214.static.mtd.tar;type=application/octet-stream" https://${bmc}/redfish/v1/UpdateService/update { "@odata.id": "/redfish/v1/TaskService/Tasks/0", "@odata.type": "#Task.v1_4_3.Task", "Id": "0", "TaskState": "Running", "TaskStatus": "OK" } ```
/redfish/v1/Managers/bmc as Target URI: ``` > curl -k -H "X-Auth-Token: $token" -H "Content-Type:multipart/form-data" -X POST -F UpdateParameters="{\"Targets\":[\"/redfish/v1/Managers/bmc\"],\"@Redfish.OperationApplyTime\":\"Immediate\"};type=application/json" -F "UpdateFile=@obmc-phosphor-image-romulus-20240529184214.static.mtd.tar;type=application/octet-stream" https://${bmc}/redfish/v1/UpdateService/update { "@odata.id": "/redfish/v1/TaskService/Tasks/0", "@odata.type": "#Task.v1_4_3.Task", "Id": "0", "TaskState": "Running", "TaskStatus": "OK" } ```
Redfish service validator passing: ``` Elapsed time: 0:04:33 metadataNamespaces: 3727 pass: 5184 passAction: 16 passGet: 213 passRedfishUri: 205 skipNoSchema: 3 skipOptional: 3535 unvalidated: 1 warnDeprecated: 5 warningPresent: 6 ```
Change-Id: I6c22a904cecaf8e3043706990ae3a71da8f5addf Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
show more ...
|
#
ac1e1246
|
| 11-Jul-2024 |
Ed Tanous <ed@tanous.net> |
Make multipart use consistent parse
This is an instance of common error #5. Fix it.
Tested: Code compiles. Inspection only.
Change-Id: I5580a9789930ffab6513a03689b633d5201e72a4 Signed-off-by: Ed
Make multipart use consistent parse
This is an instance of common error #5. Fix it.
Tested: Code compiles. Inspection only.
Change-Id: I5580a9789930ffab6513a03689b633d5201e72a4 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
9dae4dee
|
| 03-Jun-2024 |
Jagpal Singh Gill <paligill@gmail.com> |
add D-Bus interface for unstructured HTTP push
Add the D-Bus interface for unstructured HTTP push update. Unstructured HTTP push updates are discouraged in favor of Multipart-form based updates, hen
add D-Bus interface for unstructured HTTP push
Add the D-Bus interface for unstructured HTTP push update. Unstructured HTTP push updates are discouraged in favor of Multipart-form based updates, hence D-Bus interface has been added only for BMC updates for backward compatibility. Fore more details refer to [1].
Tested: ``` > curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/octet-stream" -X POST -T obmc-phosphor-image-romulus-20240529184214.static.mtd.tar https://${bmc}/redfish/v1/UpdateService/update { "@odata.id": "/redfish/v1/TaskService/Tasks/0", "@odata.type": "#Task.v1_4_3.Task", "Id": "0", "TaskState": "Running", "TaskStatus": "OK" } ```
[1]: https://www.dmtf.org/sites/default/files/standards/documents/DSP2062_1.0.1.pdf
Change-Id: I365c0c188190032cb191940072399d9abd8a87b3 Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
show more ...
|
#
e93abac6
|
| 14-Jun-2024 |
Ginu George <ginugeorge@ami.com> |
Pass redfishPropertyName earlier argument
It was pointed out that the setDbusProperty method should have an end that approximately matches dbus-send and busctl set-property in its arguments, to aid
Pass redfishPropertyName earlier argument
It was pointed out that the setDbusProperty method should have an end that approximately matches dbus-send and busctl set-property in its arguments, to aid with debug. This seems reasonable.
Tested: Redfish service validator passes.
Change-Id: Ic20295d93c71c957e3e76704e1eda9da187861b1 Signed-off-by: Ginu George <ginugeorge@ami.com> Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
9c95be77
|
| 03-Jun-2024 |
Jagpal Singh Gill <paligill@gmail.com> |
remove unstructured HTTP patch for ApplyOptions
Remove the support for Unstructured HTTP patch as the main user of this Redfish API is IBM and they only use this API to set the ApplyTime as immediat
remove unstructured HTTP patch for ApplyOptions
Remove the support for Unstructured HTTP patch as the main user of this Redfish API is IBM and they only use this API to set the ApplyTime as immediate. Hence ApplyTime will be passed as immediate (as default) for Unstructured HTTP POST updates. Modify the get for ApplyTime to only return immediate.
Tested: Patch operation removal test: ``` > curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH -d '{"HttpPushUriOptions":{"HttpPushUriApplyTime":{"ApplyTime":"Immediate"}}}' https://${bmc}/redfish/v1/UpdateService { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The HTTP method is not allowed on this resource.", "MessageArgs": [], "MessageId": "Base.1.16.0.OperationNotAllowed", "MessageSeverity": "Critical", "Resolution": "None." } ], "code": "Base.1.16.0.OperationNotAllowed", "message": "The HTTP method is not allowed on this resource." } } ```
ApplyTime get test: ``` > curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/UpdateService { "@odata.id": "/redfish/v1/UpdateService", "@odata.type": "#UpdateService.v1_11_1.UpdateService", "Actions": { "#UpdateService.SimpleUpdate": { "TransferProtocol@Redfish.AllowableValues": [ "HTTPS" ], "target": "/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate" } }, "Description": "Service for Software Update", "FirmwareInventory": { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory" }, "HttpPushUri": "/redfish/v1/UpdateService/update", "HttpPushUriOptions": { "HttpPushUriApplyTime": { "ApplyTime": "Immediate" } }, "Id": "UpdateService", "MaxImageSizeBytes": 31457280, "MultipartHttpPushUri": "/redfish/v1/UpdateService/update", "Name": "Update Service", "ServiceEnabled": true } ```
Change-Id: I25d21119d74a3411cd1fd581c9d56e1e9e1604f8 Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
show more ...
|
#
049079f6
|
| 02-Jun-2024 |
Jagpal Singh Gill <paligill@gmail.com> |
update service: update applytime value
Update interface has been updated to use ApplyTime from ApplyTime interface. This helps to avoid any conversions between the values. Hence update the BMCWeb to
update service: update applytime value
Update interface has been updated to use ApplyTime from ApplyTime interface. This helps to avoid any conversions between the values. Hence update the BMCWeb to reflect this change.
Tested: ``` curl -k -H "X-Auth-Token: $token" -H "Content-Type:multipart/form-data" -X POST -F UpdateParameters="{\"Targets\":[\"/redfish/v1/UpdateService/FirmwareInventory/3c956be0\"],\"@Redfish.OperationApplyTime\":\"Immediate\"} ;type=application/json" -F "UpdateFile=@obmc-phosphor-image-romulus-20240529184214.static.mtd.tar;type=application/octet-stream" https://${bmc}/redfish/v1/UpdateService/update { "@odata.id": "/redfish/v1/TaskService/Tasks/2", "@odata.type": "#Task.v1_4_3.Task", "Id": "2", "TaskState": "Running", "TaskStatus": "OK" } ```
Change-Id: I311d8048d80616cc8933c3e32ca44b4cfa64b1e9 Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
show more ...
|
#
de0c960c
|
| 29-Apr-2024 |
Jagpal Singh Gill <paligill@gmail.com> |
updateservice: add start update D-Bus interface
Add the start update D-Bus interface based flow for multi-form content path. This involves mapping the TargetURI to the corresponding serviceName and
updateservice: add start update D-Bus interface
Add the start update D-Bus interface based flow for multi-form content path. This involves mapping the TargetURI to the corresponding serviceName and objectPath which hosts the specific D-Bus interface. As per discussion with Redfish community both ResourceURI and FirmwareInventory Redfish URI can be used as TargetURI. Current implementation already allows /redfish/v1/Managers/<bmc>, hence support for this specific ResourceURI has been preserved. New implementation adds FirmwareInventory Redfish URI for TargetURI as default option. https://redfishforum.com/thread/1054. For more details on design refer to - https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/65738 https://gerrit.openbmc.org/c/openbmc/docs/+/65739
Tested: Redfish Validator and Build passes. multipart form data update request with Resource URI as target ``` curl -k -H "X-Auth-Token: $token" -H "Content-Type:multipart/form-data" \ -X POST -F UpdateParameters="{\"Targets\":[\"/redfish/v1/Managers/bmc\"],\"@Redfish.OperationApplyTime\":\"Immediate\"};type=application/json" \ -F "UpdateFile=@obmc-phosphor-image-romulus-20240425222313.static.mtd.all.tar;type=application/octet-stream" \ https://${bmc}/redfish/v1/UpdateService/update { "@odata.id": "/redfish/v1/TaskService/Tasks/0", "@odata.type": "#Task.v1_4_3.Task", "Id": "0", "TaskState": "Running", "TaskStatus": "OK" } ```
multipart form data update request with Firmware Inventory URI as target ``` curl -k -H "X-Auth-Token: $token" -H "Content-Type:multipart/form-data" \ -X POST -F UpdateParameters="{\"Targets\":[\"/redfish/v1/Managers/bmc\"],\"@Redfish.OperationApplyTime\":\"Immediate\"};type=application/json" \ -F "UpdateFile=@obmc-phosphor-image-romulus-20240509003505.static.mtd.all.tar;type=application/octet-stream" \ https://${bmc}/redfish/v1/UpdateService/update { "@odata.id": "/redfish/v1/TaskService/Tasks/1", "@odata.type": "#Task.v1_4_3.Task", "Id": "1", "TaskState": "Running", "TaskStatus": "OK" } ```
Change-Id: Id46de79d3af8834630a793678a6fc0e859295afe Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
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 ...
|
#
c71b6c99
|
| 29-Apr-2024 |
Jagpal Singh Gill <paligill@gmail.com> |
updateservice: refactor task creation
Refactor task creation into a separate function so it can be used from different places in code. The new usage of this function will be from start update interf
updateservice: refactor task creation
Refactor task creation into a separate function so it can be used from different places in code. The new usage of this function will be from start update interface based flow. More details refer to - https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/65738 https://gerrit.openbmc.org/c/openbmc/docs/+/65739
Tested: Firmware update using curl. Change-Id: I5e8a0ab98f49657178ee733fa4d34fbf40a7b1f3 Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
show more ...
|
#
ef93eab3
|
| 17-Apr-2024 |
Jagpal Singh Gill <paligill@gmail.com> |
updateservice: refactor parse multi-part forms
Refactor parsing multi-part forms into a different function for using it in legacy vs start update flows. More more details refer to - https://gerrit.o
updateservice: refactor parse multi-part forms
Refactor parsing multi-part forms into a different function for using it in legacy vs start update flows. More more details refer to - https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/65738 https://gerrit.openbmc.org/c/openbmc/docs/+/65739
Tested: Used curl to test firmware update.
Change-Id: I2ec1ec9f4ac04349a1fbd588664f2d51bae827ea Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
show more ...
|
#
c72503f3
|
| 06-May-2024 |
Ed Tanous <ed@tanous.net> |
Fix TFTP merge conflict
Static analysis now shows this code as "dead", even though it's not. This is a merge conflict that was handled wrong.
Tested: inspection only. Suspect TFTP will now work.
Fix TFTP merge conflict
Static analysis now shows this code as "dead", even though it's not. This is a merge conflict that was handled wrong.
Tested: inspection only. Suspect TFTP will now work.
Change-Id: I51e52d62c51b251baf4c6ae74b100c1eda95603d Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
e5cf777e
|
| 03-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Add https parsing
This is yet another step in parsing HTTP requests.
Tested: ''' curl -vvvv -k --user "root:0penBmc" -H "Content-Type: application/json" \ -X POST https://192.168.7.2/redfish/v1/Upd
Add https parsing
This is yet another step in parsing HTTP requests.
Tested: ''' curl -vvvv -k --user "root:0penBmc" -H "Content-Type: application/json" \ -X POST https://192.168.7.2/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate \ -d '{ \ "TransferProtocol":"TFTP", \ "ImageURI":"https://192.168.7.1/myfile.bin" \ }' '''
Returns ActionParameterNotSupported
TransferProtocol: Omitted ImageURI: https://192.168.7.1/myfile.bin Returns ActionParameterNotSupported
TransferProtocol: Omitted ImageURI: 192.168.7.1/myfile.bin Returns ActionParameterValueTypeError
TransferProtocol: Bad ImageURI: https:/192.168.7.1/myfile.bin Returns: ActionParameterNotSupported
No changes to GET requests, so Redfish Service Validator not necessary.
Change-Id: Ibf4b69877031f3b8617412c06d40f2d0d0827ac3 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 ...
|
#
6b54e4e0
|
| 10-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Handle error code properly
As part of the previous patch tests, UpdateService shows this bug, where on a multipart parser failure, the dbus match object gets instantiated, and eventually fails. Thi
Handle error code properly
As part of the previous patch tests, UpdateService shows this bug, where on a multipart parser failure, the dbus match object gets instantiated, and eventually fails. This leads to mediocre logging, and possibly could leave update service in an undesirable state.
Fix the error by moving the conditional up.
Tested: Filling a 16MB file with all zeros and sending it now no longer logs that a monitor has been set up, and returns immediately instead of waiting for timeout.
``` dd if=/dev/zero of=zeros-file bs=1048576 count=16 of=16mb.txt curl -k --location POST https://192.168.7.2/redfish/v1/UpdateService/update -F 'UpdateParameters={"Targets":[]} ;type=application/json' -H "Expect:" --user "root:0penBmc" -F UpdateFile=@16mb.txt -v ```
Change-Id: I0962d15c624936b4fa199a675123702003dd697b Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
5b90429a
|
| 16-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Add missing headers
Most of these were found by breaking every redfish class handler into its own compile unit:
When that's done, these missing headers become compile errors. We should just fix the
Add missing headers
Most of these were found by breaking every redfish class handler into its own compile unit:
When that's done, these missing headers become compile errors. We should just fix them.
In addition, this allows us to enable automatic header checking in clang-tidy using misc-header-cleaner. Because the compiler can now "see" all the defines, it no longer tries to remove headers that it thinks are unused.
[1] https://github.com/openbmc/bmcweb/commit/4fdee9e39e9f03122ee16a6fb251a380681f56ac
Tested: Code compiles.
Change-Id: Ifa27ac4a512362b7ded7cc3068648dc4aea6ad7b Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
757178a5
|
| 03-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Refactor tftp parser
This function in the next patch will be used for more than just TFTP, so rename it to match intent, and refactor to use non-TFTP specific types.
Tested: Rename only. Need help
Refactor tftp parser
This function in the next patch will be used for more than just TFTP, so rename it to match intent, and refactor to use non-TFTP specific types.
Tested: Rename only. Need help on TFTP setups if we need it.
Change-Id: Ifc7485aa60ec53407c38b3d1bec530bdacf50075 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
6b0f66bd
|
| 03-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Break out DoTftpUpdate
This refactor of code is in preparation for adding new SimpleUpdate types. Separating out TFTP helps to keep code organized.
Tested: Need help here. TFTP isn't enabled a lo
Break out DoTftpUpdate
This refactor of code is in preparation for adding new SimpleUpdate types. Separating out TFTP helps to keep code organized.
Tested: Need help here. TFTP isn't enabled a lot.
Change-Id: Ifbdd4b73bb0f9c31092d729d1ec3d3f395f680b8 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
f5139334
|
| 03-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Refactor UpdateService
Similar to other refactorings we've been doing, make UpdateService call into methods instead of inline lambdas.
Tested: Redfish service validator passes. Structural changes
Refactor UpdateService
Similar to other refactorings we've been doing, make UpdateService call into methods instead of inline lambdas.
Tested: Redfish service validator passes. Structural changes only.
Change-Id: I96b6db5e14fa0f7d357fb0faf63d0457b7963581 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
8e8245db
|
| 12-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Fix nullptr failures for image upload
Several places that call *req.ioService were missing nullptr checks. Add them, and fix the one case where it might not be filled in.
Tested: With HTTP2 enable
Fix nullptr failures for image upload
Several places that call *req.ioService were missing nullptr checks. Add them, and fix the one case where it might not be filled in.
Tested: With HTTP2 enabled, the following command succeeds. ``` curl -k https://192.168.7.2/redfish/v1/UpdateService/update -F 'UpdateParameters={"Targets":["/redfish/v1/Managers/bmc"]} ;type=application/json' --user "root:0penBmc" -F UpdateFile=@/home/ed/bmcweb/16mb.txt -v -H "Expect:" ```
Change-Id: I81e7944c22f5922d461bf5d231086c7468a16e62 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
df254f2c
|
| 01-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Remove redundant static modifier
"inline static void func()"
Doesn't make sense when put in a header file. Find all instances, and make them inline like we do everywhere else.
Tested: Code compil
Remove redundant static modifier
"inline static void func()"
Doesn't make sense when put in a header file. Find all instances, and make them inline like we do everywhere else.
Tested: Code compiles.
Change-Id: I7da5821b1e372941680f82939627af39fdc2a4eb Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
d02aad39
|
| 13-Feb-2024 |
Ed Tanous <ed@tanous.net> |
Create Redfish specific setProperty call
There are currently 78 sdbusplus::asio::setProperty calls in redfish-core. The error handler for nearly all of them looks something like:
``` if (ec) {
Create Redfish specific setProperty call
There are currently 78 sdbusplus::asio::setProperty calls in redfish-core. The error handler for nearly all of them looks something like:
``` if (ec) { const sd_bus_error* dbusError = msg.get_error(); if ((dbusError != nullptr) && (dbusError->name == std::string_view( "xyz.openbmc_project.Common.Error.InvalidArgument"))) { BMCWEB_LOG_WARNING("DBUS response error: {}", ec); messages::propertyValueIncorrect(asyncResp->res, "<PropertyName>", <PropertyValue>); return; } messages::internalError(asyncResp->res); return; } messages::success(asyncResp->res);
```
In some cases there are more errors handled that translate to more error messages, but the vast majority only handle InvalidArgument. Many of these, like the ones in account_service.hpp, do the error handling in a lambda, which causes readability problems. This commit starts to make things more consistent, and easier for trivial property sets.
This commit invents a setDbusProperty method in the redfish namespace that tries to handle all DBus errors in a consistent manner. Looking for input on whether this will work before changing over the other 73 calls. Overall this is less code, fewer inline lambdas, and defaults that should work for MOST use cases of calling an OpenBMC daemon, and fall back to more generic errors when calling a "normal" dbus daemon.
As part of this, I've ported over several examples. Some things that might be up in the air: 1. Do we always return 204 no_content on property sets? Today there's a mix of 200, with a Base::Success message, and 204, with an empty body. 2. Do all DBus response codes map to the same error? A majority are covered by xyz.openbmc_project.Common.Error.InvalidArgument, but there are likely differences. If we allow any daemon to return any return code, does that cause compatibility problems later?
Tested: ``` curl -k --user "root:0penBmc" -H "Content-Type: application/json" -X PATCH -d '{"HostName":"openbmc@#"}' https://192.168.7.2/redfish/v1/Managers/bmc/EthernetInterfaces/eth0 ```
Returns the appropriate error in the response Base.1.16.0.PropertyValueIncorrect
Change-Id: If033a1112ba516792c9386c997d090c8f9094f3a Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
7cb59f65
|
| 05-May-2022 |
Ed Tanous <edtanous@google.com> |
Use readJson to simplify update
Similar to other places where we've ported the depth-based readJson support forward, this commit ports the UpdateService handler to simplify the code.
Signed-off-by:
Use readJson to simplify update
Similar to other places where we've ported the depth-based readJson support forward, this commit ports the UpdateService handler to simplify the code.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ia9841a10b4414f81205d3f9b49ec8aab8f9d491d
show more ...
|
#
18f8f608
|
| 18-Jul-2023 |
Ed Tanous <edtanous@google.com> |
Remove some boost includes
The less we rely on boost, and more on std algorithms, the less people have to look up, and the more likely that our code will deduplicate.
Replace all uses of boost::alg
Remove some boost includes
The less we rely on boost, and more on std algorithms, the less people have to look up, and the more likely that our code will deduplicate.
Replace all uses of boost::algorithms with std alternatives.
Tested: Redfish Service Validator passes.
Change-Id: I8a26f39b5709adc444b4178e92f5f3c7b988b05b Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|