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 43*4a102cd4SPatrick Williams static nlohmann::json 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); 47*4a102cd4SPatrick Williams if (index >= redfish::registries::Base::registry.size()) 48b6cd31e1SEd Tanous { 49b6cd31e1SEd Tanous return {}; 50b6cd31e1SEd Tanous } 51*4a102cd4SPatrick Williams return getLogFromRegistry(redfish::registries::Base::header, 52*4a102cd4SPatrick 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 */ 62f8cca876SEd Tanous nlohmann::json success() 631abe55efSEd Tanous { 64*4a102cd4SPatrick 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 */ 79f8cca876SEd Tanous nlohmann::json generalError() 801abe55efSEd Tanous { 81*4a102cd4SPatrick 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 */ 97f8cca876SEd Tanous nlohmann::json created() 981abe55efSEd Tanous { 99*4a102cd4SPatrick 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 */ 115f8cca876SEd Tanous nlohmann::json noOperation() 116f8cca876SEd Tanous { 117*4a102cd4SPatrick 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 */ 1331668ce6dSEd Tanous nlohmann::json propertyDuplicate(std::string_view arg1) 1341abe55efSEd Tanous { 135*4a102cd4SPatrick 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 */ 152f8cca876SEd Tanous nlohmann::json propertyUnknown(std::string_view arg1) 1531abe55efSEd Tanous { 154*4a102cd4SPatrick 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 */ 171f8cca876SEd Tanous nlohmann::json 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); 176*4a102cd4SPatrick 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 */ 194f818b04dSEd Tanous nlohmann::json 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); 199*4a102cd4SPatrick 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 */ 217e2616cc5SEd Tanous nlohmann::json 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); 222*4a102cd4SPatrick 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 */ 24095b3ad73SEd Tanous nlohmann::json 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); 245*4a102cd4SPatrick 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 */ 263f8cca876SEd Tanous nlohmann::json propertyValueError(std::string_view arg1) 2641abe55efSEd Tanous { 265*4a102cd4SPatrick 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 */ 282f8cca876SEd Tanous nlohmann::json propertyNotWritable(std::string_view arg1) 2831abe55efSEd Tanous { 284*4a102cd4SPatrick 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 { 290f8cca876SEd Tanous res.result(boost::beast::http::status::forbidden); 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 */ 301f8cca876SEd Tanous nlohmann::json propertyNotUpdated(std::string_view arg1) 3021abe55efSEd Tanous { 303*4a102cd4SPatrick 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 */ 320f8cca876SEd Tanous nlohmann::json propertyMissing(std::string_view arg1) 321f8cca876SEd Tanous { 322*4a102cd4SPatrick 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 */ 339f8cca876SEd Tanous nlohmann::json malformedJSON() 340f8cca876SEd Tanous { 341*4a102cd4SPatrick 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 */ 357f8cca876SEd Tanous nlohmann::json invalidJSON(std::string_view arg1) 358f8cca876SEd Tanous { 359*4a102cd4SPatrick 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 */ 376f8cca876SEd Tanous nlohmann::json emptyJSON() 377f8cca876SEd Tanous { 378*4a102cd4SPatrick 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 */ 394f8cca876SEd Tanous nlohmann::json actionNotSupported(std::string_view arg1) 395f8cca876SEd Tanous { 396*4a102cd4SPatrick 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 */ 4131668ce6dSEd Tanous nlohmann::json actionParameterMissing(std::string_view arg1, 4141668ce6dSEd Tanous std::string_view arg2) 4151abe55efSEd Tanous { 416*4a102cd4SPatrick 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 */ 434f8cca876SEd Tanous nlohmann::json actionParameterDuplicate(std::string_view arg1, 435f8cca876SEd Tanous std::string_view arg2) 436f8cca876SEd Tanous { 437*4a102cd4SPatrick 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 */ 455f8cca876SEd Tanous nlohmann::json actionParameterUnknown(std::string_view arg1, 456f8cca876SEd Tanous std::string_view arg2) 457f8cca876SEd Tanous { 458*4a102cd4SPatrick 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 */ 476f8cca876SEd Tanous nlohmann::json 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( 482*4a102cd4SPatrick 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 */ 502f8cca876SEd Tanous nlohmann::json 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( 508*4a102cd4SPatrick 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 */ 528f8cca876SEd Tanous nlohmann::json actionParameterValueNotInList( 529f8cca876SEd Tanous std::string_view arg1, std::string_view arg2, std::string_view arg3) 530f8cca876SEd Tanous { 531f8cca876SEd Tanous return getLog( 532*4a102cd4SPatrick 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 */ 551f8cca876SEd Tanous nlohmann::json actionParameterValueOutOfRange( 552f8cca876SEd Tanous std::string_view arg1, std::string_view arg2, std::string_view arg3) 553f8cca876SEd Tanous { 554f8cca876SEd Tanous return getLog( 555*4a102cd4SPatrick 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 */ 575f8cca876SEd Tanous nlohmann::json 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); 580*4a102cd4SPatrick 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 */ 598f8cca876SEd Tanous nlohmann::json actionParameterNotSupported(std::string_view arg1, 599f8cca876SEd Tanous std::string_view arg2) 600f8cca876SEd Tanous { 601*4a102cd4SPatrick 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 */ 620f8cca876SEd Tanous nlohmann::json arraySizeTooLong(std::string_view arg1, uint64_t arg2) 621f8cca876SEd Tanous { 622f8cca876SEd Tanous std::string arg2Str = std::to_string(arg2); 623*4a102cd4SPatrick 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 */ 640f8cca876SEd Tanous nlohmann::json arraySizeTooShort(std::string_view arg1, std::string_view arg2) 641f8cca876SEd Tanous { 642*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::arraySizeTooShort, 643f8cca876SEd Tanous std::to_array({arg1, arg2})); 644f8cca876SEd Tanous } 645f8cca876SEd Tanous 646f8cca876SEd Tanous void arraySizeTooShort(crow::Response& res, std::string_view arg1, 647f8cca876SEd Tanous std::string_view arg2) 648f8cca876SEd Tanous { 649f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 650f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, arraySizeTooShort(arg1, arg2)); 651f8cca876SEd Tanous } 652f8cca876SEd Tanous 653f8cca876SEd Tanous /** 654f8cca876SEd Tanous * @internal 655f8cca876SEd Tanous * @brief Formats QueryParameterValueTypeError message into JSON 656f8cca876SEd Tanous * 657f8cca876SEd Tanous * See header file for more information 658f8cca876SEd Tanous * @endinternal 659f8cca876SEd Tanous */ 660f8cca876SEd Tanous nlohmann::json queryParameterValueTypeError(const nlohmann::json& arg1, 661f8cca876SEd Tanous std::string_view arg2) 662f8cca876SEd Tanous { 663f8cca876SEd Tanous std::string arg1Str = 664f8cca876SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 665f8cca876SEd Tanous return getLog( 666*4a102cd4SPatrick Williams redfish::registries::Base::Index::queryParameterValueTypeError, 667f8cca876SEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 668f8cca876SEd Tanous } 669f8cca876SEd Tanous 670f8cca876SEd Tanous void queryParameterValueTypeError( 671f8cca876SEd Tanous crow::Response& res, const nlohmann::json& arg1, std::string_view arg2) 672f8cca876SEd Tanous { 673f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 674f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 675f8cca876SEd Tanous queryParameterValueTypeError(arg1, arg2)); 676f8cca876SEd Tanous } 677f8cca876SEd Tanous 678f8cca876SEd Tanous /** 679f8cca876SEd Tanous * @internal 680f8cca876SEd Tanous * @brief Formats QueryParameterValueFormatError message into JSON 681f8cca876SEd Tanous * 682f8cca876SEd Tanous * See header file for more information 683f8cca876SEd Tanous * @endinternal 684f8cca876SEd Tanous */ 685f8cca876SEd Tanous nlohmann::json queryParameterValueFormatError(const nlohmann::json& arg1, 686f8cca876SEd Tanous std::string_view arg2) 687f8cca876SEd Tanous { 688f8cca876SEd Tanous std::string arg1Str = 689f8cca876SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 690f8cca876SEd Tanous return getLog( 691*4a102cd4SPatrick Williams redfish::registries::Base::Index::queryParameterValueFormatError, 692f8cca876SEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 693f8cca876SEd Tanous } 694f8cca876SEd Tanous 695f8cca876SEd Tanous void queryParameterValueFormatError( 696f8cca876SEd Tanous crow::Response& res, const nlohmann::json& arg1, std::string_view arg2) 697f8cca876SEd Tanous { 698f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 699f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 700f8cca876SEd Tanous queryParameterValueFormatError(arg1, arg2)); 701f8cca876SEd Tanous } 702f8cca876SEd Tanous 703f8cca876SEd Tanous /** 704f8cca876SEd Tanous * @internal 705f8cca876SEd Tanous * @brief Formats QueryParameterValueError message into JSON 706f8cca876SEd Tanous * 707f8cca876SEd Tanous * See header file for more information 708f8cca876SEd Tanous * @endinternal 709f8cca876SEd Tanous */ 710f8cca876SEd Tanous nlohmann::json queryParameterValueError(std::string_view arg1) 711f8cca876SEd Tanous { 712*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::queryParameterValueError, 713f8cca876SEd Tanous std::to_array({arg1})); 714f8cca876SEd Tanous } 715f8cca876SEd Tanous 716f8cca876SEd Tanous void queryParameterValueError(crow::Response& res, std::string_view arg1) 717f8cca876SEd Tanous { 718f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 719f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, queryParameterValueError(arg1)); 720f8cca876SEd Tanous } 721f8cca876SEd Tanous 722f8cca876SEd Tanous /** 723f8cca876SEd Tanous * @internal 724f8cca876SEd Tanous * @brief Formats QueryParameterOutOfRange message into JSON 725f8cca876SEd Tanous * 726f8cca876SEd Tanous * See header file for more information 727f8cca876SEd Tanous * @endinternal 728f8cca876SEd Tanous */ 729f8cca876SEd Tanous nlohmann::json queryParameterOutOfRange( 730f8cca876SEd Tanous std::string_view arg1, std::string_view arg2, std::string_view arg3) 731f8cca876SEd Tanous { 732*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::queryParameterOutOfRange, 733f8cca876SEd Tanous std::to_array({arg1, arg2, arg3})); 734f8cca876SEd Tanous } 735f8cca876SEd Tanous 736f8cca876SEd Tanous void queryParameterOutOfRange(crow::Response& res, std::string_view arg1, 737f8cca876SEd Tanous std::string_view arg2, std::string_view arg3) 738f8cca876SEd Tanous { 739f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 740f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 741f8cca876SEd Tanous queryParameterOutOfRange(arg1, arg2, arg3)); 742f8cca876SEd Tanous } 743f8cca876SEd Tanous 744f8cca876SEd Tanous /** 745f8cca876SEd Tanous * @internal 746f8cca876SEd Tanous * @brief Formats QueryNotSupportedOnResource message into JSON 747f8cca876SEd Tanous * 748f8cca876SEd Tanous * See header file for more information 749f8cca876SEd Tanous * @endinternal 750f8cca876SEd Tanous */ 751f8cca876SEd Tanous nlohmann::json queryNotSupportedOnResource() 752f8cca876SEd Tanous { 753*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::queryNotSupportedOnResource, 754f8cca876SEd Tanous {}); 755f8cca876SEd Tanous } 756f8cca876SEd Tanous 757f8cca876SEd Tanous void queryNotSupportedOnResource(crow::Response& res) 758f8cca876SEd Tanous { 759f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 760f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, queryNotSupportedOnResource()); 761f8cca876SEd Tanous } 762f8cca876SEd Tanous 763f8cca876SEd Tanous /** 764f8cca876SEd Tanous * @internal 765f8cca876SEd Tanous * @brief Formats QueryNotSupportedOnOperation message into JSON 766f8cca876SEd Tanous * 767f8cca876SEd Tanous * See header file for more information 768f8cca876SEd Tanous * @endinternal 769f8cca876SEd Tanous */ 770f8cca876SEd Tanous nlohmann::json queryNotSupportedOnOperation() 771f8cca876SEd Tanous { 772f8cca876SEd Tanous return getLog( 773*4a102cd4SPatrick Williams redfish::registries::Base::Index::queryNotSupportedOnOperation, {}); 774f8cca876SEd Tanous } 775f8cca876SEd Tanous 776f8cca876SEd Tanous void queryNotSupportedOnOperation(crow::Response& res) 777f8cca876SEd Tanous { 778f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 779f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, queryNotSupportedOnOperation()); 780f8cca876SEd Tanous } 781f8cca876SEd Tanous 782f8cca876SEd Tanous /** 783f8cca876SEd Tanous * @internal 784f8cca876SEd Tanous * @brief Formats QueryNotSupported message into JSON 785f8cca876SEd Tanous * 786f8cca876SEd Tanous * See header file for more information 787f8cca876SEd Tanous * @endinternal 788f8cca876SEd Tanous */ 789f8cca876SEd Tanous nlohmann::json queryNotSupported() 790f8cca876SEd Tanous { 791*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::queryNotSupported, {}); 792f8cca876SEd Tanous } 793f8cca876SEd Tanous 794f8cca876SEd Tanous void queryNotSupported(crow::Response& res) 795f8cca876SEd Tanous { 796f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 797f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, queryNotSupported()); 798f8cca876SEd Tanous } 799f8cca876SEd Tanous 800f8cca876SEd Tanous /** 801f8cca876SEd Tanous * @internal 802f8cca876SEd Tanous * @brief Formats QueryCombinationInvalid message into JSON 803f8cca876SEd Tanous * 804f8cca876SEd Tanous * See header file for more information 805f8cca876SEd Tanous * @endinternal 806f8cca876SEd Tanous */ 807f8cca876SEd Tanous nlohmann::json queryCombinationInvalid() 808f8cca876SEd Tanous { 809*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::queryCombinationInvalid, 810f8cca876SEd Tanous {}); 811f8cca876SEd Tanous } 812f8cca876SEd Tanous 813f8cca876SEd Tanous void queryCombinationInvalid(crow::Response& res) 814f8cca876SEd Tanous { 815f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 816f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, queryCombinationInvalid()); 817f8cca876SEd Tanous } 818f8cca876SEd Tanous 819f8cca876SEd Tanous /** 820f8cca876SEd Tanous * @internal 821f8cca876SEd Tanous * @brief Formats QueryParameterUnsupported message into JSON 822f8cca876SEd Tanous * 823f8cca876SEd Tanous * See header file for more information 824f8cca876SEd Tanous * @endinternal 825f8cca876SEd Tanous */ 826f8cca876SEd Tanous nlohmann::json queryParameterUnsupported(std::string_view arg1) 827f8cca876SEd Tanous { 828*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::queryParameterUnsupported, 829f8cca876SEd Tanous std::to_array({arg1})); 830f8cca876SEd Tanous } 831f8cca876SEd Tanous 832f8cca876SEd Tanous void queryParameterUnsupported(crow::Response& res, std::string_view arg1) 833f8cca876SEd Tanous { 834f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 835f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, queryParameterUnsupported(arg1)); 836f8cca876SEd Tanous } 837f8cca876SEd Tanous 838f8cca876SEd Tanous /** 839f8cca876SEd Tanous * @internal 840f8cca876SEd Tanous * @brief Formats SessionLimitExceeded message into JSON 841f8cca876SEd Tanous * 842f8cca876SEd Tanous * See header file for more information 843f8cca876SEd Tanous * @endinternal 844f8cca876SEd Tanous */ 845f8cca876SEd Tanous nlohmann::json sessionLimitExceeded() 846f8cca876SEd Tanous { 847*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::sessionLimitExceeded, {}); 848f8cca876SEd Tanous } 849f8cca876SEd Tanous 850f8cca876SEd Tanous void sessionLimitExceeded(crow::Response& res) 851f8cca876SEd Tanous { 852f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 853f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, sessionLimitExceeded()); 854f8cca876SEd Tanous } 855f8cca876SEd Tanous 856f8cca876SEd Tanous /** 857f8cca876SEd Tanous * @internal 858f8cca876SEd Tanous * @brief Formats EventSubscriptionLimitExceeded message into JSON 859f8cca876SEd Tanous * 860f8cca876SEd Tanous * See header file for more information 861f8cca876SEd Tanous * @endinternal 862f8cca876SEd Tanous */ 863f8cca876SEd Tanous nlohmann::json eventSubscriptionLimitExceeded() 864f8cca876SEd Tanous { 865f8cca876SEd Tanous return getLog( 866*4a102cd4SPatrick Williams redfish::registries::Base::Index::eventSubscriptionLimitExceeded, {}); 867f8cca876SEd Tanous } 868f8cca876SEd Tanous 869f8cca876SEd Tanous void eventSubscriptionLimitExceeded(crow::Response& res) 870f8cca876SEd Tanous { 871f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 872f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, eventSubscriptionLimitExceeded()); 873f8cca876SEd Tanous } 874f8cca876SEd Tanous 875f8cca876SEd Tanous /** 876f8cca876SEd Tanous * @internal 877f8cca876SEd Tanous * @brief Formats ResourceCannotBeDeleted message into JSON 878f8cca876SEd Tanous * 879f8cca876SEd Tanous * See header file for more information 880f8cca876SEd Tanous * @endinternal 881f8cca876SEd Tanous */ 882f8cca876SEd Tanous nlohmann::json resourceCannotBeDeleted() 883f8cca876SEd Tanous { 884*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceCannotBeDeleted, 885f8cca876SEd Tanous {}); 886f8cca876SEd Tanous } 887f8cca876SEd Tanous 888f8cca876SEd Tanous void resourceCannotBeDeleted(crow::Response& res) 889f8cca876SEd Tanous { 890f8cca876SEd Tanous res.result(boost::beast::http::status::method_not_allowed); 891f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceCannotBeDeleted()); 892f8cca876SEd Tanous } 893f8cca876SEd Tanous 894f8cca876SEd Tanous /** 895f8cca876SEd Tanous * @internal 896f8cca876SEd Tanous * @brief Formats ResourceInUse message into JSON 897f8cca876SEd Tanous * 898f8cca876SEd Tanous * See header file for more information 899f8cca876SEd Tanous * @endinternal 900f8cca876SEd Tanous */ 901f8cca876SEd Tanous nlohmann::json resourceInUse() 902f8cca876SEd Tanous { 903*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceInUse, {}); 904f8cca876SEd Tanous } 905f8cca876SEd Tanous 906f8cca876SEd Tanous void resourceInUse(crow::Response& res) 907f8cca876SEd Tanous { 908f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 909f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceInUse()); 910f8cca876SEd Tanous } 911f8cca876SEd Tanous 912f8cca876SEd Tanous /** 913f8cca876SEd Tanous * @internal 914f8cca876SEd Tanous * @brief Formats ResourceAlreadyExists message into JSON 915f8cca876SEd Tanous * 916f8cca876SEd Tanous * See header file for more information 917f8cca876SEd Tanous * @endinternal 918f8cca876SEd Tanous */ 919f8cca876SEd Tanous nlohmann::json resourceAlreadyExists( 920f8cca876SEd Tanous std::string_view arg1, std::string_view arg2, std::string_view arg3) 921f8cca876SEd Tanous { 922*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceAlreadyExists, 923f8cca876SEd Tanous std::to_array({arg1, arg2, arg3})); 924f8cca876SEd Tanous } 925f8cca876SEd Tanous 926f8cca876SEd Tanous void resourceAlreadyExists(crow::Response& res, std::string_view arg1, 927f8cca876SEd Tanous std::string_view arg2, std::string_view arg3) 928f8cca876SEd Tanous { 929f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 930f8cca876SEd Tanous addMessageToJson(res.jsonValue, resourceAlreadyExists(arg1, arg2, arg3), 931f8cca876SEd Tanous arg2); 932f8cca876SEd Tanous } 933f8cca876SEd Tanous 934f8cca876SEd Tanous /** 935f8cca876SEd Tanous * @internal 936f8cca876SEd Tanous * @brief Formats ResourceNotFound message into JSON 937f8cca876SEd Tanous * 938f8cca876SEd Tanous * See header file for more information 939f8cca876SEd Tanous * @endinternal 940f8cca876SEd Tanous */ 941f8cca876SEd Tanous nlohmann::json resourceNotFound(std::string_view arg1, std::string_view arg2) 942f8cca876SEd Tanous { 943*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceNotFound, 944f8cca876SEd Tanous std::to_array({arg1, arg2})); 945f8cca876SEd Tanous } 946f8cca876SEd Tanous 947f8cca876SEd Tanous void resourceNotFound(crow::Response& res, std::string_view arg1, 948f8cca876SEd Tanous std::string_view arg2) 949f8cca876SEd Tanous { 950f8cca876SEd Tanous res.result(boost::beast::http::status::not_found); 951f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceNotFound(arg1, arg2)); 952f8cca876SEd Tanous } 953f8cca876SEd Tanous 954f8cca876SEd Tanous /** 955f8cca876SEd Tanous * @internal 956f8cca876SEd Tanous * @brief Formats PayloadTooLarge message into JSON 957f8cca876SEd Tanous * 958f8cca876SEd Tanous * See header file for more information 959f8cca876SEd Tanous * @endinternal 960f8cca876SEd Tanous */ 961f8cca876SEd Tanous nlohmann::json payloadTooLarge() 962f8cca876SEd Tanous { 963*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::payloadTooLarge, {}); 964f8cca876SEd Tanous } 965f8cca876SEd Tanous 966f8cca876SEd Tanous void payloadTooLarge(crow::Response& res) 967f8cca876SEd Tanous { 968f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 969f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, payloadTooLarge()); 970f8cca876SEd Tanous } 971f8cca876SEd Tanous 972f8cca876SEd Tanous /** 973f8cca876SEd Tanous * @internal 974f8cca876SEd Tanous * @brief Formats InsufficientStorage message into JSON 975f8cca876SEd Tanous * 976f8cca876SEd Tanous * See header file for more information 977f8cca876SEd Tanous * @endinternal 978f8cca876SEd Tanous */ 979f8cca876SEd Tanous nlohmann::json insufficientStorage() 980f8cca876SEd Tanous { 981*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::insufficientStorage, {}); 982f8cca876SEd Tanous } 983f8cca876SEd Tanous 984f8cca876SEd Tanous void insufficientStorage(crow::Response& res) 985f8cca876SEd Tanous { 986f8cca876SEd Tanous res.result(boost::beast::http::status::insufficient_storage); 987f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, insufficientStorage()); 988f8cca876SEd Tanous } 989f8cca876SEd Tanous 990f8cca876SEd Tanous /** 991f8cca876SEd Tanous * @internal 992f8cca876SEd Tanous * @brief Formats MissingOrMalformedPart message into JSON 993f8cca876SEd Tanous * 994f8cca876SEd Tanous * See header file for more information 995f8cca876SEd Tanous * @endinternal 996f8cca876SEd Tanous */ 997f8cca876SEd Tanous nlohmann::json missingOrMalformedPart() 998f8cca876SEd Tanous { 999*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::missingOrMalformedPart, {}); 1000f8cca876SEd Tanous } 1001f8cca876SEd Tanous 1002f8cca876SEd Tanous void missingOrMalformedPart(crow::Response& res) 1003f8cca876SEd Tanous { 1004f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1005f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, missingOrMalformedPart()); 1006f8cca876SEd Tanous } 1007f8cca876SEd Tanous 1008f8cca876SEd Tanous /** 1009f8cca876SEd Tanous * @internal 1010f8cca876SEd Tanous * @brief Formats InvalidURI message into JSON 1011f8cca876SEd Tanous * 1012f8cca876SEd Tanous * See header file for more information 1013f8cca876SEd Tanous * @endinternal 1014f8cca876SEd Tanous */ 1015f8cca876SEd Tanous nlohmann::json invalidURI(std::string_view arg1) 1016f8cca876SEd Tanous { 1017*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::invalidURI, 1018f8cca876SEd Tanous std::to_array({arg1})); 1019f8cca876SEd Tanous } 1020f8cca876SEd Tanous 1021f8cca876SEd Tanous void invalidURI(crow::Response& res, std::string_view arg1) 1022f8cca876SEd Tanous { 1023f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1024f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, invalidURI(arg1)); 1025f8cca876SEd Tanous } 1026f8cca876SEd Tanous 1027f8cca876SEd Tanous /** 1028f8cca876SEd Tanous * @internal 1029f8cca876SEd Tanous * @brief Formats CreateFailedMissingReqProperties message into JSON 1030f8cca876SEd Tanous * 1031f8cca876SEd Tanous * See header file for more information 1032f8cca876SEd Tanous * @endinternal 1033f8cca876SEd Tanous */ 1034f8cca876SEd Tanous nlohmann::json createFailedMissingReqProperties(std::string_view arg1) 1035f8cca876SEd Tanous { 1036f8cca876SEd Tanous return getLog( 1037*4a102cd4SPatrick Williams redfish::registries::Base::Index::createFailedMissingReqProperties, 1038f8cca876SEd Tanous std::to_array({arg1})); 1039f8cca876SEd Tanous } 1040f8cca876SEd Tanous 1041f8cca876SEd Tanous void createFailedMissingReqProperties(crow::Response& res, 1042f8cca876SEd Tanous std::string_view arg1) 1043f8cca876SEd Tanous { 1044f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1045f8cca876SEd Tanous addMessageToJson(res.jsonValue, createFailedMissingReqProperties(arg1), 1046f8cca876SEd Tanous arg1); 1047f8cca876SEd Tanous } 1048f8cca876SEd Tanous 1049f8cca876SEd Tanous /** 1050f8cca876SEd Tanous * @internal 1051f8cca876SEd Tanous * @brief Formats CreateLimitReachedForResource message into JSON 1052f8cca876SEd Tanous * 1053f8cca876SEd Tanous * See header file for more information 1054f8cca876SEd Tanous * @endinternal 1055f8cca876SEd Tanous */ 1056f8cca876SEd Tanous nlohmann::json createLimitReachedForResource() 1057f8cca876SEd Tanous { 1058f8cca876SEd Tanous return getLog( 1059*4a102cd4SPatrick Williams redfish::registries::Base::Index::createLimitReachedForResource, {}); 1060f8cca876SEd Tanous } 1061f8cca876SEd Tanous 1062f8cca876SEd Tanous void createLimitReachedForResource(crow::Response& res) 1063f8cca876SEd Tanous { 1064f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1065f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, createLimitReachedForResource()); 1066f8cca876SEd Tanous } 1067f8cca876SEd Tanous 1068f8cca876SEd Tanous /** 1069f8cca876SEd Tanous * @internal 1070f8cca876SEd Tanous * @brief Formats ServiceShuttingDown message into JSON 1071f8cca876SEd Tanous * 1072f8cca876SEd Tanous * See header file for more information 1073f8cca876SEd Tanous * @endinternal 1074f8cca876SEd Tanous */ 1075f8cca876SEd Tanous nlohmann::json serviceShuttingDown() 1076f8cca876SEd Tanous { 1077*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::serviceShuttingDown, {}); 1078f8cca876SEd Tanous } 1079f8cca876SEd Tanous 1080f8cca876SEd Tanous void serviceShuttingDown(crow::Response& res) 1081f8cca876SEd Tanous { 1082f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 1083f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, serviceShuttingDown()); 1084f8cca876SEd Tanous } 1085f8cca876SEd Tanous 1086f8cca876SEd Tanous /** 1087f8cca876SEd Tanous * @internal 1088f8cca876SEd Tanous * @brief Formats ServiceInUnknownState message into JSON 1089f8cca876SEd Tanous * 1090f8cca876SEd Tanous * See header file for more information 1091f8cca876SEd Tanous * @endinternal 1092f8cca876SEd Tanous */ 1093f8cca876SEd Tanous nlohmann::json serviceInUnknownState() 1094f8cca876SEd Tanous { 1095*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::serviceInUnknownState, {}); 1096f8cca876SEd Tanous } 1097f8cca876SEd Tanous 1098f8cca876SEd Tanous void serviceInUnknownState(crow::Response& res) 1099f8cca876SEd Tanous { 1100f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 1101f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, serviceInUnknownState()); 1102f8cca876SEd Tanous } 1103f8cca876SEd Tanous 1104f8cca876SEd Tanous /** 1105f8cca876SEd Tanous * @internal 1106f8cca876SEd Tanous * @brief Formats NoValidSession message into JSON 1107f8cca876SEd Tanous * 1108f8cca876SEd Tanous * See header file for more information 1109f8cca876SEd Tanous * @endinternal 1110f8cca876SEd Tanous */ 1111f8cca876SEd Tanous nlohmann::json noValidSession() 1112f8cca876SEd Tanous { 1113*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::noValidSession, {}); 1114f8cca876SEd Tanous } 1115f8cca876SEd Tanous 1116f8cca876SEd Tanous void noValidSession(crow::Response& res) 1117f8cca876SEd Tanous { 1118f8cca876SEd Tanous res.result(boost::beast::http::status::forbidden); 1119f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, noValidSession()); 1120f8cca876SEd Tanous } 1121f8cca876SEd Tanous 1122f8cca876SEd Tanous /** 1123f8cca876SEd Tanous * @internal 1124f8cca876SEd Tanous * @brief Formats InsufficientPrivilege message into JSON 1125f8cca876SEd Tanous * 1126f8cca876SEd Tanous * See header file for more information 1127f8cca876SEd Tanous * @endinternal 1128f8cca876SEd Tanous */ 1129f8cca876SEd Tanous nlohmann::json insufficientPrivilege() 1130f8cca876SEd Tanous { 1131*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::insufficientPrivilege, {}); 1132f8cca876SEd Tanous } 1133f8cca876SEd Tanous 1134f8cca876SEd Tanous void insufficientPrivilege(crow::Response& res) 1135f8cca876SEd Tanous { 1136f8cca876SEd Tanous res.result(boost::beast::http::status::forbidden); 1137f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, insufficientPrivilege()); 1138f8cca876SEd Tanous } 1139f8cca876SEd Tanous 1140f8cca876SEd Tanous /** 1141f8cca876SEd Tanous * @internal 1142f8cca876SEd Tanous * @brief Formats AccountModified message into JSON 1143f8cca876SEd Tanous * 1144f8cca876SEd Tanous * See header file for more information 1145f8cca876SEd Tanous * @endinternal 1146f8cca876SEd Tanous */ 1147f8cca876SEd Tanous nlohmann::json accountModified() 1148f8cca876SEd Tanous { 1149*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::accountModified, {}); 1150f8cca876SEd Tanous } 1151f8cca876SEd Tanous 1152f8cca876SEd Tanous void accountModified(crow::Response& res) 1153f8cca876SEd Tanous { 1154f8cca876SEd Tanous res.result(boost::beast::http::status::ok); 1155f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, accountModified()); 1156f8cca876SEd Tanous } 1157f8cca876SEd Tanous 1158f8cca876SEd Tanous /** 1159f8cca876SEd Tanous * @internal 1160f8cca876SEd Tanous * @brief Formats AccountNotModified message into JSON 1161f8cca876SEd Tanous * 1162f8cca876SEd Tanous * See header file for more information 1163f8cca876SEd Tanous * @endinternal 1164f8cca876SEd Tanous */ 1165f8cca876SEd Tanous nlohmann::json accountNotModified() 1166f8cca876SEd Tanous { 1167*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::accountNotModified, {}); 1168f8cca876SEd Tanous } 1169f8cca876SEd Tanous 1170f8cca876SEd Tanous void accountNotModified(crow::Response& res) 1171f8cca876SEd Tanous { 1172f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1173f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, accountNotModified()); 1174f8cca876SEd Tanous } 1175f8cca876SEd Tanous 1176f8cca876SEd Tanous /** 1177f8cca876SEd Tanous * @internal 1178f8cca876SEd Tanous * @brief Formats AccountRemoved message into JSON 1179f8cca876SEd Tanous * 1180f8cca876SEd Tanous * See header file for more information 1181f8cca876SEd Tanous * @endinternal 1182f8cca876SEd Tanous */ 1183f8cca876SEd Tanous nlohmann::json accountRemoved() 1184f8cca876SEd Tanous { 1185*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::accountRemoved, {}); 1186f8cca876SEd Tanous } 1187f8cca876SEd Tanous 1188f8cca876SEd Tanous void accountRemoved(crow::Response& res) 1189f8cca876SEd Tanous { 1190f8cca876SEd Tanous res.result(boost::beast::http::status::ok); 1191f8cca876SEd Tanous addMessageToJsonRoot(res.jsonValue, accountRemoved()); 1192f8cca876SEd Tanous } 1193f8cca876SEd Tanous 1194f8cca876SEd Tanous /** 1195f8cca876SEd Tanous * @internal 1196f8cca876SEd Tanous * @brief Formats AccountForSessionNoLongerExists message into JSON 1197f8cca876SEd Tanous * 1198f8cca876SEd Tanous * See header file for more information 1199f8cca876SEd Tanous * @endinternal 1200f8cca876SEd Tanous */ 1201f8cca876SEd Tanous nlohmann::json accountForSessionNoLongerExists() 1202f8cca876SEd Tanous { 1203f8cca876SEd Tanous return getLog( 1204*4a102cd4SPatrick Williams redfish::registries::Base::Index::accountForSessionNoLongerExists, {}); 1205f8cca876SEd Tanous } 1206f8cca876SEd Tanous 1207f8cca876SEd Tanous void accountForSessionNoLongerExists(crow::Response& res) 1208f8cca876SEd Tanous { 1209f8cca876SEd Tanous res.result(boost::beast::http::status::forbidden); 1210f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, accountForSessionNoLongerExists()); 1211f8cca876SEd Tanous } 1212f8cca876SEd Tanous 1213f8cca876SEd Tanous /** 1214f8cca876SEd Tanous * @internal 1215f8cca876SEd Tanous * @brief Formats InvalidObject message into JSON 1216f8cca876SEd Tanous * 1217f8cca876SEd Tanous * See header file for more information 1218f8cca876SEd Tanous * @endinternal 1219f8cca876SEd Tanous */ 1220f8cca876SEd Tanous nlohmann::json invalidObject(const boost::urls::url_view_base& arg1) 1221f8cca876SEd Tanous { 1222*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::invalidObject, 1223f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1224f8cca876SEd Tanous } 1225f8cca876SEd Tanous 1226f8cca876SEd Tanous void invalidObject(crow::Response& res, const boost::urls::url_view_base& arg1) 1227f8cca876SEd Tanous { 1228f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1229f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, invalidObject(arg1)); 1230f8cca876SEd Tanous } 1231f8cca876SEd Tanous 1232f8cca876SEd Tanous /** 1233f8cca876SEd Tanous * @internal 1234f8cca876SEd Tanous * @brief Formats InternalError message into JSON 1235f8cca876SEd Tanous * 1236f8cca876SEd Tanous * See header file for more information 1237f8cca876SEd Tanous * @endinternal 1238f8cca876SEd Tanous */ 1239f8cca876SEd Tanous nlohmann::json internalError() 1240f8cca876SEd Tanous { 1241*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::internalError, {}); 1242f8cca876SEd Tanous } 1243f8cca876SEd Tanous 1244f8cca876SEd Tanous void internalError(crow::Response& res, const std::source_location location) 1245f8cca876SEd Tanous { 1246f8cca876SEd Tanous BMCWEB_LOG_CRITICAL("Internal Error {}({}:{}) `{}`: ", location.file_name(), 1247f8cca876SEd Tanous location.line(), location.column(), 1248f8cca876SEd Tanous location.function_name()); 1249f8cca876SEd Tanous res.result(boost::beast::http::status::internal_server_error); 1250f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, internalError()); 1251f8cca876SEd Tanous } 1252f8cca876SEd Tanous 1253f8cca876SEd Tanous /** 1254f8cca876SEd Tanous * @internal 1255f8cca876SEd Tanous * @brief Formats UnrecognizedRequestBody message into JSON 1256f8cca876SEd Tanous * 1257f8cca876SEd Tanous * See header file for more information 1258f8cca876SEd Tanous * @endinternal 1259f8cca876SEd Tanous */ 1260f8cca876SEd Tanous nlohmann::json unrecognizedRequestBody() 1261f8cca876SEd Tanous { 1262*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::unrecognizedRequestBody, 1263f8cca876SEd Tanous {}); 1264f8cca876SEd Tanous } 1265f8cca876SEd Tanous 1266f8cca876SEd Tanous void unrecognizedRequestBody(crow::Response& res) 1267f8cca876SEd Tanous { 1268f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1269f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, unrecognizedRequestBody()); 1270f8cca876SEd Tanous } 1271f8cca876SEd Tanous 1272f8cca876SEd Tanous /** 1273f8cca876SEd Tanous * @internal 1274f8cca876SEd Tanous * @brief Formats ResourceMissingAtURI message into JSON 1275f8cca876SEd Tanous * 1276f8cca876SEd Tanous * See header file for more information 1277f8cca876SEd Tanous * @endinternal 1278f8cca876SEd Tanous */ 1279f8cca876SEd Tanous nlohmann::json resourceMissingAtURI(const boost::urls::url_view_base& arg1) 1280f8cca876SEd Tanous { 1281*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceMissingAtURI, 1282f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1283f8cca876SEd Tanous } 1284f8cca876SEd Tanous 1285f8cca876SEd Tanous void resourceMissingAtURI(crow::Response& res, 1286f8cca876SEd Tanous const boost::urls::url_view_base& arg1) 1287f8cca876SEd Tanous { 1288f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1289f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceMissingAtURI(arg1)); 1290f8cca876SEd Tanous } 1291f8cca876SEd Tanous 1292f8cca876SEd Tanous /** 1293f8cca876SEd Tanous * @internal 1294f8cca876SEd Tanous * @brief Formats ResourceAtUriInUnknownFormat message into JSON 1295f8cca876SEd Tanous * 1296f8cca876SEd Tanous * See header file for more information 1297f8cca876SEd Tanous * @endinternal 1298f8cca876SEd Tanous */ 1299504af5a0SPatrick Williams nlohmann::json resourceAtUriInUnknownFormat( 1300504af5a0SPatrick Williams const boost::urls::url_view_base& arg1) 1301f8cca876SEd Tanous { 1302f8cca876SEd Tanous return getLog( 1303*4a102cd4SPatrick Williams redfish::registries::Base::Index::resourceAtUriInUnknownFormat, 1304f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1305f8cca876SEd Tanous } 1306f8cca876SEd Tanous 1307f8cca876SEd Tanous void resourceAtUriInUnknownFormat(crow::Response& res, 1308f8cca876SEd Tanous const boost::urls::url_view_base& arg1) 1309f8cca876SEd Tanous { 1310f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1311f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceAtUriInUnknownFormat(arg1)); 1312f8cca876SEd Tanous } 1313f8cca876SEd Tanous 1314f8cca876SEd Tanous /** 1315f8cca876SEd Tanous * @internal 1316f8cca876SEd Tanous * @brief Formats ResourceAtUriUnauthorized message into JSON 1317f8cca876SEd Tanous * 1318f8cca876SEd Tanous * See header file for more information 1319f8cca876SEd Tanous * @endinternal 1320f8cca876SEd Tanous */ 1321f8cca876SEd Tanous nlohmann::json resourceAtUriUnauthorized(const boost::urls::url_view_base& arg1, 1322f8cca876SEd Tanous std::string_view arg2) 1323f8cca876SEd Tanous { 1324*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceAtUriUnauthorized, 1325f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer(), arg2})); 1326f8cca876SEd Tanous } 1327f8cca876SEd Tanous 1328f8cca876SEd Tanous void resourceAtUriUnauthorized(crow::Response& res, 1329f8cca876SEd Tanous const boost::urls::url_view_base& arg1, 1330f8cca876SEd Tanous std::string_view arg2) 1331f8cca876SEd Tanous { 1332f8cca876SEd Tanous res.result(boost::beast::http::status::unauthorized); 1333f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceAtUriUnauthorized(arg1, arg2)); 1334f8cca876SEd Tanous } 1335f8cca876SEd Tanous 1336f8cca876SEd Tanous /** 1337f8cca876SEd Tanous * @internal 1338f8cca876SEd Tanous * @brief Formats CouldNotEstablishConnection message into JSON 1339f8cca876SEd Tanous * 1340f8cca876SEd Tanous * See header file for more information 1341f8cca876SEd Tanous * @endinternal 1342f8cca876SEd Tanous */ 1343504af5a0SPatrick Williams nlohmann::json couldNotEstablishConnection( 1344504af5a0SPatrick Williams const boost::urls::url_view_base& arg1) 1345f8cca876SEd Tanous { 1346*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::couldNotEstablishConnection, 1347f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1348f8cca876SEd Tanous } 1349f8cca876SEd Tanous 1350f8cca876SEd Tanous void couldNotEstablishConnection(crow::Response& res, 1351f8cca876SEd Tanous const boost::urls::url_view_base& arg1) 1352f8cca876SEd Tanous { 1353f8cca876SEd Tanous res.result(boost::beast::http::status::not_found); 1354f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, couldNotEstablishConnection(arg1)); 1355f8cca876SEd Tanous } 1356f8cca876SEd Tanous 1357f8cca876SEd Tanous /** 1358f8cca876SEd Tanous * @internal 1359f8cca876SEd Tanous * @brief Formats SourceDoesNotSupportProtocol message into JSON 1360f8cca876SEd Tanous * 1361f8cca876SEd Tanous * See header file for more information 1362f8cca876SEd Tanous * @endinternal 1363f8cca876SEd Tanous */ 1364f8cca876SEd Tanous nlohmann::json sourceDoesNotSupportProtocol( 1365f8cca876SEd Tanous const boost::urls::url_view_base& arg1, std::string_view arg2) 1366f8cca876SEd Tanous { 1367f8cca876SEd Tanous return getLog( 1368*4a102cd4SPatrick Williams redfish::registries::Base::Index::sourceDoesNotSupportProtocol, 1369f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer(), arg2})); 1370f8cca876SEd Tanous } 1371f8cca876SEd Tanous 1372f8cca876SEd Tanous void sourceDoesNotSupportProtocol(crow::Response& res, 1373f8cca876SEd Tanous const boost::urls::url_view_base& arg1, 1374f8cca876SEd Tanous std::string_view arg2) 1375f8cca876SEd Tanous { 1376f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1377f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 1378f8cca876SEd Tanous sourceDoesNotSupportProtocol(arg1, arg2)); 1379f8cca876SEd Tanous } 1380f8cca876SEd Tanous 1381f8cca876SEd Tanous /** 1382f8cca876SEd Tanous * @internal 1383f8cca876SEd Tanous * @brief Formats AccessDenied message into JSON 1384f8cca876SEd Tanous * 1385f8cca876SEd Tanous * See header file for more information 1386f8cca876SEd Tanous * @endinternal 1387f8cca876SEd Tanous */ 1388f8cca876SEd Tanous nlohmann::json accessDenied(const boost::urls::url_view_base& arg1) 1389f8cca876SEd Tanous { 1390*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::accessDenied, 1391f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1392f8cca876SEd Tanous } 1393f8cca876SEd Tanous 1394f8cca876SEd Tanous void accessDenied(crow::Response& res, const boost::urls::url_view_base& arg1) 1395f8cca876SEd Tanous { 1396f8cca876SEd Tanous res.result(boost::beast::http::status::forbidden); 1397f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, accessDenied(arg1)); 1398f8cca876SEd Tanous } 1399f8cca876SEd Tanous 1400f8cca876SEd Tanous /** 1401f8cca876SEd Tanous * @internal 1402f8cca876SEd Tanous * @brief Formats ServiceTemporarilyUnavailable message into JSON 1403f8cca876SEd Tanous * 1404f8cca876SEd Tanous * See header file for more information 1405f8cca876SEd Tanous * @endinternal 1406f8cca876SEd Tanous */ 1407f8cca876SEd Tanous nlohmann::json serviceTemporarilyUnavailable(std::string_view arg1) 1408f8cca876SEd Tanous { 1409f8cca876SEd Tanous return getLog( 1410*4a102cd4SPatrick Williams redfish::registries::Base::Index::serviceTemporarilyUnavailable, 1411f8cca876SEd Tanous std::to_array({arg1})); 1412f8cca876SEd Tanous } 1413f8cca876SEd Tanous 1414f8cca876SEd Tanous void serviceTemporarilyUnavailable(crow::Response& res, std::string_view arg1) 1415f8cca876SEd Tanous { 1416f8cca876SEd Tanous res.addHeader(boost::beast::http::field::retry_after, arg1); 1417f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 1418f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, serviceTemporarilyUnavailable(arg1)); 1419f8cca876SEd Tanous } 1420f8cca876SEd Tanous 1421f8cca876SEd Tanous /** 1422f8cca876SEd Tanous * @internal 1423f8cca876SEd Tanous * @brief Formats InvalidIndex message into JSON 1424f8cca876SEd Tanous * 1425f8cca876SEd Tanous * See header file for more information 1426f8cca876SEd Tanous * @endinternal 1427f8cca876SEd Tanous */ 1428644cdcb8SEd Tanous nlohmann::json invalidIndex(uint64_t arg1) 1429f8cca876SEd Tanous { 1430f8cca876SEd Tanous std::string arg1Str = std::to_string(arg1); 1431*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::invalidIndex, 1432f8cca876SEd Tanous std::to_array<std::string_view>({arg1Str})); 1433f8cca876SEd Tanous } 1434f8cca876SEd Tanous 1435644cdcb8SEd Tanous void invalidIndex(crow::Response& res, uint64_t arg1) 1436f8cca876SEd Tanous { 1437f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1438f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, invalidIndex(arg1)); 1439f8cca876SEd Tanous } 1440f8cca876SEd Tanous 1441f8cca876SEd Tanous /** 1442f8cca876SEd Tanous * @internal 1443f8cca876SEd Tanous * @brief Formats PropertyValueModified message into JSON 1444f8cca876SEd Tanous * 1445f8cca876SEd Tanous * See header file for more information 1446f8cca876SEd Tanous * @endinternal 1447f8cca876SEd Tanous */ 1448f8cca876SEd Tanous nlohmann::json propertyValueModified(std::string_view arg1, 1449f8cca876SEd Tanous const nlohmann::json& arg2) 1450f8cca876SEd Tanous { 1451f8cca876SEd Tanous std::string arg2Str = 1452f8cca876SEd Tanous arg2.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 1453*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyValueModified, 1454f8cca876SEd Tanous std::to_array<std::string_view>({arg1, arg2Str})); 1455f8cca876SEd Tanous } 1456f8cca876SEd Tanous 1457f8cca876SEd Tanous void propertyValueModified(crow::Response& res, std::string_view arg1, 1458f8cca876SEd Tanous const nlohmann::json& arg2) 1459f8cca876SEd Tanous { 1460f8cca876SEd Tanous res.result(boost::beast::http::status::ok); 1461f8cca876SEd Tanous addMessageToJson(res.jsonValue, propertyValueModified(arg1, arg2), arg1); 1462f8cca876SEd Tanous } 1463f8cca876SEd Tanous 1464f8cca876SEd Tanous /** 1465f8cca876SEd Tanous * @internal 1466f8cca876SEd Tanous * @brief Formats ResourceInStandby message into JSON 1467f8cca876SEd Tanous * 1468f8cca876SEd Tanous * See header file for more information 1469f8cca876SEd Tanous * @endinternal 1470f8cca876SEd Tanous */ 1471f8cca876SEd Tanous nlohmann::json resourceInStandby() 1472f8cca876SEd Tanous { 1473*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceInStandby, {}); 1474f8cca876SEd Tanous } 1475f8cca876SEd Tanous 1476f8cca876SEd Tanous void resourceInStandby(crow::Response& res) 1477f8cca876SEd Tanous { 1478f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 1479f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceInStandby()); 1480f8cca876SEd Tanous } 1481f8cca876SEd Tanous 1482f8cca876SEd Tanous /** 1483f8cca876SEd Tanous * @internal 1484f8cca876SEd Tanous * @brief Formats ResourceExhaustion message into JSON 1485f8cca876SEd Tanous * 1486f8cca876SEd Tanous * See header file for more information 1487f8cca876SEd Tanous * @endinternal 1488f8cca876SEd Tanous */ 1489f8cca876SEd Tanous nlohmann::json resourceExhaustion(std::string_view arg1) 1490f8cca876SEd Tanous { 1491*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceExhaustion, 1492f8cca876SEd Tanous std::to_array({arg1})); 1493f8cca876SEd Tanous } 1494f8cca876SEd Tanous 1495f8cca876SEd Tanous void resourceExhaustion(crow::Response& res, std::string_view arg1) 1496f8cca876SEd Tanous { 1497f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 1498f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceExhaustion(arg1)); 1499f8cca876SEd Tanous } 1500f8cca876SEd Tanous 1501f8cca876SEd Tanous /** 1502f8cca876SEd Tanous * @internal 1503f4c4dcf4SKowalski, Kamil * @brief Formats StringValueTooLong message into JSON 1504f4c4dcf4SKowalski, Kamil * 1505f4c4dcf4SKowalski, Kamil * See header file for more information 1506f4c4dcf4SKowalski, Kamil * @endinternal 1507f4c4dcf4SKowalski, Kamil */ 1508644cdcb8SEd Tanous nlohmann::json stringValueTooLong(std::string_view arg1, uint64_t arg2) 15091abe55efSEd Tanous { 15107ccfe684SEd Tanous std::string arg2Str = std::to_string(arg2); 1511*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::stringValueTooLong, 15127ccfe684SEd Tanous std::to_array<std::string_view>({arg1, arg2Str})); 1513b5c07418SJames Feist } 1514b5c07418SJames Feist 1515644cdcb8SEd Tanous void stringValueTooLong(crow::Response& res, std::string_view arg1, 1516644cdcb8SEd Tanous uint64_t arg2) 1517b5c07418SJames Feist { 1518b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1519b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, stringValueTooLong(arg1, arg2)); 1520f4c4dcf4SKowalski, Kamil } 1521f4c4dcf4SKowalski, Kamil 1522f4c4dcf4SKowalski, Kamil /** 1523f4c4dcf4SKowalski, Kamil * @internal 1524f8cca876SEd Tanous * @brief Formats StringValueTooShort message into JSON 1525f8cca876SEd Tanous * 1526f8cca876SEd Tanous * See header file for more information 1527f8cca876SEd Tanous * @endinternal 1528f8cca876SEd Tanous */ 1529f8cca876SEd Tanous nlohmann::json stringValueTooShort(std::string_view arg1, std::string_view arg2) 1530f8cca876SEd Tanous { 1531*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::stringValueTooShort, 1532f8cca876SEd Tanous std::to_array({arg1, arg2})); 1533f8cca876SEd Tanous } 1534f8cca876SEd Tanous 1535f8cca876SEd Tanous void stringValueTooShort(crow::Response& res, std::string_view arg1, 1536f8cca876SEd Tanous std::string_view arg2) 1537f8cca876SEd Tanous { 1538f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1539f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, stringValueTooShort(arg1, arg2)); 1540f8cca876SEd Tanous } 1541f8cca876SEd Tanous 1542f8cca876SEd Tanous /** 1543f8cca876SEd Tanous * @internal 1544cc9139ecSJason M. Bills * @brief Formats SessionTerminated message into JSON 1545cc9139ecSJason M. Bills * 1546cc9139ecSJason M. Bills * See header file for more information 1547cc9139ecSJason M. Bills * @endinternal 1548cc9139ecSJason M. Bills */ 1549d9fcfcc1SEd Tanous nlohmann::json sessionTerminated() 1550cc9139ecSJason M. Bills { 1551*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::sessionTerminated, {}); 1552b5c07418SJames Feist } 1553b5c07418SJames Feist 1554b5c07418SJames Feist void sessionTerminated(crow::Response& res) 1555b5c07418SJames Feist { 1556b5c07418SJames Feist res.result(boost::beast::http::status::ok); 1557b5c07418SJames Feist addMessageToJsonRoot(res.jsonValue, sessionTerminated()); 1558cc9139ecSJason M. Bills } 1559cc9139ecSJason M. Bills 1560cc9139ecSJason M. Bills /** 1561cc9139ecSJason M. Bills * @internal 1562684bb4b8SJason M. Bills * @brief Formats SubscriptionTerminated message into JSON 1563684bb4b8SJason M. Bills * 1564684bb4b8SJason M. Bills * See header file for more information 1565684bb4b8SJason M. Bills * @endinternal 1566684bb4b8SJason M. Bills */ 1567d9fcfcc1SEd Tanous nlohmann::json subscriptionTerminated() 1568684bb4b8SJason M. Bills { 1569*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::subscriptionTerminated, {}); 1570684bb4b8SJason M. Bills } 1571684bb4b8SJason M. Bills 1572684bb4b8SJason M. Bills void subscriptionTerminated(crow::Response& res) 1573684bb4b8SJason M. Bills { 1574684bb4b8SJason M. Bills res.result(boost::beast::http::status::ok); 1575684bb4b8SJason M. Bills addMessageToJsonRoot(res.jsonValue, subscriptionTerminated()); 1576684bb4b8SJason M. Bills } 1577684bb4b8SJason M. Bills 1578684bb4b8SJason M. Bills /** 1579684bb4b8SJason M. Bills * @internal 1580cc9139ecSJason M. Bills * @brief Formats ResourceTypeIncompatible message into JSON 1581cc9139ecSJason M. Bills * 1582cc9139ecSJason M. Bills * See header file for more information 1583cc9139ecSJason M. Bills * @endinternal 1584cc9139ecSJason M. Bills */ 15851668ce6dSEd Tanous nlohmann::json resourceTypeIncompatible(std::string_view arg1, 15861668ce6dSEd Tanous std::string_view arg2) 1587cc9139ecSJason M. Bills { 1588*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceTypeIncompatible, 15891668ce6dSEd Tanous std::to_array({arg1, arg2})); 1590b5c07418SJames Feist } 1591b5c07418SJames Feist 15921668ce6dSEd Tanous void resourceTypeIncompatible(crow::Response& res, std::string_view arg1, 15931668ce6dSEd Tanous std::string_view arg2) 1594b5c07418SJames Feist { 1595b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1596b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, resourceTypeIncompatible(arg1, arg2)); 1597cc9139ecSJason M. Bills } 1598cc9139ecSJason M. Bills 1599cc9139ecSJason M. Bills /** 1600cc9139ecSJason M. Bills * @internal 1601f8cca876SEd Tanous * @brief Formats PasswordChangeRequired message into JSON 1602f8cca876SEd Tanous * 1603f8cca876SEd Tanous * See header file for more information 1604f8cca876SEd Tanous * @endinternal 1605f8cca876SEd Tanous */ 1606f8cca876SEd Tanous nlohmann::json passwordChangeRequired(const boost::urls::url_view_base& arg1) 1607f8cca876SEd Tanous { 1608*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::passwordChangeRequired, 1609f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1610f8cca876SEd Tanous } 1611f8cca876SEd Tanous 1612f8cca876SEd Tanous void passwordChangeRequired(crow::Response& res, 1613f8cca876SEd Tanous const boost::urls::url_view_base& arg1) 1614f8cca876SEd Tanous { 1615f8cca876SEd Tanous addMessageToJsonRoot(res.jsonValue, passwordChangeRequired(arg1)); 1616f8cca876SEd Tanous } 1617f8cca876SEd Tanous 1618f8cca876SEd Tanous /** 1619f8cca876SEd Tanous * @internal 1620684bb4b8SJason M. Bills * @brief Formats ResetRequired message into JSON 1621684bb4b8SJason M. Bills * 1622684bb4b8SJason M. Bills * See header file for more information 1623684bb4b8SJason M. Bills * @endinternal 1624684bb4b8SJason M. Bills */ 16254a7fbefdSEd Tanous nlohmann::json resetRequired(const boost::urls::url_view_base& arg1, 16264a7fbefdSEd Tanous std::string_view arg2) 1627684bb4b8SJason M. Bills { 1628*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resetRequired, 1629079360aeSEd Tanous std::to_array<std::string_view>({arg1.buffer(), arg2})); 1630684bb4b8SJason M. Bills } 1631684bb4b8SJason M. Bills 16324a7fbefdSEd Tanous void resetRequired(crow::Response& res, const boost::urls::url_view_base& arg1, 16331668ce6dSEd Tanous std::string_view arg2) 1634684bb4b8SJason M. Bills { 1635684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1636684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, resetRequired(arg1, arg2)); 1637684bb4b8SJason M. Bills } 1638684bb4b8SJason M. Bills 1639684bb4b8SJason M. Bills /** 1640684bb4b8SJason M. Bills * @internal 1641f8cca876SEd Tanous * @brief Formats ResetRecommended message into JSON 1642f8cca876SEd Tanous * 1643f8cca876SEd Tanous * See header file for more information 1644f8cca876SEd Tanous * @endinternal 1645f8cca876SEd Tanous */ 1646f8cca876SEd Tanous nlohmann::json resetRecommended(std::string_view arg1, std::string_view arg2) 1647f8cca876SEd Tanous { 1648*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resetRecommended, 1649f8cca876SEd Tanous std::to_array({arg1, arg2})); 1650f8cca876SEd Tanous } 1651f8cca876SEd Tanous 1652f8cca876SEd Tanous void resetRecommended(crow::Response& res, std::string_view arg1, 1653f8cca876SEd Tanous std::string_view arg2) 1654f8cca876SEd Tanous { 1655f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1656f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resetRecommended(arg1, arg2)); 1657f8cca876SEd Tanous } 1658f8cca876SEd Tanous 1659f8cca876SEd Tanous /** 1660f8cca876SEd Tanous * @internal 1661684bb4b8SJason M. Bills * @brief Formats ChassisPowerStateOnRequired message into JSON 1662684bb4b8SJason M. Bills * 1663684bb4b8SJason M. Bills * See header file for more information 1664684bb4b8SJason M. Bills * @endinternal 1665684bb4b8SJason M. Bills */ 16661668ce6dSEd Tanous nlohmann::json chassisPowerStateOnRequired(std::string_view arg1) 1667684bb4b8SJason M. Bills { 1668*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::chassisPowerStateOnRequired, 16691668ce6dSEd Tanous std::to_array({arg1})); 1670684bb4b8SJason M. Bills } 1671684bb4b8SJason M. Bills 16721668ce6dSEd Tanous void chassisPowerStateOnRequired(crow::Response& res, std::string_view arg1) 1673684bb4b8SJason M. Bills { 1674684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1675684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, chassisPowerStateOnRequired(arg1)); 1676684bb4b8SJason M. Bills } 1677684bb4b8SJason M. Bills 1678684bb4b8SJason M. Bills /** 1679684bb4b8SJason M. Bills * @internal 1680684bb4b8SJason M. Bills * @brief Formats ChassisPowerStateOffRequired message into JSON 1681684bb4b8SJason M. Bills * 1682684bb4b8SJason M. Bills * See header file for more information 1683684bb4b8SJason M. Bills * @endinternal 1684684bb4b8SJason M. Bills */ 16851668ce6dSEd Tanous nlohmann::json chassisPowerStateOffRequired(std::string_view arg1) 1686684bb4b8SJason M. Bills { 1687b6cd31e1SEd Tanous return getLog( 1688*4a102cd4SPatrick Williams redfish::registries::Base::Index::chassisPowerStateOffRequired, 16891668ce6dSEd Tanous std::to_array({arg1})); 1690684bb4b8SJason M. Bills } 1691684bb4b8SJason M. Bills 16921668ce6dSEd Tanous void chassisPowerStateOffRequired(crow::Response& res, std::string_view arg1) 1693684bb4b8SJason M. Bills { 1694684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1695684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, chassisPowerStateOffRequired(arg1)); 1696684bb4b8SJason M. Bills } 1697684bb4b8SJason M. Bills 1698684bb4b8SJason M. Bills /** 1699684bb4b8SJason M. Bills * @internal 1700684bb4b8SJason M. Bills * @brief Formats PropertyValueConflict message into JSON 1701684bb4b8SJason M. Bills * 1702684bb4b8SJason M. Bills * See header file for more information 1703684bb4b8SJason M. Bills * @endinternal 1704684bb4b8SJason M. Bills */ 17051668ce6dSEd Tanous nlohmann::json propertyValueConflict(std::string_view arg1, 17061668ce6dSEd Tanous std::string_view arg2) 1707684bb4b8SJason M. Bills { 1708*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyValueConflict, 17091668ce6dSEd Tanous std::to_array({arg1, arg2})); 1710684bb4b8SJason M. Bills } 1711684bb4b8SJason M. Bills 17121668ce6dSEd Tanous void propertyValueConflict(crow::Response& res, std::string_view arg1, 17131668ce6dSEd Tanous std::string_view arg2) 1714684bb4b8SJason M. Bills { 1715684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1716684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, propertyValueConflict(arg1, arg2)); 1717684bb4b8SJason M. Bills } 1718684bb4b8SJason M. Bills 1719684bb4b8SJason M. Bills /** 1720684bb4b8SJason M. Bills * @internal 17212a6af81cSRamesh Iyyar * @brief Formats PropertyValueResourceConflict message into JSON 17222a6af81cSRamesh Iyyar * 17232a6af81cSRamesh Iyyar * See header file for more information 17242a6af81cSRamesh Iyyar * @endinternal 17252a6af81cSRamesh Iyyar */ 1726bd79bce8SPatrick Williams nlohmann::json propertyValueResourceConflict( 1727bd79bce8SPatrick Williams std::string_view arg1, const nlohmann::json& arg2, 17284a7fbefdSEd Tanous const boost::urls::url_view_base& arg3) 17292a6af81cSRamesh Iyyar { 1730bd79bce8SPatrick Williams std::string arg2Str = 1731034e1259SEd Tanous arg2.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 17322a6af81cSRamesh Iyyar return getLog( 1733*4a102cd4SPatrick Williams redfish::registries::Base::Index::propertyValueResourceConflict, 173495b3ad73SEd Tanous std::to_array<std::string_view>({arg1, arg2Str, arg3.buffer()})); 17352a6af81cSRamesh Iyyar } 17362a6af81cSRamesh Iyyar 17372a6af81cSRamesh Iyyar void propertyValueResourceConflict(crow::Response& res, std::string_view arg1, 173895b3ad73SEd Tanous const nlohmann::json& arg2, 17394a7fbefdSEd Tanous const boost::urls::url_view_base& arg3) 17402a6af81cSRamesh Iyyar { 17412a6af81cSRamesh Iyyar res.result(boost::beast::http::status::conflict); 17422a6af81cSRamesh Iyyar addMessageToErrorJson(res.jsonValue, 17432a6af81cSRamesh Iyyar propertyValueResourceConflict(arg1, arg2, arg3)); 17442a6af81cSRamesh Iyyar } 17452a6af81cSRamesh Iyyar 17462a6af81cSRamesh Iyyar /** 17472a6af81cSRamesh Iyyar * @internal 174824861a28SRamesh Iyyar * @brief Formats PropertyValueExternalConflict message into JSON 174924861a28SRamesh Iyyar * 175024861a28SRamesh Iyyar * See header file for more information 175124861a28SRamesh Iyyar * @endinternal 175224861a28SRamesh Iyyar */ 175324861a28SRamesh Iyyar nlohmann::json propertyValueExternalConflict(std::string_view arg1, 175495b3ad73SEd Tanous const nlohmann::json& arg2) 175524861a28SRamesh Iyyar { 1756bd79bce8SPatrick Williams std::string arg2Str = 1757034e1259SEd Tanous arg2.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 175824861a28SRamesh Iyyar return getLog( 1759*4a102cd4SPatrick Williams redfish::registries::Base::Index::propertyValueExternalConflict, 176095b3ad73SEd Tanous std::to_array<std::string_view>({arg1, arg2Str})); 176124861a28SRamesh Iyyar } 176224861a28SRamesh Iyyar 176324861a28SRamesh Iyyar void propertyValueExternalConflict(crow::Response& res, std::string_view arg1, 176495b3ad73SEd Tanous const nlohmann::json& arg2) 176524861a28SRamesh Iyyar { 176624861a28SRamesh Iyyar res.result(boost::beast::http::status::conflict); 176724861a28SRamesh Iyyar addMessageToErrorJson(res.jsonValue, 176824861a28SRamesh Iyyar propertyValueExternalConflict(arg1, arg2)); 176924861a28SRamesh Iyyar } 177024861a28SRamesh Iyyar 177124861a28SRamesh Iyyar /** 177224861a28SRamesh Iyyar * @internal 1773684bb4b8SJason M. Bills * @brief Formats PropertyValueIncorrect message into JSON 1774684bb4b8SJason M. Bills * 1775684bb4b8SJason M. Bills * See header file for more information 1776684bb4b8SJason M. Bills * @endinternal 1777684bb4b8SJason M. Bills */ 1778367b3dceSGinu George nlohmann::json propertyValueIncorrect(std::string_view arg1, 1779367b3dceSGinu George const nlohmann::json& arg2) 1780684bb4b8SJason M. Bills { 1781bd79bce8SPatrick Williams std::string arg2Str = 1782034e1259SEd Tanous arg2.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 1783*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyValueIncorrect, 1784367b3dceSGinu George std::to_array<std::string_view>({arg1, arg2Str})); 1785684bb4b8SJason M. Bills } 1786684bb4b8SJason M. Bills 1787367b3dceSGinu George void propertyValueIncorrect(crow::Response& res, std::string_view arg1, 1788367b3dceSGinu George const nlohmann::json& arg2) 1789684bb4b8SJason M. Bills { 1790684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1791684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, propertyValueIncorrect(arg1, arg2)); 1792684bb4b8SJason M. Bills } 1793684bb4b8SJason M. Bills 1794684bb4b8SJason M. Bills /** 1795684bb4b8SJason M. Bills * @internal 1796684bb4b8SJason M. Bills * @brief Formats ResourceCreationConflict message into JSON 1797684bb4b8SJason M. Bills * 1798684bb4b8SJason M. Bills * See header file for more information 1799684bb4b8SJason M. Bills * @endinternal 1800684bb4b8SJason M. Bills */ 18014a7fbefdSEd Tanous nlohmann::json resourceCreationConflict(const boost::urls::url_view_base& arg1) 1802684bb4b8SJason M. Bills { 1803*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceCreationConflict, 1804079360aeSEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1805684bb4b8SJason M. Bills } 1806684bb4b8SJason M. Bills 18074a7fbefdSEd Tanous void resourceCreationConflict(crow::Response& res, 18084a7fbefdSEd Tanous const boost::urls::url_view_base& arg1) 1809684bb4b8SJason M. Bills { 1810684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1811684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, resourceCreationConflict(arg1)); 1812684bb4b8SJason M. Bills } 1813684bb4b8SJason M. Bills 1814684bb4b8SJason M. Bills /** 1815684bb4b8SJason M. Bills * @internal 1816f8cca876SEd Tanous * @brief Formats ActionParameterValueConflict message into JSON 1817f8cca876SEd Tanous * 1818f8cca876SEd Tanous * See header file for more information 1819f8cca876SEd Tanous * @endinternal 1820f8cca876SEd Tanous */ 1821504af5a0SPatrick Williams nlohmann::json actionParameterValueConflict(std::string_view arg1, 1822504af5a0SPatrick Williams std::string_view arg2) 1823f8cca876SEd Tanous { 1824f8cca876SEd Tanous return getLog( 1825*4a102cd4SPatrick Williams redfish::registries::Base::Index::actionParameterValueConflict, 1826f8cca876SEd Tanous std::to_array({arg1, arg2})); 1827f8cca876SEd Tanous } 1828f8cca876SEd Tanous 1829f8cca876SEd Tanous void actionParameterValueConflict(crow::Response& res, std::string_view arg1, 1830f8cca876SEd Tanous std::string_view arg2) 1831f8cca876SEd Tanous { 1832f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1833f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 1834f8cca876SEd Tanous actionParameterValueConflict(arg1, arg2)); 1835f8cca876SEd Tanous } 1836f8cca876SEd Tanous 1837f8cca876SEd Tanous /** 1838f8cca876SEd Tanous * @internal 1839684bb4b8SJason M. Bills * @brief Formats MaximumErrorsExceeded message into JSON 1840684bb4b8SJason M. Bills * 1841684bb4b8SJason M. Bills * See header file for more information 1842684bb4b8SJason M. Bills * @endinternal 1843684bb4b8SJason M. Bills */ 1844d9fcfcc1SEd Tanous nlohmann::json maximumErrorsExceeded() 1845684bb4b8SJason M. Bills { 1846*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::maximumErrorsExceeded, {}); 1847684bb4b8SJason M. Bills } 1848684bb4b8SJason M. Bills 1849684bb4b8SJason M. Bills void maximumErrorsExceeded(crow::Response& res) 1850684bb4b8SJason M. Bills { 1851684bb4b8SJason M. Bills res.result(boost::beast::http::status::internal_server_error); 1852684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, maximumErrorsExceeded()); 1853684bb4b8SJason M. Bills } 1854684bb4b8SJason M. Bills 1855684bb4b8SJason M. Bills /** 1856684bb4b8SJason M. Bills * @internal 1857684bb4b8SJason M. Bills * @brief Formats PreconditionFailed message into JSON 1858684bb4b8SJason M. Bills * 1859684bb4b8SJason M. Bills * See header file for more information 1860684bb4b8SJason M. Bills * @endinternal 1861684bb4b8SJason M. Bills */ 1862d9fcfcc1SEd Tanous nlohmann::json preconditionFailed() 1863684bb4b8SJason M. Bills { 1864*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::preconditionFailed, {}); 1865684bb4b8SJason M. Bills } 1866684bb4b8SJason M. Bills 1867684bb4b8SJason M. Bills void preconditionFailed(crow::Response& res) 1868684bb4b8SJason M. Bills { 18694df1bee0SEd Tanous res.result(boost::beast::http::status::precondition_failed); 1870684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, preconditionFailed()); 1871684bb4b8SJason M. Bills } 1872684bb4b8SJason M. Bills 1873684bb4b8SJason M. Bills /** 1874684bb4b8SJason M. Bills * @internal 1875684bb4b8SJason M. Bills * @brief Formats PreconditionRequired message into JSON 1876684bb4b8SJason M. Bills * 1877684bb4b8SJason M. Bills * See header file for more information 1878684bb4b8SJason M. Bills * @endinternal 1879684bb4b8SJason M. Bills */ 1880d9fcfcc1SEd Tanous nlohmann::json preconditionRequired() 1881684bb4b8SJason M. Bills { 1882*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::preconditionRequired, {}); 1883684bb4b8SJason M. Bills } 1884684bb4b8SJason M. Bills 1885684bb4b8SJason M. Bills void preconditionRequired(crow::Response& res) 1886684bb4b8SJason M. Bills { 1887684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1888684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, preconditionRequired()); 1889684bb4b8SJason M. Bills } 1890684bb4b8SJason M. Bills 1891684bb4b8SJason M. Bills /** 1892684bb4b8SJason M. Bills * @internal 1893f8cca876SEd Tanous * @brief Formats HeaderMissing message into JSON 1894f8cca876SEd Tanous * 1895f8cca876SEd Tanous * See header file for more information 1896f8cca876SEd Tanous * @endinternal 1897f8cca876SEd Tanous */ 1898f8cca876SEd Tanous nlohmann::json headerMissing(std::string_view arg1) 1899f8cca876SEd Tanous { 1900*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::headerMissing, 1901f8cca876SEd Tanous std::to_array({arg1})); 1902f8cca876SEd Tanous } 1903f8cca876SEd Tanous 1904f8cca876SEd Tanous void headerMissing(crow::Response& res, std::string_view arg1) 1905f8cca876SEd Tanous { 1906f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1907f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, headerMissing(arg1)); 1908f8cca876SEd Tanous } 1909f8cca876SEd Tanous 1910f8cca876SEd Tanous /** 1911f8cca876SEd Tanous * @internal 1912f8cca876SEd Tanous * @brief Formats HeaderInvalid message into JSON 1913f8cca876SEd Tanous * 1914f8cca876SEd Tanous * See header file for more information 1915f8cca876SEd Tanous * @endinternal 1916f8cca876SEd Tanous */ 1917f8cca876SEd Tanous nlohmann::json headerInvalid(std::string_view arg1) 1918f8cca876SEd Tanous { 1919*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::headerInvalid, 1920f8cca876SEd Tanous std::to_array({arg1})); 1921f8cca876SEd Tanous } 1922f8cca876SEd Tanous 1923f8cca876SEd Tanous void headerInvalid(crow::Response& res, std::string_view arg1) 1924f8cca876SEd Tanous { 1925f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1926f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, headerInvalid(arg1)); 1927f8cca876SEd Tanous } 1928f8cca876SEd Tanous 1929f8cca876SEd Tanous /** 1930f8cca876SEd Tanous * @internal 1931684bb4b8SJason M. Bills * @brief Formats OperationFailed message into JSON 1932684bb4b8SJason M. Bills * 1933684bb4b8SJason M. Bills * See header file for more information 1934684bb4b8SJason M. Bills * @endinternal 1935684bb4b8SJason M. Bills */ 1936d9fcfcc1SEd Tanous nlohmann::json operationFailed() 1937684bb4b8SJason M. Bills { 1938*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::operationFailed, {}); 1939684bb4b8SJason M. Bills } 1940684bb4b8SJason M. Bills 1941684bb4b8SJason M. Bills void operationFailed(crow::Response& res) 1942684bb4b8SJason M. Bills { 19438868776eSEd Tanous res.result(boost::beast::http::status::bad_gateway); 1944684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, operationFailed()); 1945684bb4b8SJason M. Bills } 1946684bb4b8SJason M. Bills 1947684bb4b8SJason M. Bills /** 1948684bb4b8SJason M. Bills * @internal 1949684bb4b8SJason M. Bills * @brief Formats OperationTimeout message into JSON 1950684bb4b8SJason M. Bills * 1951684bb4b8SJason M. Bills * See header file for more information 1952684bb4b8SJason M. Bills * @endinternal 1953684bb4b8SJason M. Bills */ 1954d9fcfcc1SEd Tanous nlohmann::json operationTimeout() 1955684bb4b8SJason M. Bills { 1956*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::operationTimeout, {}); 1957684bb4b8SJason M. Bills } 1958684bb4b8SJason M. Bills 1959684bb4b8SJason M. Bills void operationTimeout(crow::Response& res) 1960684bb4b8SJason M. Bills { 1961684bb4b8SJason M. Bills res.result(boost::beast::http::status::internal_server_error); 1962684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, operationTimeout()); 1963684bb4b8SJason M. Bills } 1964684bb4b8SJason M. Bills 1965684bb4b8SJason M. Bills /** 1966684bb4b8SJason M. Bills * @internal 196744c70412SEd Tanous * @brief Formats OperationNotAllowed message into JSON 196844c70412SEd Tanous * 196944c70412SEd Tanous * See header file for more information 197044c70412SEd Tanous * @endinternal 197144c70412SEd Tanous */ 197244c70412SEd Tanous nlohmann::json operationNotAllowed() 197344c70412SEd Tanous { 1974*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::operationNotAllowed, {}); 197544c70412SEd Tanous } 197644c70412SEd Tanous 197744c70412SEd Tanous void operationNotAllowed(crow::Response& res) 197844c70412SEd Tanous { 197944c70412SEd Tanous res.result(boost::beast::http::status::method_not_allowed); 198044c70412SEd Tanous addMessageToErrorJson(res.jsonValue, operationNotAllowed()); 198144c70412SEd Tanous } 198244c70412SEd Tanous 1983600af5f1SAppaRao Puli /** 1984600af5f1SAppaRao Puli * @internal 19857ccfe684SEd Tanous * @brief Formats UndeterminedFault message into JSON 19867ccfe684SEd Tanous * 19877ccfe684SEd Tanous * See header file for more information 19887ccfe684SEd Tanous * @endinternal 19897ccfe684SEd Tanous */ 19907ccfe684SEd Tanous nlohmann::json undeterminedFault(std::string_view arg1) 19917ccfe684SEd Tanous { 1992*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::undeterminedFault, 19937ccfe684SEd Tanous std::to_array({arg1})); 19947ccfe684SEd Tanous } 19957ccfe684SEd Tanous 19967ccfe684SEd Tanous void undeterminedFault(crow::Response& res, std::string_view arg1) 19977ccfe684SEd Tanous { 19987ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 19997ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, undeterminedFault(arg1)); 20007ccfe684SEd Tanous } 20017ccfe684SEd Tanous 20027ccfe684SEd Tanous /** 20037ccfe684SEd Tanous * @internal 20047ccfe684SEd Tanous * @brief Formats ConditionInRelatedResource message into JSON 20057ccfe684SEd Tanous * 20067ccfe684SEd Tanous * See header file for more information 20077ccfe684SEd Tanous * @endinternal 20087ccfe684SEd Tanous */ 20097ccfe684SEd Tanous nlohmann::json conditionInRelatedResource() 20107ccfe684SEd Tanous { 2011*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::conditionInRelatedResource, 20127ccfe684SEd Tanous {}); 20137ccfe684SEd Tanous } 20147ccfe684SEd Tanous 20157ccfe684SEd Tanous void conditionInRelatedResource(crow::Response& res) 20167ccfe684SEd Tanous { 20177ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 20187ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, conditionInRelatedResource()); 20197ccfe684SEd Tanous } 20207ccfe684SEd Tanous 20217ccfe684SEd Tanous /** 20227ccfe684SEd Tanous * @internal 20237ccfe684SEd Tanous * @brief Formats RestrictedRole message into JSON 20247ccfe684SEd Tanous * 20257ccfe684SEd Tanous * See header file for more information 20267ccfe684SEd Tanous * @endinternal 20277ccfe684SEd Tanous */ 20287ccfe684SEd Tanous nlohmann::json restrictedRole(std::string_view arg1) 20297ccfe684SEd Tanous { 2030*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::restrictedRole, 20317ccfe684SEd Tanous std::to_array({arg1})); 20327ccfe684SEd Tanous } 20337ccfe684SEd Tanous 20347ccfe684SEd Tanous void restrictedRole(crow::Response& res, std::string_view arg1) 20357ccfe684SEd Tanous { 20367f84d8c6SMyung Bae res.result(boost::beast::http::status::forbidden); 20377ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, restrictedRole(arg1)); 20387ccfe684SEd Tanous } 20397ccfe684SEd Tanous 20407ccfe684SEd Tanous /** 20417ccfe684SEd Tanous * @internal 20427ccfe684SEd Tanous * @brief Formats RestrictedPrivilege message into JSON 20437ccfe684SEd Tanous * 20447ccfe684SEd Tanous * See header file for more information 20457ccfe684SEd Tanous * @endinternal 20467ccfe684SEd Tanous */ 20477ccfe684SEd Tanous nlohmann::json restrictedPrivilege(std::string_view arg1) 20487ccfe684SEd Tanous { 2049*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::restrictedPrivilege, 20507ccfe684SEd Tanous std::to_array({arg1})); 20517ccfe684SEd Tanous } 20527ccfe684SEd Tanous 20537ccfe684SEd Tanous void restrictedPrivilege(crow::Response& res, std::string_view arg1) 20547ccfe684SEd Tanous { 20557ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 20567ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, restrictedPrivilege(arg1)); 20577ccfe684SEd Tanous } 20587ccfe684SEd Tanous 20597ccfe684SEd Tanous /** 20607ccfe684SEd Tanous * @internal 2061f8cca876SEd Tanous * @brief Formats StrictAccountTypes message into JSON 2062f8cca876SEd Tanous * 2063f8cca876SEd Tanous * See header file for more information 2064f8cca876SEd Tanous * @endinternal 2065f8cca876SEd Tanous */ 2066f8cca876SEd Tanous nlohmann::json strictAccountTypes(std::string_view arg1) 2067f8cca876SEd Tanous { 2068*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::strictAccountTypes, 2069f8cca876SEd Tanous std::to_array({arg1})); 2070f8cca876SEd Tanous } 2071f8cca876SEd Tanous 2072f8cca876SEd Tanous void strictAccountTypes(crow::Response& res, std::string_view arg1) 2073f8cca876SEd Tanous { 2074f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 2075f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, strictAccountTypes(arg1)); 2076f8cca876SEd Tanous } 2077f8cca876SEd Tanous 2078f8cca876SEd Tanous /** 2079f8cca876SEd Tanous * @internal 20807ccfe684SEd Tanous * @brief Formats PropertyDeprecated message into JSON 20817ccfe684SEd Tanous * 20827ccfe684SEd Tanous * See header file for more information 20837ccfe684SEd Tanous * @endinternal 20847ccfe684SEd Tanous */ 20857ccfe684SEd Tanous nlohmann::json propertyDeprecated(std::string_view arg1) 20867ccfe684SEd Tanous { 2087*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyDeprecated, 20887ccfe684SEd Tanous std::to_array({arg1})); 20897ccfe684SEd Tanous } 20907ccfe684SEd Tanous 20917ccfe684SEd Tanous void propertyDeprecated(crow::Response& res, std::string_view arg1) 20927ccfe684SEd Tanous { 20937ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 20947ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, propertyDeprecated(arg1)); 20957ccfe684SEd Tanous } 20967ccfe684SEd Tanous 20977ccfe684SEd Tanous /** 20987ccfe684SEd Tanous * @internal 20997ccfe684SEd Tanous * @brief Formats ResourceDeprecated message into JSON 21007ccfe684SEd Tanous * 21017ccfe684SEd Tanous * See header file for more information 21027ccfe684SEd Tanous * @endinternal 21037ccfe684SEd Tanous */ 21047ccfe684SEd Tanous nlohmann::json resourceDeprecated(std::string_view arg1) 21057ccfe684SEd Tanous { 2106*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::resourceDeprecated, 21077ccfe684SEd Tanous std::to_array({arg1})); 21087ccfe684SEd Tanous } 21097ccfe684SEd Tanous 21107ccfe684SEd Tanous void resourceDeprecated(crow::Response& res, std::string_view arg1) 21117ccfe684SEd Tanous { 21127ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 21137ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, resourceDeprecated(arg1)); 21147ccfe684SEd Tanous } 21157ccfe684SEd Tanous 21167ccfe684SEd Tanous /** 21177ccfe684SEd Tanous * @internal 21187ccfe684SEd Tanous * @brief Formats PropertyValueDeprecated message into JSON 21197ccfe684SEd Tanous * 21207ccfe684SEd Tanous * See header file for more information 21217ccfe684SEd Tanous * @endinternal 21227ccfe684SEd Tanous */ 21237ccfe684SEd Tanous nlohmann::json propertyValueDeprecated(std::string_view arg1, 21247ccfe684SEd Tanous std::string_view arg2) 21257ccfe684SEd Tanous { 2126*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyValueDeprecated, 21277ccfe684SEd Tanous std::to_array({arg1, arg2})); 21287ccfe684SEd Tanous } 21297ccfe684SEd Tanous 21307ccfe684SEd Tanous void propertyValueDeprecated(crow::Response& res, std::string_view arg1, 21317ccfe684SEd Tanous std::string_view arg2) 21327ccfe684SEd Tanous { 21337ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 21347ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, propertyValueDeprecated(arg1, arg2)); 21357ccfe684SEd Tanous } 21367ccfe684SEd Tanous 21377ccfe684SEd Tanous /** 21387ccfe684SEd Tanous * @internal 21397ccfe684SEd Tanous * @brief Formats ActionDeprecated message into JSON 21407ccfe684SEd Tanous * 21417ccfe684SEd Tanous * See header file for more information 21427ccfe684SEd Tanous * @endinternal 21437ccfe684SEd Tanous */ 21447ccfe684SEd Tanous nlohmann::json actionDeprecated(std::string_view arg1) 21457ccfe684SEd Tanous { 2146*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::actionDeprecated, 21477ccfe684SEd Tanous std::to_array({arg1})); 21487ccfe684SEd Tanous } 21497ccfe684SEd Tanous 21507ccfe684SEd Tanous void actionDeprecated(crow::Response& res, std::string_view arg1) 21517ccfe684SEd Tanous { 21527ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 21537ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, actionDeprecated(arg1)); 21547ccfe684SEd Tanous } 21557ccfe684SEd Tanous 21567ccfe684SEd Tanous /** 21577ccfe684SEd Tanous * @internal 21587ccfe684SEd Tanous * @brief Formats NetworkNameResolutionNotConfigured message into JSON 21597ccfe684SEd Tanous * 21607ccfe684SEd Tanous * See header file for more information 21617ccfe684SEd Tanous * @endinternal 21627ccfe684SEd Tanous */ 21637ccfe684SEd Tanous nlohmann::json networkNameResolutionNotConfigured() 21647ccfe684SEd Tanous { 21657ccfe684SEd Tanous return getLog( 2166*4a102cd4SPatrick Williams redfish::registries::Base::Index::networkNameResolutionNotConfigured, 21677ccfe684SEd Tanous {}); 21687ccfe684SEd Tanous } 21697ccfe684SEd Tanous 21707ccfe684SEd Tanous void networkNameResolutionNotConfigured(crow::Response& res) 21717ccfe684SEd Tanous { 21727ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 21737ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, networkNameResolutionNotConfigured()); 21747ccfe684SEd Tanous } 21757ccfe684SEd Tanous 21767ccfe684SEd Tanous /** 21777ccfe684SEd Tanous * @internal 21787ccfe684SEd Tanous * @brief Formats NetworkNameResolutionNotSupported message into JSON 21797ccfe684SEd Tanous * 21807ccfe684SEd Tanous * See header file for more information 21817ccfe684SEd Tanous * @endinternal 21827ccfe684SEd Tanous */ 21837ccfe684SEd Tanous nlohmann::json networkNameResolutionNotSupported() 21847ccfe684SEd Tanous { 21857ccfe684SEd Tanous return getLog( 2186*4a102cd4SPatrick Williams redfish::registries::Base::Index::networkNameResolutionNotSupported, 21877ccfe684SEd Tanous {}); 21887ccfe684SEd Tanous } 21897ccfe684SEd Tanous 21907ccfe684SEd Tanous void networkNameResolutionNotSupported(crow::Response& res) 21917ccfe684SEd Tanous { 21927ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 21937ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, networkNameResolutionNotSupported()); 21947ccfe684SEd Tanous } 21957ccfe684SEd Tanous 21967ccfe684SEd Tanous /** 21977ccfe684SEd Tanous * @internal 2198f8cca876SEd Tanous * @brief Formats ServiceDisabled message into JSON 2199f8cca876SEd Tanous * 2200f8cca876SEd Tanous * See header file for more information 2201f8cca876SEd Tanous * @endinternal 2202f8cca876SEd Tanous */ 2203f8cca876SEd Tanous nlohmann::json serviceDisabled(std::string_view arg1) 2204f8cca876SEd Tanous { 2205*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::serviceDisabled, 2206f8cca876SEd Tanous std::to_array({arg1})); 2207f8cca876SEd Tanous } 2208f8cca876SEd Tanous 2209f8cca876SEd Tanous void serviceDisabled(crow::Response& res, std::string_view arg1) 2210f8cca876SEd Tanous { 2211f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 2212f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, serviceDisabled(arg1)); 2213f8cca876SEd Tanous } 2214f8cca876SEd Tanous 2215f8cca876SEd Tanous /** 2216f8cca876SEd Tanous * @internal 2217f8cca876SEd Tanous * @brief Formats EventBufferExceeded message into JSON 2218f8cca876SEd Tanous * 2219f8cca876SEd Tanous * See header file for more information 2220f8cca876SEd Tanous * @endinternal 2221f8cca876SEd Tanous */ 2222f8cca876SEd Tanous nlohmann::json eventBufferExceeded() 2223f8cca876SEd Tanous { 2224*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::eventBufferExceeded, {}); 2225f8cca876SEd Tanous } 2226f8cca876SEd Tanous 2227f8cca876SEd Tanous void eventBufferExceeded(crow::Response& res) 2228f8cca876SEd Tanous { 2229f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 2230f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, eventBufferExceeded()); 2231f8cca876SEd Tanous } 2232f8cca876SEd Tanous 2233f8cca876SEd Tanous /** 2234f8cca876SEd Tanous * @internal 22357ccfe684SEd Tanous * @brief Formats AuthenticationTokenRequired message into JSON 22367ccfe684SEd Tanous * 22377ccfe684SEd Tanous * See header file for more information 22387ccfe684SEd Tanous * @endinternal 22397ccfe684SEd Tanous */ 22407ccfe684SEd Tanous nlohmann::json authenticationTokenRequired() 22417ccfe684SEd Tanous { 2242*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::authenticationTokenRequired, 22437ccfe684SEd Tanous {}); 22447ccfe684SEd Tanous } 22457ccfe684SEd Tanous 22467ccfe684SEd Tanous void authenticationTokenRequired(crow::Response& res) 22477ccfe684SEd Tanous { 22487ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 22497ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, authenticationTokenRequired()); 22507ccfe684SEd Tanous } 22517ccfe684SEd Tanous 22527ccfe684SEd Tanous /** 22537ccfe684SEd Tanous * @internal 22547ccfe684SEd Tanous * @brief Formats OneTimePasscodeSent message into JSON 22557ccfe684SEd Tanous * 22567ccfe684SEd Tanous * See header file for more information 22577ccfe684SEd Tanous * @endinternal 22587ccfe684SEd Tanous */ 22597ccfe684SEd Tanous nlohmann::json oneTimePasscodeSent(std::string_view arg1) 22607ccfe684SEd Tanous { 2261*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::oneTimePasscodeSent, 22627ccfe684SEd Tanous std::to_array({arg1})); 22637ccfe684SEd Tanous } 22647ccfe684SEd Tanous 22657ccfe684SEd Tanous void oneTimePasscodeSent(crow::Response& res, std::string_view arg1) 22667ccfe684SEd Tanous { 22677ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 22687ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, oneTimePasscodeSent(arg1)); 22697ccfe684SEd Tanous } 22707ccfe684SEd Tanous 22717ccfe684SEd Tanous /** 22727ccfe684SEd Tanous * @internal 22737ccfe684SEd Tanous * @brief Formats LicenseRequired message into JSON 22747ccfe684SEd Tanous * 22757ccfe684SEd Tanous * See header file for more information 22767ccfe684SEd Tanous * @endinternal 22777ccfe684SEd Tanous */ 22787ccfe684SEd Tanous nlohmann::json licenseRequired(std::string_view arg1) 22797ccfe684SEd Tanous { 2280*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::licenseRequired, 22817ccfe684SEd Tanous std::to_array({arg1})); 22827ccfe684SEd Tanous } 22837ccfe684SEd Tanous 22847ccfe684SEd Tanous void licenseRequired(crow::Response& res, std::string_view arg1) 22857ccfe684SEd Tanous { 22867ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 22877ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, licenseRequired(arg1)); 22887ccfe684SEd Tanous } 22897ccfe684SEd Tanous 22907ccfe684SEd Tanous /** 22917ccfe684SEd Tanous * @internal 22927ccfe684SEd Tanous * @brief Formats PropertyModified message into JSON 22937ccfe684SEd Tanous * 22947ccfe684SEd Tanous * See header file for more information 22957ccfe684SEd Tanous * @endinternal 22967ccfe684SEd Tanous */ 22977ccfe684SEd Tanous nlohmann::json propertyModified() 22987ccfe684SEd Tanous { 2299*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::propertyModified, {}); 23007ccfe684SEd Tanous } 23017ccfe684SEd Tanous 23027ccfe684SEd Tanous void propertyModified(crow::Response& res) 23037ccfe684SEd Tanous { 23047ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 23057ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, propertyModified()); 23067585b760SJishnu CM } 23077585b760SJishnu CM 2308f8cca876SEd Tanous /** 2309f8cca876SEd Tanous * @internal 2310f8cca876SEd Tanous * @brief Formats GenerateSecretKeyRequired message into JSON 2311f8cca876SEd Tanous * 2312f8cca876SEd Tanous * See header file for more information 2313f8cca876SEd Tanous * @endinternal 2314f8cca876SEd Tanous */ 2315f8cca876SEd Tanous nlohmann::json generateSecretKeyRequired(const boost::urls::url_view_base& arg1) 2316f8cca876SEd Tanous { 2317*4a102cd4SPatrick Williams return getLog(redfish::registries::Base::Index::generateSecretKeyRequired, 2318f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 2319f8cca876SEd Tanous } 2320f8cca876SEd Tanous 2321f8cca876SEd Tanous void generateSecretKeyRequired(crow::Response& res, 2322f8cca876SEd Tanous const boost::urls::url_view_base& arg1) 2323f8cca876SEd Tanous { 2324f8cca876SEd Tanous res.result(boost::beast::http::status::forbidden); 2325f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, generateSecretKeyRequired(arg1)); 2326f8cca876SEd Tanous } 2327f8cca876SEd Tanous 2328f4c4dcf4SKowalski, Kamil } // namespace messages 2329d425c6f6SEd Tanous } // namespace redfish 2330