diff options
author | Shantappa Teekappanavar <shantappa.teekappanavar@ibm.com> | 2022-09-16 18:49:55 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2022-10-11 20:18:51 +0300 |
commit | b4ad4c05eeb2104de3becaf704fa1055f72e8b61 (patch) | |
tree | 4b4bf596318be9fe82d9b31d4bbdf27a281985ea /redfish-core/src/error_messages.cpp | |
parent | 8e31778e76b90c9a36ef40fff898d6218c649df6 (diff) | |
download | bmcweb-b4ad4c05eeb2104de3becaf704fa1055f72e8b61.tar.xz |
bmcweb: Add strictAccountTypes error message
Error message to be thrown when StrictAccountTypes is true and the
specified value(s) for AccountTypes or OEMAccountTypes was not accepted.
Testing:
strictAccountTypes() error message was tested while testing redfish
PATCH API for patching AccountTypes.
Signed-off-by: Shantappa Teekappanavar <shantappa.teekappanavar@ibm.com>
Change-Id: I13abcd142ddfb04a2a187c9373fa996ecfe987a1
Diffstat (limited to 'redfish-core/src/error_messages.cpp')
-rw-r--r-- | redfish-core/src/error_messages.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/redfish-core/src/error_messages.cpp b/redfish-core/src/error_messages.cpp index 1bfce24504..5f055bfca7 100644 --- a/redfish-core/src/error_messages.cpp +++ b/redfish-core/src/error_messages.cpp @@ -1148,6 +1148,25 @@ void sourceDoesNotSupportProtocol(crow::Response& res, /** * @internal + * @brief Formats StrictAccountTypes message into JSON + * + * See header file for more information + * @endinternal + */ +nlohmann::json strictAccountTypes(std::string_view arg1) +{ + return getLog(redfish::registries::base::Index::strictAccountTypes, + std::to_array({arg1})); +} + +void strictAccountTypes(crow::Response& res, std::string_view arg1) +{ + res.result(boost::beast::http::status::bad_request); + addMessageToErrorJson(res.jsonValue, strictAccountTypes(arg1)); +} + +/** + * @internal * @brief Formats AccountRemoved message into JSON * * See header file for more information |