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 130442ef92SNan Zhou #include "http_response.hpp" 140442ef92SNan Zhou #include "logging.hpp" 150442ef92SNan Zhou #include "registries.hpp" 160442ef92SNan Zhou #include "registries/base_message_registry.hpp" 170442ef92SNan Zhou 180442ef92SNan Zhou #include <boost/beast/http/field.hpp> 199ea15c35SEd Tanous #include <boost/beast/http/status.hpp> 204a7fbefdSEd Tanous #include <boost/url/url_view_base.hpp> 21faf100f9SEd Tanous #include <nlohmann/json.hpp> 22f4c4dcf4SKowalski, Kamil 231668ce6dSEd Tanous #include <array> 240442ef92SNan Zhou #include <cstddef> 25f0b59af4SEd Tanous #include <cstdint> 26d85418e3SPatrick Williams #include <source_location> 270442ef92SNan Zhou #include <span> 280442ef92SNan Zhou #include <string> 29f0b59af4SEd Tanous #include <string_view> 300442ef92SNan Zhou 317ccfe684SEd Tanous // Clang can't seem to decide whether this header needs to be included or not, 327ccfe684SEd Tanous // and is inconsistent. Include it for now 337ccfe684SEd Tanous // NOLINTNEXTLINE(misc-include-cleaner) 347ccfe684SEd Tanous #include <utility> 357ccfe684SEd Tanous 361abe55efSEd Tanous namespace redfish 371abe55efSEd Tanous { 381abe55efSEd Tanous 391abe55efSEd Tanous namespace messages 401abe55efSEd Tanous { 41f4c4dcf4SKowalski, Kamil 42f12894f8SJason M. Bills static void addMessageToErrorJson(nlohmann::json& target, 431abe55efSEd Tanous const nlohmann::json& message) 441abe55efSEd Tanous { 45f4c4dcf4SKowalski, Kamil auto& error = target["error"]; 46f4c4dcf4SKowalski, Kamil 471abe55efSEd Tanous // If this is the first error message, fill in the information from the 481abe55efSEd Tanous // first error message to the top level struct 491abe55efSEd Tanous if (!error.is_object()) 501abe55efSEd Tanous { 51c074230bSJason M. Bills auto messageIdIterator = message.find("MessageId"); 52c074230bSJason M. Bills if (messageIdIterator == message.end()) 531abe55efSEd Tanous { 5462598e31SEd Tanous BMCWEB_LOG_CRITICAL( 5562598e31SEd Tanous "Attempt to add error message without MessageId"); 56f4c4dcf4SKowalski, Kamil return; 57f4c4dcf4SKowalski, Kamil } 58f4c4dcf4SKowalski, Kamil 59c074230bSJason M. Bills auto messageFieldIterator = message.find("Message"); 60c074230bSJason M. Bills if (messageFieldIterator == message.end()) 611abe55efSEd Tanous { 6262598e31SEd Tanous BMCWEB_LOG_CRITICAL("Attempt to add error message without Message"); 63f4c4dcf4SKowalski, Kamil return; 64f4c4dcf4SKowalski, Kamil } 651476687dSEd Tanous error["code"] = *messageIdIterator; 661476687dSEd Tanous error["message"] = *messageFieldIterator; 671abe55efSEd Tanous } 681abe55efSEd Tanous else 691abe55efSEd Tanous { 70f4c4dcf4SKowalski, Kamil // More than 1 error occurred, so the message has to be generic 7155c7b7a2SEd Tanous error["code"] = std::string(messageVersionPrefix) + "GeneralError"; 72cc9139ecSJason M. Bills error["message"] = "A general error has occurred. See Resolution for " 73cc9139ecSJason M. Bills "information on how to resolve the error."; 74f4c4dcf4SKowalski, Kamil } 75f4c4dcf4SKowalski, Kamil 763590bd1dSNan Zhou // This check could technically be done in the default construction 77f4c4dcf4SKowalski, Kamil // branch above, but because we need the pointer to the extended info field 78f4c4dcf4SKowalski, Kamil // anyway, it's more efficient to do it here. 79c074230bSJason M. Bills auto& extendedInfo = error[messages::messageAnnotation]; 80c074230bSJason M. Bills if (!extendedInfo.is_array()) 811abe55efSEd Tanous { 82c074230bSJason M. Bills extendedInfo = nlohmann::json::array(); 83f4c4dcf4SKowalski, Kamil } 84f4c4dcf4SKowalski, Kamil 85c074230bSJason M. Bills extendedInfo.push_back(message); 86f4c4dcf4SKowalski, Kamil } 87f4c4dcf4SKowalski, Kamil 883590bd1dSNan Zhou void moveErrorsToErrorJson(nlohmann::json& target, nlohmann::json& source) 893590bd1dSNan Zhou { 903590bd1dSNan Zhou if (!source.is_object()) 913590bd1dSNan Zhou { 923590bd1dSNan Zhou return; 933590bd1dSNan Zhou } 943590bd1dSNan Zhou auto errorIt = source.find("error"); 953590bd1dSNan Zhou if (errorIt == source.end()) 963590bd1dSNan Zhou { 973590bd1dSNan Zhou // caller puts error message in root 983590bd1dSNan Zhou messages::addMessageToErrorJson(target, source); 993590bd1dSNan Zhou source.clear(); 1003590bd1dSNan Zhou return; 1013590bd1dSNan Zhou } 1023590bd1dSNan Zhou auto extendedInfoIt = errorIt->find(messages::messageAnnotation); 1033590bd1dSNan Zhou if (extendedInfoIt == errorIt->end()) 1043590bd1dSNan Zhou { 1053590bd1dSNan Zhou return; 1063590bd1dSNan Zhou } 1073590bd1dSNan Zhou const nlohmann::json::array_t* extendedInfo = 1083590bd1dSNan Zhou (*extendedInfoIt).get_ptr<const nlohmann::json::array_t*>(); 1093590bd1dSNan Zhou if (extendedInfo == nullptr) 1103590bd1dSNan Zhou { 1113590bd1dSNan Zhou source.erase(errorIt); 1123590bd1dSNan Zhou return; 1133590bd1dSNan Zhou } 1143590bd1dSNan Zhou for (const nlohmann::json& message : *extendedInfo) 1153590bd1dSNan Zhou { 1163590bd1dSNan Zhou addMessageToErrorJson(target, message); 1173590bd1dSNan Zhou } 1183590bd1dSNan Zhou source.erase(errorIt); 1193590bd1dSNan Zhou } 1203590bd1dSNan Zhou 121f12894f8SJason M. Bills static void addMessageToJsonRoot(nlohmann::json& target, 122f12894f8SJason M. Bills const nlohmann::json& message) 1231abe55efSEd Tanous { 1241abe55efSEd Tanous if (!target[messages::messageAnnotation].is_array()) 1251abe55efSEd Tanous { 126f4c4dcf4SKowalski, Kamil // Force object to be an array 12755c7b7a2SEd Tanous target[messages::messageAnnotation] = nlohmann::json::array(); 128f4c4dcf4SKowalski, Kamil } 129f4c4dcf4SKowalski, Kamil 13055c7b7a2SEd Tanous target[messages::messageAnnotation].push_back(message); 131f4c4dcf4SKowalski, Kamil } 132f4c4dcf4SKowalski, Kamil 133f12894f8SJason M. Bills static void addMessageToJson(nlohmann::json& target, 134f12894f8SJason M. Bills const nlohmann::json& message, 1351668ce6dSEd Tanous std::string_view fieldPath) 1361abe55efSEd Tanous { 1371668ce6dSEd Tanous std::string extendedInfo(fieldPath); 1381668ce6dSEd Tanous extendedInfo += messages::messageAnnotation; 139f4c4dcf4SKowalski, Kamil 1401668ce6dSEd Tanous nlohmann::json& field = target[extendedInfo]; 1411668ce6dSEd Tanous if (!field.is_array()) 1421abe55efSEd Tanous { 143f4c4dcf4SKowalski, Kamil // Force object to be an array 1441668ce6dSEd Tanous field = nlohmann::json::array(); 145f4c4dcf4SKowalski, Kamil } 146f4c4dcf4SKowalski, Kamil 147f4c4dcf4SKowalski, Kamil // Object exists and it is an array so we can just push in the message 1481668ce6dSEd Tanous field.push_back(message); 149f4c4dcf4SKowalski, Kamil } 150f4c4dcf4SKowalski, Kamil 151f7725d79SEd Tanous static nlohmann::json getLog(redfish::registries::base::Index name, 152b6cd31e1SEd Tanous std::span<const std::string_view> args) 153b6cd31e1SEd Tanous { 154b6cd31e1SEd Tanous size_t index = static_cast<size_t>(name); 155fffb8c1fSEd Tanous if (index >= redfish::registries::base::registry.size()) 156b6cd31e1SEd Tanous { 157b6cd31e1SEd Tanous return {}; 158b6cd31e1SEd Tanous } 15965e4f1f7SEd Tanous return getLogFromRegistry(redfish::registries::base::header, 16065e4f1f7SEd Tanous redfish::registries::base::registry, index, args); 161b6cd31e1SEd Tanous } 162b6cd31e1SEd Tanous 163f4c4dcf4SKowalski, Kamil /** 164f4c4dcf4SKowalski, Kamil * @internal 165*f8cca876SEd Tanous * @brief Formats Success message into JSON 166f4c4dcf4SKowalski, Kamil * 167f4c4dcf4SKowalski, Kamil * See header file for more information 168f4c4dcf4SKowalski, Kamil * @endinternal 169f4c4dcf4SKowalski, Kamil */ 170*f8cca876SEd Tanous nlohmann::json success() 1711abe55efSEd Tanous { 172*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::success, {}); 173b5c07418SJames Feist } 174b5c07418SJames Feist 175*f8cca876SEd Tanous void success(crow::Response& res) 176b5c07418SJames Feist { 177*f8cca876SEd Tanous addMessageToJsonRoot(res.jsonValue, success()); 178f4c4dcf4SKowalski, Kamil } 179f4c4dcf4SKowalski, Kamil 180f4c4dcf4SKowalski, Kamil /** 181f4c4dcf4SKowalski, Kamil * @internal 182*f8cca876SEd Tanous * @brief Formats GeneralError message into JSON 183f4c4dcf4SKowalski, Kamil * 184f4c4dcf4SKowalski, Kamil * See header file for more information 185f4c4dcf4SKowalski, Kamil * @endinternal 186f4c4dcf4SKowalski, Kamil */ 187*f8cca876SEd Tanous nlohmann::json generalError() 1881abe55efSEd Tanous { 189*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::generalError, {}); 190b5c07418SJames Feist } 191b5c07418SJames Feist 192*f8cca876SEd Tanous void generalError(crow::Response& res) 193b5c07418SJames Feist { 194b5c07418SJames Feist res.result(boost::beast::http::status::internal_server_error); 195*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, generalError()); 196f12894f8SJason M. Bills } 197f12894f8SJason M. Bills 198f12894f8SJason M. Bills /** 199f12894f8SJason M. Bills * @internal 200*f8cca876SEd Tanous * @brief Formats Created message into JSON 201f4c4dcf4SKowalski, Kamil * 202f4c4dcf4SKowalski, Kamil * See header file for more information 203f4c4dcf4SKowalski, Kamil * @endinternal 204f4c4dcf4SKowalski, Kamil */ 205*f8cca876SEd Tanous nlohmann::json created() 2061abe55efSEd Tanous { 207*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::created, {}); 208b5c07418SJames Feist } 209b5c07418SJames Feist 210*f8cca876SEd Tanous void created(crow::Response& res) 211*f8cca876SEd Tanous { 212*f8cca876SEd Tanous res.result(boost::beast::http::status::created); 213*f8cca876SEd Tanous addMessageToJsonRoot(res.jsonValue, created()); 214*f8cca876SEd Tanous } 215*f8cca876SEd Tanous 216*f8cca876SEd Tanous /** 217*f8cca876SEd Tanous * @internal 218*f8cca876SEd Tanous * @brief Formats NoOperation message into JSON 219*f8cca876SEd Tanous * 220*f8cca876SEd Tanous * See header file for more information 221*f8cca876SEd Tanous * @endinternal 222*f8cca876SEd Tanous */ 223*f8cca876SEd Tanous nlohmann::json noOperation() 224*f8cca876SEd Tanous { 225*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::noOperation, {}); 226*f8cca876SEd Tanous } 227*f8cca876SEd Tanous 228*f8cca876SEd Tanous void noOperation(crow::Response& res) 229b5c07418SJames Feist { 230b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 231*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, noOperation()); 232f4c4dcf4SKowalski, Kamil } 233f4c4dcf4SKowalski, Kamil 234f4c4dcf4SKowalski, Kamil /** 235f4c4dcf4SKowalski, Kamil * @internal 236f4c4dcf4SKowalski, Kamil * @brief Formats PropertyDuplicate message into JSON 237f4c4dcf4SKowalski, Kamil * 238f4c4dcf4SKowalski, Kamil * See header file for more information 239f4c4dcf4SKowalski, Kamil * @endinternal 240f4c4dcf4SKowalski, Kamil */ 2411668ce6dSEd Tanous nlohmann::json propertyDuplicate(std::string_view arg1) 2421abe55efSEd Tanous { 243fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::propertyDuplicate, 2441668ce6dSEd Tanous std::to_array({arg1})); 245b5c07418SJames Feist } 246b5c07418SJames Feist 2471668ce6dSEd Tanous void propertyDuplicate(crow::Response& res, std::string_view arg1) 248b5c07418SJames Feist { 249b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 250b5c07418SJames Feist addMessageToJson(res.jsonValue, propertyDuplicate(arg1), arg1); 251f4c4dcf4SKowalski, Kamil } 252f4c4dcf4SKowalski, Kamil 253f4c4dcf4SKowalski, Kamil /** 254f4c4dcf4SKowalski, Kamil * @internal 255*f8cca876SEd Tanous * @brief Formats PropertyUnknown message into JSON 256f4c4dcf4SKowalski, Kamil * 257f4c4dcf4SKowalski, Kamil * See header file for more information 258f4c4dcf4SKowalski, Kamil * @endinternal 259f4c4dcf4SKowalski, Kamil */ 260*f8cca876SEd Tanous nlohmann::json propertyUnknown(std::string_view arg1) 2611abe55efSEd Tanous { 262*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::propertyUnknown, 2631668ce6dSEd Tanous std::to_array({arg1})); 264b5c07418SJames Feist } 265b5c07418SJames Feist 266*f8cca876SEd Tanous void propertyUnknown(crow::Response& res, std::string_view arg1) 267b5c07418SJames Feist { 268b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 269*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, propertyUnknown(arg1)); 270f4c4dcf4SKowalski, Kamil } 271f4c4dcf4SKowalski, Kamil 272f4c4dcf4SKowalski, Kamil /** 273f4c4dcf4SKowalski, Kamil * @internal 274*f8cca876SEd Tanous * @brief Formats PropertyValueTypeError message into JSON 275f4c4dcf4SKowalski, Kamil * 276f4c4dcf4SKowalski, Kamil * See header file for more information 277f4c4dcf4SKowalski, Kamil * @endinternal 278f4c4dcf4SKowalski, Kamil */ 279*f8cca876SEd Tanous nlohmann::json propertyValueTypeError(const nlohmann::json& arg1, 280*f8cca876SEd Tanous std::string_view arg2) 2811abe55efSEd Tanous { 282*f8cca876SEd Tanous std::string arg1Str = 283*f8cca876SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 284*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::propertyValueTypeError, 285*f8cca876SEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 286b5c07418SJames Feist } 287b5c07418SJames Feist 288*f8cca876SEd Tanous void propertyValueTypeError(crow::Response& res, const nlohmann::json& arg1, 289*f8cca876SEd Tanous std::string_view arg2) 290b5c07418SJames Feist { 291b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 292*f8cca876SEd Tanous addMessageToJson(res.jsonValue, propertyValueTypeError(arg1, arg2), arg2); 293f12894f8SJason M. Bills } 294f12894f8SJason M. Bills 295f12894f8SJason M. Bills /** 296f12894f8SJason M. Bills * @internal 2977ccfe684SEd Tanous * @brief Formats PropertyValueFormatError message into JSON 298f12894f8SJason M. Bills * 299f12894f8SJason M. Bills * See header file for more information 300f12894f8SJason M. Bills * @endinternal 301f12894f8SJason M. Bills */ 302f818b04dSEd Tanous nlohmann::json propertyValueFormatError(const nlohmann::json& arg1, 3031668ce6dSEd Tanous std::string_view arg2) 304f12894f8SJason M. Bills { 305bd79bce8SPatrick Williams std::string arg1Str = 306034e1259SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 307fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::propertyValueFormatError, 308f818b04dSEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 309b5c07418SJames Feist } 310b5c07418SJames Feist 311f818b04dSEd Tanous void propertyValueFormatError(crow::Response& res, const nlohmann::json& arg1, 3121668ce6dSEd Tanous std::string_view arg2) 313b5c07418SJames Feist { 314b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 315b5c07418SJames Feist addMessageToJson(res.jsonValue, propertyValueFormatError(arg1, arg2), arg2); 316f12894f8SJason M. Bills } 317f12894f8SJason M. Bills 318f12894f8SJason M. Bills /** 319f12894f8SJason M. Bills * @internal 3207ccfe684SEd Tanous * @brief Formats PropertyValueNotInList message into JSON 321f12894f8SJason M. Bills * 322f12894f8SJason M. Bills * See header file for more information 323f12894f8SJason M. Bills * @endinternal 324f12894f8SJason M. Bills */ 325e2616cc5SEd Tanous nlohmann::json propertyValueNotInList(const nlohmann::json& arg1, 3261668ce6dSEd Tanous std::string_view arg2) 327f12894f8SJason M. Bills { 328bd79bce8SPatrick Williams std::string arg1Str = 329bd79bce8SPatrick Williams arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 330fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::propertyValueNotInList, 331e2616cc5SEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 332b5c07418SJames Feist } 333b5c07418SJames Feist 334e2616cc5SEd Tanous void propertyValueNotInList(crow::Response& res, const nlohmann::json& arg1, 3351668ce6dSEd Tanous std::string_view arg2) 336b5c07418SJames Feist { 337b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 338b5c07418SJames Feist addMessageToJson(res.jsonValue, propertyValueNotInList(arg1, arg2), arg2); 339f4c4dcf4SKowalski, Kamil } 340f4c4dcf4SKowalski, Kamil 341f4c4dcf4SKowalski, Kamil /** 342f4c4dcf4SKowalski, Kamil * @internal 343227a2b0aSJiaqing Zhao * @brief Formats PropertyValueOutOfRange message into JSON 344227a2b0aSJiaqing Zhao * 345227a2b0aSJiaqing Zhao * See header file for more information 346227a2b0aSJiaqing Zhao * @endinternal 347227a2b0aSJiaqing Zhao */ 34895b3ad73SEd Tanous nlohmann::json propertyValueOutOfRange(const nlohmann::json& arg1, 349227a2b0aSJiaqing Zhao std::string_view arg2) 350227a2b0aSJiaqing Zhao { 351bd79bce8SPatrick Williams std::string arg1Str = 352034e1259SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 353227a2b0aSJiaqing Zhao return getLog(redfish::registries::base::Index::propertyValueOutOfRange, 35495b3ad73SEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 355227a2b0aSJiaqing Zhao } 356227a2b0aSJiaqing Zhao 35795b3ad73SEd Tanous void propertyValueOutOfRange(crow::Response& res, const nlohmann::json& arg1, 358227a2b0aSJiaqing Zhao std::string_view arg2) 359227a2b0aSJiaqing Zhao { 360227a2b0aSJiaqing Zhao res.result(boost::beast::http::status::bad_request); 361227a2b0aSJiaqing Zhao addMessageToErrorJson(res.jsonValue, propertyValueOutOfRange(arg1, arg2)); 362227a2b0aSJiaqing Zhao } 363227a2b0aSJiaqing Zhao 364227a2b0aSJiaqing Zhao /** 365227a2b0aSJiaqing Zhao * @internal 366*f8cca876SEd Tanous * @brief Formats PropertyValueError message into JSON 367f4c4dcf4SKowalski, Kamil * 368f4c4dcf4SKowalski, Kamil * See header file for more information 369f4c4dcf4SKowalski, Kamil * @endinternal 370f4c4dcf4SKowalski, Kamil */ 371*f8cca876SEd Tanous nlohmann::json propertyValueError(std::string_view arg1) 3721abe55efSEd Tanous { 373*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::propertyValueError, 3741668ce6dSEd Tanous std::to_array({arg1})); 37581856681SAsmitha Karunanithi } 37681856681SAsmitha Karunanithi 377*f8cca876SEd Tanous void propertyValueError(crow::Response& res, std::string_view arg1) 37881856681SAsmitha Karunanithi { 379*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 380*f8cca876SEd Tanous addMessageToJson(res.jsonValue, propertyValueError(arg1), arg1); 38181856681SAsmitha Karunanithi } 38281856681SAsmitha Karunanithi 38381856681SAsmitha Karunanithi /** 38481856681SAsmitha Karunanithi * @internal 385*f8cca876SEd Tanous * @brief Formats PropertyNotWritable message into JSON 386f4c4dcf4SKowalski, Kamil * 387f4c4dcf4SKowalski, Kamil * See header file for more information 388f4c4dcf4SKowalski, Kamil * @endinternal 389f4c4dcf4SKowalski, Kamil */ 390*f8cca876SEd Tanous nlohmann::json propertyNotWritable(std::string_view arg1) 3911abe55efSEd Tanous { 392*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::propertyNotWritable, 393*f8cca876SEd Tanous std::to_array({arg1})); 394b5c07418SJames Feist } 395b5c07418SJames Feist 396*f8cca876SEd Tanous void propertyNotWritable(crow::Response& res, std::string_view arg1) 397b5c07418SJames Feist { 398*f8cca876SEd Tanous res.result(boost::beast::http::status::forbidden); 399*f8cca876SEd Tanous addMessageToJson(res.jsonValue, propertyNotWritable(arg1), arg1); 400f4c4dcf4SKowalski, Kamil } 401f4c4dcf4SKowalski, Kamil 402f4c4dcf4SKowalski, Kamil /** 403f4c4dcf4SKowalski, Kamil * @internal 404*f8cca876SEd Tanous * @brief Formats PropertyNotUpdated message into JSON 405f4c4dcf4SKowalski, Kamil * 406f4c4dcf4SKowalski, Kamil * See header file for more information 407f4c4dcf4SKowalski, Kamil * @endinternal 408f4c4dcf4SKowalski, Kamil */ 409*f8cca876SEd Tanous nlohmann::json propertyNotUpdated(std::string_view arg1) 4101abe55efSEd Tanous { 411*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::propertyNotUpdated, 412*f8cca876SEd Tanous std::to_array({arg1})); 413b5c07418SJames Feist } 414b5c07418SJames Feist 415*f8cca876SEd Tanous void propertyNotUpdated(crow::Response& res, std::string_view arg1) 416b5c07418SJames Feist { 417*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 418*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, propertyNotUpdated(arg1)); 419*f8cca876SEd Tanous } 420*f8cca876SEd Tanous 421*f8cca876SEd Tanous /** 422*f8cca876SEd Tanous * @internal 423*f8cca876SEd Tanous * @brief Formats PropertyMissing message into JSON 424*f8cca876SEd Tanous * 425*f8cca876SEd Tanous * See header file for more information 426*f8cca876SEd Tanous * @endinternal 427*f8cca876SEd Tanous */ 428*f8cca876SEd Tanous nlohmann::json propertyMissing(std::string_view arg1) 429*f8cca876SEd Tanous { 430*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::propertyMissing, 431*f8cca876SEd Tanous std::to_array({arg1})); 432*f8cca876SEd Tanous } 433*f8cca876SEd Tanous 434*f8cca876SEd Tanous void propertyMissing(crow::Response& res, std::string_view arg1) 435*f8cca876SEd Tanous { 436*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 437*f8cca876SEd Tanous addMessageToJson(res.jsonValue, propertyMissing(arg1), arg1); 438*f8cca876SEd Tanous } 439*f8cca876SEd Tanous 440*f8cca876SEd Tanous /** 441*f8cca876SEd Tanous * @internal 442*f8cca876SEd Tanous * @brief Formats MalformedJSON message into JSON 443*f8cca876SEd Tanous * 444*f8cca876SEd Tanous * See header file for more information 445*f8cca876SEd Tanous * @endinternal 446*f8cca876SEd Tanous */ 447*f8cca876SEd Tanous nlohmann::json malformedJSON() 448*f8cca876SEd Tanous { 449*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::malformedJSON, {}); 450*f8cca876SEd Tanous } 451*f8cca876SEd Tanous 452*f8cca876SEd Tanous void malformedJSON(crow::Response& res) 453*f8cca876SEd Tanous { 454*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 455*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, malformedJSON()); 456*f8cca876SEd Tanous } 457*f8cca876SEd Tanous 458*f8cca876SEd Tanous /** 459*f8cca876SEd Tanous * @internal 460*f8cca876SEd Tanous * @brief Formats InvalidJSON message into JSON 461*f8cca876SEd Tanous * 462*f8cca876SEd Tanous * See header file for more information 463*f8cca876SEd Tanous * @endinternal 464*f8cca876SEd Tanous */ 465*f8cca876SEd Tanous nlohmann::json invalidJSON(std::string_view arg1) 466*f8cca876SEd Tanous { 467*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::invalidJSON, 468*f8cca876SEd Tanous std::to_array({arg1})); 469*f8cca876SEd Tanous } 470*f8cca876SEd Tanous 471*f8cca876SEd Tanous void invalidJSON(crow::Response& res, std::string_view arg1) 472*f8cca876SEd Tanous { 473*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 474*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, invalidJSON(arg1)); 475*f8cca876SEd Tanous } 476*f8cca876SEd Tanous 477*f8cca876SEd Tanous /** 478*f8cca876SEd Tanous * @internal 479*f8cca876SEd Tanous * @brief Formats EmptyJSON message into JSON 480*f8cca876SEd Tanous * 481*f8cca876SEd Tanous * See header file for more information 482*f8cca876SEd Tanous * @endinternal 483*f8cca876SEd Tanous */ 484*f8cca876SEd Tanous nlohmann::json emptyJSON() 485*f8cca876SEd Tanous { 486*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::emptyJSON, {}); 487*f8cca876SEd Tanous } 488*f8cca876SEd Tanous 489*f8cca876SEd Tanous void emptyJSON(crow::Response& res) 490*f8cca876SEd Tanous { 491*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 492*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, emptyJSON()); 493*f8cca876SEd Tanous } 494*f8cca876SEd Tanous 495*f8cca876SEd Tanous /** 496*f8cca876SEd Tanous * @internal 497*f8cca876SEd Tanous * @brief Formats ActionNotSupported message into JSON 498*f8cca876SEd Tanous * 499*f8cca876SEd Tanous * See header file for more information 500*f8cca876SEd Tanous * @endinternal 501*f8cca876SEd Tanous */ 502*f8cca876SEd Tanous nlohmann::json actionNotSupported(std::string_view arg1) 503*f8cca876SEd Tanous { 504*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::actionNotSupported, 505*f8cca876SEd Tanous std::to_array({arg1})); 506*f8cca876SEd Tanous } 507*f8cca876SEd Tanous 508*f8cca876SEd Tanous void actionNotSupported(crow::Response& res, std::string_view arg1) 509*f8cca876SEd Tanous { 510*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 511*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, actionNotSupported(arg1)); 512f4c4dcf4SKowalski, Kamil } 513f4c4dcf4SKowalski, Kamil 514f4c4dcf4SKowalski, Kamil /** 515f4c4dcf4SKowalski, Kamil * @internal 516f4c4dcf4SKowalski, Kamil * @brief Formats ActionParameterMissing message into JSON 517f4c4dcf4SKowalski, Kamil * 518f4c4dcf4SKowalski, Kamil * See header file for more information 519f4c4dcf4SKowalski, Kamil * @endinternal 520f4c4dcf4SKowalski, Kamil */ 5211668ce6dSEd Tanous nlohmann::json actionParameterMissing(std::string_view arg1, 5221668ce6dSEd Tanous std::string_view arg2) 5231abe55efSEd Tanous { 524fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::actionParameterMissing, 5251668ce6dSEd Tanous std::to_array({arg1, arg2})); 526b5c07418SJames Feist } 527b5c07418SJames Feist 5281668ce6dSEd Tanous void actionParameterMissing(crow::Response& res, std::string_view arg1, 5291668ce6dSEd Tanous std::string_view arg2) 530b5c07418SJames Feist { 531b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 532b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, actionParameterMissing(arg1, arg2)); 533f4c4dcf4SKowalski, Kamil } 534f4c4dcf4SKowalski, Kamil 535f4c4dcf4SKowalski, Kamil /** 536f4c4dcf4SKowalski, Kamil * @internal 537*f8cca876SEd Tanous * @brief Formats ActionParameterDuplicate message into JSON 538*f8cca876SEd Tanous * 539*f8cca876SEd Tanous * See header file for more information 540*f8cca876SEd Tanous * @endinternal 541*f8cca876SEd Tanous */ 542*f8cca876SEd Tanous nlohmann::json actionParameterDuplicate(std::string_view arg1, 543*f8cca876SEd Tanous std::string_view arg2) 544*f8cca876SEd Tanous { 545*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::actionParameterDuplicate, 546*f8cca876SEd Tanous std::to_array({arg1, arg2})); 547*f8cca876SEd Tanous } 548*f8cca876SEd Tanous 549*f8cca876SEd Tanous void actionParameterDuplicate(crow::Response& res, std::string_view arg1, 550*f8cca876SEd Tanous std::string_view arg2) 551*f8cca876SEd Tanous { 552*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 553*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, actionParameterDuplicate(arg1, arg2)); 554*f8cca876SEd Tanous } 555*f8cca876SEd Tanous 556*f8cca876SEd Tanous /** 557*f8cca876SEd Tanous * @internal 558*f8cca876SEd Tanous * @brief Formats ActionParameterUnknown message into JSON 559*f8cca876SEd Tanous * 560*f8cca876SEd Tanous * See header file for more information 561*f8cca876SEd Tanous * @endinternal 562*f8cca876SEd Tanous */ 563*f8cca876SEd Tanous nlohmann::json actionParameterUnknown(std::string_view arg1, 564*f8cca876SEd Tanous std::string_view arg2) 565*f8cca876SEd Tanous { 566*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::actionParameterUnknown, 567*f8cca876SEd Tanous std::to_array({arg1, arg2})); 568*f8cca876SEd Tanous } 569*f8cca876SEd Tanous 570*f8cca876SEd Tanous void actionParameterUnknown(crow::Response& res, std::string_view arg1, 571*f8cca876SEd Tanous std::string_view arg2) 572*f8cca876SEd Tanous { 573*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 574*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, actionParameterUnknown(arg1, arg2)); 575*f8cca876SEd Tanous } 576*f8cca876SEd Tanous 577*f8cca876SEd Tanous /** 578*f8cca876SEd Tanous * @internal 579*f8cca876SEd Tanous * @brief Formats ActionParameterValueTypeError message into JSON 580*f8cca876SEd Tanous * 581*f8cca876SEd Tanous * See header file for more information 582*f8cca876SEd Tanous * @endinternal 583*f8cca876SEd Tanous */ 584*f8cca876SEd Tanous nlohmann::json actionParameterValueTypeError( 585*f8cca876SEd Tanous const nlohmann::json& arg1, std::string_view arg2, std::string_view arg3) 586*f8cca876SEd Tanous { 587*f8cca876SEd Tanous std::string arg1Str = 588*f8cca876SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 589*f8cca876SEd Tanous return getLog( 590*f8cca876SEd Tanous redfish::registries::base::Index::actionParameterValueTypeError, 591*f8cca876SEd Tanous std::to_array<std::string_view>({arg1Str, arg2, arg3})); 592*f8cca876SEd Tanous } 593*f8cca876SEd Tanous 594*f8cca876SEd Tanous void actionParameterValueTypeError(crow::Response& res, 595*f8cca876SEd Tanous const nlohmann::json& arg1, 596*f8cca876SEd Tanous std::string_view arg2, std::string_view arg3) 597*f8cca876SEd Tanous { 598*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 599*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 600*f8cca876SEd Tanous actionParameterValueTypeError(arg1, arg2, arg3)); 601*f8cca876SEd Tanous } 602*f8cca876SEd Tanous 603*f8cca876SEd Tanous /** 604*f8cca876SEd Tanous * @internal 605*f8cca876SEd Tanous * @brief Formats ActionParameterValueFormatError message into JSON 606*f8cca876SEd Tanous * 607*f8cca876SEd Tanous * See header file for more information 608*f8cca876SEd Tanous * @endinternal 609*f8cca876SEd Tanous */ 610*f8cca876SEd Tanous nlohmann::json actionParameterValueFormatError( 611*f8cca876SEd Tanous const nlohmann::json& arg1, std::string_view arg2, std::string_view arg3) 612*f8cca876SEd Tanous { 613*f8cca876SEd Tanous std::string arg1Str = 614*f8cca876SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 615*f8cca876SEd Tanous return getLog( 616*f8cca876SEd Tanous redfish::registries::base::Index::actionParameterValueFormatError, 617*f8cca876SEd Tanous std::to_array<std::string_view>({arg1Str, arg2, arg3})); 618*f8cca876SEd Tanous } 619*f8cca876SEd Tanous 620*f8cca876SEd Tanous void actionParameterValueFormatError( 621*f8cca876SEd Tanous crow::Response& res, const nlohmann::json& arg1, std::string_view arg2, 622*f8cca876SEd Tanous std::string_view arg3) 623*f8cca876SEd Tanous { 624*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 625*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 626*f8cca876SEd Tanous actionParameterValueFormatError(arg1, arg2, arg3)); 627*f8cca876SEd Tanous } 628*f8cca876SEd Tanous 629*f8cca876SEd Tanous /** 630*f8cca876SEd Tanous * @internal 631*f8cca876SEd Tanous * @brief Formats ActionParameterValueNotInList message into JSON 632*f8cca876SEd Tanous * 633*f8cca876SEd Tanous * See header file for more information 634*f8cca876SEd Tanous * @endinternal 635*f8cca876SEd Tanous */ 636*f8cca876SEd Tanous nlohmann::json actionParameterValueNotInList( 637*f8cca876SEd Tanous std::string_view arg1, std::string_view arg2, std::string_view arg3) 638*f8cca876SEd Tanous { 639*f8cca876SEd Tanous return getLog( 640*f8cca876SEd Tanous redfish::registries::base::Index::actionParameterValueNotInList, 641*f8cca876SEd Tanous std::to_array({arg1, arg2, arg3})); 642*f8cca876SEd Tanous } 643*f8cca876SEd Tanous 644*f8cca876SEd Tanous void actionParameterValueNotInList(crow::Response& res, std::string_view arg1, 645*f8cca876SEd Tanous std::string_view arg2, std::string_view arg3) 646*f8cca876SEd Tanous { 647*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 648*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 649*f8cca876SEd Tanous actionParameterValueNotInList(arg1, arg2, arg3)); 650*f8cca876SEd Tanous } 651*f8cca876SEd Tanous 652*f8cca876SEd Tanous /** 653*f8cca876SEd Tanous * @internal 654*f8cca876SEd Tanous * @brief Formats ActionParameterValueOutOfRange message into JSON 655*f8cca876SEd Tanous * 656*f8cca876SEd Tanous * See header file for more information 657*f8cca876SEd Tanous * @endinternal 658*f8cca876SEd Tanous */ 659*f8cca876SEd Tanous nlohmann::json actionParameterValueOutOfRange( 660*f8cca876SEd Tanous std::string_view arg1, std::string_view arg2, std::string_view arg3) 661*f8cca876SEd Tanous { 662*f8cca876SEd Tanous return getLog( 663*f8cca876SEd Tanous redfish::registries::base::Index::actionParameterValueOutOfRange, 664*f8cca876SEd Tanous std::to_array({arg1, arg2, arg3})); 665*f8cca876SEd Tanous } 666*f8cca876SEd Tanous 667*f8cca876SEd Tanous void actionParameterValueOutOfRange(crow::Response& res, std::string_view arg1, 668*f8cca876SEd Tanous std::string_view arg2, 669*f8cca876SEd Tanous std::string_view arg3) 670*f8cca876SEd Tanous { 671*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 672*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 673*f8cca876SEd Tanous actionParameterValueOutOfRange(arg1, arg2, arg3)); 674*f8cca876SEd Tanous } 675*f8cca876SEd Tanous 676*f8cca876SEd Tanous /** 677*f8cca876SEd Tanous * @internal 678*f8cca876SEd Tanous * @brief Formats ActionParameterValueError message into JSON 679*f8cca876SEd Tanous * 680*f8cca876SEd Tanous * See header file for more information 681*f8cca876SEd Tanous * @endinternal 682*f8cca876SEd Tanous */ 683*f8cca876SEd Tanous nlohmann::json actionParameterValueError(const nlohmann::json& arg1, 684*f8cca876SEd Tanous std::string_view arg2) 685*f8cca876SEd Tanous { 686*f8cca876SEd Tanous std::string arg1Str = 687*f8cca876SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 688*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::actionParameterValueError, 689*f8cca876SEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 690*f8cca876SEd Tanous } 691*f8cca876SEd Tanous 692*f8cca876SEd Tanous void actionParameterValueError(crow::Response& res, const nlohmann::json& arg1, 693*f8cca876SEd Tanous std::string_view arg2) 694*f8cca876SEd Tanous { 695*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 696*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, actionParameterValueError(arg1, arg2)); 697*f8cca876SEd Tanous } 698*f8cca876SEd Tanous 699*f8cca876SEd Tanous /** 700*f8cca876SEd Tanous * @internal 701*f8cca876SEd Tanous * @brief Formats ActionParameterNotSupported message into JSON 702*f8cca876SEd Tanous * 703*f8cca876SEd Tanous * See header file for more information 704*f8cca876SEd Tanous * @endinternal 705*f8cca876SEd Tanous */ 706*f8cca876SEd Tanous nlohmann::json actionParameterNotSupported(std::string_view arg1, 707*f8cca876SEd Tanous std::string_view arg2) 708*f8cca876SEd Tanous { 709*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::actionParameterNotSupported, 710*f8cca876SEd Tanous std::to_array({arg1, arg2})); 711*f8cca876SEd Tanous } 712*f8cca876SEd Tanous 713*f8cca876SEd Tanous void actionParameterNotSupported(crow::Response& res, std::string_view arg1, 714*f8cca876SEd Tanous std::string_view arg2) 715*f8cca876SEd Tanous { 716*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 717*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 718*f8cca876SEd Tanous actionParameterNotSupported(arg1, arg2)); 719*f8cca876SEd Tanous } 720*f8cca876SEd Tanous 721*f8cca876SEd Tanous /** 722*f8cca876SEd Tanous * @internal 723*f8cca876SEd Tanous * @brief Formats ArraySizeTooLong message into JSON 724*f8cca876SEd Tanous * 725*f8cca876SEd Tanous * See header file for more information 726*f8cca876SEd Tanous * @endinternal 727*f8cca876SEd Tanous */ 728*f8cca876SEd Tanous nlohmann::json arraySizeTooLong(std::string_view arg1, uint64_t arg2) 729*f8cca876SEd Tanous { 730*f8cca876SEd Tanous std::string arg2Str = std::to_string(arg2); 731*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::arraySizeTooLong, 732*f8cca876SEd Tanous std::to_array<std::string_view>({arg1, arg2Str})); 733*f8cca876SEd Tanous } 734*f8cca876SEd Tanous 735*f8cca876SEd Tanous void arraySizeTooLong(crow::Response& res, std::string_view arg1, uint64_t arg2) 736*f8cca876SEd Tanous { 737*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 738*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, arraySizeTooLong(arg1, arg2)); 739*f8cca876SEd Tanous } 740*f8cca876SEd Tanous 741*f8cca876SEd Tanous /** 742*f8cca876SEd Tanous * @internal 743*f8cca876SEd Tanous * @brief Formats ArraySizeTooShort message into JSON 744*f8cca876SEd Tanous * 745*f8cca876SEd Tanous * See header file for more information 746*f8cca876SEd Tanous * @endinternal 747*f8cca876SEd Tanous */ 748*f8cca876SEd Tanous nlohmann::json arraySizeTooShort(std::string_view arg1, std::string_view arg2) 749*f8cca876SEd Tanous { 750*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::arraySizeTooShort, 751*f8cca876SEd Tanous std::to_array({arg1, arg2})); 752*f8cca876SEd Tanous } 753*f8cca876SEd Tanous 754*f8cca876SEd Tanous void arraySizeTooShort(crow::Response& res, std::string_view arg1, 755*f8cca876SEd Tanous std::string_view arg2) 756*f8cca876SEd Tanous { 757*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 758*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, arraySizeTooShort(arg1, arg2)); 759*f8cca876SEd Tanous } 760*f8cca876SEd Tanous 761*f8cca876SEd Tanous /** 762*f8cca876SEd Tanous * @internal 763*f8cca876SEd Tanous * @brief Formats QueryParameterValueTypeError message into JSON 764*f8cca876SEd Tanous * 765*f8cca876SEd Tanous * See header file for more information 766*f8cca876SEd Tanous * @endinternal 767*f8cca876SEd Tanous */ 768*f8cca876SEd Tanous nlohmann::json queryParameterValueTypeError(const nlohmann::json& arg1, 769*f8cca876SEd Tanous std::string_view arg2) 770*f8cca876SEd Tanous { 771*f8cca876SEd Tanous std::string arg1Str = 772*f8cca876SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 773*f8cca876SEd Tanous return getLog( 774*f8cca876SEd Tanous redfish::registries::base::Index::queryParameterValueTypeError, 775*f8cca876SEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 776*f8cca876SEd Tanous } 777*f8cca876SEd Tanous 778*f8cca876SEd Tanous void queryParameterValueTypeError( 779*f8cca876SEd Tanous crow::Response& res, const nlohmann::json& arg1, std::string_view arg2) 780*f8cca876SEd Tanous { 781*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 782*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 783*f8cca876SEd Tanous queryParameterValueTypeError(arg1, arg2)); 784*f8cca876SEd Tanous } 785*f8cca876SEd Tanous 786*f8cca876SEd Tanous /** 787*f8cca876SEd Tanous * @internal 788*f8cca876SEd Tanous * @brief Formats QueryParameterValueFormatError message into JSON 789*f8cca876SEd Tanous * 790*f8cca876SEd Tanous * See header file for more information 791*f8cca876SEd Tanous * @endinternal 792*f8cca876SEd Tanous */ 793*f8cca876SEd Tanous nlohmann::json queryParameterValueFormatError(const nlohmann::json& arg1, 794*f8cca876SEd Tanous std::string_view arg2) 795*f8cca876SEd Tanous { 796*f8cca876SEd Tanous std::string arg1Str = 797*f8cca876SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 798*f8cca876SEd Tanous return getLog( 799*f8cca876SEd Tanous redfish::registries::base::Index::queryParameterValueFormatError, 800*f8cca876SEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 801*f8cca876SEd Tanous } 802*f8cca876SEd Tanous 803*f8cca876SEd Tanous void queryParameterValueFormatError( 804*f8cca876SEd Tanous crow::Response& res, const nlohmann::json& arg1, std::string_view arg2) 805*f8cca876SEd Tanous { 806*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 807*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 808*f8cca876SEd Tanous queryParameterValueFormatError(arg1, arg2)); 809*f8cca876SEd Tanous } 810*f8cca876SEd Tanous 811*f8cca876SEd Tanous /** 812*f8cca876SEd Tanous * @internal 813*f8cca876SEd Tanous * @brief Formats QueryParameterValueError message into JSON 814*f8cca876SEd Tanous * 815*f8cca876SEd Tanous * See header file for more information 816*f8cca876SEd Tanous * @endinternal 817*f8cca876SEd Tanous */ 818*f8cca876SEd Tanous nlohmann::json queryParameterValueError(std::string_view arg1) 819*f8cca876SEd Tanous { 820*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::queryParameterValueError, 821*f8cca876SEd Tanous std::to_array({arg1})); 822*f8cca876SEd Tanous } 823*f8cca876SEd Tanous 824*f8cca876SEd Tanous void queryParameterValueError(crow::Response& res, std::string_view arg1) 825*f8cca876SEd Tanous { 826*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 827*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, queryParameterValueError(arg1)); 828*f8cca876SEd Tanous } 829*f8cca876SEd Tanous 830*f8cca876SEd Tanous /** 831*f8cca876SEd Tanous * @internal 832*f8cca876SEd Tanous * @brief Formats QueryParameterOutOfRange message into JSON 833*f8cca876SEd Tanous * 834*f8cca876SEd Tanous * See header file for more information 835*f8cca876SEd Tanous * @endinternal 836*f8cca876SEd Tanous */ 837*f8cca876SEd Tanous nlohmann::json queryParameterOutOfRange( 838*f8cca876SEd Tanous std::string_view arg1, std::string_view arg2, std::string_view arg3) 839*f8cca876SEd Tanous { 840*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::queryParameterOutOfRange, 841*f8cca876SEd Tanous std::to_array({arg1, arg2, arg3})); 842*f8cca876SEd Tanous } 843*f8cca876SEd Tanous 844*f8cca876SEd Tanous void queryParameterOutOfRange(crow::Response& res, std::string_view arg1, 845*f8cca876SEd Tanous std::string_view arg2, std::string_view arg3) 846*f8cca876SEd Tanous { 847*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 848*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 849*f8cca876SEd Tanous queryParameterOutOfRange(arg1, arg2, arg3)); 850*f8cca876SEd Tanous } 851*f8cca876SEd Tanous 852*f8cca876SEd Tanous /** 853*f8cca876SEd Tanous * @internal 854*f8cca876SEd Tanous * @brief Formats QueryNotSupportedOnResource message into JSON 855*f8cca876SEd Tanous * 856*f8cca876SEd Tanous * See header file for more information 857*f8cca876SEd Tanous * @endinternal 858*f8cca876SEd Tanous */ 859*f8cca876SEd Tanous nlohmann::json queryNotSupportedOnResource() 860*f8cca876SEd Tanous { 861*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::queryNotSupportedOnResource, 862*f8cca876SEd Tanous {}); 863*f8cca876SEd Tanous } 864*f8cca876SEd Tanous 865*f8cca876SEd Tanous void queryNotSupportedOnResource(crow::Response& res) 866*f8cca876SEd Tanous { 867*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 868*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, queryNotSupportedOnResource()); 869*f8cca876SEd Tanous } 870*f8cca876SEd Tanous 871*f8cca876SEd Tanous /** 872*f8cca876SEd Tanous * @internal 873*f8cca876SEd Tanous * @brief Formats QueryNotSupportedOnOperation message into JSON 874*f8cca876SEd Tanous * 875*f8cca876SEd Tanous * See header file for more information 876*f8cca876SEd Tanous * @endinternal 877*f8cca876SEd Tanous */ 878*f8cca876SEd Tanous nlohmann::json queryNotSupportedOnOperation() 879*f8cca876SEd Tanous { 880*f8cca876SEd Tanous return getLog( 881*f8cca876SEd Tanous redfish::registries::base::Index::queryNotSupportedOnOperation, {}); 882*f8cca876SEd Tanous } 883*f8cca876SEd Tanous 884*f8cca876SEd Tanous void queryNotSupportedOnOperation(crow::Response& res) 885*f8cca876SEd Tanous { 886*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 887*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, queryNotSupportedOnOperation()); 888*f8cca876SEd Tanous } 889*f8cca876SEd Tanous 890*f8cca876SEd Tanous /** 891*f8cca876SEd Tanous * @internal 892*f8cca876SEd Tanous * @brief Formats QueryNotSupported message into JSON 893*f8cca876SEd Tanous * 894*f8cca876SEd Tanous * See header file for more information 895*f8cca876SEd Tanous * @endinternal 896*f8cca876SEd Tanous */ 897*f8cca876SEd Tanous nlohmann::json queryNotSupported() 898*f8cca876SEd Tanous { 899*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::queryNotSupported, {}); 900*f8cca876SEd Tanous } 901*f8cca876SEd Tanous 902*f8cca876SEd Tanous void queryNotSupported(crow::Response& res) 903*f8cca876SEd Tanous { 904*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 905*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, queryNotSupported()); 906*f8cca876SEd Tanous } 907*f8cca876SEd Tanous 908*f8cca876SEd Tanous /** 909*f8cca876SEd Tanous * @internal 910*f8cca876SEd Tanous * @brief Formats QueryCombinationInvalid message into JSON 911*f8cca876SEd Tanous * 912*f8cca876SEd Tanous * See header file for more information 913*f8cca876SEd Tanous * @endinternal 914*f8cca876SEd Tanous */ 915*f8cca876SEd Tanous nlohmann::json queryCombinationInvalid() 916*f8cca876SEd Tanous { 917*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::queryCombinationInvalid, 918*f8cca876SEd Tanous {}); 919*f8cca876SEd Tanous } 920*f8cca876SEd Tanous 921*f8cca876SEd Tanous void queryCombinationInvalid(crow::Response& res) 922*f8cca876SEd Tanous { 923*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 924*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, queryCombinationInvalid()); 925*f8cca876SEd Tanous } 926*f8cca876SEd Tanous 927*f8cca876SEd Tanous /** 928*f8cca876SEd Tanous * @internal 929*f8cca876SEd Tanous * @brief Formats QueryParameterUnsupported message into JSON 930*f8cca876SEd Tanous * 931*f8cca876SEd Tanous * See header file for more information 932*f8cca876SEd Tanous * @endinternal 933*f8cca876SEd Tanous */ 934*f8cca876SEd Tanous nlohmann::json queryParameterUnsupported(std::string_view arg1) 935*f8cca876SEd Tanous { 936*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::queryParameterUnsupported, 937*f8cca876SEd Tanous std::to_array({arg1})); 938*f8cca876SEd Tanous } 939*f8cca876SEd Tanous 940*f8cca876SEd Tanous void queryParameterUnsupported(crow::Response& res, std::string_view arg1) 941*f8cca876SEd Tanous { 942*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 943*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, queryParameterUnsupported(arg1)); 944*f8cca876SEd Tanous } 945*f8cca876SEd Tanous 946*f8cca876SEd Tanous /** 947*f8cca876SEd Tanous * @internal 948*f8cca876SEd Tanous * @brief Formats SessionLimitExceeded message into JSON 949*f8cca876SEd Tanous * 950*f8cca876SEd Tanous * See header file for more information 951*f8cca876SEd Tanous * @endinternal 952*f8cca876SEd Tanous */ 953*f8cca876SEd Tanous nlohmann::json sessionLimitExceeded() 954*f8cca876SEd Tanous { 955*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::sessionLimitExceeded, {}); 956*f8cca876SEd Tanous } 957*f8cca876SEd Tanous 958*f8cca876SEd Tanous void sessionLimitExceeded(crow::Response& res) 959*f8cca876SEd Tanous { 960*f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 961*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, sessionLimitExceeded()); 962*f8cca876SEd Tanous } 963*f8cca876SEd Tanous 964*f8cca876SEd Tanous /** 965*f8cca876SEd Tanous * @internal 966*f8cca876SEd Tanous * @brief Formats EventSubscriptionLimitExceeded message into JSON 967*f8cca876SEd Tanous * 968*f8cca876SEd Tanous * See header file for more information 969*f8cca876SEd Tanous * @endinternal 970*f8cca876SEd Tanous */ 971*f8cca876SEd Tanous nlohmann::json eventSubscriptionLimitExceeded() 972*f8cca876SEd Tanous { 973*f8cca876SEd Tanous return getLog( 974*f8cca876SEd Tanous redfish::registries::base::Index::eventSubscriptionLimitExceeded, {}); 975*f8cca876SEd Tanous } 976*f8cca876SEd Tanous 977*f8cca876SEd Tanous void eventSubscriptionLimitExceeded(crow::Response& res) 978*f8cca876SEd Tanous { 979*f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 980*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, eventSubscriptionLimitExceeded()); 981*f8cca876SEd Tanous } 982*f8cca876SEd Tanous 983*f8cca876SEd Tanous /** 984*f8cca876SEd Tanous * @internal 985*f8cca876SEd Tanous * @brief Formats ResourceCannotBeDeleted message into JSON 986*f8cca876SEd Tanous * 987*f8cca876SEd Tanous * See header file for more information 988*f8cca876SEd Tanous * @endinternal 989*f8cca876SEd Tanous */ 990*f8cca876SEd Tanous nlohmann::json resourceCannotBeDeleted() 991*f8cca876SEd Tanous { 992*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::resourceCannotBeDeleted, 993*f8cca876SEd Tanous {}); 994*f8cca876SEd Tanous } 995*f8cca876SEd Tanous 996*f8cca876SEd Tanous void resourceCannotBeDeleted(crow::Response& res) 997*f8cca876SEd Tanous { 998*f8cca876SEd Tanous res.result(boost::beast::http::status::method_not_allowed); 999*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceCannotBeDeleted()); 1000*f8cca876SEd Tanous } 1001*f8cca876SEd Tanous 1002*f8cca876SEd Tanous /** 1003*f8cca876SEd Tanous * @internal 1004*f8cca876SEd Tanous * @brief Formats ResourceInUse message into JSON 1005*f8cca876SEd Tanous * 1006*f8cca876SEd Tanous * See header file for more information 1007*f8cca876SEd Tanous * @endinternal 1008*f8cca876SEd Tanous */ 1009*f8cca876SEd Tanous nlohmann::json resourceInUse() 1010*f8cca876SEd Tanous { 1011*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::resourceInUse, {}); 1012*f8cca876SEd Tanous } 1013*f8cca876SEd Tanous 1014*f8cca876SEd Tanous void resourceInUse(crow::Response& res) 1015*f8cca876SEd Tanous { 1016*f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 1017*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceInUse()); 1018*f8cca876SEd Tanous } 1019*f8cca876SEd Tanous 1020*f8cca876SEd Tanous /** 1021*f8cca876SEd Tanous * @internal 1022*f8cca876SEd Tanous * @brief Formats ResourceAlreadyExists message into JSON 1023*f8cca876SEd Tanous * 1024*f8cca876SEd Tanous * See header file for more information 1025*f8cca876SEd Tanous * @endinternal 1026*f8cca876SEd Tanous */ 1027*f8cca876SEd Tanous nlohmann::json resourceAlreadyExists( 1028*f8cca876SEd Tanous std::string_view arg1, std::string_view arg2, std::string_view arg3) 1029*f8cca876SEd Tanous { 1030*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::resourceAlreadyExists, 1031*f8cca876SEd Tanous std::to_array({arg1, arg2, arg3})); 1032*f8cca876SEd Tanous } 1033*f8cca876SEd Tanous 1034*f8cca876SEd Tanous void resourceAlreadyExists(crow::Response& res, std::string_view arg1, 1035*f8cca876SEd Tanous std::string_view arg2, std::string_view arg3) 1036*f8cca876SEd Tanous { 1037*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1038*f8cca876SEd Tanous addMessageToJson(res.jsonValue, resourceAlreadyExists(arg1, arg2, arg3), 1039*f8cca876SEd Tanous arg2); 1040*f8cca876SEd Tanous } 1041*f8cca876SEd Tanous 1042*f8cca876SEd Tanous /** 1043*f8cca876SEd Tanous * @internal 1044*f8cca876SEd Tanous * @brief Formats ResourceNotFound message into JSON 1045*f8cca876SEd Tanous * 1046*f8cca876SEd Tanous * See header file for more information 1047*f8cca876SEd Tanous * @endinternal 1048*f8cca876SEd Tanous */ 1049*f8cca876SEd Tanous nlohmann::json resourceNotFound(std::string_view arg1, std::string_view arg2) 1050*f8cca876SEd Tanous { 1051*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::resourceNotFound, 1052*f8cca876SEd Tanous std::to_array({arg1, arg2})); 1053*f8cca876SEd Tanous } 1054*f8cca876SEd Tanous 1055*f8cca876SEd Tanous void resourceNotFound(crow::Response& res, std::string_view arg1, 1056*f8cca876SEd Tanous std::string_view arg2) 1057*f8cca876SEd Tanous { 1058*f8cca876SEd Tanous res.result(boost::beast::http::status::not_found); 1059*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceNotFound(arg1, arg2)); 1060*f8cca876SEd Tanous } 1061*f8cca876SEd Tanous 1062*f8cca876SEd Tanous /** 1063*f8cca876SEd Tanous * @internal 1064*f8cca876SEd Tanous * @brief Formats PayloadTooLarge message into JSON 1065*f8cca876SEd Tanous * 1066*f8cca876SEd Tanous * See header file for more information 1067*f8cca876SEd Tanous * @endinternal 1068*f8cca876SEd Tanous */ 1069*f8cca876SEd Tanous nlohmann::json payloadTooLarge() 1070*f8cca876SEd Tanous { 1071*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::payloadTooLarge, {}); 1072*f8cca876SEd Tanous } 1073*f8cca876SEd Tanous 1074*f8cca876SEd Tanous void payloadTooLarge(crow::Response& res) 1075*f8cca876SEd Tanous { 1076*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1077*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, payloadTooLarge()); 1078*f8cca876SEd Tanous } 1079*f8cca876SEd Tanous 1080*f8cca876SEd Tanous /** 1081*f8cca876SEd Tanous * @internal 1082*f8cca876SEd Tanous * @brief Formats InsufficientStorage message into JSON 1083*f8cca876SEd Tanous * 1084*f8cca876SEd Tanous * See header file for more information 1085*f8cca876SEd Tanous * @endinternal 1086*f8cca876SEd Tanous */ 1087*f8cca876SEd Tanous nlohmann::json insufficientStorage() 1088*f8cca876SEd Tanous { 1089*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::insufficientStorage, {}); 1090*f8cca876SEd Tanous } 1091*f8cca876SEd Tanous 1092*f8cca876SEd Tanous void insufficientStorage(crow::Response& res) 1093*f8cca876SEd Tanous { 1094*f8cca876SEd Tanous res.result(boost::beast::http::status::insufficient_storage); 1095*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, insufficientStorage()); 1096*f8cca876SEd Tanous } 1097*f8cca876SEd Tanous 1098*f8cca876SEd Tanous /** 1099*f8cca876SEd Tanous * @internal 1100*f8cca876SEd Tanous * @brief Formats MissingOrMalformedPart message into JSON 1101*f8cca876SEd Tanous * 1102*f8cca876SEd Tanous * See header file for more information 1103*f8cca876SEd Tanous * @endinternal 1104*f8cca876SEd Tanous */ 1105*f8cca876SEd Tanous nlohmann::json missingOrMalformedPart() 1106*f8cca876SEd Tanous { 1107*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::missingOrMalformedPart, {}); 1108*f8cca876SEd Tanous } 1109*f8cca876SEd Tanous 1110*f8cca876SEd Tanous void missingOrMalformedPart(crow::Response& res) 1111*f8cca876SEd Tanous { 1112*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1113*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, missingOrMalformedPart()); 1114*f8cca876SEd Tanous } 1115*f8cca876SEd Tanous 1116*f8cca876SEd Tanous /** 1117*f8cca876SEd Tanous * @internal 1118*f8cca876SEd Tanous * @brief Formats InvalidURI message into JSON 1119*f8cca876SEd Tanous * 1120*f8cca876SEd Tanous * See header file for more information 1121*f8cca876SEd Tanous * @endinternal 1122*f8cca876SEd Tanous */ 1123*f8cca876SEd Tanous nlohmann::json invalidURI(std::string_view arg1) 1124*f8cca876SEd Tanous { 1125*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::invalidURI, 1126*f8cca876SEd Tanous std::to_array({arg1})); 1127*f8cca876SEd Tanous } 1128*f8cca876SEd Tanous 1129*f8cca876SEd Tanous void invalidURI(crow::Response& res, std::string_view arg1) 1130*f8cca876SEd Tanous { 1131*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1132*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, invalidURI(arg1)); 1133*f8cca876SEd Tanous } 1134*f8cca876SEd Tanous 1135*f8cca876SEd Tanous /** 1136*f8cca876SEd Tanous * @internal 1137*f8cca876SEd Tanous * @brief Formats CreateFailedMissingReqProperties message into JSON 1138*f8cca876SEd Tanous * 1139*f8cca876SEd Tanous * See header file for more information 1140*f8cca876SEd Tanous * @endinternal 1141*f8cca876SEd Tanous */ 1142*f8cca876SEd Tanous nlohmann::json createFailedMissingReqProperties(std::string_view arg1) 1143*f8cca876SEd Tanous { 1144*f8cca876SEd Tanous return getLog( 1145*f8cca876SEd Tanous redfish::registries::base::Index::createFailedMissingReqProperties, 1146*f8cca876SEd Tanous std::to_array({arg1})); 1147*f8cca876SEd Tanous } 1148*f8cca876SEd Tanous 1149*f8cca876SEd Tanous void createFailedMissingReqProperties(crow::Response& res, 1150*f8cca876SEd Tanous std::string_view arg1) 1151*f8cca876SEd Tanous { 1152*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1153*f8cca876SEd Tanous addMessageToJson(res.jsonValue, createFailedMissingReqProperties(arg1), 1154*f8cca876SEd Tanous arg1); 1155*f8cca876SEd Tanous } 1156*f8cca876SEd Tanous 1157*f8cca876SEd Tanous /** 1158*f8cca876SEd Tanous * @internal 1159*f8cca876SEd Tanous * @brief Formats CreateLimitReachedForResource message into JSON 1160*f8cca876SEd Tanous * 1161*f8cca876SEd Tanous * See header file for more information 1162*f8cca876SEd Tanous * @endinternal 1163*f8cca876SEd Tanous */ 1164*f8cca876SEd Tanous nlohmann::json createLimitReachedForResource() 1165*f8cca876SEd Tanous { 1166*f8cca876SEd Tanous return getLog( 1167*f8cca876SEd Tanous redfish::registries::base::Index::createLimitReachedForResource, {}); 1168*f8cca876SEd Tanous } 1169*f8cca876SEd Tanous 1170*f8cca876SEd Tanous void createLimitReachedForResource(crow::Response& res) 1171*f8cca876SEd Tanous { 1172*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1173*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, createLimitReachedForResource()); 1174*f8cca876SEd Tanous } 1175*f8cca876SEd Tanous 1176*f8cca876SEd Tanous /** 1177*f8cca876SEd Tanous * @internal 1178*f8cca876SEd Tanous * @brief Formats ServiceShuttingDown message into JSON 1179*f8cca876SEd Tanous * 1180*f8cca876SEd Tanous * See header file for more information 1181*f8cca876SEd Tanous * @endinternal 1182*f8cca876SEd Tanous */ 1183*f8cca876SEd Tanous nlohmann::json serviceShuttingDown() 1184*f8cca876SEd Tanous { 1185*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::serviceShuttingDown, {}); 1186*f8cca876SEd Tanous } 1187*f8cca876SEd Tanous 1188*f8cca876SEd Tanous void serviceShuttingDown(crow::Response& res) 1189*f8cca876SEd Tanous { 1190*f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 1191*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, serviceShuttingDown()); 1192*f8cca876SEd Tanous } 1193*f8cca876SEd Tanous 1194*f8cca876SEd Tanous /** 1195*f8cca876SEd Tanous * @internal 1196*f8cca876SEd Tanous * @brief Formats ServiceInUnknownState message into JSON 1197*f8cca876SEd Tanous * 1198*f8cca876SEd Tanous * See header file for more information 1199*f8cca876SEd Tanous * @endinternal 1200*f8cca876SEd Tanous */ 1201*f8cca876SEd Tanous nlohmann::json serviceInUnknownState() 1202*f8cca876SEd Tanous { 1203*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::serviceInUnknownState, {}); 1204*f8cca876SEd Tanous } 1205*f8cca876SEd Tanous 1206*f8cca876SEd Tanous void serviceInUnknownState(crow::Response& res) 1207*f8cca876SEd Tanous { 1208*f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 1209*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, serviceInUnknownState()); 1210*f8cca876SEd Tanous } 1211*f8cca876SEd Tanous 1212*f8cca876SEd Tanous /** 1213*f8cca876SEd Tanous * @internal 1214*f8cca876SEd Tanous * @brief Formats NoValidSession message into JSON 1215*f8cca876SEd Tanous * 1216*f8cca876SEd Tanous * See header file for more information 1217*f8cca876SEd Tanous * @endinternal 1218*f8cca876SEd Tanous */ 1219*f8cca876SEd Tanous nlohmann::json noValidSession() 1220*f8cca876SEd Tanous { 1221*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::noValidSession, {}); 1222*f8cca876SEd Tanous } 1223*f8cca876SEd Tanous 1224*f8cca876SEd Tanous void noValidSession(crow::Response& res) 1225*f8cca876SEd Tanous { 1226*f8cca876SEd Tanous res.result(boost::beast::http::status::forbidden); 1227*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, noValidSession()); 1228*f8cca876SEd Tanous } 1229*f8cca876SEd Tanous 1230*f8cca876SEd Tanous /** 1231*f8cca876SEd Tanous * @internal 1232*f8cca876SEd Tanous * @brief Formats InsufficientPrivilege message into JSON 1233*f8cca876SEd Tanous * 1234*f8cca876SEd Tanous * See header file for more information 1235*f8cca876SEd Tanous * @endinternal 1236*f8cca876SEd Tanous */ 1237*f8cca876SEd Tanous nlohmann::json insufficientPrivilege() 1238*f8cca876SEd Tanous { 1239*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::insufficientPrivilege, {}); 1240*f8cca876SEd Tanous } 1241*f8cca876SEd Tanous 1242*f8cca876SEd Tanous void insufficientPrivilege(crow::Response& res) 1243*f8cca876SEd Tanous { 1244*f8cca876SEd Tanous res.result(boost::beast::http::status::forbidden); 1245*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, insufficientPrivilege()); 1246*f8cca876SEd Tanous } 1247*f8cca876SEd Tanous 1248*f8cca876SEd Tanous /** 1249*f8cca876SEd Tanous * @internal 1250*f8cca876SEd Tanous * @brief Formats AccountModified message into JSON 1251*f8cca876SEd Tanous * 1252*f8cca876SEd Tanous * See header file for more information 1253*f8cca876SEd Tanous * @endinternal 1254*f8cca876SEd Tanous */ 1255*f8cca876SEd Tanous nlohmann::json accountModified() 1256*f8cca876SEd Tanous { 1257*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::accountModified, {}); 1258*f8cca876SEd Tanous } 1259*f8cca876SEd Tanous 1260*f8cca876SEd Tanous void accountModified(crow::Response& res) 1261*f8cca876SEd Tanous { 1262*f8cca876SEd Tanous res.result(boost::beast::http::status::ok); 1263*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, accountModified()); 1264*f8cca876SEd Tanous } 1265*f8cca876SEd Tanous 1266*f8cca876SEd Tanous /** 1267*f8cca876SEd Tanous * @internal 1268*f8cca876SEd Tanous * @brief Formats AccountNotModified message into JSON 1269*f8cca876SEd Tanous * 1270*f8cca876SEd Tanous * See header file for more information 1271*f8cca876SEd Tanous * @endinternal 1272*f8cca876SEd Tanous */ 1273*f8cca876SEd Tanous nlohmann::json accountNotModified() 1274*f8cca876SEd Tanous { 1275*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::accountNotModified, {}); 1276*f8cca876SEd Tanous } 1277*f8cca876SEd Tanous 1278*f8cca876SEd Tanous void accountNotModified(crow::Response& res) 1279*f8cca876SEd Tanous { 1280*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1281*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, accountNotModified()); 1282*f8cca876SEd Tanous } 1283*f8cca876SEd Tanous 1284*f8cca876SEd Tanous /** 1285*f8cca876SEd Tanous * @internal 1286*f8cca876SEd Tanous * @brief Formats AccountRemoved message into JSON 1287*f8cca876SEd Tanous * 1288*f8cca876SEd Tanous * See header file for more information 1289*f8cca876SEd Tanous * @endinternal 1290*f8cca876SEd Tanous */ 1291*f8cca876SEd Tanous nlohmann::json accountRemoved() 1292*f8cca876SEd Tanous { 1293*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::accountRemoved, {}); 1294*f8cca876SEd Tanous } 1295*f8cca876SEd Tanous 1296*f8cca876SEd Tanous void accountRemoved(crow::Response& res) 1297*f8cca876SEd Tanous { 1298*f8cca876SEd Tanous res.result(boost::beast::http::status::ok); 1299*f8cca876SEd Tanous addMessageToJsonRoot(res.jsonValue, accountRemoved()); 1300*f8cca876SEd Tanous } 1301*f8cca876SEd Tanous 1302*f8cca876SEd Tanous /** 1303*f8cca876SEd Tanous * @internal 1304*f8cca876SEd Tanous * @brief Formats AccountForSessionNoLongerExists message into JSON 1305*f8cca876SEd Tanous * 1306*f8cca876SEd Tanous * See header file for more information 1307*f8cca876SEd Tanous * @endinternal 1308*f8cca876SEd Tanous */ 1309*f8cca876SEd Tanous nlohmann::json accountForSessionNoLongerExists() 1310*f8cca876SEd Tanous { 1311*f8cca876SEd Tanous return getLog( 1312*f8cca876SEd Tanous redfish::registries::base::Index::accountForSessionNoLongerExists, {}); 1313*f8cca876SEd Tanous } 1314*f8cca876SEd Tanous 1315*f8cca876SEd Tanous void accountForSessionNoLongerExists(crow::Response& res) 1316*f8cca876SEd Tanous { 1317*f8cca876SEd Tanous res.result(boost::beast::http::status::forbidden); 1318*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, accountForSessionNoLongerExists()); 1319*f8cca876SEd Tanous } 1320*f8cca876SEd Tanous 1321*f8cca876SEd Tanous /** 1322*f8cca876SEd Tanous * @internal 1323*f8cca876SEd Tanous * @brief Formats InvalidObject message into JSON 1324*f8cca876SEd Tanous * 1325*f8cca876SEd Tanous * See header file for more information 1326*f8cca876SEd Tanous * @endinternal 1327*f8cca876SEd Tanous */ 1328*f8cca876SEd Tanous nlohmann::json invalidObject(const boost::urls::url_view_base& arg1) 1329*f8cca876SEd Tanous { 1330*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::invalidObject, 1331*f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1332*f8cca876SEd Tanous } 1333*f8cca876SEd Tanous 1334*f8cca876SEd Tanous void invalidObject(crow::Response& res, const boost::urls::url_view_base& arg1) 1335*f8cca876SEd Tanous { 1336*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1337*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, invalidObject(arg1)); 1338*f8cca876SEd Tanous } 1339*f8cca876SEd Tanous 1340*f8cca876SEd Tanous /** 1341*f8cca876SEd Tanous * @internal 1342*f8cca876SEd Tanous * @brief Formats InternalError message into JSON 1343*f8cca876SEd Tanous * 1344*f8cca876SEd Tanous * See header file for more information 1345*f8cca876SEd Tanous * @endinternal 1346*f8cca876SEd Tanous */ 1347*f8cca876SEd Tanous nlohmann::json internalError() 1348*f8cca876SEd Tanous { 1349*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::internalError, {}); 1350*f8cca876SEd Tanous } 1351*f8cca876SEd Tanous 1352*f8cca876SEd Tanous void internalError(crow::Response& res, const std::source_location location) 1353*f8cca876SEd Tanous { 1354*f8cca876SEd Tanous BMCWEB_LOG_CRITICAL("Internal Error {}({}:{}) `{}`: ", location.file_name(), 1355*f8cca876SEd Tanous location.line(), location.column(), 1356*f8cca876SEd Tanous location.function_name()); 1357*f8cca876SEd Tanous res.result(boost::beast::http::status::internal_server_error); 1358*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, internalError()); 1359*f8cca876SEd Tanous } 1360*f8cca876SEd Tanous 1361*f8cca876SEd Tanous /** 1362*f8cca876SEd Tanous * @internal 1363*f8cca876SEd Tanous * @brief Formats UnrecognizedRequestBody message into JSON 1364*f8cca876SEd Tanous * 1365*f8cca876SEd Tanous * See header file for more information 1366*f8cca876SEd Tanous * @endinternal 1367*f8cca876SEd Tanous */ 1368*f8cca876SEd Tanous nlohmann::json unrecognizedRequestBody() 1369*f8cca876SEd Tanous { 1370*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::unrecognizedRequestBody, 1371*f8cca876SEd Tanous {}); 1372*f8cca876SEd Tanous } 1373*f8cca876SEd Tanous 1374*f8cca876SEd Tanous void unrecognizedRequestBody(crow::Response& res) 1375*f8cca876SEd Tanous { 1376*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1377*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, unrecognizedRequestBody()); 1378*f8cca876SEd Tanous } 1379*f8cca876SEd Tanous 1380*f8cca876SEd Tanous /** 1381*f8cca876SEd Tanous * @internal 1382*f8cca876SEd Tanous * @brief Formats ResourceMissingAtURI message into JSON 1383*f8cca876SEd Tanous * 1384*f8cca876SEd Tanous * See header file for more information 1385*f8cca876SEd Tanous * @endinternal 1386*f8cca876SEd Tanous */ 1387*f8cca876SEd Tanous nlohmann::json resourceMissingAtURI(const boost::urls::url_view_base& arg1) 1388*f8cca876SEd Tanous { 1389*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::resourceMissingAtURI, 1390*f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1391*f8cca876SEd Tanous } 1392*f8cca876SEd Tanous 1393*f8cca876SEd Tanous void resourceMissingAtURI(crow::Response& res, 1394*f8cca876SEd Tanous const boost::urls::url_view_base& arg1) 1395*f8cca876SEd Tanous { 1396*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1397*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceMissingAtURI(arg1)); 1398*f8cca876SEd Tanous } 1399*f8cca876SEd Tanous 1400*f8cca876SEd Tanous /** 1401*f8cca876SEd Tanous * @internal 1402*f8cca876SEd Tanous * @brief Formats ResourceAtUriInUnknownFormat message into JSON 1403*f8cca876SEd Tanous * 1404*f8cca876SEd Tanous * See header file for more information 1405*f8cca876SEd Tanous * @endinternal 1406*f8cca876SEd Tanous */ 1407*f8cca876SEd Tanous nlohmann::json 1408*f8cca876SEd Tanous resourceAtUriInUnknownFormat(const boost::urls::url_view_base& arg1) 1409*f8cca876SEd Tanous { 1410*f8cca876SEd Tanous return getLog( 1411*f8cca876SEd Tanous redfish::registries::base::Index::resourceAtUriInUnknownFormat, 1412*f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1413*f8cca876SEd Tanous } 1414*f8cca876SEd Tanous 1415*f8cca876SEd Tanous void resourceAtUriInUnknownFormat(crow::Response& res, 1416*f8cca876SEd Tanous const boost::urls::url_view_base& arg1) 1417*f8cca876SEd Tanous { 1418*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1419*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceAtUriInUnknownFormat(arg1)); 1420*f8cca876SEd Tanous } 1421*f8cca876SEd Tanous 1422*f8cca876SEd Tanous /** 1423*f8cca876SEd Tanous * @internal 1424*f8cca876SEd Tanous * @brief Formats ResourceAtUriUnauthorized message into JSON 1425*f8cca876SEd Tanous * 1426*f8cca876SEd Tanous * See header file for more information 1427*f8cca876SEd Tanous * @endinternal 1428*f8cca876SEd Tanous */ 1429*f8cca876SEd Tanous nlohmann::json resourceAtUriUnauthorized(const boost::urls::url_view_base& arg1, 1430*f8cca876SEd Tanous std::string_view arg2) 1431*f8cca876SEd Tanous { 1432*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::resourceAtUriUnauthorized, 1433*f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer(), arg2})); 1434*f8cca876SEd Tanous } 1435*f8cca876SEd Tanous 1436*f8cca876SEd Tanous void resourceAtUriUnauthorized(crow::Response& res, 1437*f8cca876SEd Tanous const boost::urls::url_view_base& arg1, 1438*f8cca876SEd Tanous std::string_view arg2) 1439*f8cca876SEd Tanous { 1440*f8cca876SEd Tanous res.result(boost::beast::http::status::unauthorized); 1441*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceAtUriUnauthorized(arg1, arg2)); 1442*f8cca876SEd Tanous } 1443*f8cca876SEd Tanous 1444*f8cca876SEd Tanous /** 1445*f8cca876SEd Tanous * @internal 1446*f8cca876SEd Tanous * @brief Formats CouldNotEstablishConnection message into JSON 1447*f8cca876SEd Tanous * 1448*f8cca876SEd Tanous * See header file for more information 1449*f8cca876SEd Tanous * @endinternal 1450*f8cca876SEd Tanous */ 1451*f8cca876SEd Tanous nlohmann::json 1452*f8cca876SEd Tanous couldNotEstablishConnection(const boost::urls::url_view_base& arg1) 1453*f8cca876SEd Tanous { 1454*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::couldNotEstablishConnection, 1455*f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1456*f8cca876SEd Tanous } 1457*f8cca876SEd Tanous 1458*f8cca876SEd Tanous void couldNotEstablishConnection(crow::Response& res, 1459*f8cca876SEd Tanous const boost::urls::url_view_base& arg1) 1460*f8cca876SEd Tanous { 1461*f8cca876SEd Tanous res.result(boost::beast::http::status::not_found); 1462*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, couldNotEstablishConnection(arg1)); 1463*f8cca876SEd Tanous } 1464*f8cca876SEd Tanous 1465*f8cca876SEd Tanous /** 1466*f8cca876SEd Tanous * @internal 1467*f8cca876SEd Tanous * @brief Formats SourceDoesNotSupportProtocol message into JSON 1468*f8cca876SEd Tanous * 1469*f8cca876SEd Tanous * See header file for more information 1470*f8cca876SEd Tanous * @endinternal 1471*f8cca876SEd Tanous */ 1472*f8cca876SEd Tanous nlohmann::json sourceDoesNotSupportProtocol( 1473*f8cca876SEd Tanous const boost::urls::url_view_base& arg1, std::string_view arg2) 1474*f8cca876SEd Tanous { 1475*f8cca876SEd Tanous return getLog( 1476*f8cca876SEd Tanous redfish::registries::base::Index::sourceDoesNotSupportProtocol, 1477*f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer(), arg2})); 1478*f8cca876SEd Tanous } 1479*f8cca876SEd Tanous 1480*f8cca876SEd Tanous void sourceDoesNotSupportProtocol(crow::Response& res, 1481*f8cca876SEd Tanous const boost::urls::url_view_base& arg1, 1482*f8cca876SEd Tanous std::string_view arg2) 1483*f8cca876SEd Tanous { 1484*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1485*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 1486*f8cca876SEd Tanous sourceDoesNotSupportProtocol(arg1, arg2)); 1487*f8cca876SEd Tanous } 1488*f8cca876SEd Tanous 1489*f8cca876SEd Tanous /** 1490*f8cca876SEd Tanous * @internal 1491*f8cca876SEd Tanous * @brief Formats AccessDenied message into JSON 1492*f8cca876SEd Tanous * 1493*f8cca876SEd Tanous * See header file for more information 1494*f8cca876SEd Tanous * @endinternal 1495*f8cca876SEd Tanous */ 1496*f8cca876SEd Tanous nlohmann::json accessDenied(const boost::urls::url_view_base& arg1) 1497*f8cca876SEd Tanous { 1498*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::accessDenied, 1499*f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1500*f8cca876SEd Tanous } 1501*f8cca876SEd Tanous 1502*f8cca876SEd Tanous void accessDenied(crow::Response& res, const boost::urls::url_view_base& arg1) 1503*f8cca876SEd Tanous { 1504*f8cca876SEd Tanous res.result(boost::beast::http::status::forbidden); 1505*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, accessDenied(arg1)); 1506*f8cca876SEd Tanous } 1507*f8cca876SEd Tanous 1508*f8cca876SEd Tanous /** 1509*f8cca876SEd Tanous * @internal 1510*f8cca876SEd Tanous * @brief Formats ServiceTemporarilyUnavailable message into JSON 1511*f8cca876SEd Tanous * 1512*f8cca876SEd Tanous * See header file for more information 1513*f8cca876SEd Tanous * @endinternal 1514*f8cca876SEd Tanous */ 1515*f8cca876SEd Tanous nlohmann::json serviceTemporarilyUnavailable(std::string_view arg1) 1516*f8cca876SEd Tanous { 1517*f8cca876SEd Tanous return getLog( 1518*f8cca876SEd Tanous redfish::registries::base::Index::serviceTemporarilyUnavailable, 1519*f8cca876SEd Tanous std::to_array({arg1})); 1520*f8cca876SEd Tanous } 1521*f8cca876SEd Tanous 1522*f8cca876SEd Tanous void serviceTemporarilyUnavailable(crow::Response& res, std::string_view arg1) 1523*f8cca876SEd Tanous { 1524*f8cca876SEd Tanous res.addHeader(boost::beast::http::field::retry_after, arg1); 1525*f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 1526*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, serviceTemporarilyUnavailable(arg1)); 1527*f8cca876SEd Tanous } 1528*f8cca876SEd Tanous 1529*f8cca876SEd Tanous /** 1530*f8cca876SEd Tanous * @internal 1531*f8cca876SEd Tanous * @brief Formats InvalidIndex message into JSON 1532*f8cca876SEd Tanous * 1533*f8cca876SEd Tanous * See header file for more information 1534*f8cca876SEd Tanous * @endinternal 1535*f8cca876SEd Tanous */ 1536*f8cca876SEd Tanous nlohmann::json invalidIndex(int64_t arg1) 1537*f8cca876SEd Tanous { 1538*f8cca876SEd Tanous std::string arg1Str = std::to_string(arg1); 1539*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::invalidIndex, 1540*f8cca876SEd Tanous std::to_array<std::string_view>({arg1Str})); 1541*f8cca876SEd Tanous } 1542*f8cca876SEd Tanous 1543*f8cca876SEd Tanous void invalidIndex(crow::Response& res, int64_t arg1) 1544*f8cca876SEd Tanous { 1545*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1546*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, invalidIndex(arg1)); 1547*f8cca876SEd Tanous } 1548*f8cca876SEd Tanous 1549*f8cca876SEd Tanous /** 1550*f8cca876SEd Tanous * @internal 1551*f8cca876SEd Tanous * @brief Formats PropertyValueModified message into JSON 1552*f8cca876SEd Tanous * 1553*f8cca876SEd Tanous * See header file for more information 1554*f8cca876SEd Tanous * @endinternal 1555*f8cca876SEd Tanous */ 1556*f8cca876SEd Tanous nlohmann::json propertyValueModified(std::string_view arg1, 1557*f8cca876SEd Tanous const nlohmann::json& arg2) 1558*f8cca876SEd Tanous { 1559*f8cca876SEd Tanous std::string arg2Str = 1560*f8cca876SEd Tanous arg2.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 1561*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::propertyValueModified, 1562*f8cca876SEd Tanous std::to_array<std::string_view>({arg1, arg2Str})); 1563*f8cca876SEd Tanous } 1564*f8cca876SEd Tanous 1565*f8cca876SEd Tanous void propertyValueModified(crow::Response& res, std::string_view arg1, 1566*f8cca876SEd Tanous const nlohmann::json& arg2) 1567*f8cca876SEd Tanous { 1568*f8cca876SEd Tanous res.result(boost::beast::http::status::ok); 1569*f8cca876SEd Tanous addMessageToJson(res.jsonValue, propertyValueModified(arg1, arg2), arg1); 1570*f8cca876SEd Tanous } 1571*f8cca876SEd Tanous 1572*f8cca876SEd Tanous /** 1573*f8cca876SEd Tanous * @internal 1574*f8cca876SEd Tanous * @brief Formats ResourceInStandby message into JSON 1575*f8cca876SEd Tanous * 1576*f8cca876SEd Tanous * See header file for more information 1577*f8cca876SEd Tanous * @endinternal 1578*f8cca876SEd Tanous */ 1579*f8cca876SEd Tanous nlohmann::json resourceInStandby() 1580*f8cca876SEd Tanous { 1581*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::resourceInStandby, {}); 1582*f8cca876SEd Tanous } 1583*f8cca876SEd Tanous 1584*f8cca876SEd Tanous void resourceInStandby(crow::Response& res) 1585*f8cca876SEd Tanous { 1586*f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 1587*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceInStandby()); 1588*f8cca876SEd Tanous } 1589*f8cca876SEd Tanous 1590*f8cca876SEd Tanous /** 1591*f8cca876SEd Tanous * @internal 1592*f8cca876SEd Tanous * @brief Formats ResourceExhaustion message into JSON 1593*f8cca876SEd Tanous * 1594*f8cca876SEd Tanous * See header file for more information 1595*f8cca876SEd Tanous * @endinternal 1596*f8cca876SEd Tanous */ 1597*f8cca876SEd Tanous nlohmann::json resourceExhaustion(std::string_view arg1) 1598*f8cca876SEd Tanous { 1599*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::resourceExhaustion, 1600*f8cca876SEd Tanous std::to_array({arg1})); 1601*f8cca876SEd Tanous } 1602*f8cca876SEd Tanous 1603*f8cca876SEd Tanous void resourceExhaustion(crow::Response& res, std::string_view arg1) 1604*f8cca876SEd Tanous { 1605*f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 1606*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resourceExhaustion(arg1)); 1607*f8cca876SEd Tanous } 1608*f8cca876SEd Tanous 1609*f8cca876SEd Tanous /** 1610*f8cca876SEd Tanous * @internal 1611f4c4dcf4SKowalski, Kamil * @brief Formats StringValueTooLong message into JSON 1612f4c4dcf4SKowalski, Kamil * 1613f4c4dcf4SKowalski, Kamil * See header file for more information 1614f4c4dcf4SKowalski, Kamil * @endinternal 1615f4c4dcf4SKowalski, Kamil */ 16161668ce6dSEd Tanous nlohmann::json stringValueTooLong(std::string_view arg1, int arg2) 16171abe55efSEd Tanous { 16187ccfe684SEd Tanous std::string arg2Str = std::to_string(arg2); 1619fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::stringValueTooLong, 16207ccfe684SEd Tanous std::to_array<std::string_view>({arg1, arg2Str})); 1621b5c07418SJames Feist } 1622b5c07418SJames Feist 16231668ce6dSEd Tanous void stringValueTooLong(crow::Response& res, std::string_view arg1, int arg2) 1624b5c07418SJames Feist { 1625b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1626b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, stringValueTooLong(arg1, arg2)); 1627f4c4dcf4SKowalski, Kamil } 1628f4c4dcf4SKowalski, Kamil 1629f4c4dcf4SKowalski, Kamil /** 1630f4c4dcf4SKowalski, Kamil * @internal 1631*f8cca876SEd Tanous * @brief Formats StringValueTooShort message into JSON 1632*f8cca876SEd Tanous * 1633*f8cca876SEd Tanous * See header file for more information 1634*f8cca876SEd Tanous * @endinternal 1635*f8cca876SEd Tanous */ 1636*f8cca876SEd Tanous nlohmann::json stringValueTooShort(std::string_view arg1, std::string_view arg2) 1637*f8cca876SEd Tanous { 1638*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::stringValueTooShort, 1639*f8cca876SEd Tanous std::to_array({arg1, arg2})); 1640*f8cca876SEd Tanous } 1641*f8cca876SEd Tanous 1642*f8cca876SEd Tanous void stringValueTooShort(crow::Response& res, std::string_view arg1, 1643*f8cca876SEd Tanous std::string_view arg2) 1644*f8cca876SEd Tanous { 1645*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1646*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, stringValueTooShort(arg1, arg2)); 1647*f8cca876SEd Tanous } 1648*f8cca876SEd Tanous 1649*f8cca876SEd Tanous /** 1650*f8cca876SEd Tanous * @internal 1651cc9139ecSJason M. Bills * @brief Formats SessionTerminated message into JSON 1652cc9139ecSJason M. Bills * 1653cc9139ecSJason M. Bills * See header file for more information 1654cc9139ecSJason M. Bills * @endinternal 1655cc9139ecSJason M. Bills */ 1656d9fcfcc1SEd Tanous nlohmann::json sessionTerminated() 1657cc9139ecSJason M. Bills { 1658fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::sessionTerminated, {}); 1659b5c07418SJames Feist } 1660b5c07418SJames Feist 1661b5c07418SJames Feist void sessionTerminated(crow::Response& res) 1662b5c07418SJames Feist { 1663b5c07418SJames Feist res.result(boost::beast::http::status::ok); 1664b5c07418SJames Feist addMessageToJsonRoot(res.jsonValue, sessionTerminated()); 1665cc9139ecSJason M. Bills } 1666cc9139ecSJason M. Bills 1667cc9139ecSJason M. Bills /** 1668cc9139ecSJason M. Bills * @internal 1669684bb4b8SJason M. Bills * @brief Formats SubscriptionTerminated message into JSON 1670684bb4b8SJason M. Bills * 1671684bb4b8SJason M. Bills * See header file for more information 1672684bb4b8SJason M. Bills * @endinternal 1673684bb4b8SJason M. Bills */ 1674d9fcfcc1SEd Tanous nlohmann::json subscriptionTerminated() 1675684bb4b8SJason M. Bills { 1676fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::subscriptionTerminated, {}); 1677684bb4b8SJason M. Bills } 1678684bb4b8SJason M. Bills 1679684bb4b8SJason M. Bills void subscriptionTerminated(crow::Response& res) 1680684bb4b8SJason M. Bills { 1681684bb4b8SJason M. Bills res.result(boost::beast::http::status::ok); 1682684bb4b8SJason M. Bills addMessageToJsonRoot(res.jsonValue, subscriptionTerminated()); 1683684bb4b8SJason M. Bills } 1684684bb4b8SJason M. Bills 1685684bb4b8SJason M. Bills /** 1686684bb4b8SJason M. Bills * @internal 1687cc9139ecSJason M. Bills * @brief Formats ResourceTypeIncompatible message into JSON 1688cc9139ecSJason M. Bills * 1689cc9139ecSJason M. Bills * See header file for more information 1690cc9139ecSJason M. Bills * @endinternal 1691cc9139ecSJason M. Bills */ 16921668ce6dSEd Tanous nlohmann::json resourceTypeIncompatible(std::string_view arg1, 16931668ce6dSEd Tanous std::string_view arg2) 1694cc9139ecSJason M. Bills { 1695fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::resourceTypeIncompatible, 16961668ce6dSEd Tanous std::to_array({arg1, arg2})); 1697b5c07418SJames Feist } 1698b5c07418SJames Feist 16991668ce6dSEd Tanous void resourceTypeIncompatible(crow::Response& res, std::string_view arg1, 17001668ce6dSEd Tanous std::string_view arg2) 1701b5c07418SJames Feist { 1702b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1703b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, resourceTypeIncompatible(arg1, arg2)); 1704cc9139ecSJason M. Bills } 1705cc9139ecSJason M. Bills 1706cc9139ecSJason M. Bills /** 1707cc9139ecSJason M. Bills * @internal 1708*f8cca876SEd Tanous * @brief Formats PasswordChangeRequired message into JSON 1709*f8cca876SEd Tanous * 1710*f8cca876SEd Tanous * See header file for more information 1711*f8cca876SEd Tanous * @endinternal 1712*f8cca876SEd Tanous */ 1713*f8cca876SEd Tanous nlohmann::json passwordChangeRequired(const boost::urls::url_view_base& arg1) 1714*f8cca876SEd Tanous { 1715*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::passwordChangeRequired, 1716*f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1717*f8cca876SEd Tanous } 1718*f8cca876SEd Tanous 1719*f8cca876SEd Tanous void passwordChangeRequired(crow::Response& res, 1720*f8cca876SEd Tanous const boost::urls::url_view_base& arg1) 1721*f8cca876SEd Tanous { 1722*f8cca876SEd Tanous addMessageToJsonRoot(res.jsonValue, passwordChangeRequired(arg1)); 1723*f8cca876SEd Tanous } 1724*f8cca876SEd Tanous 1725*f8cca876SEd Tanous /** 1726*f8cca876SEd Tanous * @internal 1727684bb4b8SJason M. Bills * @brief Formats ResetRequired message into JSON 1728684bb4b8SJason M. Bills * 1729684bb4b8SJason M. Bills * See header file for more information 1730684bb4b8SJason M. Bills * @endinternal 1731684bb4b8SJason M. Bills */ 17324a7fbefdSEd Tanous nlohmann::json resetRequired(const boost::urls::url_view_base& arg1, 17334a7fbefdSEd Tanous std::string_view arg2) 1734684bb4b8SJason M. Bills { 1735fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::resetRequired, 1736079360aeSEd Tanous std::to_array<std::string_view>({arg1.buffer(), arg2})); 1737684bb4b8SJason M. Bills } 1738684bb4b8SJason M. Bills 17394a7fbefdSEd Tanous void resetRequired(crow::Response& res, const boost::urls::url_view_base& arg1, 17401668ce6dSEd Tanous std::string_view arg2) 1741684bb4b8SJason M. Bills { 1742684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1743684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, resetRequired(arg1, arg2)); 1744684bb4b8SJason M. Bills } 1745684bb4b8SJason M. Bills 1746684bb4b8SJason M. Bills /** 1747684bb4b8SJason M. Bills * @internal 1748*f8cca876SEd Tanous * @brief Formats ResetRecommended message into JSON 1749*f8cca876SEd Tanous * 1750*f8cca876SEd Tanous * See header file for more information 1751*f8cca876SEd Tanous * @endinternal 1752*f8cca876SEd Tanous */ 1753*f8cca876SEd Tanous nlohmann::json resetRecommended(std::string_view arg1, std::string_view arg2) 1754*f8cca876SEd Tanous { 1755*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::resetRecommended, 1756*f8cca876SEd Tanous std::to_array({arg1, arg2})); 1757*f8cca876SEd Tanous } 1758*f8cca876SEd Tanous 1759*f8cca876SEd Tanous void resetRecommended(crow::Response& res, std::string_view arg1, 1760*f8cca876SEd Tanous std::string_view arg2) 1761*f8cca876SEd Tanous { 1762*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1763*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, resetRecommended(arg1, arg2)); 1764*f8cca876SEd Tanous } 1765*f8cca876SEd Tanous 1766*f8cca876SEd Tanous /** 1767*f8cca876SEd Tanous * @internal 1768684bb4b8SJason M. Bills * @brief Formats ChassisPowerStateOnRequired message into JSON 1769684bb4b8SJason M. Bills * 1770684bb4b8SJason M. Bills * See header file for more information 1771684bb4b8SJason M. Bills * @endinternal 1772684bb4b8SJason M. Bills */ 17731668ce6dSEd Tanous nlohmann::json chassisPowerStateOnRequired(std::string_view arg1) 1774684bb4b8SJason M. Bills { 17757ccfe684SEd Tanous return getLog(redfish::registries::base::Index::chassisPowerStateOnRequired, 17761668ce6dSEd Tanous std::to_array({arg1})); 1777684bb4b8SJason M. Bills } 1778684bb4b8SJason M. Bills 17791668ce6dSEd Tanous void chassisPowerStateOnRequired(crow::Response& res, std::string_view arg1) 1780684bb4b8SJason M. Bills { 1781684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1782684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, chassisPowerStateOnRequired(arg1)); 1783684bb4b8SJason M. Bills } 1784684bb4b8SJason M. Bills 1785684bb4b8SJason M. Bills /** 1786684bb4b8SJason M. Bills * @internal 1787684bb4b8SJason M. Bills * @brief Formats ChassisPowerStateOffRequired message into JSON 1788684bb4b8SJason M. Bills * 1789684bb4b8SJason M. Bills * See header file for more information 1790684bb4b8SJason M. Bills * @endinternal 1791684bb4b8SJason M. Bills */ 17921668ce6dSEd Tanous nlohmann::json chassisPowerStateOffRequired(std::string_view arg1) 1793684bb4b8SJason M. Bills { 1794b6cd31e1SEd Tanous return getLog( 1795fffb8c1fSEd Tanous redfish::registries::base::Index::chassisPowerStateOffRequired, 17961668ce6dSEd Tanous std::to_array({arg1})); 1797684bb4b8SJason M. Bills } 1798684bb4b8SJason M. Bills 17991668ce6dSEd Tanous void chassisPowerStateOffRequired(crow::Response& res, std::string_view arg1) 1800684bb4b8SJason M. Bills { 1801684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1802684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, chassisPowerStateOffRequired(arg1)); 1803684bb4b8SJason M. Bills } 1804684bb4b8SJason M. Bills 1805684bb4b8SJason M. Bills /** 1806684bb4b8SJason M. Bills * @internal 1807684bb4b8SJason M. Bills * @brief Formats PropertyValueConflict message into JSON 1808684bb4b8SJason M. Bills * 1809684bb4b8SJason M. Bills * See header file for more information 1810684bb4b8SJason M. Bills * @endinternal 1811684bb4b8SJason M. Bills */ 18121668ce6dSEd Tanous nlohmann::json propertyValueConflict(std::string_view arg1, 18131668ce6dSEd Tanous std::string_view arg2) 1814684bb4b8SJason M. Bills { 1815fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::propertyValueConflict, 18161668ce6dSEd Tanous std::to_array({arg1, arg2})); 1817684bb4b8SJason M. Bills } 1818684bb4b8SJason M. Bills 18191668ce6dSEd Tanous void propertyValueConflict(crow::Response& res, std::string_view arg1, 18201668ce6dSEd Tanous std::string_view arg2) 1821684bb4b8SJason M. Bills { 1822684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1823684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, propertyValueConflict(arg1, arg2)); 1824684bb4b8SJason M. Bills } 1825684bb4b8SJason M. Bills 1826684bb4b8SJason M. Bills /** 1827684bb4b8SJason M. Bills * @internal 18282a6af81cSRamesh Iyyar * @brief Formats PropertyValueResourceConflict message into JSON 18292a6af81cSRamesh Iyyar * 18302a6af81cSRamesh Iyyar * See header file for more information 18312a6af81cSRamesh Iyyar * @endinternal 18322a6af81cSRamesh Iyyar */ 1833bd79bce8SPatrick Williams nlohmann::json propertyValueResourceConflict( 1834bd79bce8SPatrick Williams std::string_view arg1, const nlohmann::json& arg2, 18354a7fbefdSEd Tanous const boost::urls::url_view_base& arg3) 18362a6af81cSRamesh Iyyar { 1837bd79bce8SPatrick Williams std::string arg2Str = 1838034e1259SEd Tanous arg2.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 18392a6af81cSRamesh Iyyar return getLog( 18402a6af81cSRamesh Iyyar redfish::registries::base::Index::propertyValueResourceConflict, 184195b3ad73SEd Tanous std::to_array<std::string_view>({arg1, arg2Str, arg3.buffer()})); 18422a6af81cSRamesh Iyyar } 18432a6af81cSRamesh Iyyar 18442a6af81cSRamesh Iyyar void propertyValueResourceConflict(crow::Response& res, std::string_view arg1, 184595b3ad73SEd Tanous const nlohmann::json& arg2, 18464a7fbefdSEd Tanous const boost::urls::url_view_base& arg3) 18472a6af81cSRamesh Iyyar { 18482a6af81cSRamesh Iyyar res.result(boost::beast::http::status::conflict); 18492a6af81cSRamesh Iyyar addMessageToErrorJson(res.jsonValue, 18502a6af81cSRamesh Iyyar propertyValueResourceConflict(arg1, arg2, arg3)); 18512a6af81cSRamesh Iyyar } 18522a6af81cSRamesh Iyyar 18532a6af81cSRamesh Iyyar /** 18542a6af81cSRamesh Iyyar * @internal 185524861a28SRamesh Iyyar * @brief Formats PropertyValueExternalConflict message into JSON 185624861a28SRamesh Iyyar * 185724861a28SRamesh Iyyar * See header file for more information 185824861a28SRamesh Iyyar * @endinternal 185924861a28SRamesh Iyyar */ 186024861a28SRamesh Iyyar nlohmann::json propertyValueExternalConflict(std::string_view arg1, 186195b3ad73SEd Tanous const nlohmann::json& arg2) 186224861a28SRamesh Iyyar { 1863bd79bce8SPatrick Williams std::string arg2Str = 1864034e1259SEd Tanous arg2.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 186524861a28SRamesh Iyyar return getLog( 186624861a28SRamesh Iyyar redfish::registries::base::Index::propertyValueExternalConflict, 186795b3ad73SEd Tanous std::to_array<std::string_view>({arg1, arg2Str})); 186824861a28SRamesh Iyyar } 186924861a28SRamesh Iyyar 187024861a28SRamesh Iyyar void propertyValueExternalConflict(crow::Response& res, std::string_view arg1, 187195b3ad73SEd Tanous const nlohmann::json& arg2) 187224861a28SRamesh Iyyar { 187324861a28SRamesh Iyyar res.result(boost::beast::http::status::conflict); 187424861a28SRamesh Iyyar addMessageToErrorJson(res.jsonValue, 187524861a28SRamesh Iyyar propertyValueExternalConflict(arg1, arg2)); 187624861a28SRamesh Iyyar } 187724861a28SRamesh Iyyar 187824861a28SRamesh Iyyar /** 187924861a28SRamesh Iyyar * @internal 1880684bb4b8SJason M. Bills * @brief Formats PropertyValueIncorrect message into JSON 1881684bb4b8SJason M. Bills * 1882684bb4b8SJason M. Bills * See header file for more information 1883684bb4b8SJason M. Bills * @endinternal 1884684bb4b8SJason M. Bills */ 1885367b3dceSGinu George nlohmann::json propertyValueIncorrect(std::string_view arg1, 1886367b3dceSGinu George const nlohmann::json& arg2) 1887684bb4b8SJason M. Bills { 1888bd79bce8SPatrick Williams std::string arg2Str = 1889034e1259SEd Tanous arg2.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 1890fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::propertyValueIncorrect, 1891367b3dceSGinu George std::to_array<std::string_view>({arg1, arg2Str})); 1892684bb4b8SJason M. Bills } 1893684bb4b8SJason M. Bills 1894367b3dceSGinu George void propertyValueIncorrect(crow::Response& res, std::string_view arg1, 1895367b3dceSGinu George const nlohmann::json& arg2) 1896684bb4b8SJason M. Bills { 1897684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1898684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, propertyValueIncorrect(arg1, arg2)); 1899684bb4b8SJason M. Bills } 1900684bb4b8SJason M. Bills 1901684bb4b8SJason M. Bills /** 1902684bb4b8SJason M. Bills * @internal 1903684bb4b8SJason M. Bills * @brief Formats ResourceCreationConflict message into JSON 1904684bb4b8SJason M. Bills * 1905684bb4b8SJason M. Bills * See header file for more information 1906684bb4b8SJason M. Bills * @endinternal 1907684bb4b8SJason M. Bills */ 19084a7fbefdSEd Tanous nlohmann::json resourceCreationConflict(const boost::urls::url_view_base& arg1) 1909684bb4b8SJason M. Bills { 1910fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::resourceCreationConflict, 1911079360aeSEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1912684bb4b8SJason M. Bills } 1913684bb4b8SJason M. Bills 19144a7fbefdSEd Tanous void resourceCreationConflict(crow::Response& res, 19154a7fbefdSEd Tanous const boost::urls::url_view_base& arg1) 1916684bb4b8SJason M. Bills { 1917684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1918684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, resourceCreationConflict(arg1)); 1919684bb4b8SJason M. Bills } 1920684bb4b8SJason M. Bills 1921684bb4b8SJason M. Bills /** 1922684bb4b8SJason M. Bills * @internal 1923*f8cca876SEd Tanous * @brief Formats ActionParameterValueConflict message into JSON 1924*f8cca876SEd Tanous * 1925*f8cca876SEd Tanous * See header file for more information 1926*f8cca876SEd Tanous * @endinternal 1927*f8cca876SEd Tanous */ 1928*f8cca876SEd Tanous nlohmann::json 1929*f8cca876SEd Tanous actionParameterValueConflict(std::string_view arg1, std::string_view arg2) 1930*f8cca876SEd Tanous { 1931*f8cca876SEd Tanous return getLog( 1932*f8cca876SEd Tanous redfish::registries::base::Index::actionParameterValueConflict, 1933*f8cca876SEd Tanous std::to_array({arg1, arg2})); 1934*f8cca876SEd Tanous } 1935*f8cca876SEd Tanous 1936*f8cca876SEd Tanous void actionParameterValueConflict(crow::Response& res, std::string_view arg1, 1937*f8cca876SEd Tanous std::string_view arg2) 1938*f8cca876SEd Tanous { 1939*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 1940*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, 1941*f8cca876SEd Tanous actionParameterValueConflict(arg1, arg2)); 1942*f8cca876SEd Tanous } 1943*f8cca876SEd Tanous 1944*f8cca876SEd Tanous /** 1945*f8cca876SEd Tanous * @internal 1946684bb4b8SJason M. Bills * @brief Formats MaximumErrorsExceeded message into JSON 1947684bb4b8SJason M. Bills * 1948684bb4b8SJason M. Bills * See header file for more information 1949684bb4b8SJason M. Bills * @endinternal 1950684bb4b8SJason M. Bills */ 1951d9fcfcc1SEd Tanous nlohmann::json maximumErrorsExceeded() 1952684bb4b8SJason M. Bills { 1953fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::maximumErrorsExceeded, {}); 1954684bb4b8SJason M. Bills } 1955684bb4b8SJason M. Bills 1956684bb4b8SJason M. Bills void maximumErrorsExceeded(crow::Response& res) 1957684bb4b8SJason M. Bills { 1958684bb4b8SJason M. Bills res.result(boost::beast::http::status::internal_server_error); 1959684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, maximumErrorsExceeded()); 1960684bb4b8SJason M. Bills } 1961684bb4b8SJason M. Bills 1962684bb4b8SJason M. Bills /** 1963684bb4b8SJason M. Bills * @internal 1964684bb4b8SJason M. Bills * @brief Formats PreconditionFailed message into JSON 1965684bb4b8SJason M. Bills * 1966684bb4b8SJason M. Bills * See header file for more information 1967684bb4b8SJason M. Bills * @endinternal 1968684bb4b8SJason M. Bills */ 1969d9fcfcc1SEd Tanous nlohmann::json preconditionFailed() 1970684bb4b8SJason M. Bills { 1971fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::preconditionFailed, {}); 1972684bb4b8SJason M. Bills } 1973684bb4b8SJason M. Bills 1974684bb4b8SJason M. Bills void preconditionFailed(crow::Response& res) 1975684bb4b8SJason M. Bills { 19764df1bee0SEd Tanous res.result(boost::beast::http::status::precondition_failed); 1977684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, preconditionFailed()); 1978684bb4b8SJason M. Bills } 1979684bb4b8SJason M. Bills 1980684bb4b8SJason M. Bills /** 1981684bb4b8SJason M. Bills * @internal 1982684bb4b8SJason M. Bills * @brief Formats PreconditionRequired message into JSON 1983684bb4b8SJason M. Bills * 1984684bb4b8SJason M. Bills * See header file for more information 1985684bb4b8SJason M. Bills * @endinternal 1986684bb4b8SJason M. Bills */ 1987d9fcfcc1SEd Tanous nlohmann::json preconditionRequired() 1988684bb4b8SJason M. Bills { 1989fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::preconditionRequired, {}); 1990684bb4b8SJason M. Bills } 1991684bb4b8SJason M. Bills 1992684bb4b8SJason M. Bills void preconditionRequired(crow::Response& res) 1993684bb4b8SJason M. Bills { 1994684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1995684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, preconditionRequired()); 1996684bb4b8SJason M. Bills } 1997684bb4b8SJason M. Bills 1998684bb4b8SJason M. Bills /** 1999684bb4b8SJason M. Bills * @internal 2000*f8cca876SEd Tanous * @brief Formats HeaderMissing message into JSON 2001*f8cca876SEd Tanous * 2002*f8cca876SEd Tanous * See header file for more information 2003*f8cca876SEd Tanous * @endinternal 2004*f8cca876SEd Tanous */ 2005*f8cca876SEd Tanous nlohmann::json headerMissing(std::string_view arg1) 2006*f8cca876SEd Tanous { 2007*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::headerMissing, 2008*f8cca876SEd Tanous std::to_array({arg1})); 2009*f8cca876SEd Tanous } 2010*f8cca876SEd Tanous 2011*f8cca876SEd Tanous void headerMissing(crow::Response& res, std::string_view arg1) 2012*f8cca876SEd Tanous { 2013*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 2014*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, headerMissing(arg1)); 2015*f8cca876SEd Tanous } 2016*f8cca876SEd Tanous 2017*f8cca876SEd Tanous /** 2018*f8cca876SEd Tanous * @internal 2019*f8cca876SEd Tanous * @brief Formats HeaderInvalid message into JSON 2020*f8cca876SEd Tanous * 2021*f8cca876SEd Tanous * See header file for more information 2022*f8cca876SEd Tanous * @endinternal 2023*f8cca876SEd Tanous */ 2024*f8cca876SEd Tanous nlohmann::json headerInvalid(std::string_view arg1) 2025*f8cca876SEd Tanous { 2026*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::headerInvalid, 2027*f8cca876SEd Tanous std::to_array({arg1})); 2028*f8cca876SEd Tanous } 2029*f8cca876SEd Tanous 2030*f8cca876SEd Tanous void headerInvalid(crow::Response& res, std::string_view arg1) 2031*f8cca876SEd Tanous { 2032*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 2033*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, headerInvalid(arg1)); 2034*f8cca876SEd Tanous } 2035*f8cca876SEd Tanous 2036*f8cca876SEd Tanous /** 2037*f8cca876SEd Tanous * @internal 2038684bb4b8SJason M. Bills * @brief Formats OperationFailed message into JSON 2039684bb4b8SJason M. Bills * 2040684bb4b8SJason M. Bills * See header file for more information 2041684bb4b8SJason M. Bills * @endinternal 2042684bb4b8SJason M. Bills */ 2043d9fcfcc1SEd Tanous nlohmann::json operationFailed() 2044684bb4b8SJason M. Bills { 2045fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::operationFailed, {}); 2046684bb4b8SJason M. Bills } 2047684bb4b8SJason M. Bills 2048684bb4b8SJason M. Bills void operationFailed(crow::Response& res) 2049684bb4b8SJason M. Bills { 20508868776eSEd Tanous res.result(boost::beast::http::status::bad_gateway); 2051684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, operationFailed()); 2052684bb4b8SJason M. Bills } 2053684bb4b8SJason M. Bills 2054684bb4b8SJason M. Bills /** 2055684bb4b8SJason M. Bills * @internal 2056684bb4b8SJason M. Bills * @brief Formats OperationTimeout message into JSON 2057684bb4b8SJason M. Bills * 2058684bb4b8SJason M. Bills * See header file for more information 2059684bb4b8SJason M. Bills * @endinternal 2060684bb4b8SJason M. Bills */ 2061d9fcfcc1SEd Tanous nlohmann::json operationTimeout() 2062684bb4b8SJason M. Bills { 2063fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::operationTimeout, {}); 2064684bb4b8SJason M. Bills } 2065684bb4b8SJason M. Bills 2066684bb4b8SJason M. Bills void operationTimeout(crow::Response& res) 2067684bb4b8SJason M. Bills { 2068684bb4b8SJason M. Bills res.result(boost::beast::http::status::internal_server_error); 2069684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, operationTimeout()); 2070684bb4b8SJason M. Bills } 2071684bb4b8SJason M. Bills 2072684bb4b8SJason M. Bills /** 2073684bb4b8SJason M. Bills * @internal 207444c70412SEd Tanous * @brief Formats OperationNotAllowed message into JSON 207544c70412SEd Tanous * 207644c70412SEd Tanous * See header file for more information 207744c70412SEd Tanous * @endinternal 207844c70412SEd Tanous */ 207944c70412SEd Tanous nlohmann::json operationNotAllowed() 208044c70412SEd Tanous { 208144c70412SEd Tanous return getLog(redfish::registries::base::Index::operationNotAllowed, {}); 208244c70412SEd Tanous } 208344c70412SEd Tanous 208444c70412SEd Tanous void operationNotAllowed(crow::Response& res) 208544c70412SEd Tanous { 208644c70412SEd Tanous res.result(boost::beast::http::status::method_not_allowed); 208744c70412SEd Tanous addMessageToErrorJson(res.jsonValue, operationNotAllowed()); 208844c70412SEd Tanous } 208944c70412SEd Tanous 2090600af5f1SAppaRao Puli /** 2091600af5f1SAppaRao Puli * @internal 20927ccfe684SEd Tanous * @brief Formats UndeterminedFault message into JSON 20937ccfe684SEd Tanous * 20947ccfe684SEd Tanous * See header file for more information 20957ccfe684SEd Tanous * @endinternal 20967ccfe684SEd Tanous */ 20977ccfe684SEd Tanous nlohmann::json undeterminedFault(std::string_view arg1) 20987ccfe684SEd Tanous { 20997ccfe684SEd Tanous return getLog(redfish::registries::base::Index::undeterminedFault, 21007ccfe684SEd Tanous std::to_array({arg1})); 21017ccfe684SEd Tanous } 21027ccfe684SEd Tanous 21037ccfe684SEd Tanous void undeterminedFault(crow::Response& res, std::string_view arg1) 21047ccfe684SEd Tanous { 21057ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 21067ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, undeterminedFault(arg1)); 21077ccfe684SEd Tanous } 21087ccfe684SEd Tanous 21097ccfe684SEd Tanous /** 21107ccfe684SEd Tanous * @internal 21117ccfe684SEd Tanous * @brief Formats ConditionInRelatedResource message into JSON 21127ccfe684SEd Tanous * 21137ccfe684SEd Tanous * See header file for more information 21147ccfe684SEd Tanous * @endinternal 21157ccfe684SEd Tanous */ 21167ccfe684SEd Tanous nlohmann::json conditionInRelatedResource() 21177ccfe684SEd Tanous { 21187ccfe684SEd Tanous return getLog(redfish::registries::base::Index::conditionInRelatedResource, 21197ccfe684SEd Tanous {}); 21207ccfe684SEd Tanous } 21217ccfe684SEd Tanous 21227ccfe684SEd Tanous void conditionInRelatedResource(crow::Response& res) 21237ccfe684SEd Tanous { 21247ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 21257ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, conditionInRelatedResource()); 21267ccfe684SEd Tanous } 21277ccfe684SEd Tanous 21287ccfe684SEd Tanous /** 21297ccfe684SEd Tanous * @internal 21307ccfe684SEd Tanous * @brief Formats RestrictedRole message into JSON 21317ccfe684SEd Tanous * 21327ccfe684SEd Tanous * See header file for more information 21337ccfe684SEd Tanous * @endinternal 21347ccfe684SEd Tanous */ 21357ccfe684SEd Tanous nlohmann::json restrictedRole(std::string_view arg1) 21367ccfe684SEd Tanous { 21377ccfe684SEd Tanous return getLog(redfish::registries::base::Index::restrictedRole, 21387ccfe684SEd Tanous std::to_array({arg1})); 21397ccfe684SEd Tanous } 21407ccfe684SEd Tanous 21417ccfe684SEd Tanous void restrictedRole(crow::Response& res, std::string_view arg1) 21427ccfe684SEd Tanous { 21437ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 21447ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, restrictedRole(arg1)); 21457ccfe684SEd Tanous } 21467ccfe684SEd Tanous 21477ccfe684SEd Tanous /** 21487ccfe684SEd Tanous * @internal 21497ccfe684SEd Tanous * @brief Formats RestrictedPrivilege message into JSON 21507ccfe684SEd Tanous * 21517ccfe684SEd Tanous * See header file for more information 21527ccfe684SEd Tanous * @endinternal 21537ccfe684SEd Tanous */ 21547ccfe684SEd Tanous nlohmann::json restrictedPrivilege(std::string_view arg1) 21557ccfe684SEd Tanous { 21567ccfe684SEd Tanous return getLog(redfish::registries::base::Index::restrictedPrivilege, 21577ccfe684SEd Tanous std::to_array({arg1})); 21587ccfe684SEd Tanous } 21597ccfe684SEd Tanous 21607ccfe684SEd Tanous void restrictedPrivilege(crow::Response& res, std::string_view arg1) 21617ccfe684SEd Tanous { 21627ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 21637ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, restrictedPrivilege(arg1)); 21647ccfe684SEd Tanous } 21657ccfe684SEd Tanous 21667ccfe684SEd Tanous /** 21677ccfe684SEd Tanous * @internal 2168*f8cca876SEd Tanous * @brief Formats StrictAccountTypes message into JSON 2169*f8cca876SEd Tanous * 2170*f8cca876SEd Tanous * See header file for more information 2171*f8cca876SEd Tanous * @endinternal 2172*f8cca876SEd Tanous */ 2173*f8cca876SEd Tanous nlohmann::json strictAccountTypes(std::string_view arg1) 2174*f8cca876SEd Tanous { 2175*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::strictAccountTypes, 2176*f8cca876SEd Tanous std::to_array({arg1})); 2177*f8cca876SEd Tanous } 2178*f8cca876SEd Tanous 2179*f8cca876SEd Tanous void strictAccountTypes(crow::Response& res, std::string_view arg1) 2180*f8cca876SEd Tanous { 2181*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 2182*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, strictAccountTypes(arg1)); 2183*f8cca876SEd Tanous } 2184*f8cca876SEd Tanous 2185*f8cca876SEd Tanous /** 2186*f8cca876SEd Tanous * @internal 21877ccfe684SEd Tanous * @brief Formats PropertyDeprecated message into JSON 21887ccfe684SEd Tanous * 21897ccfe684SEd Tanous * See header file for more information 21907ccfe684SEd Tanous * @endinternal 21917ccfe684SEd Tanous */ 21927ccfe684SEd Tanous nlohmann::json propertyDeprecated(std::string_view arg1) 21937ccfe684SEd Tanous { 21947ccfe684SEd Tanous return getLog(redfish::registries::base::Index::propertyDeprecated, 21957ccfe684SEd Tanous std::to_array({arg1})); 21967ccfe684SEd Tanous } 21977ccfe684SEd Tanous 21987ccfe684SEd Tanous void propertyDeprecated(crow::Response& res, std::string_view arg1) 21997ccfe684SEd Tanous { 22007ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 22017ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, propertyDeprecated(arg1)); 22027ccfe684SEd Tanous } 22037ccfe684SEd Tanous 22047ccfe684SEd Tanous /** 22057ccfe684SEd Tanous * @internal 22067ccfe684SEd Tanous * @brief Formats ResourceDeprecated message into JSON 22077ccfe684SEd Tanous * 22087ccfe684SEd Tanous * See header file for more information 22097ccfe684SEd Tanous * @endinternal 22107ccfe684SEd Tanous */ 22117ccfe684SEd Tanous nlohmann::json resourceDeprecated(std::string_view arg1) 22127ccfe684SEd Tanous { 22137ccfe684SEd Tanous return getLog(redfish::registries::base::Index::resourceDeprecated, 22147ccfe684SEd Tanous std::to_array({arg1})); 22157ccfe684SEd Tanous } 22167ccfe684SEd Tanous 22177ccfe684SEd Tanous void resourceDeprecated(crow::Response& res, std::string_view arg1) 22187ccfe684SEd Tanous { 22197ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 22207ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, resourceDeprecated(arg1)); 22217ccfe684SEd Tanous } 22227ccfe684SEd Tanous 22237ccfe684SEd Tanous /** 22247ccfe684SEd Tanous * @internal 22257ccfe684SEd Tanous * @brief Formats PropertyValueDeprecated message into JSON 22267ccfe684SEd Tanous * 22277ccfe684SEd Tanous * See header file for more information 22287ccfe684SEd Tanous * @endinternal 22297ccfe684SEd Tanous */ 22307ccfe684SEd Tanous nlohmann::json propertyValueDeprecated(std::string_view arg1, 22317ccfe684SEd Tanous std::string_view arg2) 22327ccfe684SEd Tanous { 22337ccfe684SEd Tanous return getLog(redfish::registries::base::Index::propertyValueDeprecated, 22347ccfe684SEd Tanous std::to_array({arg1, arg2})); 22357ccfe684SEd Tanous } 22367ccfe684SEd Tanous 22377ccfe684SEd Tanous void propertyValueDeprecated(crow::Response& res, std::string_view arg1, 22387ccfe684SEd Tanous std::string_view arg2) 22397ccfe684SEd Tanous { 22407ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 22417ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, propertyValueDeprecated(arg1, arg2)); 22427ccfe684SEd Tanous } 22437ccfe684SEd Tanous 22447ccfe684SEd Tanous /** 22457ccfe684SEd Tanous * @internal 22467ccfe684SEd Tanous * @brief Formats ActionDeprecated message into JSON 22477ccfe684SEd Tanous * 22487ccfe684SEd Tanous * See header file for more information 22497ccfe684SEd Tanous * @endinternal 22507ccfe684SEd Tanous */ 22517ccfe684SEd Tanous nlohmann::json actionDeprecated(std::string_view arg1) 22527ccfe684SEd Tanous { 22537ccfe684SEd Tanous return getLog(redfish::registries::base::Index::actionDeprecated, 22547ccfe684SEd Tanous std::to_array({arg1})); 22557ccfe684SEd Tanous } 22567ccfe684SEd Tanous 22577ccfe684SEd Tanous void actionDeprecated(crow::Response& res, std::string_view arg1) 22587ccfe684SEd Tanous { 22597ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 22607ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, actionDeprecated(arg1)); 22617ccfe684SEd Tanous } 22627ccfe684SEd Tanous 22637ccfe684SEd Tanous /** 22647ccfe684SEd Tanous * @internal 22657ccfe684SEd Tanous * @brief Formats NetworkNameResolutionNotConfigured message into JSON 22667ccfe684SEd Tanous * 22677ccfe684SEd Tanous * See header file for more information 22687ccfe684SEd Tanous * @endinternal 22697ccfe684SEd Tanous */ 22707ccfe684SEd Tanous nlohmann::json networkNameResolutionNotConfigured() 22717ccfe684SEd Tanous { 22727ccfe684SEd Tanous return getLog( 22737ccfe684SEd Tanous redfish::registries::base::Index::networkNameResolutionNotConfigured, 22747ccfe684SEd Tanous {}); 22757ccfe684SEd Tanous } 22767ccfe684SEd Tanous 22777ccfe684SEd Tanous void networkNameResolutionNotConfigured(crow::Response& res) 22787ccfe684SEd Tanous { 22797ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 22807ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, networkNameResolutionNotConfigured()); 22817ccfe684SEd Tanous } 22827ccfe684SEd Tanous 22837ccfe684SEd Tanous /** 22847ccfe684SEd Tanous * @internal 22857ccfe684SEd Tanous * @brief Formats NetworkNameResolutionNotSupported message into JSON 22867ccfe684SEd Tanous * 22877ccfe684SEd Tanous * See header file for more information 22887ccfe684SEd Tanous * @endinternal 22897ccfe684SEd Tanous */ 22907ccfe684SEd Tanous nlohmann::json networkNameResolutionNotSupported() 22917ccfe684SEd Tanous { 22927ccfe684SEd Tanous return getLog( 22937ccfe684SEd Tanous redfish::registries::base::Index::networkNameResolutionNotSupported, 22947ccfe684SEd Tanous {}); 22957ccfe684SEd Tanous } 22967ccfe684SEd Tanous 22977ccfe684SEd Tanous void networkNameResolutionNotSupported(crow::Response& res) 22987ccfe684SEd Tanous { 22997ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 23007ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, networkNameResolutionNotSupported()); 23017ccfe684SEd Tanous } 23027ccfe684SEd Tanous 23037ccfe684SEd Tanous /** 23047ccfe684SEd Tanous * @internal 2305*f8cca876SEd Tanous * @brief Formats ServiceDisabled message into JSON 2306*f8cca876SEd Tanous * 2307*f8cca876SEd Tanous * See header file for more information 2308*f8cca876SEd Tanous * @endinternal 2309*f8cca876SEd Tanous */ 2310*f8cca876SEd Tanous nlohmann::json serviceDisabled(std::string_view arg1) 2311*f8cca876SEd Tanous { 2312*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::serviceDisabled, 2313*f8cca876SEd Tanous std::to_array({arg1})); 2314*f8cca876SEd Tanous } 2315*f8cca876SEd Tanous 2316*f8cca876SEd Tanous void serviceDisabled(crow::Response& res, std::string_view arg1) 2317*f8cca876SEd Tanous { 2318*f8cca876SEd Tanous res.result(boost::beast::http::status::service_unavailable); 2319*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, serviceDisabled(arg1)); 2320*f8cca876SEd Tanous } 2321*f8cca876SEd Tanous 2322*f8cca876SEd Tanous /** 2323*f8cca876SEd Tanous * @internal 2324*f8cca876SEd Tanous * @brief Formats EventBufferExceeded message into JSON 2325*f8cca876SEd Tanous * 2326*f8cca876SEd Tanous * See header file for more information 2327*f8cca876SEd Tanous * @endinternal 2328*f8cca876SEd Tanous */ 2329*f8cca876SEd Tanous nlohmann::json eventBufferExceeded() 2330*f8cca876SEd Tanous { 2331*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::eventBufferExceeded, {}); 2332*f8cca876SEd Tanous } 2333*f8cca876SEd Tanous 2334*f8cca876SEd Tanous void eventBufferExceeded(crow::Response& res) 2335*f8cca876SEd Tanous { 2336*f8cca876SEd Tanous res.result(boost::beast::http::status::bad_request); 2337*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, eventBufferExceeded()); 2338*f8cca876SEd Tanous } 2339*f8cca876SEd Tanous 2340*f8cca876SEd Tanous /** 2341*f8cca876SEd Tanous * @internal 23427ccfe684SEd Tanous * @brief Formats AuthenticationTokenRequired message into JSON 23437ccfe684SEd Tanous * 23447ccfe684SEd Tanous * See header file for more information 23457ccfe684SEd Tanous * @endinternal 23467ccfe684SEd Tanous */ 23477ccfe684SEd Tanous nlohmann::json authenticationTokenRequired() 23487ccfe684SEd Tanous { 23497ccfe684SEd Tanous return getLog(redfish::registries::base::Index::authenticationTokenRequired, 23507ccfe684SEd Tanous {}); 23517ccfe684SEd Tanous } 23527ccfe684SEd Tanous 23537ccfe684SEd Tanous void authenticationTokenRequired(crow::Response& res) 23547ccfe684SEd Tanous { 23557ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 23567ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, authenticationTokenRequired()); 23577ccfe684SEd Tanous } 23587ccfe684SEd Tanous 23597ccfe684SEd Tanous /** 23607ccfe684SEd Tanous * @internal 23617ccfe684SEd Tanous * @brief Formats OneTimePasscodeSent message into JSON 23627ccfe684SEd Tanous * 23637ccfe684SEd Tanous * See header file for more information 23647ccfe684SEd Tanous * @endinternal 23657ccfe684SEd Tanous */ 23667ccfe684SEd Tanous nlohmann::json oneTimePasscodeSent(std::string_view arg1) 23677ccfe684SEd Tanous { 23687ccfe684SEd Tanous return getLog(redfish::registries::base::Index::oneTimePasscodeSent, 23697ccfe684SEd Tanous std::to_array({arg1})); 23707ccfe684SEd Tanous } 23717ccfe684SEd Tanous 23727ccfe684SEd Tanous void oneTimePasscodeSent(crow::Response& res, std::string_view arg1) 23737ccfe684SEd Tanous { 23747ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 23757ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, oneTimePasscodeSent(arg1)); 23767ccfe684SEd Tanous } 23777ccfe684SEd Tanous 23787ccfe684SEd Tanous /** 23797ccfe684SEd Tanous * @internal 23807ccfe684SEd Tanous * @brief Formats LicenseRequired message into JSON 23817ccfe684SEd Tanous * 23827ccfe684SEd Tanous * See header file for more information 23837ccfe684SEd Tanous * @endinternal 23847ccfe684SEd Tanous */ 23857ccfe684SEd Tanous nlohmann::json licenseRequired(std::string_view arg1) 23867ccfe684SEd Tanous { 23877ccfe684SEd Tanous return getLog(redfish::registries::base::Index::licenseRequired, 23887ccfe684SEd Tanous std::to_array({arg1})); 23897ccfe684SEd Tanous } 23907ccfe684SEd Tanous 23917ccfe684SEd Tanous void licenseRequired(crow::Response& res, std::string_view arg1) 23927ccfe684SEd Tanous { 23937ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 23947ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, licenseRequired(arg1)); 23957ccfe684SEd Tanous } 23967ccfe684SEd Tanous 23977ccfe684SEd Tanous /** 23987ccfe684SEd Tanous * @internal 23997ccfe684SEd Tanous * @brief Formats PropertyModified message into JSON 24007ccfe684SEd Tanous * 24017ccfe684SEd Tanous * See header file for more information 24027ccfe684SEd Tanous * @endinternal 24037ccfe684SEd Tanous */ 24047ccfe684SEd Tanous nlohmann::json propertyModified() 24057ccfe684SEd Tanous { 24067ccfe684SEd Tanous return getLog(redfish::registries::base::Index::propertyModified, {}); 24077ccfe684SEd Tanous } 24087ccfe684SEd Tanous 24097ccfe684SEd Tanous void propertyModified(crow::Response& res) 24107ccfe684SEd Tanous { 24117ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 24127ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, propertyModified()); 24137585b760SJishnu CM } 24147585b760SJishnu CM 2415*f8cca876SEd Tanous /** 2416*f8cca876SEd Tanous * @internal 2417*f8cca876SEd Tanous * @brief Formats GenerateSecretKeyRequired message into JSON 2418*f8cca876SEd Tanous * 2419*f8cca876SEd Tanous * See header file for more information 2420*f8cca876SEd Tanous * @endinternal 2421*f8cca876SEd Tanous */ 2422*f8cca876SEd Tanous nlohmann::json generateSecretKeyRequired(const boost::urls::url_view_base& arg1) 2423*f8cca876SEd Tanous { 2424*f8cca876SEd Tanous return getLog(redfish::registries::base::Index::generateSecretKeyRequired, 2425*f8cca876SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 2426*f8cca876SEd Tanous } 2427*f8cca876SEd Tanous 2428*f8cca876SEd Tanous void generateSecretKeyRequired(crow::Response& res, 2429*f8cca876SEd Tanous const boost::urls::url_view_base& arg1) 2430*f8cca876SEd Tanous { 2431*f8cca876SEd Tanous res.result(boost::beast::http::status::forbidden); 2432*f8cca876SEd Tanous addMessageToErrorJson(res.jsonValue, generateSecretKeyRequired(arg1)); 2433*f8cca876SEd Tanous } 2434*f8cca876SEd Tanous 2435f4c4dcf4SKowalski, Kamil } // namespace messages 2436d425c6f6SEd Tanous } // namespace redfish 2437