17ccfe684SEd Tanous /**************************************************************** 27ccfe684SEd Tanous * READ THIS WARNING FIRST 37ccfe684SEd Tanous * This is an auto-generated header which contains definitions 47ccfe684SEd Tanous * for Redfish DMTF defined messages. 57ccfe684SEd Tanous * DO NOT modify this registry outside of running the 67ccfe684SEd Tanous * parse_registries.py script. The definitions contained within 77ccfe684SEd Tanous * this file are owned by DMTF. Any modifications to these files 87ccfe684SEd Tanous * should be first pushed to the relevant registry in the DMTF 97ccfe684SEd Tanous * github organization. 107ccfe684SEd Tanous ***************************************************************/ 110442ef92SNan Zhou #include "error_messages.hpp" 129ea15c35SEd Tanous 136c038f26SEd Tanous #include "error_message_utils.hpp" 140442ef92SNan Zhou #include "http_response.hpp" 150442ef92SNan Zhou #include "logging.hpp" 160442ef92SNan Zhou #include "registries.hpp" 170442ef92SNan Zhou #include "registries/base_message_registry.hpp" 180442ef92SNan Zhou 190442ef92SNan Zhou #include <boost/beast/http/field.hpp> 209ea15c35SEd Tanous #include <boost/beast/http/status.hpp> 214a7fbefdSEd Tanous #include <boost/url/url_view_base.hpp> 22faf100f9SEd Tanous #include <nlohmann/json.hpp> 23f4c4dcf4SKowalski, Kamil 241668ce6dSEd Tanous #include <array> 250442ef92SNan Zhou #include <cstddef> 26f0b59af4SEd Tanous #include <cstdint> 27d85418e3SPatrick Williams #include <source_location> 280442ef92SNan Zhou #include <span> 290442ef92SNan Zhou #include <string> 30f0b59af4SEd Tanous #include <string_view> 310442ef92SNan Zhou 327ccfe684SEd Tanous // Clang can't seem to decide whether this header needs to be included or not, 337ccfe684SEd Tanous // and is inconsistent. Include it for now 347ccfe684SEd Tanous // NOLINTNEXTLINE(misc-include-cleaner) 357ccfe684SEd Tanous #include <utility> 367ccfe684SEd Tanous 371abe55efSEd Tanous namespace redfish 381abe55efSEd Tanous { 391abe55efSEd Tanous 401abe55efSEd Tanous namespace messages 411abe55efSEd Tanous { 42f4c4dcf4SKowalski, Kamil 4310cf50dcSEd Tanous static nlohmann::json::object_t getLog(redfish::registries::Base::Index name, 44b6cd31e1SEd Tanous std::span<const std::string_view> args) 45b6cd31e1SEd Tanous { 46b6cd31e1SEd Tanous size_t index = static_cast<size_t>(name); 474a102cd4SPatrick Williams if (index >= redfish::registries::Base::registry.size()) 48b6cd31e1SEd Tanous { 49b6cd31e1SEd Tanous return {}; 50b6cd31e1SEd Tanous } 514a102cd4SPatrick Williams return getLogFromRegistry(redfish::registries::Base::header, 524a102cd4SPatrick Williams redfish::registries::Base::registry, index, args); 53b6cd31e1SEd Tanous } 54b6cd31e1SEd Tanous 55f4c4dcf4SKowalski, Kamil /** 56f4c4dcf4SKowalski, Kamil * @internal 57f8cca876SEd Tanous * @brief Formats Success message into JSON 58f4c4dcf4SKowalski, Kamil * 59f4c4dcf4SKowalski, Kamil * See header file for more information 60f4c4dcf4SKowalski, Kamil * @endinternal 61f4c4dcf4SKowalski, Kamil */ 6210cf50dcSEd Tanous nlohmann::json::object_t success() 631abe55efSEd Tanous { 644a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::success, {}); 65b5c07418SJames Feist } 66b5c07418SJames Feist 67f8cca876SEd Tanous void success(crow::Response& res) 68b5c07418SJames Feist { 69f8cca876SEd Tanous addMessageToJsonRoot(res.jsonValue, success()); 70f4c4dcf4SKowalski, Kamil } 71f4c4dcf4SKowalski, Kamil 72f4c4dcf4SKowalski, Kamil /** 73f4c4dcf4SKowalski, Kamil * @internal 74f8cca876SEd Tanous * @brief Formats GeneralError message into JSON 75f4c4dcf4SKowalski, Kamil * 76f4c4dcf4SKowalski, Kamil * See header file for more information 77f4c4dcf4SKowalski, Kamil * @endinternal 78f4c4dcf4SKowalski, Kamil */ 7910cf50dcSEd Tanous nlohmann::json::object_t generalError() 801abe55efSEd Tanous { 814a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::generalError, {}); 82b5c07418SJames Feist } 83b5c07418SJames Feist 84f8cca876SEd Tanous void generalError(crow::Response& res) 85b5c07418SJames Feist { 86b5c07418SJames Feist res.result(boost::beast::http::status::internal_server_error); 87f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, generalError()); 88f12894f8SJason M. Bills } 89f12894f8SJason M. Bills 90f12894f8SJason M. Bills /** 91f12894f8SJason M. Bills * @internal 92f8cca876SEd Tanous * @brief Formats Created message into JSON 93f4c4dcf4SKowalski, Kamil * 94f4c4dcf4SKowalski, Kamil * See header file for more information 95f4c4dcf4SKowalski, Kamil * @endinternal 96f4c4dcf4SKowalski, Kamil */ 9710cf50dcSEd Tanous nlohmann::json::object_t created() 981abe55efSEd Tanous { 994a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::created, {}); 100b5c07418SJames Feist } 101b5c07418SJames Feist 102f8cca876SEd Tanous void created(crow::Response& res) 103f8cca876SEd Tanous { 104f8cca876SEd Tanous res.result(boost::beast::http::status::created); 105f8cca876SEd Tanous addMessageToJsonRoot(res.jsonValue, created()); 106f8cca876SEd Tanous } 107f8cca876SEd Tanous 108f8cca876SEd Tanous /** 109f8cca876SEd Tanous * @internal 110f8cca876SEd Tanous * @brief Formats NoOperation message into JSON 111f8cca876SEd Tanous * 112f8cca876SEd Tanous * See header file for more information 113f8cca876SEd Tanous * @endinternal 114f8cca876SEd Tanous */ 11510cf50dcSEd Tanous nlohmann::json::object_t noOperation() 116f8cca876SEd Tanous { 1174a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::noOperation, {}); 118f8cca876SEd Tanous } 119f8cca876SEd Tanous 120f8cca876SEd Tanous void noOperation(crow::Response& res) 121b5c07418SJames Feist { 122b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 123f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, noOperation()); 124f4c4dcf4SKowalski, Kamil } 125f4c4dcf4SKowalski, Kamil 126f4c4dcf4SKowalski, Kamil /** 127f4c4dcf4SKowalski, Kamil * @internal 128f4c4dcf4SKowalski, Kamil * @brief Formats PropertyDuplicate message into JSON 129f4c4dcf4SKowalski, Kamil * 130f4c4dcf4SKowalski, Kamil * See header file for more information 131f4c4dcf4SKowalski, Kamil * @endinternal 132f4c4dcf4SKowalski, Kamil */ 13310cf50dcSEd Tanous nlohmann::json::object_t propertyDuplicate(std::string_view arg1) 1341abe55efSEd Tanous { 1354a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyDuplicate, 1361668ce6dSEd Tanous std::to_array({arg1})); 137b5c07418SJames Feist } 138b5c07418SJames Feist 1391668ce6dSEd Tanous void propertyDuplicate(crow::Response& res, std::string_view arg1) 140b5c07418SJames Feist { 141b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 142b5c07418SJames Feist addMessageToJson(res.jsonValue, propertyDuplicate(arg1), arg1); 143f4c4dcf4SKowalski, Kamil } 144f4c4dcf4SKowalski, Kamil 145f4c4dcf4SKowalski, Kamil /** 146f4c4dcf4SKowalski, Kamil * @internal 147f8cca876SEd Tanous * @brief Formats PropertyUnknown message into JSON 148f4c4dcf4SKowalski, Kamil * 149f4c4dcf4SKowalski, Kamil * See header file for more information 150f4c4dcf4SKowalski, Kamil * @endinternal 151f4c4dcf4SKowalski, Kamil */ 15210cf50dcSEd Tanous nlohmann::json::object_t propertyUnknown(std::string_view arg1) 1531abe55efSEd Tanous { 1544a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyUnknown, 1551668ce6dSEd Tanous std::to_array({arg1})); 156b5c07418SJames Feist } 157b5c07418SJames Feist 158f8cca876SEd Tanous void propertyUnknown(crow::Response& res, std::string_view arg1) 159b5c07418SJames Feist { 160b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 161f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, propertyUnknown(arg1)); 162f4c4dcf4SKowalski, Kamil } 163f4c4dcf4SKowalski, Kamil 164f4c4dcf4SKowalski, Kamil /** 165f4c4dcf4SKowalski, Kamil * @internal 166f8cca876SEd Tanous * @brief Formats PropertyValueTypeError message into JSON 167f4c4dcf4SKowalski, Kamil * 168f4c4dcf4SKowalski, Kamil * See header file for more information 169f4c4dcf4SKowalski, Kamil * @endinternal 170f4c4dcf4SKowalski, Kamil */ 17110cf50dcSEd Tanous nlohmann::json::object_t propertyValueTypeError(const nlohmann::json& arg1, 172f8cca876SEd Tanous std::string_view arg2) 1731abe55efSEd Tanous { 174f8cca876SEd Tanous std::string arg1Str = 175f8cca876SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 1764a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyValueTypeError, 177f8cca876SEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 178b5c07418SJames Feist } 179b5c07418SJames Feist 180f8cca876SEd Tanous void propertyValueTypeError(crow::Response& res, const nlohmann::json& arg1, 181f8cca876SEd Tanous std::string_view arg2) 182b5c07418SJames Feist { 183b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 184f8cca876SEd Tanous addMessageToJson(res.jsonValue, propertyValueTypeError(arg1, arg2), arg2); 185f12894f8SJason M. Bills } 186f12894f8SJason M. Bills 187f12894f8SJason M. Bills /** 188f12894f8SJason M. Bills * @internal 1897ccfe684SEd Tanous * @brief Formats PropertyValueFormatError message into JSON 190f12894f8SJason M. Bills * 191f12894f8SJason M. Bills * See header file for more information 192f12894f8SJason M. Bills * @endinternal 193f12894f8SJason M. Bills */ 19410cf50dcSEd Tanous nlohmann::json::object_t propertyValueFormatError(const nlohmann::json& arg1, 1951668ce6dSEd Tanous std::string_view arg2) 196f12894f8SJason M. Bills { 197bd79bce8SPatrick Williams std::string arg1Str = 198034e1259SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 1994a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyValueFormatError, 200f818b04dSEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 201b5c07418SJames Feist } 202b5c07418SJames Feist 203f818b04dSEd Tanous void propertyValueFormatError(crow::Response& res, const nlohmann::json& arg1, 2041668ce6dSEd Tanous std::string_view arg2) 205b5c07418SJames Feist { 206b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 207b5c07418SJames Feist addMessageToJson(res.jsonValue, propertyValueFormatError(arg1, arg2), arg2); 208f12894f8SJason M. Bills } 209f12894f8SJason M. Bills 210f12894f8SJason M. Bills /** 211f12894f8SJason M. Bills * @internal 2127ccfe684SEd Tanous * @brief Formats PropertyValueNotInList message into JSON 213f12894f8SJason M. Bills * 214f12894f8SJason M. Bills * See header file for more information 215f12894f8SJason M. Bills * @endinternal 216f12894f8SJason M. Bills */ 21710cf50dcSEd Tanous nlohmann::json::object_t propertyValueNotInList(const nlohmann::json& arg1, 2181668ce6dSEd Tanous std::string_view arg2) 219f12894f8SJason M. Bills { 220bd79bce8SPatrick Williams std::string arg1Str = 221bd79bce8SPatrick Williams arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 2224a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyValueNotInList, 223e2616cc5SEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 224b5c07418SJames Feist } 225b5c07418SJames Feist 226e2616cc5SEd Tanous void propertyValueNotInList(crow::Response& res, const nlohmann::json& arg1, 2271668ce6dSEd Tanous std::string_view arg2) 228b5c07418SJames Feist { 229b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 230b5c07418SJames Feist addMessageToJson(res.jsonValue, propertyValueNotInList(arg1, arg2), arg2); 231f4c4dcf4SKowalski, Kamil } 232f4c4dcf4SKowalski, Kamil 233f4c4dcf4SKowalski, Kamil /** 234f4c4dcf4SKowalski, Kamil * @internal 235227a2b0aSJiaqing Zhao * @brief Formats PropertyValueOutOfRange message into JSON 236227a2b0aSJiaqing Zhao * 237227a2b0aSJiaqing Zhao * See header file for more information 238227a2b0aSJiaqing Zhao * @endinternal 239227a2b0aSJiaqing Zhao */ 24010cf50dcSEd Tanous nlohmann::json::object_t propertyValueOutOfRange(const nlohmann::json& arg1, 241227a2b0aSJiaqing Zhao std::string_view arg2) 242227a2b0aSJiaqing Zhao { 243bd79bce8SPatrick Williams std::string arg1Str = 244034e1259SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 2454a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyValueOutOfRange, 24695b3ad73SEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 247227a2b0aSJiaqing Zhao } 248227a2b0aSJiaqing Zhao 24995b3ad73SEd Tanous void propertyValueOutOfRange(crow::Response& res, const nlohmann::json& arg1, 250227a2b0aSJiaqing Zhao std::string_view arg2) 251227a2b0aSJiaqing Zhao { 252227a2b0aSJiaqing Zhao res.result(boost::beast::http::status::bad_request); 253227a2b0aSJiaqing Zhao addMessageToErrorJson(res.jsonValue, propertyValueOutOfRange(arg1, arg2)); 254227a2b0aSJiaqing Zhao } 255227a2b0aSJiaqing Zhao 256227a2b0aSJiaqing Zhao /** 257227a2b0aSJiaqing Zhao * @internal 258f8cca876SEd Tanous * @brief Formats PropertyValueError message into JSON 259f4c4dcf4SKowalski, Kamil * 260f4c4dcf4SKowalski, Kamil * See header file for more information 261f4c4dcf4SKowalski, Kamil * @endinternal 262f4c4dcf4SKowalski, Kamil */ 26310cf50dcSEd Tanous nlohmann::json::object_t propertyValueError(std::string_view arg1) 2641abe55efSEd Tanous { 2654a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyValueError, 2661668ce6dSEd Tanous std::to_array({arg1})); 26781856681SAsmitha Karunanithi } 26881856681SAsmitha Karunanithi 269f8cca876SEd Tanous void propertyValueError(crow::Response& res, std::string_view arg1) 27081856681SAsmitha Karunanithi { 271f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 272f8cca876SEd Tanous addMessageToJson(res.jsonValue, propertyValueError(arg1), arg1); 27381856681SAsmitha Karunanithi } 27481856681SAsmitha Karunanithi 27581856681SAsmitha Karunanithi /** 27681856681SAsmitha Karunanithi * @internal 277f8cca876SEd Tanous * @brief Formats PropertyNotWritable message into JSON 278f4c4dcf4SKowalski, Kamil * 279f4c4dcf4SKowalski, Kamil * See header file for more information 280f4c4dcf4SKowalski, Kamil * @endinternal 281f4c4dcf4SKowalski, Kamil */ 28210cf50dcSEd Tanous nlohmann::json::object_t propertyNotWritable(std::string_view arg1) 2831abe55efSEd Tanous { 2844a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyNotWritable, 285f8cca876SEd Tanous std::to_array({arg1})); 286b5c07418SJames Feist } 287b5c07418SJames Feist 288f8cca876SEd Tanous void propertyNotWritable(crow::Response& res, std::string_view arg1) 289b5c07418SJames Feist { 290*9310d76bSGunnar Mills res.result(boost::beast::http::status::method_not_allowed); 291f8cca876SEd Tanous addMessageToJson(res.jsonValue, propertyNotWritable(arg1), arg1); 292f4c4dcf4SKowalski, Kamil } 293f4c4dcf4SKowalski, Kamil 294f4c4dcf4SKowalski, Kamil /** 295f4c4dcf4SKowalski, Kamil * @internal 296f8cca876SEd Tanous * @brief Formats PropertyNotUpdated message into JSON 297f4c4dcf4SKowalski, Kamil * 298f4c4dcf4SKowalski, Kamil * See header file for more information 299f4c4dcf4SKowalski, Kamil * @endinternal 300f4c4dcf4SKowalski, Kamil */ 30110cf50dcSEd Tanous nlohmann::json::object_t propertyNotUpdated(std::string_view arg1) 3021abe55efSEd Tanous { 3034a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyNotUpdated, 304f8cca876SEd Tanous std::to_array({arg1})); 305b5c07418SJames Feist } 306b5c07418SJames Feist 307f8cca876SEd Tanous void propertyNotUpdated(crow::Response& res, std::string_view arg1) 308b5c07418SJames Feist { 309f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 310f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, propertyNotUpdated(arg1)); 311f8cca876SEd Tanous } 312f8cca876SEd Tanous 313f8cca876SEd Tanous /** 314f8cca876SEd Tanous * @internal 315f8cca876SEd Tanous * @brief Formats PropertyMissing message into JSON 316f8cca876SEd Tanous * 317f8cca876SEd Tanous * See header file for more information 318f8cca876SEd Tanous * @endinternal 319f8cca876SEd Tanous */ 32010cf50dcSEd Tanous nlohmann::json::object_t propertyMissing(std::string_view arg1) 321f8cca876SEd Tanous { 3224a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyMissing, 323f8cca876SEd Tanous std::to_array({arg1})); 324f8cca876SEd Tanous } 325f8cca876SEd Tanous 326f8cca876SEd Tanous void propertyMissing(crow::Response& res, std::string_view arg1) 327f8cca876SEd Tanous { 328f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 329f8cca876SEd Tanous addMessageToJson(res.jsonValue, propertyMissing(arg1), arg1); 330f8cca876SEd Tanous } 331f8cca876SEd Tanous 332f8cca876SEd Tanous /** 333f8cca876SEd Tanous * @internal 334f8cca876SEd Tanous * @brief Formats MalformedJSON message into JSON 335f8cca876SEd Tanous * 336f8cca876SEd Tanous * See header file for more information 337f8cca876SEd Tanous * @endinternal 338f8cca876SEd Tanous */ 33910cf50dcSEd Tanous nlohmann::json::object_t malformedJSON() 340f8cca876SEd Tanous { 3414a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::malformedJSON, {}); 342f8cca876SEd Tanous } 343f8cca876SEd Tanous 344f8cca876SEd Tanous void malformedJSON(crow::Response& res) 345f8cca876SEd Tanous { 346f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 347f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, malformedJSON()); 348f8cca876SEd Tanous } 349f8cca876SEd Tanous 350f8cca876SEd Tanous /** 351f8cca876SEd Tanous * @internal 352f8cca876SEd Tanous * @brief Formats InvalidJSON message into JSON 353f8cca876SEd Tanous * 354f8cca876SEd Tanous * See header file for more information 355f8cca876SEd Tanous * @endinternal 356f8cca876SEd Tanous */ 35710cf50dcSEd Tanous nlohmann::json::object_t invalidJSON(std::string_view arg1) 358f8cca876SEd Tanous { 3594a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::invalidJSON, 360f8cca876SEd Tanous std::to_array({arg1})); 361f8cca876SEd Tanous } 362f8cca876SEd Tanous 363f8cca876SEd Tanous void invalidJSON(crow::Response& res, std::string_view arg1) 364f8cca876SEd Tanous { 365f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 366f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, invalidJSON(arg1)); 367f8cca876SEd Tanous } 368f8cca876SEd Tanous 369f8cca876SEd Tanous /** 370f8cca876SEd Tanous * @internal 371f8cca876SEd Tanous * @brief Formats EmptyJSON message into JSON 372f8cca876SEd Tanous * 373f8cca876SEd Tanous * See header file for more information 374f8cca876SEd Tanous * @endinternal 375f8cca876SEd Tanous */ 37610cf50dcSEd Tanous nlohmann::json::object_t emptyJSON() 377f8cca876SEd Tanous { 3784a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::emptyJSON, {}); 379f8cca876SEd Tanous } 380f8cca876SEd Tanous 381f8cca876SEd Tanous void emptyJSON(crow::Response& res) 382f8cca876SEd Tanous { 383f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 384f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, emptyJSON()); 385f8cca876SEd Tanous } 386f8cca876SEd Tanous 387f8cca876SEd Tanous /** 388f8cca876SEd Tanous * @internal 389f8cca876SEd Tanous * @brief Formats ActionNotSupported message into JSON 390f8cca876SEd Tanous * 391f8cca876SEd Tanous * See header file for more information 392f8cca876SEd Tanous * @endinternal 393f8cca876SEd Tanous */ 39410cf50dcSEd Tanous nlohmann::json::object_t actionNotSupported(std::string_view arg1) 395f8cca876SEd Tanous { 3964a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::actionNotSupported, 397f8cca876SEd Tanous std::to_array({arg1})); 398f8cca876SEd Tanous } 399f8cca876SEd Tanous 400f8cca876SEd Tanous void actionNotSupported(crow::Response& res, std::string_view arg1) 401f8cca876SEd Tanous { 402f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 403f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, actionNotSupported(arg1)); 404f4c4dcf4SKowalski, Kamil } 405f4c4dcf4SKowalski, Kamil 406f4c4dcf4SKowalski, Kamil /** 407f4c4dcf4SKowalski, Kamil * @internal 408f4c4dcf4SKowalski, Kamil * @brief Formats ActionParameterMissing message into JSON 409f4c4dcf4SKowalski, Kamil * 410f4c4dcf4SKowalski, Kamil * See header file for more information 411f4c4dcf4SKowalski, Kamil * @endinternal 412f4c4dcf4SKowalski, Kamil */ 41310cf50dcSEd Tanous nlohmann::json::object_t actionParameterMissing(std::string_view arg1, 4141668ce6dSEd Tanous std::string_view arg2) 4151abe55efSEd Tanous { 4164a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::actionParameterMissing, 4171668ce6dSEd Tanous std::to_array({arg1, arg2})); 418b5c07418SJames Feist } 419b5c07418SJames Feist 4201668ce6dSEd Tanous void actionParameterMissing(crow::Response& res, std::string_view arg1, 4211668ce6dSEd Tanous std::string_view arg2) 422b5c07418SJames Feist { 423b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 424b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, actionParameterMissing(arg1, arg2)); 425f4c4dcf4SKowalski, Kamil } 426f4c4dcf4SKowalski, Kamil 427f4c4dcf4SKowalski, Kamil /** 428f4c4dcf4SKowalski, Kamil * @internal 429f8cca876SEd Tanous * @brief Formats ActionParameterDuplicate message into JSON 430f8cca876SEd Tanous * 431f8cca876SEd Tanous * See header file for more information 432f8cca876SEd Tanous * @endinternal 433f8cca876SEd Tanous */ 43410cf50dcSEd Tanous nlohmann::json::object_t actionParameterDuplicate(std::string_view arg1, 435f8cca876SEd Tanous std::string_view arg2) 436f8cca876SEd Tanous { 4374a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::actionParameterDuplicate, 438f8cca876SEd Tanous std::to_array({arg1, arg2})); 439f8cca876SEd Tanous } 440f8cca876SEd Tanous 441f8cca876SEd Tanous void actionParameterDuplicate(crow::Response& res, std::string_view arg1, 442f8cca876SEd Tanous std::string_view arg2) 443f8cca876SEd Tanous { 444f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 445f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, actionParameterDuplicate(arg1, arg2)); 446f8cca876SEd Tanous } 447f8cca876SEd Tanous 448f8cca876SEd Tanous /** 449f8cca876SEd Tanous * @internal 450f8cca876SEd Tanous * @brief Formats ActionParameterUnknown message into JSON 451f8cca876SEd Tanous * 452f8cca876SEd Tanous * See header file for more information 453f8cca876SEd Tanous * @endinternal 454f8cca876SEd Tanous */ 45510cf50dcSEd Tanous nlohmann::json::object_t actionParameterUnknown(std::string_view arg1, 456f8cca876SEd Tanous std::string_view arg2) 457f8cca876SEd Tanous { 4584a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::actionParameterUnknown, 459f8cca876SEd Tanous std::to_array({arg1, arg2})); 460f8cca876SEd Tanous } 461f8cca876SEd Tanous 462f8cca876SEd Tanous void actionParameterUnknown(crow::Response& res, std::string_view arg1, 463f8cca876SEd Tanous std::string_view arg2) 464f8cca876SEd Tanous { 465f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 466f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, actionParameterUnknown(arg1, arg2)); 467f8cca876SEd Tanous } 468f8cca876SEd Tanous 469f8cca876SEd Tanous /** 470f8cca876SEd Tanous * @internal 471f8cca876SEd Tanous * @brief Formats ActionParameterValueTypeError message into JSON 472f8cca876SEd Tanous * 473f8cca876SEd Tanous * See header file for more information 474f8cca876SEd Tanous * @endinternal 475f8cca876SEd Tanous */ 47610cf50dcSEd Tanous nlohmann::json::object_t actionParameterValueTypeError( 477f8cca876SEd Tanous const nlohmann::json& arg1, std::string_view arg2, std::string_view arg3) 478f8cca876SEd Tanous { 479f8cca876SEd Tanous std::string arg1Str = 480f8cca876SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 481f8cca876SEd Tanous return getLog( 4824a102cd4SPatrick Williams redfish::registries::Base::Index::actionParameterValueTypeError, 483f8cca876SEd Tanous std::to_array<std::string_view>({arg1Str, arg2, arg3})); 484f8cca876SEd Tanous } 485f8cca876SEd Tanous 486f8cca876SEd Tanous void actionParameterValueTypeError(crow::Response& res, 487f8cca876SEd Tanous const nlohmann::json& arg1, 488f8cca876SEd Tanous std::string_view arg2, std::string_view arg3) 489f8cca876SEd Tanous { 490f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 491f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 492f8cca876SEd Tanous actionParameterValueTypeError(arg1, arg2, arg3)); 493f8cca876SEd Tanous } 494f8cca876SEd Tanous 495f8cca876SEd Tanous /** 496f8cca876SEd Tanous * @internal 497f8cca876SEd Tanous * @brief Formats ActionParameterValueFormatError message into JSON 498f8cca876SEd Tanous * 499f8cca876SEd Tanous * See header file for more information 500f8cca876SEd Tanous * @endinternal 501f8cca876SEd Tanous */ 50210cf50dcSEd Tanous nlohmann::json::object_t actionParameterValueFormatError( 503f8cca876SEd Tanous const nlohmann::json& arg1, std::string_view arg2, std::string_view arg3) 504f8cca876SEd Tanous { 505f8cca876SEd Tanous std::string arg1Str = 506f8cca876SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 507f8cca876SEd Tanous return getLog( 5084a102cd4SPatrick Williams redfish::registries::Base::Index::actionParameterValueFormatError, 509f8cca876SEd Tanous std::to_array<std::string_view>({arg1Str, arg2, arg3})); 510f8cca876SEd Tanous } 511f8cca876SEd Tanous 512f8cca876SEd Tanous void actionParameterValueFormatError( 513f8cca876SEd Tanous crow::Response& res, const nlohmann::json& arg1, std::string_view arg2, 514f8cca876SEd Tanous std::string_view arg3) 515f8cca876SEd Tanous { 516f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 517f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 518f8cca876SEd Tanous actionParameterValueFormatError(arg1, arg2, arg3)); 519f8cca876SEd Tanous } 520f8cca876SEd Tanous 521f8cca876SEd Tanous /** 522f8cca876SEd Tanous * @internal 523f8cca876SEd Tanous * @brief Formats ActionParameterValueNotInList message into JSON 524f8cca876SEd Tanous * 525f8cca876SEd Tanous * See header file for more information 526f8cca876SEd Tanous * @endinternal 527f8cca876SEd Tanous */ 52810cf50dcSEd Tanous nlohmann::json::object_t actionParameterValueNotInList( 529f8cca876SEd Tanous std::string_view arg1, std::string_view arg2, std::string_view arg3) 530f8cca876SEd Tanous { 531f8cca876SEd Tanous return getLog( 5324a102cd4SPatrick Williams redfish::registries::Base::Index::actionParameterValueNotInList, 533f8cca876SEd Tanous std::to_array({arg1, arg2, arg3})); 534f8cca876SEd Tanous } 535f8cca876SEd Tanous 536f8cca876SEd Tanous void actionParameterValueNotInList(crow::Response& res, std::string_view arg1, 537f8cca876SEd Tanous std::string_view arg2, std::string_view arg3) 538f8cca876SEd Tanous { 539f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 540f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 541f8cca876SEd Tanous actionParameterValueNotInList(arg1, arg2, arg3)); 542f8cca876SEd Tanous } 543f8cca876SEd Tanous 544f8cca876SEd Tanous /** 545f8cca876SEd Tanous * @internal 546f8cca876SEd Tanous * @brief Formats ActionParameterValueOutOfRange message into JSON 547f8cca876SEd Tanous * 548f8cca876SEd Tanous * See header file for more information 549f8cca876SEd Tanous * @endinternal 550f8cca876SEd Tanous */ 55110cf50dcSEd Tanous nlohmann::json::object_t actionParameterValueOutOfRange( 552f8cca876SEd Tanous std::string_view arg1, std::string_view arg2, std::string_view arg3) 553f8cca876SEd Tanous { 554f8cca876SEd Tanous return getLog( 5554a102cd4SPatrick Williams redfish::registries::Base::Index::actionParameterValueOutOfRange, 556f8cca876SEd Tanous std::to_array({arg1, arg2, arg3})); 557f8cca876SEd Tanous } 558f8cca876SEd Tanous 559f8cca876SEd Tanous void actionParameterValueOutOfRange(crow::Response& res, std::string_view arg1, 560f8cca876SEd Tanous std::string_view arg2, 561f8cca876SEd Tanous std::string_view arg3) 562f8cca876SEd Tanous { 563f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 564f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 565f8cca876SEd Tanous actionParameterValueOutOfRange(arg1, arg2, arg3)); 566f8cca876SEd Tanous } 567f8cca876SEd Tanous 568f8cca876SEd Tanous /** 569f8cca876SEd Tanous * @internal 570f8cca876SEd Tanous * @brief Formats ActionParameterValueError message into JSON 571f8cca876SEd Tanous * 572f8cca876SEd Tanous * See header file for more information 573f8cca876SEd Tanous * @endinternal 574f8cca876SEd Tanous */ 57510cf50dcSEd Tanous nlohmann::json::object_t actionParameterValueError(const nlohmann::json& arg1, 576f8cca876SEd Tanous std::string_view arg2) 577f8cca876SEd Tanous { 578f8cca876SEd Tanous std::string arg1Str = 579f8cca876SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 5804a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::actionParameterValueError, 581f8cca876SEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 582f8cca876SEd Tanous } 583f8cca876SEd Tanous 584f8cca876SEd Tanous void actionParameterValueError(crow::Response& res, const nlohmann::json& arg1, 585f8cca876SEd Tanous std::string_view arg2) 586f8cca876SEd Tanous { 587f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 588f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, actionParameterValueError(arg1, arg2)); 589f8cca876SEd Tanous } 590f8cca876SEd Tanous 591f8cca876SEd Tanous /** 592f8cca876SEd Tanous * @internal 593f8cca876SEd Tanous * @brief Formats ActionParameterNotSupported message into JSON 594f8cca876SEd Tanous * 595f8cca876SEd Tanous * See header file for more information 596f8cca876SEd Tanous * @endinternal 597f8cca876SEd Tanous */ 59810cf50dcSEd Tanous nlohmann::json::object_t actionParameterNotSupported(std::string_view arg1, 599f8cca876SEd Tanous std::string_view arg2) 600f8cca876SEd Tanous { 6014a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::actionParameterNotSupported, 602f8cca876SEd Tanous std::to_array({arg1, arg2})); 603f8cca876SEd Tanous } 604f8cca876SEd Tanous 605f8cca876SEd Tanous void actionParameterNotSupported(crow::Response& res, std::string_view arg1, 606f8cca876SEd Tanous std::string_view arg2) 607f8cca876SEd Tanous { 608f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 609f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 610f8cca876SEd Tanous actionParameterNotSupported(arg1, arg2)); 611f8cca876SEd Tanous } 612f8cca876SEd Tanous 613f8cca876SEd Tanous /** 614f8cca876SEd Tanous * @internal 615f8cca876SEd Tanous * @brief Formats ArraySizeTooLong message into JSON 616f8cca876SEd Tanous * 617f8cca876SEd Tanous * See header file for more information 618f8cca876SEd Tanous * @endinternal 619f8cca876SEd Tanous */ 62010cf50dcSEd Tanous nlohmann::json::object_t arraySizeTooLong(std::string_view arg1, uint64_t arg2) 621f8cca876SEd Tanous { 622f8cca876SEd Tanous std::string arg2Str = std::to_string(arg2); 6234a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::arraySizeTooLong, 624f8cca876SEd Tanous std::to_array<std::string_view>({arg1, arg2Str})); 625f8cca876SEd Tanous } 626f8cca876SEd Tanous 627f8cca876SEd Tanous void arraySizeTooLong(crow::Response& res, std::string_view arg1, uint64_t arg2) 628f8cca876SEd Tanous { 629f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 630f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, arraySizeTooLong(arg1, arg2)); 631f8cca876SEd Tanous } 632f8cca876SEd Tanous 633f8cca876SEd Tanous /** 634f8cca876SEd Tanous * @internal 635f8cca876SEd Tanous * @brief Formats ArraySizeTooShort message into JSON 636f8cca876SEd Tanous * 637f8cca876SEd Tanous * See header file for more information 638f8cca876SEd Tanous * @endinternal 639f8cca876SEd Tanous */ 64010cf50dcSEd Tanous nlohmann::json::object_t arraySizeTooShort(std::string_view arg1, 64110cf50dcSEd Tanous std::string_view arg2) 642f8cca876SEd Tanous { 6434a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::arraySizeTooShort, 644f8cca876SEd Tanous std::to_array({arg1, arg2})); 645f8cca876SEd Tanous } 646f8cca876SEd Tanous 647f8cca876SEd Tanous void arraySizeTooShort(crow::Response& res, std::string_view arg1, 648f8cca876SEd Tanous std::string_view arg2) 649f8cca876SEd Tanous { 650f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 651f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, arraySizeTooShort(arg1, arg2)); 652f8cca876SEd Tanous } 653f8cca876SEd Tanous 654f8cca876SEd Tanous /** 655f8cca876SEd Tanous * @internal 656f8cca876SEd Tanous * @brief Formats QueryParameterValueTypeError message into JSON 657f8cca876SEd Tanous * 658f8cca876SEd Tanous * See header file for more information 659f8cca876SEd Tanous * @endinternal 660f8cca876SEd Tanous */ 66110cf50dcSEd Tanous nlohmann::json::object_t queryParameterValueTypeError( 66210cf50dcSEd Tanous const nlohmann::json& arg1, std::string_view arg2) 663f8cca876SEd Tanous { 664f8cca876SEd Tanous std::string arg1Str = 665f8cca876SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 666f8cca876SEd Tanous return getLog( 6674a102cd4SPatrick Williams redfish::registries::Base::Index::queryParameterValueTypeError, 668f8cca876SEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 669f8cca876SEd Tanous } 670f8cca876SEd Tanous 671f8cca876SEd Tanous void queryParameterValueTypeError( 672f8cca876SEd Tanous crow::Response& res, const nlohmann::json& arg1, std::string_view arg2) 673f8cca876SEd Tanous { 674f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 675f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 676f8cca876SEd Tanous queryParameterValueTypeError(arg1, arg2)); 677f8cca876SEd Tanous } 678f8cca876SEd Tanous 679f8cca876SEd Tanous /** 680f8cca876SEd Tanous * @internal 681f8cca876SEd Tanous * @brief Formats QueryParameterValueFormatError message into JSON 682f8cca876SEd Tanous * 683f8cca876SEd Tanous * See header file for more information 684f8cca876SEd Tanous * @endinternal 685f8cca876SEd Tanous */ 68610cf50dcSEd Tanous nlohmann::json::object_t queryParameterValueFormatError( 68710cf50dcSEd Tanous const nlohmann::json& arg1, std::string_view arg2) 688f8cca876SEd Tanous { 689f8cca876SEd Tanous std::string arg1Str = 690f8cca876SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 691f8cca876SEd Tanous return getLog( 6924a102cd4SPatrick Williams redfish::registries::Base::Index::queryParameterValueFormatError, 693f8cca876SEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 694f8cca876SEd Tanous } 695f8cca876SEd Tanous 696f8cca876SEd Tanous void queryParameterValueFormatError( 697f8cca876SEd Tanous crow::Response& res, const nlohmann::json& arg1, std::string_view arg2) 698f8cca876SEd Tanous { 699f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 700f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 701f8cca876SEd Tanous queryParameterValueFormatError(arg1, arg2)); 702f8cca876SEd Tanous } 703f8cca876SEd Tanous 704f8cca876SEd Tanous /** 705f8cca876SEd Tanous * @internal 706f8cca876SEd Tanous * @brief Formats QueryParameterValueError message into JSON 707f8cca876SEd Tanous * 708f8cca876SEd Tanous * See header file for more information 709f8cca876SEd Tanous * @endinternal 710f8cca876SEd Tanous */ 71110cf50dcSEd Tanous nlohmann::json::object_t queryParameterValueError(std::string_view arg1) 712f8cca876SEd Tanous { 7134a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::queryParameterValueError, 714f8cca876SEd Tanous std::to_array({arg1})); 715f8cca876SEd Tanous } 716f8cca876SEd Tanous 717f8cca876SEd Tanous void queryParameterValueError(crow::Response& res, std::string_view arg1) 718f8cca876SEd Tanous { 719f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 720f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, queryParameterValueError(arg1)); 721f8cca876SEd Tanous } 722f8cca876SEd Tanous 723f8cca876SEd Tanous /** 724f8cca876SEd Tanous * @internal 725f8cca876SEd Tanous * @brief Formats QueryParameterOutOfRange message into JSON 726f8cca876SEd Tanous * 727f8cca876SEd Tanous * See header file for more information 728f8cca876SEd Tanous * @endinternal 729f8cca876SEd Tanous */ 73010cf50dcSEd Tanous nlohmann::json::object_t queryParameterOutOfRange( 731f8cca876SEd Tanous std::string_view arg1, std::string_view arg2, std::string_view arg3) 732f8cca876SEd Tanous { 7334a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::queryParameterOutOfRange, 734f8cca876SEd Tanous std::to_array({arg1, arg2, arg3})); 735f8cca876SEd Tanous } 736f8cca876SEd Tanous 737f8cca876SEd Tanous void queryParameterOutOfRange(crow::Response& res, std::string_view arg1, 738f8cca876SEd Tanous std::string_view arg2, std::string_view arg3) 739f8cca876SEd Tanous { 740f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 741f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 742f8cca876SEd Tanous queryParameterOutOfRange(arg1, arg2, arg3)); 743f8cca876SEd Tanous } 744f8cca876SEd Tanous 745f8cca876SEd Tanous /** 746f8cca876SEd Tanous * @internal 747f8cca876SEd Tanous * @brief Formats QueryNotSupportedOnResource message into JSON 748f8cca876SEd Tanous * 749f8cca876SEd Tanous * See header file for more information 750f8cca876SEd Tanous * @endinternal 751f8cca876SEd Tanous */ 75210cf50dcSEd Tanous nlohmann::json::object_t queryNotSupportedOnResource() 753f8cca876SEd Tanous { 7544a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::queryNotSupportedOnResource, 755f8cca876SEd Tanous {}); 756f8cca876SEd Tanous } 757f8cca876SEd Tanous 758f8cca876SEd Tanous void queryNotSupportedOnResource(crow::Response& res) 759f8cca876SEd Tanous { 760f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 761f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, queryNotSupportedOnResource()); 762f8cca876SEd Tanous } 763f8cca876SEd Tanous 764f8cca876SEd Tanous /** 765f8cca876SEd Tanous * @internal 766f8cca876SEd Tanous * @brief Formats QueryNotSupportedOnOperation message into JSON 767f8cca876SEd Tanous * 768f8cca876SEd Tanous * See header file for more information 769f8cca876SEd Tanous * @endinternal 770f8cca876SEd Tanous */ 77110cf50dcSEd Tanous nlohmann::json::object_t queryNotSupportedOnOperation() 772f8cca876SEd Tanous { 773f8cca876SEd Tanous return getLog( 7744a102cd4SPatrick Williams redfish::registries::Base::Index::queryNotSupportedOnOperation, {}); 775f8cca876SEd Tanous } 776f8cca876SEd Tanous 777f8cca876SEd Tanous void queryNotSupportedOnOperation(crow::Response& res) 778f8cca876SEd Tanous { 779f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 780f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, queryNotSupportedOnOperation()); 781f8cca876SEd Tanous } 782f8cca876SEd Tanous 783f8cca876SEd Tanous /** 784f8cca876SEd Tanous * @internal 785f8cca876SEd Tanous * @brief Formats QueryNotSupported message into JSON 786f8cca876SEd Tanous * 787f8cca876SEd Tanous * See header file for more information 788f8cca876SEd Tanous * @endinternal 789f8cca876SEd Tanous */ 79010cf50dcSEd Tanous nlohmann::json::object_t queryNotSupported() 791f8cca876SEd Tanous { 7924a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::queryNotSupported, {}); 793f8cca876SEd Tanous } 794f8cca876SEd Tanous 795f8cca876SEd Tanous void queryNotSupported(crow::Response& res) 796f8cca876SEd Tanous { 797f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 798f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, queryNotSupported()); 799f8cca876SEd Tanous } 800f8cca876SEd Tanous 801f8cca876SEd Tanous /** 802f8cca876SEd Tanous * @internal 803f8cca876SEd Tanous * @brief Formats QueryCombinationInvalid message into JSON 804f8cca876SEd Tanous * 805f8cca876SEd Tanous * See header file for more information 806f8cca876SEd Tanous * @endinternal 807f8cca876SEd Tanous */ 80810cf50dcSEd Tanous nlohmann::json::object_t queryCombinationInvalid() 809f8cca876SEd Tanous { 8104a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::queryCombinationInvalid, 811f8cca876SEd Tanous {}); 812f8cca876SEd Tanous } 813f8cca876SEd Tanous 814f8cca876SEd Tanous void queryCombinationInvalid(crow::Response& res) 815f8cca876SEd Tanous { 816f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 817f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, queryCombinationInvalid()); 818f8cca876SEd Tanous } 819f8cca876SEd Tanous 820f8cca876SEd Tanous /** 821f8cca876SEd Tanous * @internal 822f8cca876SEd Tanous * @brief Formats QueryParameterUnsupported message into JSON 823f8cca876SEd Tanous * 824f8cca876SEd Tanous * See header file for more information 825f8cca876SEd Tanous * @endinternal 826f8cca876SEd Tanous */ 82710cf50dcSEd Tanous nlohmann::json::object_t queryParameterUnsupported(std::string_view arg1) 828f8cca876SEd Tanous { 8294a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::queryParameterUnsupported, 830f8cca876SEd Tanous std::to_array({arg1})); 831f8cca876SEd Tanous } 832f8cca876SEd Tanous 833f8cca876SEd Tanous void queryParameterUnsupported(crow::Response& res, std::string_view arg1) 834f8cca876SEd Tanous { 835f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 836f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, queryParameterUnsupported(arg1)); 837f8cca876SEd Tanous } 838f8cca876SEd Tanous 839f8cca876SEd Tanous /** 840f8cca876SEd Tanous * @internal 841f8cca876SEd Tanous * @brief Formats SessionLimitExceeded message into JSON 842f8cca876SEd Tanous * 843f8cca876SEd Tanous * See header file for more information 844f8cca876SEd Tanous * @endinternal 845f8cca876SEd Tanous */ 84610cf50dcSEd Tanous nlohmann::json::object_t sessionLimitExceeded() 847f8cca876SEd Tanous { 8484a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::sessionLimitExceeded, {}); 849f8cca876SEd Tanous } 850f8cca876SEd Tanous 851f8cca876SEd Tanous void sessionLimitExceeded(crow::Response& res) 852f8cca876SEd Tanous { 853f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 854f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, sessionLimitExceeded()); 855f8cca876SEd Tanous } 856f8cca876SEd Tanous 857f8cca876SEd Tanous /** 858f8cca876SEd Tanous * @internal 859f8cca876SEd Tanous * @brief Formats EventSubscriptionLimitExceeded message into JSON 860f8cca876SEd Tanous * 861f8cca876SEd Tanous * See header file for more information 862f8cca876SEd Tanous * @endinternal 863f8cca876SEd Tanous */ 86410cf50dcSEd Tanous nlohmann::json::object_t eventSubscriptionLimitExceeded() 865f8cca876SEd Tanous { 866f8cca876SEd Tanous return getLog( 8674a102cd4SPatrick Williams redfish::registries::Base::Index::eventSubscriptionLimitExceeded, {}); 868f8cca876SEd Tanous } 869f8cca876SEd Tanous 870f8cca876SEd Tanous void eventSubscriptionLimitExceeded(crow::Response& res) 871f8cca876SEd Tanous { 872f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 873f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, eventSubscriptionLimitExceeded()); 874f8cca876SEd Tanous } 875f8cca876SEd Tanous 876f8cca876SEd Tanous /** 877f8cca876SEd Tanous * @internal 878f8cca876SEd Tanous * @brief Formats ResourceCannotBeDeleted message into JSON 879f8cca876SEd Tanous * 880f8cca876SEd Tanous * See header file for more information 881f8cca876SEd Tanous * @endinternal 882f8cca876SEd Tanous */ 88310cf50dcSEd Tanous nlohmann::json::object_t resourceCannotBeDeleted() 884f8cca876SEd Tanous { 8854a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceCannotBeDeleted, 886f8cca876SEd Tanous {}); 887f8cca876SEd Tanous } 888f8cca876SEd Tanous 889f8cca876SEd Tanous void resourceCannotBeDeleted(crow::Response& res) 890f8cca876SEd Tanous { 891f8cca876SEd Tanous res.result(boost::beast::http::status::method_not_allowed); 892f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceCannotBeDeleted()); 893f8cca876SEd Tanous } 894f8cca876SEd Tanous 895f8cca876SEd Tanous /** 896f8cca876SEd Tanous * @internal 897f8cca876SEd Tanous * @brief Formats ResourceInUse message into JSON 898f8cca876SEd Tanous * 899f8cca876SEd Tanous * See header file for more information 900f8cca876SEd Tanous * @endinternal 901f8cca876SEd Tanous */ 90210cf50dcSEd Tanous nlohmann::json::object_t resourceInUse() 903f8cca876SEd Tanous { 9044a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceInUse, {}); 905f8cca876SEd Tanous } 906f8cca876SEd Tanous 907f8cca876SEd Tanous void resourceInUse(crow::Response& res) 908f8cca876SEd Tanous { 909f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 910f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceInUse()); 911f8cca876SEd Tanous } 912f8cca876SEd Tanous 913f8cca876SEd Tanous /** 914f8cca876SEd Tanous * @internal 915f8cca876SEd Tanous * @brief Formats ResourceAlreadyExists message into JSON 916f8cca876SEd Tanous * 917f8cca876SEd Tanous * See header file for more information 918f8cca876SEd Tanous * @endinternal 919f8cca876SEd Tanous */ 92010cf50dcSEd Tanous nlohmann::json::object_t resourceAlreadyExists( 921f8cca876SEd Tanous std::string_view arg1, std::string_view arg2, std::string_view arg3) 922f8cca876SEd Tanous { 9234a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceAlreadyExists, 924f8cca876SEd Tanous std::to_array({arg1, arg2, arg3})); 925f8cca876SEd Tanous } 926f8cca876SEd Tanous 927f8cca876SEd Tanous void resourceAlreadyExists(crow::Response& res, std::string_view arg1, 928f8cca876SEd Tanous std::string_view arg2, std::string_view arg3) 929f8cca876SEd Tanous { 930f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 931f8cca876SEd Tanous addMessageToJson(res.jsonValue, resourceAlreadyExists(arg1, arg2, arg3), 932f8cca876SEd Tanous arg2); 933f8cca876SEd Tanous } 934f8cca876SEd Tanous 935f8cca876SEd Tanous /** 936f8cca876SEd Tanous * @internal 937f8cca876SEd Tanous * @brief Formats ResourceNotFound message into JSON 938f8cca876SEd Tanous * 939f8cca876SEd Tanous * See header file for more information 940f8cca876SEd Tanous * @endinternal 941f8cca876SEd Tanous */ 94210cf50dcSEd Tanous nlohmann::json::object_t resourceNotFound(std::string_view arg1, 94310cf50dcSEd Tanous std::string_view arg2) 944f8cca876SEd Tanous { 9454a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceNotFound, 946f8cca876SEd Tanous std::to_array({arg1, arg2})); 947f8cca876SEd Tanous } 948f8cca876SEd Tanous 949f8cca876SEd Tanous void resourceNotFound(crow::Response& res, std::string_view arg1, 950f8cca876SEd Tanous std::string_view arg2) 951f8cca876SEd Tanous { 952f8cca876SEd Tanous res.result(boost::beast::http::status::not_found); 953f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceNotFound(arg1, arg2)); 954f8cca876SEd Tanous } 955f8cca876SEd Tanous 956f8cca876SEd Tanous /** 957f8cca876SEd Tanous * @internal 958f8cca876SEd Tanous * @brief Formats PayloadTooLarge message into JSON 959f8cca876SEd Tanous * 960f8cca876SEd Tanous * See header file for more information 961f8cca876SEd Tanous * @endinternal 962f8cca876SEd Tanous */ 96310cf50dcSEd Tanous nlohmann::json::object_t payloadTooLarge() 964f8cca876SEd Tanous { 9654a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::payloadTooLarge, {}); 966f8cca876SEd Tanous } 967f8cca876SEd Tanous 968f8cca876SEd Tanous void payloadTooLarge(crow::Response& res) 969f8cca876SEd Tanous { 970f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 971f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, payloadTooLarge()); 972f8cca876SEd Tanous } 973f8cca876SEd Tanous 974f8cca876SEd Tanous /** 975f8cca876SEd Tanous * @internal 976f8cca876SEd Tanous * @brief Formats InsufficientStorage message into JSON 977f8cca876SEd Tanous * 978f8cca876SEd Tanous * See header file for more information 979f8cca876SEd Tanous * @endinternal 980f8cca876SEd Tanous */ 98110cf50dcSEd Tanous nlohmann::json::object_t insufficientStorage() 982f8cca876SEd Tanous { 9834a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::insufficientStorage, {}); 984f8cca876SEd Tanous } 985f8cca876SEd Tanous 986f8cca876SEd Tanous void insufficientStorage(crow::Response& res) 987f8cca876SEd Tanous { 988f8cca876SEd Tanous res.result(boost::beast::http::status::insufficient_storage); 989f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, insufficientStorage()); 990f8cca876SEd Tanous } 991f8cca876SEd Tanous 992f8cca876SEd Tanous /** 993f8cca876SEd Tanous * @internal 994f8cca876SEd Tanous * @brief Formats MissingOrMalformedPart message into JSON 995f8cca876SEd Tanous * 996f8cca876SEd Tanous * See header file for more information 997f8cca876SEd Tanous * @endinternal 998f8cca876SEd Tanous */ 99910cf50dcSEd Tanous nlohmann::json::object_t missingOrMalformedPart() 1000f8cca876SEd Tanous { 10014a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::missingOrMalformedPart, {}); 1002f8cca876SEd Tanous } 1003f8cca876SEd Tanous 1004f8cca876SEd Tanous void missingOrMalformedPart(crow::Response& res) 1005f8cca876SEd Tanous { 1006f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1007f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, missingOrMalformedPart()); 1008f8cca876SEd Tanous } 1009f8cca876SEd Tanous 1010f8cca876SEd Tanous /** 1011f8cca876SEd Tanous * @internal 1012f8cca876SEd Tanous * @brief Formats InvalidURI message into JSON 1013f8cca876SEd Tanous * 1014f8cca876SEd Tanous * See header file for more information 1015f8cca876SEd Tanous * @endinternal 1016f8cca876SEd Tanous */ 101710cf50dcSEd Tanous nlohmann::json::object_t invalidURI(std::string_view arg1) 1018f8cca876SEd Tanous { 10194a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::invalidURI, 1020f8cca876SEd Tanous std::to_array({arg1})); 1021f8cca876SEd Tanous } 1022f8cca876SEd Tanous 1023f8cca876SEd Tanous void invalidURI(crow::Response& res, std::string_view arg1) 1024f8cca876SEd Tanous { 1025f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1026f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, invalidURI(arg1)); 1027f8cca876SEd Tanous } 1028f8cca876SEd Tanous 1029f8cca876SEd Tanous /** 1030f8cca876SEd Tanous * @internal 1031f8cca876SEd Tanous * @brief Formats CreateFailedMissingReqProperties message into JSON 1032f8cca876SEd Tanous * 1033f8cca876SEd Tanous * See header file for more information 1034f8cca876SEd Tanous * @endinternal 1035f8cca876SEd Tanous */ 103610cf50dcSEd Tanous nlohmann::json::object_t createFailedMissingReqProperties(std::string_view arg1) 1037f8cca876SEd Tanous { 1038f8cca876SEd Tanous return getLog( 10394a102cd4SPatrick Williams redfish::registries::Base::Index::createFailedMissingReqProperties, 1040f8cca876SEd Tanous std::to_array({arg1})); 1041f8cca876SEd Tanous } 1042f8cca876SEd Tanous 1043f8cca876SEd Tanous void createFailedMissingReqProperties(crow::Response& res, 1044f8cca876SEd Tanous std::string_view arg1) 1045f8cca876SEd Tanous { 1046f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1047f8cca876SEd Tanous addMessageToJson(res.jsonValue, createFailedMissingReqProperties(arg1), 1048f8cca876SEd Tanous arg1); 1049f8cca876SEd Tanous } 1050f8cca876SEd Tanous 1051f8cca876SEd Tanous /** 1052f8cca876SEd Tanous * @internal 1053f8cca876SEd Tanous * @brief Formats CreateLimitReachedForResource message into JSON 1054f8cca876SEd Tanous * 1055f8cca876SEd Tanous * See header file for more information 1056f8cca876SEd Tanous * @endinternal 1057f8cca876SEd Tanous */ 105810cf50dcSEd Tanous nlohmann::json::object_t createLimitReachedForResource() 1059f8cca876SEd Tanous { 1060f8cca876SEd Tanous return getLog( 10614a102cd4SPatrick Williams redfish::registries::Base::Index::createLimitReachedForResource, {}); 1062f8cca876SEd Tanous } 1063f8cca876SEd Tanous 1064f8cca876SEd Tanous void createLimitReachedForResource(crow::Response& res) 1065f8cca876SEd Tanous { 1066f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1067f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, createLimitReachedForResource()); 1068f8cca876SEd Tanous } 1069f8cca876SEd Tanous 1070f8cca876SEd Tanous /** 1071f8cca876SEd Tanous * @internal 1072f8cca876SEd Tanous * @brief Formats ServiceShuttingDown message into JSON 1073f8cca876SEd Tanous * 1074f8cca876SEd Tanous * See header file for more information 1075f8cca876SEd Tanous * @endinternal 1076f8cca876SEd Tanous */ 107710cf50dcSEd Tanous nlohmann::json::object_t serviceShuttingDown() 1078f8cca876SEd Tanous { 10794a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::serviceShuttingDown, {}); 1080f8cca876SEd Tanous } 1081f8cca876SEd Tanous 1082f8cca876SEd Tanous void serviceShuttingDown(crow::Response& res) 1083f8cca876SEd Tanous { 1084f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 1085f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, serviceShuttingDown()); 1086f8cca876SEd Tanous } 1087f8cca876SEd Tanous 1088f8cca876SEd Tanous /** 1089f8cca876SEd Tanous * @internal 1090f8cca876SEd Tanous * @brief Formats ServiceInUnknownState message into JSON 1091f8cca876SEd Tanous * 1092f8cca876SEd Tanous * See header file for more information 1093f8cca876SEd Tanous * @endinternal 1094f8cca876SEd Tanous */ 109510cf50dcSEd Tanous nlohmann::json::object_t serviceInUnknownState() 1096f8cca876SEd Tanous { 10974a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::serviceInUnknownState, {}); 1098f8cca876SEd Tanous } 1099f8cca876SEd Tanous 1100f8cca876SEd Tanous void serviceInUnknownState(crow::Response& res) 1101f8cca876SEd Tanous { 1102f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 1103f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, serviceInUnknownState()); 1104f8cca876SEd Tanous } 1105f8cca876SEd Tanous 1106f8cca876SEd Tanous /** 1107f8cca876SEd Tanous * @internal 1108f8cca876SEd Tanous * @brief Formats NoValidSession message into JSON 1109f8cca876SEd Tanous * 1110f8cca876SEd Tanous * See header file for more information 1111f8cca876SEd Tanous * @endinternal 1112f8cca876SEd Tanous */ 111310cf50dcSEd Tanous nlohmann::json::object_t noValidSession() 1114f8cca876SEd Tanous { 11154a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::noValidSession, {}); 1116f8cca876SEd Tanous } 1117f8cca876SEd Tanous 1118f8cca876SEd Tanous void noValidSession(crow::Response& res) 1119f8cca876SEd Tanous { 1120f8cca876SEd Tanous res.result(boost::beast::http::status::forbidden); 1121f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, noValidSession()); 1122f8cca876SEd Tanous } 1123f8cca876SEd Tanous 1124f8cca876SEd Tanous /** 1125f8cca876SEd Tanous * @internal 1126f8cca876SEd Tanous * @brief Formats InsufficientPrivilege message into JSON 1127f8cca876SEd Tanous * 1128f8cca876SEd Tanous * See header file for more information 1129f8cca876SEd Tanous * @endinternal 1130f8cca876SEd Tanous */ 113110cf50dcSEd Tanous nlohmann::json::object_t insufficientPrivilege() 1132f8cca876SEd Tanous { 11334a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::insufficientPrivilege, {}); 1134f8cca876SEd Tanous } 1135f8cca876SEd Tanous 1136f8cca876SEd Tanous void insufficientPrivilege(crow::Response& res) 1137f8cca876SEd Tanous { 1138f8cca876SEd Tanous res.result(boost::beast::http::status::forbidden); 1139f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, insufficientPrivilege()); 1140f8cca876SEd Tanous } 1141f8cca876SEd Tanous 1142f8cca876SEd Tanous /** 1143f8cca876SEd Tanous * @internal 1144f8cca876SEd Tanous * @brief Formats AccountModified message into JSON 1145f8cca876SEd Tanous * 1146f8cca876SEd Tanous * See header file for more information 1147f8cca876SEd Tanous * @endinternal 1148f8cca876SEd Tanous */ 114910cf50dcSEd Tanous nlohmann::json::object_t accountModified() 1150f8cca876SEd Tanous { 11514a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::accountModified, {}); 1152f8cca876SEd Tanous } 1153f8cca876SEd Tanous 1154f8cca876SEd Tanous void accountModified(crow::Response& res) 1155f8cca876SEd Tanous { 1156f8cca876SEd Tanous res.result(boost::beast::http::status::ok); 1157f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, accountModified()); 1158f8cca876SEd Tanous } 1159f8cca876SEd Tanous 1160f8cca876SEd Tanous /** 1161f8cca876SEd Tanous * @internal 1162f8cca876SEd Tanous * @brief Formats AccountNotModified message into JSON 1163f8cca876SEd Tanous * 1164f8cca876SEd Tanous * See header file for more information 1165f8cca876SEd Tanous * @endinternal 1166f8cca876SEd Tanous */ 116710cf50dcSEd Tanous nlohmann::json::object_t accountNotModified() 1168f8cca876SEd Tanous { 11694a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::accountNotModified, {}); 1170f8cca876SEd Tanous } 1171f8cca876SEd Tanous 1172f8cca876SEd Tanous void accountNotModified(crow::Response& res) 1173f8cca876SEd Tanous { 1174f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1175f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, accountNotModified()); 1176f8cca876SEd Tanous } 1177f8cca876SEd Tanous 1178f8cca876SEd Tanous /** 1179f8cca876SEd Tanous * @internal 1180f8cca876SEd Tanous * @brief Formats AccountRemoved message into JSON 1181f8cca876SEd Tanous * 1182f8cca876SEd Tanous * See header file for more information 1183f8cca876SEd Tanous * @endinternal 1184f8cca876SEd Tanous */ 118510cf50dcSEd Tanous nlohmann::json::object_t accountRemoved() 1186f8cca876SEd Tanous { 11874a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::accountRemoved, {}); 1188f8cca876SEd Tanous } 1189f8cca876SEd Tanous 1190f8cca876SEd Tanous void accountRemoved(crow::Response& res) 1191f8cca876SEd Tanous { 1192f8cca876SEd Tanous res.result(boost::beast::http::status::ok); 1193f8cca876SEd Tanous addMessageToJsonRoot(res.jsonValue, accountRemoved()); 1194f8cca876SEd Tanous } 1195f8cca876SEd Tanous 1196f8cca876SEd Tanous /** 1197f8cca876SEd Tanous * @internal 1198f8cca876SEd Tanous * @brief Formats AccountForSessionNoLongerExists message into JSON 1199f8cca876SEd Tanous * 1200f8cca876SEd Tanous * See header file for more information 1201f8cca876SEd Tanous * @endinternal 1202f8cca876SEd Tanous */ 120310cf50dcSEd Tanous nlohmann::json::object_t accountForSessionNoLongerExists() 1204f8cca876SEd Tanous { 1205f8cca876SEd Tanous return getLog( 12064a102cd4SPatrick Williams redfish::registries::Base::Index::accountForSessionNoLongerExists, {}); 1207f8cca876SEd Tanous } 1208f8cca876SEd Tanous 1209f8cca876SEd Tanous void accountForSessionNoLongerExists(crow::Response& res) 1210f8cca876SEd Tanous { 1211f8cca876SEd Tanous res.result(boost::beast::http::status::forbidden); 1212f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, accountForSessionNoLongerExists()); 1213f8cca876SEd Tanous } 1214f8cca876SEd Tanous 1215f8cca876SEd Tanous /** 1216f8cca876SEd Tanous * @internal 1217f8cca876SEd Tanous * @brief Formats InvalidObject message into JSON 1218f8cca876SEd Tanous * 1219f8cca876SEd Tanous * See header file for more information 1220f8cca876SEd Tanous * @endinternal 1221f8cca876SEd Tanous */ 122210cf50dcSEd Tanous nlohmann::json::object_t invalidObject(const boost::urls::url_view_base& arg1) 1223f8cca876SEd Tanous { 12244a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::invalidObject, 1225f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1226f8cca876SEd Tanous } 1227f8cca876SEd Tanous 1228f8cca876SEd Tanous void invalidObject(crow::Response& res, const boost::urls::url_view_base& arg1) 1229f8cca876SEd Tanous { 1230f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1231f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, invalidObject(arg1)); 1232f8cca876SEd Tanous } 1233f8cca876SEd Tanous 1234f8cca876SEd Tanous /** 1235f8cca876SEd Tanous * @internal 1236f8cca876SEd Tanous * @brief Formats InternalError message into JSON 1237f8cca876SEd Tanous * 1238f8cca876SEd Tanous * See header file for more information 1239f8cca876SEd Tanous * @endinternal 1240f8cca876SEd Tanous */ 124110cf50dcSEd Tanous nlohmann::json::object_t internalError() 1242f8cca876SEd Tanous { 12434a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::internalError, {}); 1244f8cca876SEd Tanous } 1245f8cca876SEd Tanous 1246f8cca876SEd Tanous void internalError(crow::Response& res, const std::source_location location) 1247f8cca876SEd Tanous { 1248f8cca876SEd Tanous BMCWEB_LOG_CRITICAL("Internal Error {}({}:{}) `{}`: ", location.file_name(), 1249f8cca876SEd Tanous location.line(), location.column(), 1250f8cca876SEd Tanous location.function_name()); 1251f8cca876SEd Tanous res.result(boost::beast::http::status::internal_server_error); 1252f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, internalError()); 1253f8cca876SEd Tanous } 1254f8cca876SEd Tanous 1255f8cca876SEd Tanous /** 1256f8cca876SEd Tanous * @internal 1257f8cca876SEd Tanous * @brief Formats UnrecognizedRequestBody message into JSON 1258f8cca876SEd Tanous * 1259f8cca876SEd Tanous * See header file for more information 1260f8cca876SEd Tanous * @endinternal 1261f8cca876SEd Tanous */ 126210cf50dcSEd Tanous nlohmann::json::object_t unrecognizedRequestBody() 1263f8cca876SEd Tanous { 12644a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::unrecognizedRequestBody, 1265f8cca876SEd Tanous {}); 1266f8cca876SEd Tanous } 1267f8cca876SEd Tanous 1268f8cca876SEd Tanous void unrecognizedRequestBody(crow::Response& res) 1269f8cca876SEd Tanous { 1270f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1271f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, unrecognizedRequestBody()); 1272f8cca876SEd Tanous } 1273f8cca876SEd Tanous 1274f8cca876SEd Tanous /** 1275f8cca876SEd Tanous * @internal 1276f8cca876SEd Tanous * @brief Formats ResourceMissingAtURI message into JSON 1277f8cca876SEd Tanous * 1278f8cca876SEd Tanous * See header file for more information 1279f8cca876SEd Tanous * @endinternal 1280f8cca876SEd Tanous */ 128110cf50dcSEd Tanous nlohmann::json::object_t resourceMissingAtURI( 128210cf50dcSEd Tanous const boost::urls::url_view_base& arg1) 1283f8cca876SEd Tanous { 12844a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceMissingAtURI, 1285f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1286f8cca876SEd Tanous } 1287f8cca876SEd Tanous 1288f8cca876SEd Tanous void resourceMissingAtURI(crow::Response& res, 1289f8cca876SEd Tanous const boost::urls::url_view_base& arg1) 1290f8cca876SEd Tanous { 1291f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1292f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceMissingAtURI(arg1)); 1293f8cca876SEd Tanous } 1294f8cca876SEd Tanous 1295f8cca876SEd Tanous /** 1296f8cca876SEd Tanous * @internal 1297f8cca876SEd Tanous * @brief Formats ResourceAtUriInUnknownFormat message into JSON 1298f8cca876SEd Tanous * 1299f8cca876SEd Tanous * See header file for more information 1300f8cca876SEd Tanous * @endinternal 1301f8cca876SEd Tanous */ 130210cf50dcSEd Tanous nlohmann::json::object_t resourceAtUriInUnknownFormat( 1303504af5a0SPatrick Williams const boost::urls::url_view_base& arg1) 1304f8cca876SEd Tanous { 1305f8cca876SEd Tanous return getLog( 13064a102cd4SPatrick Williams redfish::registries::Base::Index::resourceAtUriInUnknownFormat, 1307f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1308f8cca876SEd Tanous } 1309f8cca876SEd Tanous 1310f8cca876SEd Tanous void resourceAtUriInUnknownFormat(crow::Response& res, 1311f8cca876SEd Tanous const boost::urls::url_view_base& arg1) 1312f8cca876SEd Tanous { 1313f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1314f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceAtUriInUnknownFormat(arg1)); 1315f8cca876SEd Tanous } 1316f8cca876SEd Tanous 1317f8cca876SEd Tanous /** 1318f8cca876SEd Tanous * @internal 1319f8cca876SEd Tanous * @brief Formats ResourceAtUriUnauthorized message into JSON 1320f8cca876SEd Tanous * 1321f8cca876SEd Tanous * See header file for more information 1322f8cca876SEd Tanous * @endinternal 1323f8cca876SEd Tanous */ 132410cf50dcSEd Tanous nlohmann::json::object_t resourceAtUriUnauthorized( 132510cf50dcSEd Tanous const boost::urls::url_view_base& arg1, std::string_view arg2) 1326f8cca876SEd Tanous { 13274a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceAtUriUnauthorized, 1328f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer(), arg2})); 1329f8cca876SEd Tanous } 1330f8cca876SEd Tanous 1331f8cca876SEd Tanous void resourceAtUriUnauthorized(crow::Response& res, 1332f8cca876SEd Tanous const boost::urls::url_view_base& arg1, 1333f8cca876SEd Tanous std::string_view arg2) 1334f8cca876SEd Tanous { 1335f8cca876SEd Tanous res.result(boost::beast::http::status::unauthorized); 1336f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceAtUriUnauthorized(arg1, arg2)); 1337f8cca876SEd Tanous } 1338f8cca876SEd Tanous 1339f8cca876SEd Tanous /** 1340f8cca876SEd Tanous * @internal 1341f8cca876SEd Tanous * @brief Formats CouldNotEstablishConnection message into JSON 1342f8cca876SEd Tanous * 1343f8cca876SEd Tanous * See header file for more information 1344f8cca876SEd Tanous * @endinternal 1345f8cca876SEd Tanous */ 134610cf50dcSEd Tanous nlohmann::json::object_t couldNotEstablishConnection( 1347504af5a0SPatrick Williams const boost::urls::url_view_base& arg1) 1348f8cca876SEd Tanous { 13494a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::couldNotEstablishConnection, 1350f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1351f8cca876SEd Tanous } 1352f8cca876SEd Tanous 1353f8cca876SEd Tanous void couldNotEstablishConnection(crow::Response& res, 1354f8cca876SEd Tanous const boost::urls::url_view_base& arg1) 1355f8cca876SEd Tanous { 1356f8cca876SEd Tanous res.result(boost::beast::http::status::not_found); 1357f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, couldNotEstablishConnection(arg1)); 1358f8cca876SEd Tanous } 1359f8cca876SEd Tanous 1360f8cca876SEd Tanous /** 1361f8cca876SEd Tanous * @internal 1362f8cca876SEd Tanous * @brief Formats SourceDoesNotSupportProtocol message into JSON 1363f8cca876SEd Tanous * 1364f8cca876SEd Tanous * See header file for more information 1365f8cca876SEd Tanous * @endinternal 1366f8cca876SEd Tanous */ 136710cf50dcSEd Tanous nlohmann::json::object_t sourceDoesNotSupportProtocol( 1368f8cca876SEd Tanous const boost::urls::url_view_base& arg1, std::string_view arg2) 1369f8cca876SEd Tanous { 1370f8cca876SEd Tanous return getLog( 13714a102cd4SPatrick Williams redfish::registries::Base::Index::sourceDoesNotSupportProtocol, 1372f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer(), arg2})); 1373f8cca876SEd Tanous } 1374f8cca876SEd Tanous 1375f8cca876SEd Tanous void sourceDoesNotSupportProtocol(crow::Response& res, 1376f8cca876SEd Tanous const boost::urls::url_view_base& arg1, 1377f8cca876SEd Tanous std::string_view arg2) 1378f8cca876SEd Tanous { 1379f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1380f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 1381f8cca876SEd Tanous sourceDoesNotSupportProtocol(arg1, arg2)); 1382f8cca876SEd Tanous } 1383f8cca876SEd Tanous 1384f8cca876SEd Tanous /** 1385f8cca876SEd Tanous * @internal 1386f8cca876SEd Tanous * @brief Formats AccessDenied message into JSON 1387f8cca876SEd Tanous * 1388f8cca876SEd Tanous * See header file for more information 1389f8cca876SEd Tanous * @endinternal 1390f8cca876SEd Tanous */ 139110cf50dcSEd Tanous nlohmann::json::object_t accessDenied(const boost::urls::url_view_base& arg1) 1392f8cca876SEd Tanous { 13934a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::accessDenied, 1394f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1395f8cca876SEd Tanous } 1396f8cca876SEd Tanous 1397f8cca876SEd Tanous void accessDenied(crow::Response& res, const boost::urls::url_view_base& arg1) 1398f8cca876SEd Tanous { 1399f8cca876SEd Tanous res.result(boost::beast::http::status::forbidden); 1400f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, accessDenied(arg1)); 1401f8cca876SEd Tanous } 1402f8cca876SEd Tanous 1403f8cca876SEd Tanous /** 1404f8cca876SEd Tanous * @internal 1405f8cca876SEd Tanous * @brief Formats ServiceTemporarilyUnavailable message into JSON 1406f8cca876SEd Tanous * 1407f8cca876SEd Tanous * See header file for more information 1408f8cca876SEd Tanous * @endinternal 1409f8cca876SEd Tanous */ 141010cf50dcSEd Tanous nlohmann::json::object_t serviceTemporarilyUnavailable(std::string_view arg1) 1411f8cca876SEd Tanous { 1412f8cca876SEd Tanous return getLog( 14134a102cd4SPatrick Williams redfish::registries::Base::Index::serviceTemporarilyUnavailable, 1414f8cca876SEd Tanous std::to_array({arg1})); 1415f8cca876SEd Tanous } 1416f8cca876SEd Tanous 1417f8cca876SEd Tanous void serviceTemporarilyUnavailable(crow::Response& res, std::string_view arg1) 1418f8cca876SEd Tanous { 1419f8cca876SEd Tanous res.addHeader(boost::beast::http::field::retry_after, arg1); 1420f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 1421f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, serviceTemporarilyUnavailable(arg1)); 1422f8cca876SEd Tanous } 1423f8cca876SEd Tanous 1424f8cca876SEd Tanous /** 1425f8cca876SEd Tanous * @internal 1426f8cca876SEd Tanous * @brief Formats InvalidIndex message into JSON 1427f8cca876SEd Tanous * 1428f8cca876SEd Tanous * See header file for more information 1429f8cca876SEd Tanous * @endinternal 1430f8cca876SEd Tanous */ 143110cf50dcSEd Tanous nlohmann::json::object_t invalidIndex(uint64_t arg1) 1432f8cca876SEd Tanous { 1433f8cca876SEd Tanous std::string arg1Str = std::to_string(arg1); 14344a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::invalidIndex, 1435f8cca876SEd Tanous std::to_array<std::string_view>({arg1Str})); 1436f8cca876SEd Tanous } 1437f8cca876SEd Tanous 1438644cdcb8SEd Tanous void invalidIndex(crow::Response& res, uint64_t arg1) 1439f8cca876SEd Tanous { 1440f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1441f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, invalidIndex(arg1)); 1442f8cca876SEd Tanous } 1443f8cca876SEd Tanous 1444f8cca876SEd Tanous /** 1445f8cca876SEd Tanous * @internal 1446f8cca876SEd Tanous * @brief Formats PropertyValueModified message into JSON 1447f8cca876SEd Tanous * 1448f8cca876SEd Tanous * See header file for more information 1449f8cca876SEd Tanous * @endinternal 1450f8cca876SEd Tanous */ 145110cf50dcSEd Tanous nlohmann::json::object_t propertyValueModified(std::string_view arg1, 1452f8cca876SEd Tanous const nlohmann::json& arg2) 1453f8cca876SEd Tanous { 1454f8cca876SEd Tanous std::string arg2Str = 1455f8cca876SEd Tanous arg2.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 14564a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyValueModified, 1457f8cca876SEd Tanous std::to_array<std::string_view>({arg1, arg2Str})); 1458f8cca876SEd Tanous } 1459f8cca876SEd Tanous 1460f8cca876SEd Tanous void propertyValueModified(crow::Response& res, std::string_view arg1, 1461f8cca876SEd Tanous const nlohmann::json& arg2) 1462f8cca876SEd Tanous { 1463f8cca876SEd Tanous res.result(boost::beast::http::status::ok); 1464f8cca876SEd Tanous addMessageToJson(res.jsonValue, propertyValueModified(arg1, arg2), arg1); 1465f8cca876SEd Tanous } 1466f8cca876SEd Tanous 1467f8cca876SEd Tanous /** 1468f8cca876SEd Tanous * @internal 1469f8cca876SEd Tanous * @brief Formats ResourceInStandby message into JSON 1470f8cca876SEd Tanous * 1471f8cca876SEd Tanous * See header file for more information 1472f8cca876SEd Tanous * @endinternal 1473f8cca876SEd Tanous */ 147410cf50dcSEd Tanous nlohmann::json::object_t resourceInStandby() 1475f8cca876SEd Tanous { 14764a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceInStandby, {}); 1477f8cca876SEd Tanous } 1478f8cca876SEd Tanous 1479f8cca876SEd Tanous void resourceInStandby(crow::Response& res) 1480f8cca876SEd Tanous { 1481f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 1482f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceInStandby()); 1483f8cca876SEd Tanous } 1484f8cca876SEd Tanous 1485f8cca876SEd Tanous /** 1486f8cca876SEd Tanous * @internal 1487f8cca876SEd Tanous * @brief Formats ResourceExhaustion message into JSON 1488f8cca876SEd Tanous * 1489f8cca876SEd Tanous * See header file for more information 1490f8cca876SEd Tanous * @endinternal 1491f8cca876SEd Tanous */ 149210cf50dcSEd Tanous nlohmann::json::object_t resourceExhaustion(std::string_view arg1) 1493f8cca876SEd Tanous { 14944a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceExhaustion, 1495f8cca876SEd Tanous std::to_array({arg1})); 1496f8cca876SEd Tanous } 1497f8cca876SEd Tanous 1498f8cca876SEd Tanous void resourceExhaustion(crow::Response& res, std::string_view arg1) 1499f8cca876SEd Tanous { 1500f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 1501f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceExhaustion(arg1)); 1502f8cca876SEd Tanous } 1503f8cca876SEd Tanous 1504f8cca876SEd Tanous /** 1505f8cca876SEd Tanous * @internal 1506f4c4dcf4SKowalski, Kamil * @brief Formats StringValueTooLong message into JSON 1507f4c4dcf4SKowalski, Kamil * 1508f4c4dcf4SKowalski, Kamil * See header file for more information 1509f4c4dcf4SKowalski, Kamil * @endinternal 1510f4c4dcf4SKowalski, Kamil */ 151110cf50dcSEd Tanous nlohmann::json::object_t stringValueTooLong(std::string_view arg1, 151210cf50dcSEd Tanous uint64_t arg2) 15131abe55efSEd Tanous { 15147ccfe684SEd Tanous std::string arg2Str = std::to_string(arg2); 15154a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::stringValueTooLong, 15167ccfe684SEd Tanous std::to_array<std::string_view>({arg1, arg2Str})); 1517b5c07418SJames Feist } 1518b5c07418SJames Feist 1519644cdcb8SEd Tanous void stringValueTooLong(crow::Response& res, std::string_view arg1, 1520644cdcb8SEd Tanous uint64_t arg2) 1521b5c07418SJames Feist { 1522b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1523b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, stringValueTooLong(arg1, arg2)); 1524f4c4dcf4SKowalski, Kamil } 1525f4c4dcf4SKowalski, Kamil 1526f4c4dcf4SKowalski, Kamil /** 1527f4c4dcf4SKowalski, Kamil * @internal 1528f8cca876SEd Tanous * @brief Formats StringValueTooShort message into JSON 1529f8cca876SEd Tanous * 1530f8cca876SEd Tanous * See header file for more information 1531f8cca876SEd Tanous * @endinternal 1532f8cca876SEd Tanous */ 153310cf50dcSEd Tanous nlohmann::json::object_t stringValueTooShort(std::string_view arg1, 153410cf50dcSEd Tanous std::string_view arg2) 1535f8cca876SEd Tanous { 15364a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::stringValueTooShort, 1537f8cca876SEd Tanous std::to_array({arg1, arg2})); 1538f8cca876SEd Tanous } 1539f8cca876SEd Tanous 1540f8cca876SEd Tanous void stringValueTooShort(crow::Response& res, std::string_view arg1, 1541f8cca876SEd Tanous std::string_view arg2) 1542f8cca876SEd Tanous { 1543f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1544f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, stringValueTooShort(arg1, arg2)); 1545f8cca876SEd Tanous } 1546f8cca876SEd Tanous 1547f8cca876SEd Tanous /** 1548f8cca876SEd Tanous * @internal 1549cc9139ecSJason M. Bills * @brief Formats SessionTerminated message into JSON 1550cc9139ecSJason M. Bills * 1551cc9139ecSJason M. Bills * See header file for more information 1552cc9139ecSJason M. Bills * @endinternal 1553cc9139ecSJason M. Bills */ 155410cf50dcSEd Tanous nlohmann::json::object_t sessionTerminated() 1555cc9139ecSJason M. Bills { 15564a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::sessionTerminated, {}); 1557b5c07418SJames Feist } 1558b5c07418SJames Feist 1559b5c07418SJames Feist void sessionTerminated(crow::Response& res) 1560b5c07418SJames Feist { 1561b5c07418SJames Feist res.result(boost::beast::http::status::ok); 1562b5c07418SJames Feist addMessageToJsonRoot(res.jsonValue, sessionTerminated()); 1563cc9139ecSJason M. Bills } 1564cc9139ecSJason M. Bills 1565cc9139ecSJason M. Bills /** 1566cc9139ecSJason M. Bills * @internal 1567684bb4b8SJason M. Bills * @brief Formats SubscriptionTerminated message into JSON 1568684bb4b8SJason M. Bills * 1569684bb4b8SJason M. Bills * See header file for more information 1570684bb4b8SJason M. Bills * @endinternal 1571684bb4b8SJason M. Bills */ 157210cf50dcSEd Tanous nlohmann::json::object_t subscriptionTerminated() 1573684bb4b8SJason M. Bills { 15744a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::subscriptionTerminated, {}); 1575684bb4b8SJason M. Bills } 1576684bb4b8SJason M. Bills 1577684bb4b8SJason M. Bills void subscriptionTerminated(crow::Response& res) 1578684bb4b8SJason M. Bills { 1579684bb4b8SJason M. Bills res.result(boost::beast::http::status::ok); 1580684bb4b8SJason M. Bills addMessageToJsonRoot(res.jsonValue, subscriptionTerminated()); 1581684bb4b8SJason M. Bills } 1582684bb4b8SJason M. Bills 1583684bb4b8SJason M. Bills /** 1584684bb4b8SJason M. Bills * @internal 1585cc9139ecSJason M. Bills * @brief Formats ResourceTypeIncompatible message into JSON 1586cc9139ecSJason M. Bills * 1587cc9139ecSJason M. Bills * See header file for more information 1588cc9139ecSJason M. Bills * @endinternal 1589cc9139ecSJason M. Bills */ 159010cf50dcSEd Tanous nlohmann::json::object_t resourceTypeIncompatible(std::string_view arg1, 15911668ce6dSEd Tanous std::string_view arg2) 1592cc9139ecSJason M. Bills { 15934a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceTypeIncompatible, 15941668ce6dSEd Tanous std::to_array({arg1, arg2})); 1595b5c07418SJames Feist } 1596b5c07418SJames Feist 15971668ce6dSEd Tanous void resourceTypeIncompatible(crow::Response& res, std::string_view arg1, 15981668ce6dSEd Tanous std::string_view arg2) 1599b5c07418SJames Feist { 1600b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1601b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, resourceTypeIncompatible(arg1, arg2)); 1602cc9139ecSJason M. Bills } 1603cc9139ecSJason M. Bills 1604cc9139ecSJason M. Bills /** 1605cc9139ecSJason M. Bills * @internal 1606f8cca876SEd Tanous * @brief Formats PasswordChangeRequired message into JSON 1607f8cca876SEd Tanous * 1608f8cca876SEd Tanous * See header file for more information 1609f8cca876SEd Tanous * @endinternal 1610f8cca876SEd Tanous */ 161110cf50dcSEd Tanous nlohmann::json::object_t passwordChangeRequired( 161210cf50dcSEd Tanous const boost::urls::url_view_base& arg1) 1613f8cca876SEd Tanous { 16144a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::passwordChangeRequired, 1615f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1616f8cca876SEd Tanous } 1617f8cca876SEd Tanous 1618f8cca876SEd Tanous void passwordChangeRequired(crow::Response& res, 1619f8cca876SEd Tanous const boost::urls::url_view_base& arg1) 1620f8cca876SEd Tanous { 1621f8cca876SEd Tanous addMessageToJsonRoot(res.jsonValue, passwordChangeRequired(arg1)); 1622f8cca876SEd Tanous } 1623f8cca876SEd Tanous 1624f8cca876SEd Tanous /** 1625f8cca876SEd Tanous * @internal 1626684bb4b8SJason M. Bills * @brief Formats ResetRequired message into JSON 1627684bb4b8SJason M. Bills * 1628684bb4b8SJason M. Bills * See header file for more information 1629684bb4b8SJason M. Bills * @endinternal 1630684bb4b8SJason M. Bills */ 163110cf50dcSEd Tanous nlohmann::json::object_t resetRequired(const boost::urls::url_view_base& arg1, 16324a7fbefdSEd Tanous std::string_view arg2) 1633684bb4b8SJason M. Bills { 16344a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resetRequired, 1635079360aeSEd Tanous std::to_array<std::string_view>({arg1.buffer(), arg2})); 1636684bb4b8SJason M. Bills } 1637684bb4b8SJason M. Bills 16384a7fbefdSEd Tanous void resetRequired(crow::Response& res, const boost::urls::url_view_base& arg1, 16391668ce6dSEd Tanous std::string_view arg2) 1640684bb4b8SJason M. Bills { 1641684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1642684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, resetRequired(arg1, arg2)); 1643684bb4b8SJason M. Bills } 1644684bb4b8SJason M. Bills 1645684bb4b8SJason M. Bills /** 1646684bb4b8SJason M. Bills * @internal 1647f8cca876SEd Tanous * @brief Formats ResetRecommended message into JSON 1648f8cca876SEd Tanous * 1649f8cca876SEd Tanous * See header file for more information 1650f8cca876SEd Tanous * @endinternal 1651f8cca876SEd Tanous */ 165210cf50dcSEd Tanous nlohmann::json::object_t resetRecommended(std::string_view arg1, 165310cf50dcSEd Tanous std::string_view arg2) 1654f8cca876SEd Tanous { 16554a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resetRecommended, 1656f8cca876SEd Tanous std::to_array({arg1, arg2})); 1657f8cca876SEd Tanous } 1658f8cca876SEd Tanous 1659f8cca876SEd Tanous void resetRecommended(crow::Response& res, std::string_view arg1, 1660f8cca876SEd Tanous std::string_view arg2) 1661f8cca876SEd Tanous { 1662f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1663f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resetRecommended(arg1, arg2)); 1664f8cca876SEd Tanous } 1665f8cca876SEd Tanous 1666f8cca876SEd Tanous /** 1667f8cca876SEd Tanous * @internal 1668684bb4b8SJason M. Bills * @brief Formats ChassisPowerStateOnRequired message into JSON 1669684bb4b8SJason M. Bills * 1670684bb4b8SJason M. Bills * See header file for more information 1671684bb4b8SJason M. Bills * @endinternal 1672684bb4b8SJason M. Bills */ 167310cf50dcSEd Tanous nlohmann::json::object_t chassisPowerStateOnRequired(std::string_view arg1) 1674684bb4b8SJason M. Bills { 16754a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::chassisPowerStateOnRequired, 16761668ce6dSEd Tanous std::to_array({arg1})); 1677684bb4b8SJason M. Bills } 1678684bb4b8SJason M. Bills 16791668ce6dSEd Tanous void chassisPowerStateOnRequired(crow::Response& res, std::string_view arg1) 1680684bb4b8SJason M. Bills { 1681684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1682684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, chassisPowerStateOnRequired(arg1)); 1683684bb4b8SJason M. Bills } 1684684bb4b8SJason M. Bills 1685684bb4b8SJason M. Bills /** 1686684bb4b8SJason M. Bills * @internal 1687684bb4b8SJason M. Bills * @brief Formats ChassisPowerStateOffRequired message into JSON 1688684bb4b8SJason M. Bills * 1689684bb4b8SJason M. Bills * See header file for more information 1690684bb4b8SJason M. Bills * @endinternal 1691684bb4b8SJason M. Bills */ 169210cf50dcSEd Tanous nlohmann::json::object_t chassisPowerStateOffRequired(std::string_view arg1) 1693684bb4b8SJason M. Bills { 1694b6cd31e1SEd Tanous return getLog( 16954a102cd4SPatrick Williams redfish::registries::Base::Index::chassisPowerStateOffRequired, 16961668ce6dSEd Tanous std::to_array({arg1})); 1697684bb4b8SJason M. Bills } 1698684bb4b8SJason M. Bills 16991668ce6dSEd Tanous void chassisPowerStateOffRequired(crow::Response& res, std::string_view arg1) 1700684bb4b8SJason M. Bills { 1701684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1702684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, chassisPowerStateOffRequired(arg1)); 1703684bb4b8SJason M. Bills } 1704684bb4b8SJason M. Bills 1705684bb4b8SJason M. Bills /** 1706684bb4b8SJason M. Bills * @internal 1707684bb4b8SJason M. Bills * @brief Formats PropertyValueConflict message into JSON 1708684bb4b8SJason M. Bills * 1709684bb4b8SJason M. Bills * See header file for more information 1710684bb4b8SJason M. Bills * @endinternal 1711684bb4b8SJason M. Bills */ 171210cf50dcSEd Tanous nlohmann::json::object_t propertyValueConflict(std::string_view arg1, 17131668ce6dSEd Tanous std::string_view arg2) 1714684bb4b8SJason M. Bills { 17154a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyValueConflict, 17161668ce6dSEd Tanous std::to_array({arg1, arg2})); 1717684bb4b8SJason M. Bills } 1718684bb4b8SJason M. Bills 17191668ce6dSEd Tanous void propertyValueConflict(crow::Response& res, std::string_view arg1, 17201668ce6dSEd Tanous std::string_view arg2) 1721684bb4b8SJason M. Bills { 1722684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1723684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, propertyValueConflict(arg1, arg2)); 1724684bb4b8SJason M. Bills } 1725684bb4b8SJason M. Bills 1726684bb4b8SJason M. Bills /** 1727684bb4b8SJason M. Bills * @internal 17282a6af81cSRamesh Iyyar * @brief Formats PropertyValueResourceConflict message into JSON 17292a6af81cSRamesh Iyyar * 17302a6af81cSRamesh Iyyar * See header file for more information 17312a6af81cSRamesh Iyyar * @endinternal 17322a6af81cSRamesh Iyyar */ 173310cf50dcSEd Tanous nlohmann::json::object_t propertyValueResourceConflict( 1734bd79bce8SPatrick Williams std::string_view arg1, const nlohmann::json& arg2, 17354a7fbefdSEd Tanous const boost::urls::url_view_base& arg3) 17362a6af81cSRamesh Iyyar { 1737bd79bce8SPatrick Williams std::string arg2Str = 1738034e1259SEd Tanous arg2.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 17392a6af81cSRamesh Iyyar return getLog( 17404a102cd4SPatrick Williams redfish::registries::Base::Index::propertyValueResourceConflict, 174195b3ad73SEd Tanous std::to_array<std::string_view>({arg1, arg2Str, arg3.buffer()})); 17422a6af81cSRamesh Iyyar } 17432a6af81cSRamesh Iyyar 17442a6af81cSRamesh Iyyar void propertyValueResourceConflict(crow::Response& res, std::string_view arg1, 174595b3ad73SEd Tanous const nlohmann::json& arg2, 17464a7fbefdSEd Tanous const boost::urls::url_view_base& arg3) 17472a6af81cSRamesh Iyyar { 17482a6af81cSRamesh Iyyar res.result(boost::beast::http::status::conflict); 17492a6af81cSRamesh Iyyar addMessageToErrorJson(res.jsonValue, 17502a6af81cSRamesh Iyyar propertyValueResourceConflict(arg1, arg2, arg3)); 17512a6af81cSRamesh Iyyar } 17522a6af81cSRamesh Iyyar 17532a6af81cSRamesh Iyyar /** 17542a6af81cSRamesh Iyyar * @internal 175524861a28SRamesh Iyyar * @brief Formats PropertyValueExternalConflict message into JSON 175624861a28SRamesh Iyyar * 175724861a28SRamesh Iyyar * See header file for more information 175824861a28SRamesh Iyyar * @endinternal 175924861a28SRamesh Iyyar */ 176010cf50dcSEd Tanous nlohmann::json::object_t propertyValueExternalConflict( 176110cf50dcSEd Tanous std::string_view arg1, const nlohmann::json& arg2) 176224861a28SRamesh Iyyar { 1763bd79bce8SPatrick Williams std::string arg2Str = 1764034e1259SEd Tanous arg2.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 176524861a28SRamesh Iyyar return getLog( 17664a102cd4SPatrick Williams redfish::registries::Base::Index::propertyValueExternalConflict, 176795b3ad73SEd Tanous std::to_array<std::string_view>({arg1, arg2Str})); 176824861a28SRamesh Iyyar } 176924861a28SRamesh Iyyar 177024861a28SRamesh Iyyar void propertyValueExternalConflict(crow::Response& res, std::string_view arg1, 177195b3ad73SEd Tanous const nlohmann::json& arg2) 177224861a28SRamesh Iyyar { 177324861a28SRamesh Iyyar res.result(boost::beast::http::status::conflict); 177424861a28SRamesh Iyyar addMessageToErrorJson(res.jsonValue, 177524861a28SRamesh Iyyar propertyValueExternalConflict(arg1, arg2)); 177624861a28SRamesh Iyyar } 177724861a28SRamesh Iyyar 177824861a28SRamesh Iyyar /** 177924861a28SRamesh Iyyar * @internal 1780684bb4b8SJason M. Bills * @brief Formats PropertyValueIncorrect message into JSON 1781684bb4b8SJason M. Bills * 1782684bb4b8SJason M. Bills * See header file for more information 1783684bb4b8SJason M. Bills * @endinternal 1784684bb4b8SJason M. Bills */ 178510cf50dcSEd Tanous nlohmann::json::object_t propertyValueIncorrect(std::string_view arg1, 1786367b3dceSGinu George const nlohmann::json& arg2) 1787684bb4b8SJason M. Bills { 1788bd79bce8SPatrick Williams std::string arg2Str = 1789034e1259SEd Tanous arg2.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 17904a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyValueIncorrect, 1791367b3dceSGinu George std::to_array<std::string_view>({arg1, arg2Str})); 1792684bb4b8SJason M. Bills } 1793684bb4b8SJason M. Bills 1794367b3dceSGinu George void propertyValueIncorrect(crow::Response& res, std::string_view arg1, 1795367b3dceSGinu George const nlohmann::json& arg2) 1796684bb4b8SJason M. Bills { 1797684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1798684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, propertyValueIncorrect(arg1, arg2)); 1799684bb4b8SJason M. Bills } 1800684bb4b8SJason M. Bills 1801684bb4b8SJason M. Bills /** 1802684bb4b8SJason M. Bills * @internal 1803684bb4b8SJason M. Bills * @brief Formats ResourceCreationConflict message into JSON 1804684bb4b8SJason M. Bills * 1805684bb4b8SJason M. Bills * See header file for more information 1806684bb4b8SJason M. Bills * @endinternal 1807684bb4b8SJason M. Bills */ 180810cf50dcSEd Tanous nlohmann::json::object_t resourceCreationConflict( 180910cf50dcSEd Tanous const boost::urls::url_view_base& arg1) 1810684bb4b8SJason M. Bills { 18114a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceCreationConflict, 1812079360aeSEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1813684bb4b8SJason M. Bills } 1814684bb4b8SJason M. Bills 18154a7fbefdSEd Tanous void resourceCreationConflict(crow::Response& res, 18164a7fbefdSEd Tanous const boost::urls::url_view_base& arg1) 1817684bb4b8SJason M. Bills { 1818684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1819684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, resourceCreationConflict(arg1)); 1820684bb4b8SJason M. Bills } 1821684bb4b8SJason M. Bills 1822684bb4b8SJason M. Bills /** 1823684bb4b8SJason M. Bills * @internal 1824f8cca876SEd Tanous * @brief Formats ActionParameterValueConflict message into JSON 1825f8cca876SEd Tanous * 1826f8cca876SEd Tanous * See header file for more information 1827f8cca876SEd Tanous * @endinternal 1828f8cca876SEd Tanous */ 182910cf50dcSEd Tanous nlohmann::json::object_t actionParameterValueConflict(std::string_view arg1, 1830504af5a0SPatrick Williams std::string_view arg2) 1831f8cca876SEd Tanous { 1832f8cca876SEd Tanous return getLog( 18334a102cd4SPatrick Williams redfish::registries::Base::Index::actionParameterValueConflict, 1834f8cca876SEd Tanous std::to_array({arg1, arg2})); 1835f8cca876SEd Tanous } 1836f8cca876SEd Tanous 1837f8cca876SEd Tanous void actionParameterValueConflict(crow::Response& res, std::string_view arg1, 1838f8cca876SEd Tanous std::string_view arg2) 1839f8cca876SEd Tanous { 1840f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1841f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 1842f8cca876SEd Tanous actionParameterValueConflict(arg1, arg2)); 1843f8cca876SEd Tanous } 1844f8cca876SEd Tanous 1845f8cca876SEd Tanous /** 1846f8cca876SEd Tanous * @internal 1847684bb4b8SJason M. Bills * @brief Formats MaximumErrorsExceeded message into JSON 1848684bb4b8SJason M. Bills * 1849684bb4b8SJason M. Bills * See header file for more information 1850684bb4b8SJason M. Bills * @endinternal 1851684bb4b8SJason M. Bills */ 185210cf50dcSEd Tanous nlohmann::json::object_t maximumErrorsExceeded() 1853684bb4b8SJason M. Bills { 18544a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::maximumErrorsExceeded, {}); 1855684bb4b8SJason M. Bills } 1856684bb4b8SJason M. Bills 1857684bb4b8SJason M. Bills void maximumErrorsExceeded(crow::Response& res) 1858684bb4b8SJason M. Bills { 1859684bb4b8SJason M. Bills res.result(boost::beast::http::status::internal_server_error); 1860684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, maximumErrorsExceeded()); 1861684bb4b8SJason M. Bills } 1862684bb4b8SJason M. Bills 1863684bb4b8SJason M. Bills /** 1864684bb4b8SJason M. Bills * @internal 1865684bb4b8SJason M. Bills * @brief Formats PreconditionFailed message into JSON 1866684bb4b8SJason M. Bills * 1867684bb4b8SJason M. Bills * See header file for more information 1868684bb4b8SJason M. Bills * @endinternal 1869684bb4b8SJason M. Bills */ 187010cf50dcSEd Tanous nlohmann::json::object_t preconditionFailed() 1871684bb4b8SJason M. Bills { 18724a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::preconditionFailed, {}); 1873684bb4b8SJason M. Bills } 1874684bb4b8SJason M. Bills 1875684bb4b8SJason M. Bills void preconditionFailed(crow::Response& res) 1876684bb4b8SJason M. Bills { 18774df1bee0SEd Tanous res.result(boost::beast::http::status::precondition_failed); 1878684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, preconditionFailed()); 1879684bb4b8SJason M. Bills } 1880684bb4b8SJason M. Bills 1881684bb4b8SJason M. Bills /** 1882684bb4b8SJason M. Bills * @internal 1883684bb4b8SJason M. Bills * @brief Formats PreconditionRequired message into JSON 1884684bb4b8SJason M. Bills * 1885684bb4b8SJason M. Bills * See header file for more information 1886684bb4b8SJason M. Bills * @endinternal 1887684bb4b8SJason M. Bills */ 188810cf50dcSEd Tanous nlohmann::json::object_t preconditionRequired() 1889684bb4b8SJason M. Bills { 18904a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::preconditionRequired, {}); 1891684bb4b8SJason M. Bills } 1892684bb4b8SJason M. Bills 1893684bb4b8SJason M. Bills void preconditionRequired(crow::Response& res) 1894684bb4b8SJason M. Bills { 1895684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1896684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, preconditionRequired()); 1897684bb4b8SJason M. Bills } 1898684bb4b8SJason M. Bills 1899684bb4b8SJason M. Bills /** 1900684bb4b8SJason M. Bills * @internal 1901f8cca876SEd Tanous * @brief Formats HeaderMissing message into JSON 1902f8cca876SEd Tanous * 1903f8cca876SEd Tanous * See header file for more information 1904f8cca876SEd Tanous * @endinternal 1905f8cca876SEd Tanous */ 190610cf50dcSEd Tanous nlohmann::json::object_t headerMissing(std::string_view arg1) 1907f8cca876SEd Tanous { 19084a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::headerMissing, 1909f8cca876SEd Tanous std::to_array({arg1})); 1910f8cca876SEd Tanous } 1911f8cca876SEd Tanous 1912f8cca876SEd Tanous void headerMissing(crow::Response& res, std::string_view arg1) 1913f8cca876SEd Tanous { 1914f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1915f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, headerMissing(arg1)); 1916f8cca876SEd Tanous } 1917f8cca876SEd Tanous 1918f8cca876SEd Tanous /** 1919f8cca876SEd Tanous * @internal 1920f8cca876SEd Tanous * @brief Formats HeaderInvalid message into JSON 1921f8cca876SEd Tanous * 1922f8cca876SEd Tanous * See header file for more information 1923f8cca876SEd Tanous * @endinternal 1924f8cca876SEd Tanous */ 192510cf50dcSEd Tanous nlohmann::json::object_t headerInvalid(std::string_view arg1) 1926f8cca876SEd Tanous { 19274a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::headerInvalid, 1928f8cca876SEd Tanous std::to_array({arg1})); 1929f8cca876SEd Tanous } 1930f8cca876SEd Tanous 1931f8cca876SEd Tanous void headerInvalid(crow::Response& res, std::string_view arg1) 1932f8cca876SEd Tanous { 1933f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1934f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, headerInvalid(arg1)); 1935f8cca876SEd Tanous } 1936f8cca876SEd Tanous 1937f8cca876SEd Tanous /** 1938f8cca876SEd Tanous * @internal 1939684bb4b8SJason M. Bills * @brief Formats OperationFailed message into JSON 1940684bb4b8SJason M. Bills * 1941684bb4b8SJason M. Bills * See header file for more information 1942684bb4b8SJason M. Bills * @endinternal 1943684bb4b8SJason M. Bills */ 194410cf50dcSEd Tanous nlohmann::json::object_t operationFailed() 1945684bb4b8SJason M. Bills { 19464a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::operationFailed, {}); 1947684bb4b8SJason M. Bills } 1948684bb4b8SJason M. Bills 1949684bb4b8SJason M. Bills void operationFailed(crow::Response& res) 1950684bb4b8SJason M. Bills { 19518868776eSEd Tanous res.result(boost::beast::http::status::bad_gateway); 1952684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, operationFailed()); 1953684bb4b8SJason M. Bills } 1954684bb4b8SJason M. Bills 1955684bb4b8SJason M. Bills /** 1956684bb4b8SJason M. Bills * @internal 1957684bb4b8SJason M. Bills * @brief Formats OperationTimeout message into JSON 1958684bb4b8SJason M. Bills * 1959684bb4b8SJason M. Bills * See header file for more information 1960684bb4b8SJason M. Bills * @endinternal 1961684bb4b8SJason M. Bills */ 196210cf50dcSEd Tanous nlohmann::json::object_t operationTimeout() 1963684bb4b8SJason M. Bills { 19644a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::operationTimeout, {}); 1965684bb4b8SJason M. Bills } 1966684bb4b8SJason M. Bills 1967684bb4b8SJason M. Bills void operationTimeout(crow::Response& res) 1968684bb4b8SJason M. Bills { 1969684bb4b8SJason M. Bills res.result(boost::beast::http::status::internal_server_error); 1970684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, operationTimeout()); 1971684bb4b8SJason M. Bills } 1972684bb4b8SJason M. Bills 1973684bb4b8SJason M. Bills /** 1974684bb4b8SJason M. Bills * @internal 197544c70412SEd Tanous * @brief Formats OperationNotAllowed message into JSON 197644c70412SEd Tanous * 197744c70412SEd Tanous * See header file for more information 197844c70412SEd Tanous * @endinternal 197944c70412SEd Tanous */ 198010cf50dcSEd Tanous nlohmann::json::object_t operationNotAllowed() 198144c70412SEd Tanous { 19824a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::operationNotAllowed, {}); 198344c70412SEd Tanous } 198444c70412SEd Tanous 198544c70412SEd Tanous void operationNotAllowed(crow::Response& res) 198644c70412SEd Tanous { 198744c70412SEd Tanous res.result(boost::beast::http::status::method_not_allowed); 198844c70412SEd Tanous addMessageToErrorJson(res.jsonValue, operationNotAllowed()); 198944c70412SEd Tanous } 199044c70412SEd Tanous 1991600af5f1SAppaRao Puli /** 1992600af5f1SAppaRao Puli * @internal 19937ccfe684SEd Tanous * @brief Formats UndeterminedFault message into JSON 19947ccfe684SEd Tanous * 19957ccfe684SEd Tanous * See header file for more information 19967ccfe684SEd Tanous * @endinternal 19977ccfe684SEd Tanous */ 199810cf50dcSEd Tanous nlohmann::json::object_t undeterminedFault(std::string_view arg1) 19997ccfe684SEd Tanous { 20004a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::undeterminedFault, 20017ccfe684SEd Tanous std::to_array({arg1})); 20027ccfe684SEd Tanous } 20037ccfe684SEd Tanous 20047ccfe684SEd Tanous void undeterminedFault(crow::Response& res, std::string_view arg1) 20057ccfe684SEd Tanous { 20067ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 20077ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, undeterminedFault(arg1)); 20087ccfe684SEd Tanous } 20097ccfe684SEd Tanous 20107ccfe684SEd Tanous /** 20117ccfe684SEd Tanous * @internal 20127ccfe684SEd Tanous * @brief Formats ConditionInRelatedResource message into JSON 20137ccfe684SEd Tanous * 20147ccfe684SEd Tanous * See header file for more information 20157ccfe684SEd Tanous * @endinternal 20167ccfe684SEd Tanous */ 201710cf50dcSEd Tanous nlohmann::json::object_t conditionInRelatedResource() 20187ccfe684SEd Tanous { 20194a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::conditionInRelatedResource, 20207ccfe684SEd Tanous {}); 20217ccfe684SEd Tanous } 20227ccfe684SEd Tanous 20237ccfe684SEd Tanous void conditionInRelatedResource(crow::Response& res) 20247ccfe684SEd Tanous { 20257ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 20267ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, conditionInRelatedResource()); 20277ccfe684SEd Tanous } 20287ccfe684SEd Tanous 20297ccfe684SEd Tanous /** 20307ccfe684SEd Tanous * @internal 20317ccfe684SEd Tanous * @brief Formats RestrictedRole message into JSON 20327ccfe684SEd Tanous * 20337ccfe684SEd Tanous * See header file for more information 20347ccfe684SEd Tanous * @endinternal 20357ccfe684SEd Tanous */ 203610cf50dcSEd Tanous nlohmann::json::object_t restrictedRole(std::string_view arg1) 20377ccfe684SEd Tanous { 20384a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::restrictedRole, 20397ccfe684SEd Tanous std::to_array({arg1})); 20407ccfe684SEd Tanous } 20417ccfe684SEd Tanous 20427ccfe684SEd Tanous void restrictedRole(crow::Response& res, std::string_view arg1) 20437ccfe684SEd Tanous { 20447f84d8c6SMyung Bae res.result(boost::beast::http::status::forbidden); 20457ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, restrictedRole(arg1)); 20467ccfe684SEd Tanous } 20477ccfe684SEd Tanous 20487ccfe684SEd Tanous /** 20497ccfe684SEd Tanous * @internal 20507ccfe684SEd Tanous * @brief Formats RestrictedPrivilege message into JSON 20517ccfe684SEd Tanous * 20527ccfe684SEd Tanous * See header file for more information 20537ccfe684SEd Tanous * @endinternal 20547ccfe684SEd Tanous */ 205510cf50dcSEd Tanous nlohmann::json::object_t restrictedPrivilege(std::string_view arg1) 20567ccfe684SEd Tanous { 20574a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::restrictedPrivilege, 20587ccfe684SEd Tanous std::to_array({arg1})); 20597ccfe684SEd Tanous } 20607ccfe684SEd Tanous 20617ccfe684SEd Tanous void restrictedPrivilege(crow::Response& res, std::string_view arg1) 20627ccfe684SEd Tanous { 20637ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 20647ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, restrictedPrivilege(arg1)); 20657ccfe684SEd Tanous } 20667ccfe684SEd Tanous 20677ccfe684SEd Tanous /** 20687ccfe684SEd Tanous * @internal 2069f8cca876SEd Tanous * @brief Formats StrictAccountTypes message into JSON 2070f8cca876SEd Tanous * 2071f8cca876SEd Tanous * See header file for more information 2072f8cca876SEd Tanous * @endinternal 2073f8cca876SEd Tanous */ 207410cf50dcSEd Tanous nlohmann::json::object_t strictAccountTypes(std::string_view arg1) 2075f8cca876SEd Tanous { 20764a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::strictAccountTypes, 2077f8cca876SEd Tanous std::to_array({arg1})); 2078f8cca876SEd Tanous } 2079f8cca876SEd Tanous 2080f8cca876SEd Tanous void strictAccountTypes(crow::Response& res, std::string_view arg1) 2081f8cca876SEd Tanous { 2082f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 2083f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, strictAccountTypes(arg1)); 2084f8cca876SEd Tanous } 2085f8cca876SEd Tanous 2086f8cca876SEd Tanous /** 2087f8cca876SEd Tanous * @internal 20887ccfe684SEd Tanous * @brief Formats PropertyDeprecated message into JSON 20897ccfe684SEd Tanous * 20907ccfe684SEd Tanous * See header file for more information 20917ccfe684SEd Tanous * @endinternal 20927ccfe684SEd Tanous */ 209310cf50dcSEd Tanous nlohmann::json::object_t propertyDeprecated(std::string_view arg1) 20947ccfe684SEd Tanous { 20954a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyDeprecated, 20967ccfe684SEd Tanous std::to_array({arg1})); 20977ccfe684SEd Tanous } 20987ccfe684SEd Tanous 20997ccfe684SEd Tanous void propertyDeprecated(crow::Response& res, std::string_view arg1) 21007ccfe684SEd Tanous { 21017ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 21027ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, propertyDeprecated(arg1)); 21037ccfe684SEd Tanous } 21047ccfe684SEd Tanous 21057ccfe684SEd Tanous /** 21067ccfe684SEd Tanous * @internal 21077ccfe684SEd Tanous * @brief Formats ResourceDeprecated message into JSON 21087ccfe684SEd Tanous * 21097ccfe684SEd Tanous * See header file for more information 21107ccfe684SEd Tanous * @endinternal 21117ccfe684SEd Tanous */ 211210cf50dcSEd Tanous nlohmann::json::object_t resourceDeprecated(std::string_view arg1) 21137ccfe684SEd Tanous { 21144a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceDeprecated, 21157ccfe684SEd Tanous std::to_array({arg1})); 21167ccfe684SEd Tanous } 21177ccfe684SEd Tanous 21187ccfe684SEd Tanous void resourceDeprecated(crow::Response& res, std::string_view arg1) 21197ccfe684SEd Tanous { 21207ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 21217ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, resourceDeprecated(arg1)); 21227ccfe684SEd Tanous } 21237ccfe684SEd Tanous 21247ccfe684SEd Tanous /** 21257ccfe684SEd Tanous * @internal 21267ccfe684SEd Tanous * @brief Formats PropertyValueDeprecated message into JSON 21277ccfe684SEd Tanous * 21287ccfe684SEd Tanous * See header file for more information 21297ccfe684SEd Tanous * @endinternal 21307ccfe684SEd Tanous */ 213110cf50dcSEd Tanous nlohmann::json::object_t propertyValueDeprecated(std::string_view arg1, 21327ccfe684SEd Tanous std::string_view arg2) 21337ccfe684SEd Tanous { 21344a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyValueDeprecated, 21357ccfe684SEd Tanous std::to_array({arg1, arg2})); 21367ccfe684SEd Tanous } 21377ccfe684SEd Tanous 21387ccfe684SEd Tanous void propertyValueDeprecated(crow::Response& res, std::string_view arg1, 21397ccfe684SEd Tanous std::string_view arg2) 21407ccfe684SEd Tanous { 21417ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 21427ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, propertyValueDeprecated(arg1, arg2)); 21437ccfe684SEd Tanous } 21447ccfe684SEd Tanous 21457ccfe684SEd Tanous /** 21467ccfe684SEd Tanous * @internal 21477ccfe684SEd Tanous * @brief Formats ActionDeprecated message into JSON 21487ccfe684SEd Tanous * 21497ccfe684SEd Tanous * See header file for more information 21507ccfe684SEd Tanous * @endinternal 21517ccfe684SEd Tanous */ 215210cf50dcSEd Tanous nlohmann::json::object_t actionDeprecated(std::string_view arg1) 21537ccfe684SEd Tanous { 21544a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::actionDeprecated, 21557ccfe684SEd Tanous std::to_array({arg1})); 21567ccfe684SEd Tanous } 21577ccfe684SEd Tanous 21587ccfe684SEd Tanous void actionDeprecated(crow::Response& res, std::string_view arg1) 21597ccfe684SEd Tanous { 21607ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 21617ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, actionDeprecated(arg1)); 21627ccfe684SEd Tanous } 21637ccfe684SEd Tanous 21647ccfe684SEd Tanous /** 21657ccfe684SEd Tanous * @internal 21667ccfe684SEd Tanous * @brief Formats NetworkNameResolutionNotConfigured message into JSON 21677ccfe684SEd Tanous * 21687ccfe684SEd Tanous * See header file for more information 21697ccfe684SEd Tanous * @endinternal 21707ccfe684SEd Tanous */ 217110cf50dcSEd Tanous nlohmann::json::object_t networkNameResolutionNotConfigured() 21727ccfe684SEd Tanous { 21737ccfe684SEd Tanous return getLog( 21744a102cd4SPatrick Williams redfish::registries::Base::Index::networkNameResolutionNotConfigured, 21757ccfe684SEd Tanous {}); 21767ccfe684SEd Tanous } 21777ccfe684SEd Tanous 21787ccfe684SEd Tanous void networkNameResolutionNotConfigured(crow::Response& res) 21797ccfe684SEd Tanous { 21807ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 21817ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, networkNameResolutionNotConfigured()); 21827ccfe684SEd Tanous } 21837ccfe684SEd Tanous 21847ccfe684SEd Tanous /** 21857ccfe684SEd Tanous * @internal 21867ccfe684SEd Tanous * @brief Formats NetworkNameResolutionNotSupported message into JSON 21877ccfe684SEd Tanous * 21887ccfe684SEd Tanous * See header file for more information 21897ccfe684SEd Tanous * @endinternal 21907ccfe684SEd Tanous */ 219110cf50dcSEd Tanous nlohmann::json::object_t networkNameResolutionNotSupported() 21927ccfe684SEd Tanous { 21937ccfe684SEd Tanous return getLog( 21944a102cd4SPatrick Williams redfish::registries::Base::Index::networkNameResolutionNotSupported, 21957ccfe684SEd Tanous {}); 21967ccfe684SEd Tanous } 21977ccfe684SEd Tanous 21987ccfe684SEd Tanous void networkNameResolutionNotSupported(crow::Response& res) 21997ccfe684SEd Tanous { 22007ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 22017ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, networkNameResolutionNotSupported()); 22027ccfe684SEd Tanous } 22037ccfe684SEd Tanous 22047ccfe684SEd Tanous /** 22057ccfe684SEd Tanous * @internal 2206f8cca876SEd Tanous * @brief Formats ServiceDisabled message into JSON 2207f8cca876SEd Tanous * 2208f8cca876SEd Tanous * See header file for more information 2209f8cca876SEd Tanous * @endinternal 2210f8cca876SEd Tanous */ 221110cf50dcSEd Tanous nlohmann::json::object_t serviceDisabled(std::string_view arg1) 2212f8cca876SEd Tanous { 22134a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::serviceDisabled, 2214f8cca876SEd Tanous std::to_array({arg1})); 2215f8cca876SEd Tanous } 2216f8cca876SEd Tanous 2217f8cca876SEd Tanous void serviceDisabled(crow::Response& res, std::string_view arg1) 2218f8cca876SEd Tanous { 2219f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 2220f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, serviceDisabled(arg1)); 2221f8cca876SEd Tanous } 2222f8cca876SEd Tanous 2223f8cca876SEd Tanous /** 2224f8cca876SEd Tanous * @internal 2225f8cca876SEd Tanous * @brief Formats EventBufferExceeded message into JSON 2226f8cca876SEd Tanous * 2227f8cca876SEd Tanous * See header file for more information 2228f8cca876SEd Tanous * @endinternal 2229f8cca876SEd Tanous */ 223010cf50dcSEd Tanous nlohmann::json::object_t eventBufferExceeded() 2231f8cca876SEd Tanous { 22324a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::eventBufferExceeded, {}); 2233f8cca876SEd Tanous } 2234f8cca876SEd Tanous 2235f8cca876SEd Tanous void eventBufferExceeded(crow::Response& res) 2236f8cca876SEd Tanous { 2237f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 2238f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, eventBufferExceeded()); 2239f8cca876SEd Tanous } 2240f8cca876SEd Tanous 2241f8cca876SEd Tanous /** 2242f8cca876SEd Tanous * @internal 22437ccfe684SEd Tanous * @brief Formats AuthenticationTokenRequired message into JSON 22447ccfe684SEd Tanous * 22457ccfe684SEd Tanous * See header file for more information 22467ccfe684SEd Tanous * @endinternal 22477ccfe684SEd Tanous */ 224810cf50dcSEd Tanous nlohmann::json::object_t authenticationTokenRequired() 22497ccfe684SEd Tanous { 22504a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::authenticationTokenRequired, 22517ccfe684SEd Tanous {}); 22527ccfe684SEd Tanous } 22537ccfe684SEd Tanous 22547ccfe684SEd Tanous void authenticationTokenRequired(crow::Response& res) 22557ccfe684SEd Tanous { 22567ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 22577ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, authenticationTokenRequired()); 22587ccfe684SEd Tanous } 22597ccfe684SEd Tanous 22607ccfe684SEd Tanous /** 22617ccfe684SEd Tanous * @internal 22627ccfe684SEd Tanous * @brief Formats OneTimePasscodeSent message into JSON 22637ccfe684SEd Tanous * 22647ccfe684SEd Tanous * See header file for more information 22657ccfe684SEd Tanous * @endinternal 22667ccfe684SEd Tanous */ 226710cf50dcSEd Tanous nlohmann::json::object_t oneTimePasscodeSent(std::string_view arg1) 22687ccfe684SEd Tanous { 22694a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::oneTimePasscodeSent, 22707ccfe684SEd Tanous std::to_array({arg1})); 22717ccfe684SEd Tanous } 22727ccfe684SEd Tanous 22737ccfe684SEd Tanous void oneTimePasscodeSent(crow::Response& res, std::string_view arg1) 22747ccfe684SEd Tanous { 22757ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 22767ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, oneTimePasscodeSent(arg1)); 22777ccfe684SEd Tanous } 22787ccfe684SEd Tanous 22797ccfe684SEd Tanous /** 22807ccfe684SEd Tanous * @internal 22817ccfe684SEd Tanous * @brief Formats LicenseRequired message into JSON 22827ccfe684SEd Tanous * 22837ccfe684SEd Tanous * See header file for more information 22847ccfe684SEd Tanous * @endinternal 22857ccfe684SEd Tanous */ 228610cf50dcSEd Tanous nlohmann::json::object_t licenseRequired(std::string_view arg1) 22877ccfe684SEd Tanous { 22884a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::licenseRequired, 22897ccfe684SEd Tanous std::to_array({arg1})); 22907ccfe684SEd Tanous } 22917ccfe684SEd Tanous 22927ccfe684SEd Tanous void licenseRequired(crow::Response& res, std::string_view arg1) 22937ccfe684SEd Tanous { 22947ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 22957ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, licenseRequired(arg1)); 22967ccfe684SEd Tanous } 22977ccfe684SEd Tanous 22987ccfe684SEd Tanous /** 22997ccfe684SEd Tanous * @internal 23007ccfe684SEd Tanous * @brief Formats PropertyModified message into JSON 23017ccfe684SEd Tanous * 23027ccfe684SEd Tanous * See header file for more information 23037ccfe684SEd Tanous * @endinternal 23047ccfe684SEd Tanous */ 230510cf50dcSEd Tanous nlohmann::json::object_t propertyModified() 23067ccfe684SEd Tanous { 23074a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyModified, {}); 23087ccfe684SEd Tanous } 23097ccfe684SEd Tanous 23107ccfe684SEd Tanous void propertyModified(crow::Response& res) 23117ccfe684SEd Tanous { 23127ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 23137ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, propertyModified()); 23147585b760SJishnu CM } 23157585b760SJishnu CM 2316f8cca876SEd Tanous /** 2317f8cca876SEd Tanous * @internal 2318f8cca876SEd Tanous * @brief Formats GenerateSecretKeyRequired message into JSON 2319f8cca876SEd Tanous * 2320f8cca876SEd Tanous * See header file for more information 2321f8cca876SEd Tanous * @endinternal 2322f8cca876SEd Tanous */ 232310cf50dcSEd Tanous nlohmann::json::object_t generateSecretKeyRequired( 232410cf50dcSEd Tanous const boost::urls::url_view_base& arg1) 2325f8cca876SEd Tanous { 23264a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::generateSecretKeyRequired, 2327f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 2328f8cca876SEd Tanous } 2329f8cca876SEd Tanous 2330f8cca876SEd Tanous void generateSecretKeyRequired(crow::Response& res, 2331f8cca876SEd Tanous const boost::urls::url_view_base& arg1) 2332f8cca876SEd Tanous { 2333f8cca876SEd Tanous res.result(boost::beast::http::status::forbidden); 2334f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, generateSecretKeyRequired(arg1)); 2335f8cca876SEd Tanous } 2336f8cca876SEd Tanous 2337f4c4dcf4SKowalski, Kamil } // namespace messages 2338d425c6f6SEd Tanous } // namespace redfish 2339