diff options
author | Tejas Patil <tejaspp@ami.com> | 2021-06-04 13:19:35 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2021-06-09 22:51:04 +0300 |
commit | d61e5194f59793356d812c418aaf3d9ba5137884 (patch) | |
tree | ccd0f59c81c10811b4ab4a186a916dc478e235e4 | |
parent | b282a4380670e5232e7b6f9a08234d3bdbadb5ff (diff) | |
download | bmcweb-d61e5194f59793356d812c418aaf3d9ba5137884.tar.xz |
Add support for MaxImageSizeBytes in UpdateService
This commit adds the support for "MaxImageSizeBytes" property
in the "/redfish/v1/UpdateService/" Redfish URI.
This property indicates that, the maximum size of the
software update image, that clients can send to this Update Service.
Tested:
- Redfish Validator Test passed.
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X GET https://${bmc}/redfish/v1/UpdateService
{
"@odata.id": "/redfish/v1/UpdateService",
"@odata.type": "#UpdateService.v1_4_0.UpdateService",
"Description": "Service for Software Update",
"FirmwareInventory": {
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory"
},
"HttpPushUri": "/redfish/v1/UpdateService",
"HttpPushUriOptions": {
"HttpPushUriApplyTime": {
"ApplyTime": "OnReset"
}
},
"Id": "UpdateService",
"MaxImageSizeBytes": 31457280,
"Name": "Update Service",
"ServiceEnabled": true
}
Signed-off-by: Tejas Patil <tejaspp@ami.com>
Change-Id: Ibc0f3094a50ea7eb274436e4359e05c95d9cec36
-rw-r--r-- | redfish-core/lib/update_service.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp index bfab6fbe1f..7ca078701b 100644 --- a/redfish-core/lib/update_service.hpp +++ b/redfish-core/lib/update_service.hpp @@ -15,6 +15,8 @@ */ #pragma once +#include "bmcweb_config.h" + #include <app.hpp> #include <boost/container/flat_map.hpp> #include <utils/fw_utils.hpp> @@ -523,6 +525,10 @@ inline void requestRoutesUpdateService(App& app) asyncResp->res.jsonValue["ServiceEnabled"] = true; asyncResp->res.jsonValue["FirmwareInventory"] = { {"@odata.id", "/redfish/v1/UpdateService/FirmwareInventory"}}; + // Get the MaxImageSizeBytes + asyncResp->res.jsonValue["MaxImageSizeBytes"] = + bmcwebHttpReqBodyLimitMb * 1024 * 1024; + #ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE // Update Actions object. nlohmann::json& updateSvcSimpleUpdate = |