Deleting the deprecated format for SendRawPeci
Crashdump.SendRawPeci redfish interface supports two input
data formats. Removing the support for deprecated format.
Change-Id: I86db8694d94f1dbabf2852dbde04c414c846b1d1
Signed-off-by: Karthick Sundarrajan <karthick.sundarrajan@intel.com>
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index c4106b0..6a23e6e 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -2938,52 +2938,31 @@
std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
std::vector<std::vector<uint8_t>> peciCommands;
- nlohmann::json reqJson =
- nlohmann::json::parse(req.body, nullptr, false);
- if (reqJson.find("PECICommands") != reqJson.end())
+ if (!json_util::readJson(req, res, "PECICommands", peciCommands))
{
- if (!json_util::readJson(req, res, "PECICommands", peciCommands))
- {
- return;
- }
- uint32_t idx = 0;
- for (auto const& cmd : peciCommands)
- {
- if (cmd.size() < 3)
- {
- std::string s("[");
- for (auto const& val : cmd)
- {
- if (val != *cmd.begin())
- {
- s += ",";
- }
- s += std::to_string(val);
- }
- s += "]";
- messages::actionParameterValueFormatError(
- res, s, "PECICommands[" + std::to_string(idx) + "]",
- "SendRawPeci");
- return;
- }
- idx++;
- }
+ return;
}
- else
+ uint32_t idx = 0;
+ for (auto const& cmd : peciCommands)
{
- /* This interface is deprecated */
- uint8_t clientAddress = 0;
- uint8_t readLength = 0;
- std::vector<uint8_t> peciCommand;
- if (!json_util::readJson(req, res, "ClientAddress", clientAddress,
- "ReadLength", readLength, "PECICommand",
- peciCommand))
+ if (cmd.size() < 3)
{
+ std::string s("[");
+ for (auto const& val : cmd)
+ {
+ if (val != *cmd.begin())
+ {
+ s += ",";
+ }
+ s += std::to_string(val);
+ }
+ s += "]";
+ messages::actionParameterValueFormatError(
+ res, s, "PECICommands[" + std::to_string(idx) + "]",
+ "SendRawPeci");
return;
}
- peciCommands.push_back({clientAddress, 0, readLength});
- peciCommands[0].insert(peciCommands[0].end(), peciCommand.begin(),
- peciCommand.end());
+ idx++;
}
// Callback to return the Raw PECI response
auto sendRawPECICallback =