1*7ccfe684SEd Tanous /**************************************************************** 2*7ccfe684SEd Tanous * READ THIS WARNING FIRST 3*7ccfe684SEd Tanous * This is an auto-generated header which contains definitions 4*7ccfe684SEd Tanous * for Redfish DMTF defined messages. 5*7ccfe684SEd Tanous * DO NOT modify this registry outside of running the 6*7ccfe684SEd Tanous * parse_registries.py script. The definitions contained within 7*7ccfe684SEd Tanous * this file are owned by DMTF. Any modifications to these files 8*7ccfe684SEd Tanous * should be first pushed to the relevant registry in the DMTF 9*7ccfe684SEd Tanous * github organization. 10*7ccfe684SEd 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 31*7ccfe684SEd Tanous // Clang can't seem to decide whether this header needs to be included or not, 32*7ccfe684SEd Tanous // and is inconsistent. Include it for now 33*7ccfe684SEd Tanous // NOLINTNEXTLINE(misc-include-cleaner) 34*7ccfe684SEd Tanous #include <utility> 35*7ccfe684SEd 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 165f4c4dcf4SKowalski, Kamil * @brief Formats ResourceInUse message into JSON 166f4c4dcf4SKowalski, Kamil * 167f4c4dcf4SKowalski, Kamil * See header file for more information 168f4c4dcf4SKowalski, Kamil * @endinternal 169f4c4dcf4SKowalski, Kamil */ 170d9fcfcc1SEd Tanous nlohmann::json resourceInUse() 1711abe55efSEd Tanous { 172fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::resourceInUse, {}); 173b5c07418SJames Feist } 174b5c07418SJames Feist 175b5c07418SJames Feist void resourceInUse(crow::Response& res) 176b5c07418SJames Feist { 177b5c07418SJames Feist res.result(boost::beast::http::status::service_unavailable); 178b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, resourceInUse()); 179f4c4dcf4SKowalski, Kamil } 180f4c4dcf4SKowalski, Kamil 181f4c4dcf4SKowalski, Kamil /** 182f4c4dcf4SKowalski, Kamil * @internal 183f4c4dcf4SKowalski, Kamil * @brief Formats MalformedJSON message into JSON 184f4c4dcf4SKowalski, Kamil * 185f4c4dcf4SKowalski, Kamil * See header file for more information 186f4c4dcf4SKowalski, Kamil * @endinternal 187f4c4dcf4SKowalski, Kamil */ 188d9fcfcc1SEd Tanous nlohmann::json malformedJSON() 1891abe55efSEd Tanous { 190fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::malformedJSON, {}); 191b5c07418SJames Feist } 192b5c07418SJames Feist 193b5c07418SJames Feist void malformedJSON(crow::Response& res) 194b5c07418SJames Feist { 195b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 196b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, malformedJSON()); 197f4c4dcf4SKowalski, Kamil } 198f4c4dcf4SKowalski, Kamil 199f4c4dcf4SKowalski, Kamil /** 200f4c4dcf4SKowalski, Kamil * @internal 201f4c4dcf4SKowalski, Kamil * @brief Formats ResourceMissingAtURI message into JSON 202f4c4dcf4SKowalski, Kamil * 203f4c4dcf4SKowalski, Kamil * See header file for more information 204f4c4dcf4SKowalski, Kamil * @endinternal 205f4c4dcf4SKowalski, Kamil */ 2064a7fbefdSEd Tanous nlohmann::json resourceMissingAtURI(const boost::urls::url_view_base& arg1) 2071abe55efSEd Tanous { 208*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::resourceMissingAtURI, 209*7ccfe684SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 210b5c07418SJames Feist } 211b5c07418SJames Feist 2124a7fbefdSEd Tanous void resourceMissingAtURI(crow::Response& res, 2134a7fbefdSEd Tanous const boost::urls::url_view_base& arg1) 214b5c07418SJames Feist { 215b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 216b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, resourceMissingAtURI(arg1)); 217f4c4dcf4SKowalski, Kamil } 218f4c4dcf4SKowalski, Kamil 219f4c4dcf4SKowalski, Kamil /** 220f4c4dcf4SKowalski, Kamil * @internal 221f4c4dcf4SKowalski, Kamil * @brief Formats ActionParameterValueFormatError message into JSON 222f4c4dcf4SKowalski, Kamil * 223f4c4dcf4SKowalski, Kamil * See header file for more information 224f4c4dcf4SKowalski, Kamil * @endinternal 225f4c4dcf4SKowalski, Kamil */ 226bd79bce8SPatrick Williams nlohmann::json actionParameterValueFormatError( 227bd79bce8SPatrick Williams const nlohmann::json& arg1, std::string_view arg2, std::string_view arg3) 2281abe55efSEd Tanous { 229bd79bce8SPatrick Williams std::string arg1Str = 230034e1259SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 231fffb8c1fSEd Tanous return getLog( 232fffb8c1fSEd Tanous redfish::registries::base::Index::actionParameterValueFormatError, 23395b3ad73SEd Tanous std::to_array<std::string_view>({arg1Str, arg2, arg3})); 234b5c07418SJames Feist } 235b5c07418SJames Feist 236bd79bce8SPatrick Williams void actionParameterValueFormatError( 237bd79bce8SPatrick Williams crow::Response& res, const nlohmann::json& arg1, std::string_view arg2, 2381668ce6dSEd Tanous std::string_view arg3) 239b5c07418SJames Feist { 240b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 241b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, 242b5c07418SJames Feist actionParameterValueFormatError(arg1, arg2, arg3)); 243f4c4dcf4SKowalski, Kamil } 244f4c4dcf4SKowalski, Kamil 245f4c4dcf4SKowalski, Kamil /** 246f4c4dcf4SKowalski, Kamil * @internal 2474ef82a15SAlex Schendel * @brief Formats ActionParameterValueNotInList message into JSON 2484ef82a15SAlex Schendel * 2494ef82a15SAlex Schendel * See header file for more information 2504ef82a15SAlex Schendel * @endinternal 2514ef82a15SAlex Schendel */ 252bd79bce8SPatrick Williams nlohmann::json actionParameterValueNotInList( 253bd79bce8SPatrick Williams std::string_view arg1, std::string_view arg2, std::string_view arg3) 2544ef82a15SAlex Schendel { 2554ef82a15SAlex Schendel return getLog( 2564ef82a15SAlex Schendel redfish::registries::base::Index::actionParameterValueNotInList, 2574ef82a15SAlex Schendel std::to_array({arg1, arg2, arg3})); 2584ef82a15SAlex Schendel } 2594ef82a15SAlex Schendel 2604ef82a15SAlex Schendel void actionParameterValueNotInList(crow::Response& res, std::string_view arg1, 2614ef82a15SAlex Schendel std::string_view arg2, std::string_view arg3) 2624ef82a15SAlex Schendel { 2634ef82a15SAlex Schendel res.result(boost::beast::http::status::bad_request); 2644ef82a15SAlex Schendel addMessageToErrorJson(res.jsonValue, 2654ef82a15SAlex Schendel actionParameterValueNotInList(arg1, arg2, arg3)); 2664ef82a15SAlex Schendel } 2674ef82a15SAlex Schendel 2684ef82a15SAlex Schendel /** 2694ef82a15SAlex Schendel * @internal 270f4c4dcf4SKowalski, Kamil * @brief Formats InternalError message into JSON 271f4c4dcf4SKowalski, Kamil * 272f4c4dcf4SKowalski, Kamil * See header file for more information 273f4c4dcf4SKowalski, Kamil * @endinternal 274f4c4dcf4SKowalski, Kamil */ 275d9fcfcc1SEd Tanous nlohmann::json internalError() 2761abe55efSEd Tanous { 277fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::internalError, {}); 278b5c07418SJames Feist } 279b5c07418SJames Feist 280d85418e3SPatrick Williams void internalError(crow::Response& res, const std::source_location location) 281b5c07418SJames Feist { 28262598e31SEd Tanous BMCWEB_LOG_CRITICAL("Internal Error {}({}:{}) `{}`: ", location.file_name(), 28362598e31SEd Tanous location.line(), location.column(), 28462598e31SEd Tanous location.function_name()); 285b5c07418SJames Feist res.result(boost::beast::http::status::internal_server_error); 286b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, internalError()); 287f12894f8SJason M. Bills } 288f12894f8SJason M. Bills 289f12894f8SJason M. Bills /** 290f12894f8SJason M. Bills * @internal 291f4c4dcf4SKowalski, Kamil * @brief Formats UnrecognizedRequestBody message into JSON 292f4c4dcf4SKowalski, Kamil * 293f4c4dcf4SKowalski, Kamil * See header file for more information 294f4c4dcf4SKowalski, Kamil * @endinternal 295f4c4dcf4SKowalski, Kamil */ 296d9fcfcc1SEd Tanous nlohmann::json unrecognizedRequestBody() 2971abe55efSEd Tanous { 298fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::unrecognizedRequestBody, 299fffb8c1fSEd Tanous {}); 300b5c07418SJames Feist } 301b5c07418SJames Feist 302b5c07418SJames Feist void unrecognizedRequestBody(crow::Response& res) 303b5c07418SJames Feist { 304b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 305b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, unrecognizedRequestBody()); 306f4c4dcf4SKowalski, Kamil } 307f4c4dcf4SKowalski, Kamil 308f4c4dcf4SKowalski, Kamil /** 309f4c4dcf4SKowalski, Kamil * @internal 310f4c4dcf4SKowalski, Kamil * @brief Formats ResourceAtUriUnauthorized message into JSON 311f4c4dcf4SKowalski, Kamil * 312f4c4dcf4SKowalski, Kamil * See header file for more information 313f4c4dcf4SKowalski, Kamil * @endinternal 314f4c4dcf4SKowalski, Kamil */ 3154a7fbefdSEd Tanous nlohmann::json resourceAtUriUnauthorized(const boost::urls::url_view_base& arg1, 3161668ce6dSEd Tanous std::string_view arg2) 3171abe55efSEd Tanous { 318079360aeSEd Tanous return getLog(redfish::registries::base::Index::resourceAtUriUnauthorized, 319079360aeSEd Tanous std::to_array<std::string_view>({arg1.buffer(), arg2})); 320b5c07418SJames Feist } 321b5c07418SJames Feist 3224a7fbefdSEd Tanous void resourceAtUriUnauthorized(crow::Response& res, 3234a7fbefdSEd Tanous const boost::urls::url_view_base& arg1, 3241668ce6dSEd Tanous std::string_view arg2) 325b5c07418SJames Feist { 326b5c07418SJames Feist res.result(boost::beast::http::status::unauthorized); 327b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, resourceAtUriUnauthorized(arg1, arg2)); 328f4c4dcf4SKowalski, Kamil } 329f4c4dcf4SKowalski, Kamil 330f4c4dcf4SKowalski, Kamil /** 331f4c4dcf4SKowalski, Kamil * @internal 332f4c4dcf4SKowalski, Kamil * @brief Formats ActionParameterUnknown message into JSON 333f4c4dcf4SKowalski, Kamil * 334f4c4dcf4SKowalski, Kamil * See header file for more information 335f4c4dcf4SKowalski, Kamil * @endinternal 336f4c4dcf4SKowalski, Kamil */ 3371668ce6dSEd Tanous nlohmann::json actionParameterUnknown(std::string_view arg1, 3381668ce6dSEd Tanous std::string_view arg2) 339b5c07418SJames Feist { 340fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::actionParameterUnknown, 3411668ce6dSEd Tanous std::to_array({arg1, arg2})); 342b5c07418SJames Feist } 343b5c07418SJames Feist 3441668ce6dSEd Tanous void actionParameterUnknown(crow::Response& res, std::string_view arg1, 3451668ce6dSEd Tanous std::string_view arg2) 3461abe55efSEd Tanous { 347f12894f8SJason M. Bills res.result(boost::beast::http::status::bad_request); 348b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, actionParameterUnknown(arg1, arg2)); 349f4c4dcf4SKowalski, Kamil } 350f4c4dcf4SKowalski, Kamil 351f4c4dcf4SKowalski, Kamil /** 352f4c4dcf4SKowalski, Kamil * @internal 353f4c4dcf4SKowalski, Kamil * @brief Formats ResourceCannotBeDeleted message into JSON 354f4c4dcf4SKowalski, Kamil * 355f4c4dcf4SKowalski, Kamil * See header file for more information 356f4c4dcf4SKowalski, Kamil * @endinternal 357f4c4dcf4SKowalski, Kamil */ 358d9fcfcc1SEd Tanous nlohmann::json resourceCannotBeDeleted() 3591abe55efSEd Tanous { 360fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::resourceCannotBeDeleted, 361fffb8c1fSEd Tanous {}); 362b5c07418SJames Feist } 363b5c07418SJames Feist 364b5c07418SJames Feist void resourceCannotBeDeleted(crow::Response& res) 365b5c07418SJames Feist { 36644c70412SEd Tanous res.result(boost::beast::http::status::method_not_allowed); 367b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, resourceCannotBeDeleted()); 368f4c4dcf4SKowalski, Kamil } 369f4c4dcf4SKowalski, Kamil 370f4c4dcf4SKowalski, Kamil /** 371f4c4dcf4SKowalski, Kamil * @internal 372f4c4dcf4SKowalski, Kamil * @brief Formats PropertyDuplicate message into JSON 373f4c4dcf4SKowalski, Kamil * 374f4c4dcf4SKowalski, Kamil * See header file for more information 375f4c4dcf4SKowalski, Kamil * @endinternal 376f4c4dcf4SKowalski, Kamil */ 3771668ce6dSEd Tanous nlohmann::json propertyDuplicate(std::string_view arg1) 3781abe55efSEd Tanous { 379fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::propertyDuplicate, 3801668ce6dSEd Tanous std::to_array({arg1})); 381b5c07418SJames Feist } 382b5c07418SJames Feist 3831668ce6dSEd Tanous void propertyDuplicate(crow::Response& res, std::string_view arg1) 384b5c07418SJames Feist { 385b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 386b5c07418SJames Feist addMessageToJson(res.jsonValue, propertyDuplicate(arg1), arg1); 387f4c4dcf4SKowalski, Kamil } 388f4c4dcf4SKowalski, Kamil 389f4c4dcf4SKowalski, Kamil /** 390f4c4dcf4SKowalski, Kamil * @internal 391f4c4dcf4SKowalski, Kamil * @brief Formats ServiceTemporarilyUnavailable message into JSON 392f4c4dcf4SKowalski, Kamil * 393f4c4dcf4SKowalski, Kamil * See header file for more information 394f4c4dcf4SKowalski, Kamil * @endinternal 395f4c4dcf4SKowalski, Kamil */ 3961668ce6dSEd Tanous nlohmann::json serviceTemporarilyUnavailable(std::string_view arg1) 3971abe55efSEd Tanous { 398b6cd31e1SEd Tanous return getLog( 399fffb8c1fSEd Tanous redfish::registries::base::Index::serviceTemporarilyUnavailable, 4001668ce6dSEd Tanous std::to_array({arg1})); 401b5c07418SJames Feist } 402b5c07418SJames Feist 4031668ce6dSEd Tanous void serviceTemporarilyUnavailable(crow::Response& res, std::string_view arg1) 404b5c07418SJames Feist { 405d9f6c621SEd Tanous res.addHeader(boost::beast::http::field::retry_after, arg1); 406b5c07418SJames Feist res.result(boost::beast::http::status::service_unavailable); 407b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, serviceTemporarilyUnavailable(arg1)); 408f4c4dcf4SKowalski, Kamil } 409f4c4dcf4SKowalski, Kamil 410f4c4dcf4SKowalski, Kamil /** 411f4c4dcf4SKowalski, Kamil * @internal 412f4c4dcf4SKowalski, Kamil * @brief Formats ResourceAlreadyExists message into JSON 413f4c4dcf4SKowalski, Kamil * 414f4c4dcf4SKowalski, Kamil * See header file for more information 415f4c4dcf4SKowalski, Kamil * @endinternal 416f4c4dcf4SKowalski, Kamil */ 417bd79bce8SPatrick Williams nlohmann::json resourceAlreadyExists( 418bd79bce8SPatrick Williams std::string_view arg1, std::string_view arg2, std::string_view arg3) 4191abe55efSEd Tanous { 420fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::resourceAlreadyExists, 4211668ce6dSEd Tanous std::to_array({arg1, arg2, arg3})); 422b5c07418SJames Feist } 423b5c07418SJames Feist 4241668ce6dSEd Tanous void resourceAlreadyExists(crow::Response& res, std::string_view arg1, 4251668ce6dSEd Tanous std::string_view arg2, std::string_view arg3) 426b5c07418SJames Feist { 427b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 428b5c07418SJames Feist addMessageToJson(res.jsonValue, resourceAlreadyExists(arg1, arg2, arg3), 429a08b46ccSJason M. Bills arg2); 430f4c4dcf4SKowalski, Kamil } 431f4c4dcf4SKowalski, Kamil 432f4c4dcf4SKowalski, Kamil /** 433f4c4dcf4SKowalski, Kamil * @internal 434f4c4dcf4SKowalski, Kamil * @brief Formats AccountForSessionNoLongerExists message into JSON 435f4c4dcf4SKowalski, Kamil * 436f4c4dcf4SKowalski, Kamil * See header file for more information 437f4c4dcf4SKowalski, Kamil * @endinternal 438f4c4dcf4SKowalski, Kamil */ 439d9fcfcc1SEd Tanous nlohmann::json accountForSessionNoLongerExists() 4401abe55efSEd Tanous { 441fffb8c1fSEd Tanous return getLog( 442fffb8c1fSEd Tanous redfish::registries::base::Index::accountForSessionNoLongerExists, {}); 443b5c07418SJames Feist } 444b5c07418SJames Feist 445b5c07418SJames Feist void accountForSessionNoLongerExists(crow::Response& res) 446b5c07418SJames Feist { 447b5c07418SJames Feist res.result(boost::beast::http::status::forbidden); 448b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, accountForSessionNoLongerExists()); 449f4c4dcf4SKowalski, Kamil } 450f4c4dcf4SKowalski, Kamil 451f4c4dcf4SKowalski, Kamil /** 452f4c4dcf4SKowalski, Kamil * @internal 453f4c4dcf4SKowalski, Kamil * @brief Formats CreateFailedMissingReqProperties message into JSON 454f4c4dcf4SKowalski, Kamil * 455f4c4dcf4SKowalski, Kamil * See header file for more information 456f4c4dcf4SKowalski, Kamil * @endinternal 457f4c4dcf4SKowalski, Kamil */ 4581668ce6dSEd Tanous nlohmann::json createFailedMissingReqProperties(std::string_view arg1) 4591abe55efSEd Tanous { 460fffb8c1fSEd Tanous return getLog( 461fffb8c1fSEd Tanous redfish::registries::base::Index::createFailedMissingReqProperties, 4621668ce6dSEd Tanous std::to_array({arg1})); 463b5c07418SJames Feist } 464b5c07418SJames Feist 465b5c07418SJames Feist void createFailedMissingReqProperties(crow::Response& res, 4661668ce6dSEd Tanous std::string_view arg1) 467b5c07418SJames Feist { 468b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 469b5c07418SJames Feist addMessageToJson(res.jsonValue, createFailedMissingReqProperties(arg1), 470a08b46ccSJason M. Bills arg1); 471f12894f8SJason M. Bills } 472f12894f8SJason M. Bills 473f12894f8SJason M. Bills /** 474f12894f8SJason M. Bills * @internal 475*7ccfe684SEd Tanous * @brief Formats PropertyValueFormatError message into JSON 476f12894f8SJason M. Bills * 477f12894f8SJason M. Bills * See header file for more information 478f12894f8SJason M. Bills * @endinternal 479f12894f8SJason M. Bills */ 480f818b04dSEd Tanous nlohmann::json propertyValueFormatError(const nlohmann::json& arg1, 4811668ce6dSEd Tanous std::string_view arg2) 482f12894f8SJason M. Bills { 483bd79bce8SPatrick Williams std::string arg1Str = 484034e1259SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 485fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::propertyValueFormatError, 486f818b04dSEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 487b5c07418SJames Feist } 488b5c07418SJames Feist 489f818b04dSEd Tanous void propertyValueFormatError(crow::Response& res, const nlohmann::json& arg1, 4901668ce6dSEd Tanous std::string_view arg2) 491b5c07418SJames Feist { 492b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 493b5c07418SJames Feist addMessageToJson(res.jsonValue, propertyValueFormatError(arg1, arg2), arg2); 494f12894f8SJason M. Bills } 495f12894f8SJason M. Bills 496f12894f8SJason M. Bills /** 497f12894f8SJason M. Bills * @internal 498*7ccfe684SEd Tanous * @brief Formats PropertyValueNotInList message into JSON 499f12894f8SJason M. Bills * 500f12894f8SJason M. Bills * See header file for more information 501f12894f8SJason M. Bills * @endinternal 502f12894f8SJason M. Bills */ 503e2616cc5SEd Tanous nlohmann::json propertyValueNotInList(const nlohmann::json& arg1, 5041668ce6dSEd Tanous std::string_view arg2) 505f12894f8SJason M. Bills { 506bd79bce8SPatrick Williams std::string arg1Str = 507bd79bce8SPatrick Williams arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 508fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::propertyValueNotInList, 509e2616cc5SEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 510b5c07418SJames Feist } 511b5c07418SJames Feist 512e2616cc5SEd Tanous void propertyValueNotInList(crow::Response& res, const nlohmann::json& arg1, 5131668ce6dSEd Tanous std::string_view arg2) 514b5c07418SJames Feist { 515b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 516b5c07418SJames Feist addMessageToJson(res.jsonValue, propertyValueNotInList(arg1, arg2), arg2); 517f4c4dcf4SKowalski, Kamil } 518f4c4dcf4SKowalski, Kamil 519f4c4dcf4SKowalski, Kamil /** 520f4c4dcf4SKowalski, Kamil * @internal 521227a2b0aSJiaqing Zhao * @brief Formats PropertyValueOutOfRange message into JSON 522227a2b0aSJiaqing Zhao * 523227a2b0aSJiaqing Zhao * See header file for more information 524227a2b0aSJiaqing Zhao * @endinternal 525227a2b0aSJiaqing Zhao */ 52695b3ad73SEd Tanous nlohmann::json propertyValueOutOfRange(const nlohmann::json& arg1, 527227a2b0aSJiaqing Zhao std::string_view arg2) 528227a2b0aSJiaqing Zhao { 529bd79bce8SPatrick Williams std::string arg1Str = 530034e1259SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 531227a2b0aSJiaqing Zhao return getLog(redfish::registries::base::Index::propertyValueOutOfRange, 53295b3ad73SEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 533227a2b0aSJiaqing Zhao } 534227a2b0aSJiaqing Zhao 53595b3ad73SEd Tanous void propertyValueOutOfRange(crow::Response& res, const nlohmann::json& arg1, 536227a2b0aSJiaqing Zhao std::string_view arg2) 537227a2b0aSJiaqing Zhao { 538227a2b0aSJiaqing Zhao res.result(boost::beast::http::status::bad_request); 539227a2b0aSJiaqing Zhao addMessageToErrorJson(res.jsonValue, propertyValueOutOfRange(arg1, arg2)); 540227a2b0aSJiaqing Zhao } 541227a2b0aSJiaqing Zhao 542227a2b0aSJiaqing Zhao /** 543227a2b0aSJiaqing Zhao * @internal 544f4c4dcf4SKowalski, Kamil * @brief Formats ResourceAtUriInUnknownFormat message into JSON 545f4c4dcf4SKowalski, Kamil * 546f4c4dcf4SKowalski, Kamil * See header file for more information 547f4c4dcf4SKowalski, Kamil * @endinternal 548f4c4dcf4SKowalski, Kamil */ 5494a7fbefdSEd Tanous nlohmann::json 5504a7fbefdSEd Tanous resourceAtUriInUnknownFormat(const boost::urls::url_view_base& arg1) 5511abe55efSEd Tanous { 552b6cd31e1SEd Tanous return getLog( 553fffb8c1fSEd Tanous redfish::registries::base::Index::resourceAtUriInUnknownFormat, 554079360aeSEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 555b5c07418SJames Feist } 556b5c07418SJames Feist 557ace85d60SEd Tanous void resourceAtUriInUnknownFormat(crow::Response& res, 5584a7fbefdSEd Tanous const boost::urls::url_view_base& arg1) 559b5c07418SJames Feist { 560b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 561b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, resourceAtUriInUnknownFormat(arg1)); 562f4c4dcf4SKowalski, Kamil } 563f4c4dcf4SKowalski, Kamil 564f4c4dcf4SKowalski, Kamil /** 565f4c4dcf4SKowalski, Kamil * @internal 56681856681SAsmitha Karunanithi * @brief Formats ServiceDisabled message into JSON 56781856681SAsmitha Karunanithi * 56881856681SAsmitha Karunanithi * See header file for more information 56981856681SAsmitha Karunanithi * @endinternal 57081856681SAsmitha Karunanithi */ 5711668ce6dSEd Tanous nlohmann::json serviceDisabled(std::string_view arg1) 57281856681SAsmitha Karunanithi { 573fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::serviceDisabled, 5741668ce6dSEd Tanous std::to_array({arg1})); 57581856681SAsmitha Karunanithi } 57681856681SAsmitha Karunanithi 5771668ce6dSEd Tanous void serviceDisabled(crow::Response& res, std::string_view arg1) 57881856681SAsmitha Karunanithi { 57981856681SAsmitha Karunanithi res.result(boost::beast::http::status::service_unavailable); 58081856681SAsmitha Karunanithi addMessageToErrorJson(res.jsonValue, serviceDisabled(arg1)); 58181856681SAsmitha Karunanithi } 58281856681SAsmitha Karunanithi 58381856681SAsmitha Karunanithi /** 58481856681SAsmitha Karunanithi * @internal 585f4c4dcf4SKowalski, Kamil * @brief Formats ServiceInUnknownState message into JSON 586f4c4dcf4SKowalski, Kamil * 587f4c4dcf4SKowalski, Kamil * See header file for more information 588f4c4dcf4SKowalski, Kamil * @endinternal 589f4c4dcf4SKowalski, Kamil */ 590d9fcfcc1SEd Tanous nlohmann::json serviceInUnknownState() 5911abe55efSEd Tanous { 592fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::serviceInUnknownState, {}); 593b5c07418SJames Feist } 594b5c07418SJames Feist 595b5c07418SJames Feist void serviceInUnknownState(crow::Response& res) 596b5c07418SJames Feist { 597b5c07418SJames Feist res.result(boost::beast::http::status::service_unavailable); 598b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, serviceInUnknownState()); 599f4c4dcf4SKowalski, Kamil } 600f4c4dcf4SKowalski, Kamil 601f4c4dcf4SKowalski, Kamil /** 602f4c4dcf4SKowalski, Kamil * @internal 603f4c4dcf4SKowalski, Kamil * @brief Formats EventSubscriptionLimitExceeded message into JSON 604f4c4dcf4SKowalski, Kamil * 605f4c4dcf4SKowalski, Kamil * See header file for more information 606f4c4dcf4SKowalski, Kamil * @endinternal 607f4c4dcf4SKowalski, Kamil */ 608d9fcfcc1SEd Tanous nlohmann::json eventSubscriptionLimitExceeded() 6091abe55efSEd Tanous { 610fffb8c1fSEd Tanous return getLog( 611fffb8c1fSEd Tanous redfish::registries::base::Index::eventSubscriptionLimitExceeded, {}); 612b5c07418SJames Feist } 613b5c07418SJames Feist 614b5c07418SJames Feist void eventSubscriptionLimitExceeded(crow::Response& res) 615b5c07418SJames Feist { 616789fdab3SEd Tanous res.result(boost::beast::http::status::service_unavailable); 617b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, eventSubscriptionLimitExceeded()); 618f4c4dcf4SKowalski, Kamil } 619f4c4dcf4SKowalski, Kamil 620f4c4dcf4SKowalski, Kamil /** 621f4c4dcf4SKowalski, Kamil * @internal 622f4c4dcf4SKowalski, Kamil * @brief Formats ActionParameterMissing message into JSON 623f4c4dcf4SKowalski, Kamil * 624f4c4dcf4SKowalski, Kamil * See header file for more information 625f4c4dcf4SKowalski, Kamil * @endinternal 626f4c4dcf4SKowalski, Kamil */ 6271668ce6dSEd Tanous nlohmann::json actionParameterMissing(std::string_view arg1, 6281668ce6dSEd Tanous std::string_view arg2) 6291abe55efSEd Tanous { 630fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::actionParameterMissing, 6311668ce6dSEd Tanous std::to_array({arg1, arg2})); 632b5c07418SJames Feist } 633b5c07418SJames Feist 6341668ce6dSEd Tanous void actionParameterMissing(crow::Response& res, std::string_view arg1, 6351668ce6dSEd Tanous std::string_view arg2) 636b5c07418SJames Feist { 637b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 638b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, actionParameterMissing(arg1, arg2)); 639f4c4dcf4SKowalski, Kamil } 640f4c4dcf4SKowalski, Kamil 641f4c4dcf4SKowalski, Kamil /** 642f4c4dcf4SKowalski, Kamil * @internal 643f4c4dcf4SKowalski, Kamil * @brief Formats StringValueTooLong message into JSON 644f4c4dcf4SKowalski, Kamil * 645f4c4dcf4SKowalski, Kamil * See header file for more information 646f4c4dcf4SKowalski, Kamil * @endinternal 647f4c4dcf4SKowalski, Kamil */ 6481668ce6dSEd Tanous nlohmann::json stringValueTooLong(std::string_view arg1, int arg2) 6491abe55efSEd Tanous { 650*7ccfe684SEd Tanous std::string arg2Str = std::to_string(arg2); 651fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::stringValueTooLong, 652*7ccfe684SEd Tanous std::to_array<std::string_view>({arg1, arg2Str})); 653b5c07418SJames Feist } 654b5c07418SJames Feist 6551668ce6dSEd Tanous void stringValueTooLong(crow::Response& res, std::string_view arg1, int arg2) 656b5c07418SJames Feist { 657b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 658b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, stringValueTooLong(arg1, arg2)); 659f4c4dcf4SKowalski, Kamil } 660f4c4dcf4SKowalski, Kamil 661f4c4dcf4SKowalski, Kamil /** 662f4c4dcf4SKowalski, Kamil * @internal 663cc9139ecSJason M. Bills * @brief Formats SessionTerminated message into JSON 664cc9139ecSJason M. Bills * 665cc9139ecSJason M. Bills * See header file for more information 666cc9139ecSJason M. Bills * @endinternal 667cc9139ecSJason M. Bills */ 668d9fcfcc1SEd Tanous nlohmann::json sessionTerminated() 669cc9139ecSJason M. Bills { 670fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::sessionTerminated, {}); 671b5c07418SJames Feist } 672b5c07418SJames Feist 673b5c07418SJames Feist void sessionTerminated(crow::Response& res) 674b5c07418SJames Feist { 675b5c07418SJames Feist res.result(boost::beast::http::status::ok); 676b5c07418SJames Feist addMessageToJsonRoot(res.jsonValue, sessionTerminated()); 677cc9139ecSJason M. Bills } 678cc9139ecSJason M. Bills 679cc9139ecSJason M. Bills /** 680cc9139ecSJason M. Bills * @internal 681684bb4b8SJason M. Bills * @brief Formats SubscriptionTerminated message into JSON 682684bb4b8SJason M. Bills * 683684bb4b8SJason M. Bills * See header file for more information 684684bb4b8SJason M. Bills * @endinternal 685684bb4b8SJason M. Bills */ 686d9fcfcc1SEd Tanous nlohmann::json subscriptionTerminated() 687684bb4b8SJason M. Bills { 688fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::subscriptionTerminated, {}); 689684bb4b8SJason M. Bills } 690684bb4b8SJason M. Bills 691684bb4b8SJason M. Bills void subscriptionTerminated(crow::Response& res) 692684bb4b8SJason M. Bills { 693684bb4b8SJason M. Bills res.result(boost::beast::http::status::ok); 694684bb4b8SJason M. Bills addMessageToJsonRoot(res.jsonValue, subscriptionTerminated()); 695684bb4b8SJason M. Bills } 696684bb4b8SJason M. Bills 697684bb4b8SJason M. Bills /** 698684bb4b8SJason M. Bills * @internal 699cc9139ecSJason M. Bills * @brief Formats ResourceTypeIncompatible message into JSON 700cc9139ecSJason M. Bills * 701cc9139ecSJason M. Bills * See header file for more information 702cc9139ecSJason M. Bills * @endinternal 703cc9139ecSJason M. Bills */ 7041668ce6dSEd Tanous nlohmann::json resourceTypeIncompatible(std::string_view arg1, 7051668ce6dSEd Tanous std::string_view arg2) 706cc9139ecSJason M. Bills { 707fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::resourceTypeIncompatible, 7081668ce6dSEd Tanous std::to_array({arg1, arg2})); 709b5c07418SJames Feist } 710b5c07418SJames Feist 7111668ce6dSEd Tanous void resourceTypeIncompatible(crow::Response& res, std::string_view arg1, 7121668ce6dSEd Tanous std::string_view arg2) 713b5c07418SJames Feist { 714b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 715b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, resourceTypeIncompatible(arg1, arg2)); 716cc9139ecSJason M. Bills } 717cc9139ecSJason M. Bills 718cc9139ecSJason M. Bills /** 719cc9139ecSJason M. Bills * @internal 720684bb4b8SJason M. Bills * @brief Formats ResetRequired message into JSON 721684bb4b8SJason M. Bills * 722684bb4b8SJason M. Bills * See header file for more information 723684bb4b8SJason M. Bills * @endinternal 724684bb4b8SJason M. Bills */ 7254a7fbefdSEd Tanous nlohmann::json resetRequired(const boost::urls::url_view_base& arg1, 7264a7fbefdSEd Tanous std::string_view arg2) 727684bb4b8SJason M. Bills { 728fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::resetRequired, 729079360aeSEd Tanous std::to_array<std::string_view>({arg1.buffer(), arg2})); 730684bb4b8SJason M. Bills } 731684bb4b8SJason M. Bills 7324a7fbefdSEd Tanous void resetRequired(crow::Response& res, const boost::urls::url_view_base& arg1, 7331668ce6dSEd Tanous std::string_view arg2) 734684bb4b8SJason M. Bills { 735684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 736684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, resetRequired(arg1, arg2)); 737684bb4b8SJason M. Bills } 738684bb4b8SJason M. Bills 739684bb4b8SJason M. Bills /** 740684bb4b8SJason M. Bills * @internal 741684bb4b8SJason M. Bills * @brief Formats ChassisPowerStateOnRequired message into JSON 742684bb4b8SJason M. Bills * 743684bb4b8SJason M. Bills * See header file for more information 744684bb4b8SJason M. Bills * @endinternal 745684bb4b8SJason M. Bills */ 7461668ce6dSEd Tanous nlohmann::json chassisPowerStateOnRequired(std::string_view arg1) 747684bb4b8SJason M. Bills { 748*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::chassisPowerStateOnRequired, 7491668ce6dSEd Tanous std::to_array({arg1})); 750684bb4b8SJason M. Bills } 751684bb4b8SJason M. Bills 7521668ce6dSEd Tanous void chassisPowerStateOnRequired(crow::Response& res, std::string_view arg1) 753684bb4b8SJason M. Bills { 754684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 755684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, chassisPowerStateOnRequired(arg1)); 756684bb4b8SJason M. Bills } 757684bb4b8SJason M. Bills 758684bb4b8SJason M. Bills /** 759684bb4b8SJason M. Bills * @internal 760684bb4b8SJason M. Bills * @brief Formats ChassisPowerStateOffRequired message into JSON 761684bb4b8SJason M. Bills * 762684bb4b8SJason M. Bills * See header file for more information 763684bb4b8SJason M. Bills * @endinternal 764684bb4b8SJason M. Bills */ 7651668ce6dSEd Tanous nlohmann::json chassisPowerStateOffRequired(std::string_view arg1) 766684bb4b8SJason M. Bills { 767b6cd31e1SEd Tanous return getLog( 768fffb8c1fSEd Tanous redfish::registries::base::Index::chassisPowerStateOffRequired, 7691668ce6dSEd Tanous std::to_array({arg1})); 770684bb4b8SJason M. Bills } 771684bb4b8SJason M. Bills 7721668ce6dSEd Tanous void chassisPowerStateOffRequired(crow::Response& res, std::string_view arg1) 773684bb4b8SJason M. Bills { 774684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 775684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, chassisPowerStateOffRequired(arg1)); 776684bb4b8SJason M. Bills } 777684bb4b8SJason M. Bills 778684bb4b8SJason M. Bills /** 779684bb4b8SJason M. Bills * @internal 780684bb4b8SJason M. Bills * @brief Formats PropertyValueConflict message into JSON 781684bb4b8SJason M. Bills * 782684bb4b8SJason M. Bills * See header file for more information 783684bb4b8SJason M. Bills * @endinternal 784684bb4b8SJason M. Bills */ 7851668ce6dSEd Tanous nlohmann::json propertyValueConflict(std::string_view arg1, 7861668ce6dSEd Tanous std::string_view arg2) 787684bb4b8SJason M. Bills { 788fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::propertyValueConflict, 7891668ce6dSEd Tanous std::to_array({arg1, arg2})); 790684bb4b8SJason M. Bills } 791684bb4b8SJason M. Bills 7921668ce6dSEd Tanous void propertyValueConflict(crow::Response& res, std::string_view arg1, 7931668ce6dSEd Tanous std::string_view arg2) 794684bb4b8SJason M. Bills { 795684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 796684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, propertyValueConflict(arg1, arg2)); 797684bb4b8SJason M. Bills } 798684bb4b8SJason M. Bills 799684bb4b8SJason M. Bills /** 800684bb4b8SJason M. Bills * @internal 8012a6af81cSRamesh Iyyar * @brief Formats PropertyValueResourceConflict message into JSON 8022a6af81cSRamesh Iyyar * 8032a6af81cSRamesh Iyyar * See header file for more information 8042a6af81cSRamesh Iyyar * @endinternal 8052a6af81cSRamesh Iyyar */ 806bd79bce8SPatrick Williams nlohmann::json propertyValueResourceConflict( 807bd79bce8SPatrick Williams std::string_view arg1, const nlohmann::json& arg2, 8084a7fbefdSEd Tanous const boost::urls::url_view_base& arg3) 8092a6af81cSRamesh Iyyar { 810bd79bce8SPatrick Williams std::string arg2Str = 811034e1259SEd Tanous arg2.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 8122a6af81cSRamesh Iyyar return getLog( 8132a6af81cSRamesh Iyyar redfish::registries::base::Index::propertyValueResourceConflict, 81495b3ad73SEd Tanous std::to_array<std::string_view>({arg1, arg2Str, arg3.buffer()})); 8152a6af81cSRamesh Iyyar } 8162a6af81cSRamesh Iyyar 8172a6af81cSRamesh Iyyar void propertyValueResourceConflict(crow::Response& res, std::string_view arg1, 81895b3ad73SEd Tanous const nlohmann::json& arg2, 8194a7fbefdSEd Tanous const boost::urls::url_view_base& arg3) 8202a6af81cSRamesh Iyyar { 8212a6af81cSRamesh Iyyar res.result(boost::beast::http::status::conflict); 8222a6af81cSRamesh Iyyar addMessageToErrorJson(res.jsonValue, 8232a6af81cSRamesh Iyyar propertyValueResourceConflict(arg1, arg2, arg3)); 8242a6af81cSRamesh Iyyar } 8252a6af81cSRamesh Iyyar 8262a6af81cSRamesh Iyyar /** 8272a6af81cSRamesh Iyyar * @internal 82824861a28SRamesh Iyyar * @brief Formats PropertyValueExternalConflict message into JSON 82924861a28SRamesh Iyyar * 83024861a28SRamesh Iyyar * See header file for more information 83124861a28SRamesh Iyyar * @endinternal 83224861a28SRamesh Iyyar */ 83324861a28SRamesh Iyyar nlohmann::json propertyValueExternalConflict(std::string_view arg1, 83495b3ad73SEd Tanous const nlohmann::json& arg2) 83524861a28SRamesh Iyyar { 836bd79bce8SPatrick Williams std::string arg2Str = 837034e1259SEd Tanous arg2.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 83824861a28SRamesh Iyyar return getLog( 83924861a28SRamesh Iyyar redfish::registries::base::Index::propertyValueExternalConflict, 84095b3ad73SEd Tanous std::to_array<std::string_view>({arg1, arg2Str})); 84124861a28SRamesh Iyyar } 84224861a28SRamesh Iyyar 84324861a28SRamesh Iyyar void propertyValueExternalConflict(crow::Response& res, std::string_view arg1, 84495b3ad73SEd Tanous const nlohmann::json& arg2) 84524861a28SRamesh Iyyar { 84624861a28SRamesh Iyyar res.result(boost::beast::http::status::conflict); 84724861a28SRamesh Iyyar addMessageToErrorJson(res.jsonValue, 84824861a28SRamesh Iyyar propertyValueExternalConflict(arg1, arg2)); 84924861a28SRamesh Iyyar } 85024861a28SRamesh Iyyar 85124861a28SRamesh Iyyar /** 85224861a28SRamesh Iyyar * @internal 853684bb4b8SJason M. Bills * @brief Formats PropertyValueIncorrect message into JSON 854684bb4b8SJason M. Bills * 855684bb4b8SJason M. Bills * See header file for more information 856684bb4b8SJason M. Bills * @endinternal 857684bb4b8SJason M. Bills */ 858367b3dceSGinu George nlohmann::json propertyValueIncorrect(std::string_view arg1, 859367b3dceSGinu George const nlohmann::json& arg2) 860684bb4b8SJason M. Bills { 861bd79bce8SPatrick Williams std::string arg2Str = 862034e1259SEd Tanous arg2.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 863fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::propertyValueIncorrect, 864367b3dceSGinu George std::to_array<std::string_view>({arg1, arg2Str})); 865684bb4b8SJason M. Bills } 866684bb4b8SJason M. Bills 867367b3dceSGinu George void propertyValueIncorrect(crow::Response& res, std::string_view arg1, 868367b3dceSGinu George const nlohmann::json& arg2) 869684bb4b8SJason M. Bills { 870684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 871684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, propertyValueIncorrect(arg1, arg2)); 872684bb4b8SJason M. Bills } 873684bb4b8SJason M. Bills 874684bb4b8SJason M. Bills /** 875684bb4b8SJason M. Bills * @internal 876684bb4b8SJason M. Bills * @brief Formats ResourceCreationConflict message into JSON 877684bb4b8SJason M. Bills * 878684bb4b8SJason M. Bills * See header file for more information 879684bb4b8SJason M. Bills * @endinternal 880684bb4b8SJason M. Bills */ 8814a7fbefdSEd Tanous nlohmann::json resourceCreationConflict(const boost::urls::url_view_base& arg1) 882684bb4b8SJason M. Bills { 883fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::resourceCreationConflict, 884079360aeSEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 885684bb4b8SJason M. Bills } 886684bb4b8SJason M. Bills 8874a7fbefdSEd Tanous void resourceCreationConflict(crow::Response& res, 8884a7fbefdSEd Tanous const boost::urls::url_view_base& arg1) 889684bb4b8SJason M. Bills { 890684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 891684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, resourceCreationConflict(arg1)); 892684bb4b8SJason M. Bills } 893684bb4b8SJason M. Bills 894684bb4b8SJason M. Bills /** 895684bb4b8SJason M. Bills * @internal 896684bb4b8SJason M. Bills * @brief Formats MaximumErrorsExceeded message into JSON 897684bb4b8SJason M. Bills * 898684bb4b8SJason M. Bills * See header file for more information 899684bb4b8SJason M. Bills * @endinternal 900684bb4b8SJason M. Bills */ 901d9fcfcc1SEd Tanous nlohmann::json maximumErrorsExceeded() 902684bb4b8SJason M. Bills { 903fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::maximumErrorsExceeded, {}); 904684bb4b8SJason M. Bills } 905684bb4b8SJason M. Bills 906684bb4b8SJason M. Bills void maximumErrorsExceeded(crow::Response& res) 907684bb4b8SJason M. Bills { 908684bb4b8SJason M. Bills res.result(boost::beast::http::status::internal_server_error); 909684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, maximumErrorsExceeded()); 910684bb4b8SJason M. Bills } 911684bb4b8SJason M. Bills 912684bb4b8SJason M. Bills /** 913684bb4b8SJason M. Bills * @internal 914684bb4b8SJason M. Bills * @brief Formats PreconditionFailed message into JSON 915684bb4b8SJason M. Bills * 916684bb4b8SJason M. Bills * See header file for more information 917684bb4b8SJason M. Bills * @endinternal 918684bb4b8SJason M. Bills */ 919d9fcfcc1SEd Tanous nlohmann::json preconditionFailed() 920684bb4b8SJason M. Bills { 921fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::preconditionFailed, {}); 922684bb4b8SJason M. Bills } 923684bb4b8SJason M. Bills 924684bb4b8SJason M. Bills void preconditionFailed(crow::Response& res) 925684bb4b8SJason M. Bills { 9264df1bee0SEd Tanous res.result(boost::beast::http::status::precondition_failed); 927684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, preconditionFailed()); 928684bb4b8SJason M. Bills } 929684bb4b8SJason M. Bills 930684bb4b8SJason M. Bills /** 931684bb4b8SJason M. Bills * @internal 932684bb4b8SJason M. Bills * @brief Formats PreconditionRequired message into JSON 933684bb4b8SJason M. Bills * 934684bb4b8SJason M. Bills * See header file for more information 935684bb4b8SJason M. Bills * @endinternal 936684bb4b8SJason M. Bills */ 937d9fcfcc1SEd Tanous nlohmann::json preconditionRequired() 938684bb4b8SJason M. Bills { 939fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::preconditionRequired, {}); 940684bb4b8SJason M. Bills } 941684bb4b8SJason M. Bills 942684bb4b8SJason M. Bills void preconditionRequired(crow::Response& res) 943684bb4b8SJason M. Bills { 944684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 945684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, preconditionRequired()); 946684bb4b8SJason M. Bills } 947684bb4b8SJason M. Bills 948684bb4b8SJason M. Bills /** 949684bb4b8SJason M. Bills * @internal 950684bb4b8SJason M. Bills * @brief Formats OperationFailed message into JSON 951684bb4b8SJason M. Bills * 952684bb4b8SJason M. Bills * See header file for more information 953684bb4b8SJason M. Bills * @endinternal 954684bb4b8SJason M. Bills */ 955d9fcfcc1SEd Tanous nlohmann::json operationFailed() 956684bb4b8SJason M. Bills { 957fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::operationFailed, {}); 958684bb4b8SJason M. Bills } 959684bb4b8SJason M. Bills 960684bb4b8SJason M. Bills void operationFailed(crow::Response& res) 961684bb4b8SJason M. Bills { 9628868776eSEd Tanous res.result(boost::beast::http::status::bad_gateway); 963684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, operationFailed()); 964684bb4b8SJason M. Bills } 965684bb4b8SJason M. Bills 966684bb4b8SJason M. Bills /** 967684bb4b8SJason M. Bills * @internal 968684bb4b8SJason M. Bills * @brief Formats OperationTimeout message into JSON 969684bb4b8SJason M. Bills * 970684bb4b8SJason M. Bills * See header file for more information 971684bb4b8SJason M. Bills * @endinternal 972684bb4b8SJason M. Bills */ 973d9fcfcc1SEd Tanous nlohmann::json operationTimeout() 974684bb4b8SJason M. Bills { 975fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::operationTimeout, {}); 976684bb4b8SJason M. Bills } 977684bb4b8SJason M. Bills 978684bb4b8SJason M. Bills void operationTimeout(crow::Response& res) 979684bb4b8SJason M. Bills { 980684bb4b8SJason M. Bills res.result(boost::beast::http::status::internal_server_error); 981684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, operationTimeout()); 982684bb4b8SJason M. Bills } 983684bb4b8SJason M. Bills 984684bb4b8SJason M. Bills /** 985684bb4b8SJason M. Bills * @internal 986*7ccfe684SEd Tanous * @brief Formats PropertyValueTypeError message into JSON 987f12894f8SJason M. Bills * 988f12894f8SJason M. Bills * See header file for more information 989f12894f8SJason M. Bills * @endinternal 990f12894f8SJason M. Bills */ 9912e8c4bdaSEd Tanous nlohmann::json propertyValueTypeError(const nlohmann::json& arg1, 9921668ce6dSEd Tanous std::string_view arg2) 993f12894f8SJason M. Bills { 994bd79bce8SPatrick Williams std::string arg1Str = 995034e1259SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 996fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::propertyValueTypeError, 9972e8c4bdaSEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 998b5c07418SJames Feist } 999b5c07418SJames Feist 10002e8c4bdaSEd Tanous void propertyValueTypeError(crow::Response& res, const nlohmann::json& arg1, 10011668ce6dSEd Tanous std::string_view arg2) 1002b5c07418SJames Feist { 1003b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1004b5c07418SJames Feist addMessageToJson(res.jsonValue, propertyValueTypeError(arg1, arg2), arg2); 1005f4c4dcf4SKowalski, Kamil } 1006f4c4dcf4SKowalski, Kamil 1007f4c4dcf4SKowalski, Kamil /** 1008f4c4dcf4SKowalski, Kamil * @internal 1009*7ccfe684SEd Tanous * @brief Formats PropertyValueError message into JSON 1010b54eb49fSEd Tanous * 1011b54eb49fSEd Tanous * See header file for more information 1012b54eb49fSEd Tanous * @endinternal 1013b54eb49fSEd Tanous */ 1014b54eb49fSEd Tanous nlohmann::json propertyValueError(std::string_view arg1) 1015b54eb49fSEd Tanous { 1016b54eb49fSEd Tanous return getLog(redfish::registries::base::Index::propertyValueError, 1017*7ccfe684SEd Tanous std::to_array({arg1})); 1018b54eb49fSEd Tanous } 1019b54eb49fSEd Tanous 1020b54eb49fSEd Tanous void propertyValueError(crow::Response& res, std::string_view arg1) 1021b54eb49fSEd Tanous { 1022b54eb49fSEd Tanous res.result(boost::beast::http::status::bad_request); 1023b54eb49fSEd Tanous addMessageToJson(res.jsonValue, propertyValueError(arg1), arg1); 1024b54eb49fSEd Tanous } 1025b54eb49fSEd Tanous 1026b54eb49fSEd Tanous /** 1027b54eb49fSEd Tanous * @internal 1028*7ccfe684SEd Tanous * @brief Formats ResourceNotFound message into JSON 1029f4c4dcf4SKowalski, Kamil * 1030f4c4dcf4SKowalski, Kamil * See header file for more information 1031f4c4dcf4SKowalski, Kamil * @endinternal 1032f4c4dcf4SKowalski, Kamil */ 10331668ce6dSEd Tanous nlohmann::json resourceNotFound(std::string_view arg1, std::string_view arg2) 10341abe55efSEd Tanous { 1035fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::resourceNotFound, 10361668ce6dSEd Tanous std::to_array({arg1, arg2})); 1037b5c07418SJames Feist } 1038b5c07418SJames Feist 10391668ce6dSEd Tanous void resourceNotFound(crow::Response& res, std::string_view arg1, 10401668ce6dSEd Tanous std::string_view arg2) 1041b5c07418SJames Feist { 1042b5c07418SJames Feist res.result(boost::beast::http::status::not_found); 1043b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, resourceNotFound(arg1, arg2)); 1044f4c4dcf4SKowalski, Kamil } 1045f4c4dcf4SKowalski, Kamil 1046f4c4dcf4SKowalski, Kamil /** 1047f4c4dcf4SKowalski, Kamil * @internal 1048f4c4dcf4SKowalski, Kamil * @brief Formats CouldNotEstablishConnection message into JSON 1049f4c4dcf4SKowalski, Kamil * 1050f4c4dcf4SKowalski, Kamil * See header file for more information 1051f4c4dcf4SKowalski, Kamil * @endinternal 1052f4c4dcf4SKowalski, Kamil */ 10534a7fbefdSEd Tanous nlohmann::json 10544a7fbefdSEd Tanous couldNotEstablishConnection(const boost::urls::url_view_base& arg1) 10551abe55efSEd Tanous { 1056fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::couldNotEstablishConnection, 1057079360aeSEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1058b5c07418SJames Feist } 1059b5c07418SJames Feist 1060ace85d60SEd Tanous void couldNotEstablishConnection(crow::Response& res, 10614a7fbefdSEd Tanous const boost::urls::url_view_base& arg1) 1062b5c07418SJames Feist { 1063b5c07418SJames Feist res.result(boost::beast::http::status::not_found); 1064b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, couldNotEstablishConnection(arg1)); 1065f4c4dcf4SKowalski, Kamil } 1066f4c4dcf4SKowalski, Kamil 1067f4c4dcf4SKowalski, Kamil /** 1068f4c4dcf4SKowalski, Kamil * @internal 1069*7ccfe684SEd Tanous * @brief Formats PropertyNotWritable message into JSON 1070f12894f8SJason M. Bills * 1071f12894f8SJason M. Bills * See header file for more information 1072f12894f8SJason M. Bills * @endinternal 1073f12894f8SJason M. Bills */ 10741668ce6dSEd Tanous nlohmann::json propertyNotWritable(std::string_view arg1) 1075f12894f8SJason M. Bills { 1076fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::propertyNotWritable, 10771668ce6dSEd Tanous std::to_array({arg1})); 1078b5c07418SJames Feist } 1079b5c07418SJames Feist 10801668ce6dSEd Tanous void propertyNotWritable(crow::Response& res, std::string_view arg1) 1081b5c07418SJames Feist { 1082b5c07418SJames Feist res.result(boost::beast::http::status::forbidden); 1083b5c07418SJames Feist addMessageToJson(res.jsonValue, propertyNotWritable(arg1), arg1); 1084f4c4dcf4SKowalski, Kamil } 1085f4c4dcf4SKowalski, Kamil 1086f4c4dcf4SKowalski, Kamil /** 1087f4c4dcf4SKowalski, Kamil * @internal 1088f4c4dcf4SKowalski, Kamil * @brief Formats QueryParameterValueTypeError message into JSON 1089f4c4dcf4SKowalski, Kamil * 1090f4c4dcf4SKowalski, Kamil * See header file for more information 1091f4c4dcf4SKowalski, Kamil * @endinternal 1092f4c4dcf4SKowalski, Kamil */ 109395b3ad73SEd Tanous nlohmann::json queryParameterValueTypeError(const nlohmann::json& arg1, 10941668ce6dSEd Tanous std::string_view arg2) 10951abe55efSEd Tanous { 1096bd79bce8SPatrick Williams std::string arg1Str = 1097034e1259SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 1098b6cd31e1SEd Tanous return getLog( 1099fffb8c1fSEd Tanous redfish::registries::base::Index::queryParameterValueTypeError, 110095b3ad73SEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 1101b5c07418SJames Feist } 1102b5c07418SJames Feist 1103bd79bce8SPatrick Williams void queryParameterValueTypeError( 1104bd79bce8SPatrick Williams crow::Response& res, const nlohmann::json& arg1, std::string_view arg2) 1105b5c07418SJames Feist { 1106b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1107b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, 1108b5c07418SJames Feist queryParameterValueTypeError(arg1, arg2)); 1109f4c4dcf4SKowalski, Kamil } 1110f4c4dcf4SKowalski, Kamil 1111f4c4dcf4SKowalski, Kamil /** 1112f4c4dcf4SKowalski, Kamil * @internal 1113f4c4dcf4SKowalski, Kamil * @brief Formats ServiceShuttingDown message into JSON 1114f4c4dcf4SKowalski, Kamil * 1115f4c4dcf4SKowalski, Kamil * See header file for more information 1116f4c4dcf4SKowalski, Kamil * @endinternal 1117f4c4dcf4SKowalski, Kamil */ 1118d9fcfcc1SEd Tanous nlohmann::json serviceShuttingDown() 11191abe55efSEd Tanous { 1120fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::serviceShuttingDown, {}); 1121b5c07418SJames Feist } 1122b5c07418SJames Feist 1123b5c07418SJames Feist void serviceShuttingDown(crow::Response& res) 1124b5c07418SJames Feist { 1125b5c07418SJames Feist res.result(boost::beast::http::status::service_unavailable); 1126b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, serviceShuttingDown()); 1127f4c4dcf4SKowalski, Kamil } 1128f4c4dcf4SKowalski, Kamil 1129f4c4dcf4SKowalski, Kamil /** 1130f4c4dcf4SKowalski, Kamil * @internal 1131f4c4dcf4SKowalski, Kamil * @brief Formats ActionParameterDuplicate message into JSON 1132f4c4dcf4SKowalski, Kamil * 1133f4c4dcf4SKowalski, Kamil * See header file for more information 1134f4c4dcf4SKowalski, Kamil * @endinternal 1135f4c4dcf4SKowalski, Kamil */ 11361668ce6dSEd Tanous nlohmann::json actionParameterDuplicate(std::string_view arg1, 11371668ce6dSEd Tanous std::string_view arg2) 11381abe55efSEd Tanous { 1139fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::actionParameterDuplicate, 11401668ce6dSEd Tanous std::to_array({arg1, arg2})); 1141b5c07418SJames Feist } 1142b5c07418SJames Feist 11431668ce6dSEd Tanous void actionParameterDuplicate(crow::Response& res, std::string_view arg1, 11441668ce6dSEd Tanous std::string_view arg2) 1145b5c07418SJames Feist { 1146b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1147b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, actionParameterDuplicate(arg1, arg2)); 1148f4c4dcf4SKowalski, Kamil } 1149f4c4dcf4SKowalski, Kamil 1150f4c4dcf4SKowalski, Kamil /** 1151f4c4dcf4SKowalski, Kamil * @internal 1152f4c4dcf4SKowalski, Kamil * @brief Formats ActionParameterNotSupported message into JSON 1153f4c4dcf4SKowalski, Kamil * 1154f4c4dcf4SKowalski, Kamil * See header file for more information 1155f4c4dcf4SKowalski, Kamil * @endinternal 1156f4c4dcf4SKowalski, Kamil */ 11571668ce6dSEd Tanous nlohmann::json actionParameterNotSupported(std::string_view arg1, 11581668ce6dSEd Tanous std::string_view arg2) 11591abe55efSEd Tanous { 1160fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::actionParameterNotSupported, 11611668ce6dSEd Tanous std::to_array({arg1, arg2})); 1162b5c07418SJames Feist } 1163b5c07418SJames Feist 11641668ce6dSEd Tanous void actionParameterNotSupported(crow::Response& res, std::string_view arg1, 11651668ce6dSEd Tanous std::string_view arg2) 1166b5c07418SJames Feist { 1167b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1168b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, 1169b5c07418SJames Feist actionParameterNotSupported(arg1, arg2)); 1170f4c4dcf4SKowalski, Kamil } 1171f4c4dcf4SKowalski, Kamil 1172f4c4dcf4SKowalski, Kamil /** 1173f4c4dcf4SKowalski, Kamil * @internal 1174f4c4dcf4SKowalski, Kamil * @brief Formats SourceDoesNotSupportProtocol message into JSON 1175f4c4dcf4SKowalski, Kamil * 1176f4c4dcf4SKowalski, Kamil * See header file for more information 1177f4c4dcf4SKowalski, Kamil * @endinternal 1178f4c4dcf4SKowalski, Kamil */ 1179bd79bce8SPatrick Williams nlohmann::json sourceDoesNotSupportProtocol( 1180bd79bce8SPatrick Williams const boost::urls::url_view_base& arg1, std::string_view arg2) 11811abe55efSEd Tanous { 1182b6cd31e1SEd Tanous return getLog( 1183fffb8c1fSEd Tanous redfish::registries::base::Index::sourceDoesNotSupportProtocol, 1184079360aeSEd Tanous std::to_array<std::string_view>({arg1.buffer(), arg2})); 1185b5c07418SJames Feist } 1186b5c07418SJames Feist 1187ace85d60SEd Tanous void sourceDoesNotSupportProtocol(crow::Response& res, 11884a7fbefdSEd Tanous const boost::urls::url_view_base& arg1, 11891668ce6dSEd Tanous std::string_view arg2) 1190b5c07418SJames Feist { 1191b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1192b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, 1193b5c07418SJames Feist sourceDoesNotSupportProtocol(arg1, arg2)); 1194f4c4dcf4SKowalski, Kamil } 1195f4c4dcf4SKowalski, Kamil 1196f4c4dcf4SKowalski, Kamil /** 1197f4c4dcf4SKowalski, Kamil * @internal 1198b4ad4c05SShantappa Teekappanavar * @brief Formats StrictAccountTypes message into JSON 1199b4ad4c05SShantappa Teekappanavar * 1200b4ad4c05SShantappa Teekappanavar * See header file for more information 1201b4ad4c05SShantappa Teekappanavar * @endinternal 1202b4ad4c05SShantappa Teekappanavar */ 1203b4ad4c05SShantappa Teekappanavar nlohmann::json strictAccountTypes(std::string_view arg1) 1204b4ad4c05SShantappa Teekappanavar { 1205b4ad4c05SShantappa Teekappanavar return getLog(redfish::registries::base::Index::strictAccountTypes, 1206b4ad4c05SShantappa Teekappanavar std::to_array({arg1})); 1207b4ad4c05SShantappa Teekappanavar } 1208b4ad4c05SShantappa Teekappanavar 1209b4ad4c05SShantappa Teekappanavar void strictAccountTypes(crow::Response& res, std::string_view arg1) 1210b4ad4c05SShantappa Teekappanavar { 1211b4ad4c05SShantappa Teekappanavar res.result(boost::beast::http::status::bad_request); 1212b4ad4c05SShantappa Teekappanavar addMessageToErrorJson(res.jsonValue, strictAccountTypes(arg1)); 1213b4ad4c05SShantappa Teekappanavar } 1214b4ad4c05SShantappa Teekappanavar 1215b4ad4c05SShantappa Teekappanavar /** 1216b4ad4c05SShantappa Teekappanavar * @internal 1217f4c4dcf4SKowalski, Kamil * @brief Formats AccountRemoved message into JSON 1218f4c4dcf4SKowalski, Kamil * 1219f4c4dcf4SKowalski, Kamil * See header file for more information 1220f4c4dcf4SKowalski, Kamil * @endinternal 1221f4c4dcf4SKowalski, Kamil */ 1222d9fcfcc1SEd Tanous nlohmann::json accountRemoved() 12231abe55efSEd Tanous { 1224fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::accountRemoved, {}); 1225b5c07418SJames Feist } 1226b5c07418SJames Feist 1227b5c07418SJames Feist void accountRemoved(crow::Response& res) 1228b5c07418SJames Feist { 1229b5c07418SJames Feist res.result(boost::beast::http::status::ok); 1230b5c07418SJames Feist addMessageToJsonRoot(res.jsonValue, accountRemoved()); 1231f4c4dcf4SKowalski, Kamil } 1232f4c4dcf4SKowalski, Kamil 1233f4c4dcf4SKowalski, Kamil /** 1234f4c4dcf4SKowalski, Kamil * @internal 1235f4c4dcf4SKowalski, Kamil * @brief Formats AccessDenied message into JSON 1236f4c4dcf4SKowalski, Kamil * 1237f4c4dcf4SKowalski, Kamil * See header file for more information 1238f4c4dcf4SKowalski, Kamil * @endinternal 1239f4c4dcf4SKowalski, Kamil */ 12404a7fbefdSEd Tanous nlohmann::json accessDenied(const boost::urls::url_view_base& arg1) 12411abe55efSEd Tanous { 1242fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::accessDenied, 1243079360aeSEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1244b5c07418SJames Feist } 1245b5c07418SJames Feist 12464a7fbefdSEd Tanous void accessDenied(crow::Response& res, const boost::urls::url_view_base& arg1) 1247b5c07418SJames Feist { 1248b5c07418SJames Feist res.result(boost::beast::http::status::forbidden); 1249b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, accessDenied(arg1)); 1250f4c4dcf4SKowalski, Kamil } 1251f4c4dcf4SKowalski, Kamil 1252f4c4dcf4SKowalski, Kamil /** 1253f4c4dcf4SKowalski, Kamil * @internal 1254f4c4dcf4SKowalski, Kamil * @brief Formats QueryNotSupported message into JSON 1255f4c4dcf4SKowalski, Kamil * 1256f4c4dcf4SKowalski, Kamil * See header file for more information 1257f4c4dcf4SKowalski, Kamil * @endinternal 1258f4c4dcf4SKowalski, Kamil */ 1259d9fcfcc1SEd Tanous nlohmann::json queryNotSupported() 12601abe55efSEd Tanous { 1261fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::queryNotSupported, {}); 1262b5c07418SJames Feist } 1263b5c07418SJames Feist 1264b5c07418SJames Feist void queryNotSupported(crow::Response& res) 1265b5c07418SJames Feist { 1266b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1267b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, queryNotSupported()); 1268f4c4dcf4SKowalski, Kamil } 1269f4c4dcf4SKowalski, Kamil 1270f4c4dcf4SKowalski, Kamil /** 1271f4c4dcf4SKowalski, Kamil * @internal 1272f4c4dcf4SKowalski, Kamil * @brief Formats CreateLimitReachedForResource message into JSON 1273f4c4dcf4SKowalski, Kamil * 1274f4c4dcf4SKowalski, Kamil * See header file for more information 1275f4c4dcf4SKowalski, Kamil * @endinternal 1276f4c4dcf4SKowalski, Kamil */ 1277d9fcfcc1SEd Tanous nlohmann::json createLimitReachedForResource() 12781abe55efSEd Tanous { 1279b6cd31e1SEd Tanous return getLog( 1280fffb8c1fSEd Tanous redfish::registries::base::Index::createLimitReachedForResource, {}); 1281b5c07418SJames Feist } 1282b5c07418SJames Feist 1283b5c07418SJames Feist void createLimitReachedForResource(crow::Response& res) 1284b5c07418SJames Feist { 1285b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1286b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, createLimitReachedForResource()); 1287f4c4dcf4SKowalski, Kamil } 1288f4c4dcf4SKowalski, Kamil 1289f4c4dcf4SKowalski, Kamil /** 1290f4c4dcf4SKowalski, Kamil * @internal 1291f4c4dcf4SKowalski, Kamil * @brief Formats GeneralError message into JSON 1292f4c4dcf4SKowalski, Kamil * 1293f4c4dcf4SKowalski, Kamil * See header file for more information 1294f4c4dcf4SKowalski, Kamil * @endinternal 1295f4c4dcf4SKowalski, Kamil */ 1296d9fcfcc1SEd Tanous nlohmann::json generalError() 12971abe55efSEd Tanous { 1298fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::generalError, {}); 1299b5c07418SJames Feist } 1300b5c07418SJames Feist 1301b5c07418SJames Feist void generalError(crow::Response& res) 1302b5c07418SJames Feist { 1303b5c07418SJames Feist res.result(boost::beast::http::status::internal_server_error); 1304b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, generalError()); 1305f4c4dcf4SKowalski, Kamil } 1306f4c4dcf4SKowalski, Kamil 1307f4c4dcf4SKowalski, Kamil /** 1308f4c4dcf4SKowalski, Kamil * @internal 1309f4c4dcf4SKowalski, Kamil * @brief Formats Success message into JSON 1310f4c4dcf4SKowalski, Kamil * 1311f4c4dcf4SKowalski, Kamil * See header file for more information 1312f4c4dcf4SKowalski, Kamil * @endinternal 1313f4c4dcf4SKowalski, Kamil */ 1314d9fcfcc1SEd Tanous nlohmann::json success() 13151abe55efSEd Tanous { 1316fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::success, {}); 1317b5c07418SJames Feist } 1318b5c07418SJames Feist 1319b5c07418SJames Feist void success(crow::Response& res) 1320b5c07418SJames Feist { 1321b5c07418SJames Feist addMessageToJsonRoot(res.jsonValue, success()); 1322f12894f8SJason M. Bills } 1323f12894f8SJason M. Bills 1324f12894f8SJason M. Bills /** 1325f12894f8SJason M. Bills * @internal 1326f4c4dcf4SKowalski, Kamil * @brief Formats Created message into JSON 1327f4c4dcf4SKowalski, Kamil * 1328f4c4dcf4SKowalski, Kamil * See header file for more information 1329f4c4dcf4SKowalski, Kamil * @endinternal 1330f4c4dcf4SKowalski, Kamil */ 1331d9fcfcc1SEd Tanous nlohmann::json created() 13321abe55efSEd Tanous { 1333fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::created, {}); 1334b5c07418SJames Feist } 1335b5c07418SJames Feist 1336b5c07418SJames Feist void created(crow::Response& res) 1337b5c07418SJames Feist { 1338b5c07418SJames Feist res.result(boost::beast::http::status::created); 1339b5c07418SJames Feist addMessageToJsonRoot(res.jsonValue, created()); 1340f4c4dcf4SKowalski, Kamil } 1341f4c4dcf4SKowalski, Kamil 1342f4c4dcf4SKowalski, Kamil /** 1343f4c4dcf4SKowalski, Kamil * @internal 1344cc9139ecSJason M. Bills * @brief Formats NoOperation message into JSON 1345cc9139ecSJason M. Bills * 1346cc9139ecSJason M. Bills * See header file for more information 1347cc9139ecSJason M. Bills * @endinternal 1348cc9139ecSJason M. Bills */ 1349d9fcfcc1SEd Tanous nlohmann::json noOperation() 1350cc9139ecSJason M. Bills { 1351fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::noOperation, {}); 1352b5c07418SJames Feist } 1353b5c07418SJames Feist 1354b5c07418SJames Feist void noOperation(crow::Response& res) 1355b5c07418SJames Feist { 1356b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1357b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, noOperation()); 1358cc9139ecSJason M. Bills } 1359cc9139ecSJason M. Bills 1360cc9139ecSJason M. Bills /** 1361cc9139ecSJason M. Bills * @internal 1362*7ccfe684SEd Tanous * @brief Formats PropertyUnknown message into JSON 1363f12894f8SJason M. Bills * 1364f12894f8SJason M. Bills * See header file for more information 1365f12894f8SJason M. Bills * @endinternal 1366f12894f8SJason M. Bills */ 13671668ce6dSEd Tanous nlohmann::json propertyUnknown(std::string_view arg1) 1368b5c07418SJames Feist { 1369fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::propertyUnknown, 13701668ce6dSEd Tanous std::to_array({arg1})); 1371b5c07418SJames Feist } 1372b5c07418SJames Feist 13731668ce6dSEd Tanous void propertyUnknown(crow::Response& res, std::string_view arg1) 1374f12894f8SJason M. Bills { 1375f12894f8SJason M. Bills res.result(boost::beast::http::status::bad_request); 13767b1dd2f9SEd Tanous addMessageToErrorJson(res.jsonValue, propertyUnknown(arg1)); 1377f4c4dcf4SKowalski, Kamil } 1378f4c4dcf4SKowalski, Kamil 1379f4c4dcf4SKowalski, Kamil /** 1380f4c4dcf4SKowalski, Kamil * @internal 1381f4c4dcf4SKowalski, Kamil * @brief Formats NoValidSession message into JSON 1382f4c4dcf4SKowalski, Kamil * 1383f4c4dcf4SKowalski, Kamil * See header file for more information 1384f4c4dcf4SKowalski, Kamil * @endinternal 1385f4c4dcf4SKowalski, Kamil */ 1386d9fcfcc1SEd Tanous nlohmann::json noValidSession() 13871abe55efSEd Tanous { 1388fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::noValidSession, {}); 1389b5c07418SJames Feist } 1390b5c07418SJames Feist 1391b5c07418SJames Feist void noValidSession(crow::Response& res) 1392b5c07418SJames Feist { 1393b5c07418SJames Feist res.result(boost::beast::http::status::forbidden); 1394b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, noValidSession()); 1395f4c4dcf4SKowalski, Kamil } 1396f4c4dcf4SKowalski, Kamil 1397f4c4dcf4SKowalski, Kamil /** 1398f4c4dcf4SKowalski, Kamil * @internal 1399f4c4dcf4SKowalski, Kamil * @brief Formats InvalidObject message into JSON 1400f4c4dcf4SKowalski, Kamil * 1401f4c4dcf4SKowalski, Kamil * See header file for more information 1402f4c4dcf4SKowalski, Kamil * @endinternal 1403f4c4dcf4SKowalski, Kamil */ 14044a7fbefdSEd Tanous nlohmann::json invalidObject(const boost::urls::url_view_base& arg1) 14051abe55efSEd Tanous { 1406fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::invalidObject, 1407079360aeSEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1408b5c07418SJames Feist } 1409b5c07418SJames Feist 14104a7fbefdSEd Tanous void invalidObject(crow::Response& res, const boost::urls::url_view_base& arg1) 1411b5c07418SJames Feist { 1412b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1413b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, invalidObject(arg1)); 1414f4c4dcf4SKowalski, Kamil } 1415f4c4dcf4SKowalski, Kamil 1416f4c4dcf4SKowalski, Kamil /** 1417f4c4dcf4SKowalski, Kamil * @internal 1418f4c4dcf4SKowalski, Kamil * @brief Formats ResourceInStandby message into JSON 1419f4c4dcf4SKowalski, Kamil * 1420f4c4dcf4SKowalski, Kamil * See header file for more information 1421f4c4dcf4SKowalski, Kamil * @endinternal 1422f4c4dcf4SKowalski, Kamil */ 1423d9fcfcc1SEd Tanous nlohmann::json resourceInStandby() 14241abe55efSEd Tanous { 1425fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::resourceInStandby, {}); 1426b5c07418SJames Feist } 1427b5c07418SJames Feist 1428b5c07418SJames Feist void resourceInStandby(crow::Response& res) 1429b5c07418SJames Feist { 1430b5c07418SJames Feist res.result(boost::beast::http::status::service_unavailable); 1431b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, resourceInStandby()); 1432f4c4dcf4SKowalski, Kamil } 1433f4c4dcf4SKowalski, Kamil 1434f4c4dcf4SKowalski, Kamil /** 1435f4c4dcf4SKowalski, Kamil * @internal 1436f4c4dcf4SKowalski, Kamil * @brief Formats ActionParameterValueTypeError message into JSON 1437f4c4dcf4SKowalski, Kamil * 1438f4c4dcf4SKowalski, Kamil * See header file for more information 1439f4c4dcf4SKowalski, Kamil * @endinternal 1440f4c4dcf4SKowalski, Kamil */ 1441bd79bce8SPatrick Williams nlohmann::json actionParameterValueTypeError( 1442bd79bce8SPatrick Williams const nlohmann::json& arg1, std::string_view arg2, std::string_view arg3) 14431abe55efSEd Tanous { 1444bd79bce8SPatrick Williams std::string arg1Str = 1445034e1259SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 1446b6cd31e1SEd Tanous return getLog( 1447fffb8c1fSEd Tanous redfish::registries::base::Index::actionParameterValueTypeError, 144895b3ad73SEd Tanous std::to_array<std::string_view>({arg1Str, arg2, arg3})); 1449b5c07418SJames Feist } 1450b5c07418SJames Feist 145195b3ad73SEd Tanous void actionParameterValueTypeError(crow::Response& res, 145295b3ad73SEd Tanous const nlohmann::json& arg1, 14531668ce6dSEd Tanous std::string_view arg2, std::string_view arg3) 1454b5c07418SJames Feist { 1455b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1456b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, 1457b5c07418SJames Feist actionParameterValueTypeError(arg1, arg2, arg3)); 1458f4c4dcf4SKowalski, Kamil } 1459f4c4dcf4SKowalski, Kamil 1460f4c4dcf4SKowalski, Kamil /** 1461f4c4dcf4SKowalski, Kamil * @internal 1462*7ccfe684SEd Tanous * @brief Formats ActionParameterValueError message into JSON 14631827b4f1SAsmitha Karunanithi * 14641827b4f1SAsmitha Karunanithi * See header file for more information 14651827b4f1SAsmitha Karunanithi * @endinternal 14661827b4f1SAsmitha Karunanithi */ 14671827b4f1SAsmitha Karunanithi nlohmann::json actionParameterValueError(const nlohmann::json& arg1, 14681827b4f1SAsmitha Karunanithi std::string_view arg2) 14691827b4f1SAsmitha Karunanithi { 1470bd79bce8SPatrick Williams std::string arg1Str = 1471034e1259SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 14721827b4f1SAsmitha Karunanithi return getLog(redfish::registries::base::Index::actionParameterValueError, 14731827b4f1SAsmitha Karunanithi std::to_array<std::string_view>({arg1Str, arg2})); 14741827b4f1SAsmitha Karunanithi } 14751827b4f1SAsmitha Karunanithi 14761827b4f1SAsmitha Karunanithi void actionParameterValueError(crow::Response& res, const nlohmann::json& arg1, 14771827b4f1SAsmitha Karunanithi std::string_view arg2) 14781827b4f1SAsmitha Karunanithi { 14791827b4f1SAsmitha Karunanithi res.result(boost::beast::http::status::bad_request); 14801827b4f1SAsmitha Karunanithi addMessageToErrorJson(res.jsonValue, actionParameterValueError(arg1, arg2)); 14811827b4f1SAsmitha Karunanithi } 14821827b4f1SAsmitha Karunanithi 14831827b4f1SAsmitha Karunanithi /** 14841827b4f1SAsmitha Karunanithi * @internal 1485f4c4dcf4SKowalski, Kamil * @brief Formats SessionLimitExceeded message into JSON 1486f4c4dcf4SKowalski, Kamil * 1487f4c4dcf4SKowalski, Kamil * See header file for more information 1488f4c4dcf4SKowalski, Kamil * @endinternal 1489f4c4dcf4SKowalski, Kamil */ 1490d9fcfcc1SEd Tanous nlohmann::json sessionLimitExceeded() 14911abe55efSEd Tanous { 1492fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::sessionLimitExceeded, {}); 1493b5c07418SJames Feist } 1494b5c07418SJames Feist 1495b5c07418SJames Feist void sessionLimitExceeded(crow::Response& res) 1496b5c07418SJames Feist { 1497b5c07418SJames Feist res.result(boost::beast::http::status::service_unavailable); 1498b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, sessionLimitExceeded()); 1499f4c4dcf4SKowalski, Kamil } 1500f4c4dcf4SKowalski, Kamil 1501f4c4dcf4SKowalski, Kamil /** 1502f4c4dcf4SKowalski, Kamil * @internal 1503f4c4dcf4SKowalski, Kamil * @brief Formats ActionNotSupported message into JSON 1504f4c4dcf4SKowalski, Kamil * 1505f4c4dcf4SKowalski, Kamil * See header file for more information 1506f4c4dcf4SKowalski, Kamil * @endinternal 1507f4c4dcf4SKowalski, Kamil */ 15081668ce6dSEd Tanous nlohmann::json actionNotSupported(std::string_view arg1) 15091abe55efSEd Tanous { 1510fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::actionNotSupported, 15111668ce6dSEd Tanous std::to_array({arg1})); 1512b5c07418SJames Feist } 1513b5c07418SJames Feist 15141668ce6dSEd Tanous void actionNotSupported(crow::Response& res, std::string_view arg1) 1515b5c07418SJames Feist { 1516b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1517b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, actionNotSupported(arg1)); 1518f4c4dcf4SKowalski, Kamil } 1519f4c4dcf4SKowalski, Kamil 1520f4c4dcf4SKowalski, Kamil /** 1521f4c4dcf4SKowalski, Kamil * @internal 1522f4c4dcf4SKowalski, Kamil * @brief Formats InvalidIndex message into JSON 1523f4c4dcf4SKowalski, Kamil * 1524f4c4dcf4SKowalski, Kamil * See header file for more information 1525f4c4dcf4SKowalski, Kamil * @endinternal 1526f4c4dcf4SKowalski, Kamil */ 15275187e09bSJosh Lehan nlohmann::json invalidIndex(int64_t arg1) 15281abe55efSEd Tanous { 1529b6cd31e1SEd Tanous std::string arg1Str = std::to_string(arg1); 1530fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::invalidIndex, 15311668ce6dSEd Tanous std::to_array<std::string_view>({arg1Str})); 1532b5c07418SJames Feist } 1533b5c07418SJames Feist 15345187e09bSJosh Lehan void invalidIndex(crow::Response& res, int64_t arg1) 1535b5c07418SJames Feist { 1536b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1537b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, invalidIndex(arg1)); 1538f4c4dcf4SKowalski, Kamil } 1539f4c4dcf4SKowalski, Kamil 1540f4c4dcf4SKowalski, Kamil /** 1541f4c4dcf4SKowalski, Kamil * @internal 1542f4c4dcf4SKowalski, Kamil * @brief Formats EmptyJSON message into JSON 1543f4c4dcf4SKowalski, Kamil * 1544f4c4dcf4SKowalski, Kamil * See header file for more information 1545f4c4dcf4SKowalski, Kamil * @endinternal 1546f4c4dcf4SKowalski, Kamil */ 1547d9fcfcc1SEd Tanous nlohmann::json emptyJSON() 15481abe55efSEd Tanous { 1549fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::emptyJSON, {}); 1550b5c07418SJames Feist } 1551b5c07418SJames Feist 1552b5c07418SJames Feist void emptyJSON(crow::Response& res) 1553b5c07418SJames Feist { 1554b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1555b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, emptyJSON()); 1556f4c4dcf4SKowalski, Kamil } 1557f4c4dcf4SKowalski, Kamil 1558f4c4dcf4SKowalski, Kamil /** 1559f4c4dcf4SKowalski, Kamil * @internal 1560f4c4dcf4SKowalski, Kamil * @brief Formats QueryNotSupportedOnResource message into JSON 1561f4c4dcf4SKowalski, Kamil * 1562f4c4dcf4SKowalski, Kamil * See header file for more information 1563f4c4dcf4SKowalski, Kamil * @endinternal 1564f4c4dcf4SKowalski, Kamil */ 1565d9fcfcc1SEd Tanous nlohmann::json queryNotSupportedOnResource() 15661abe55efSEd Tanous { 1567fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::queryNotSupportedOnResource, 1568b6cd31e1SEd Tanous {}); 1569b5c07418SJames Feist } 1570b5c07418SJames Feist 1571b5c07418SJames Feist void queryNotSupportedOnResource(crow::Response& res) 1572b5c07418SJames Feist { 15736a409c12SEd Tanous res.result(boost::beast::http::status::bad_request); 1574b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, queryNotSupportedOnResource()); 1575f4c4dcf4SKowalski, Kamil } 1576f4c4dcf4SKowalski, Kamil 1577f4c4dcf4SKowalski, Kamil /** 1578f4c4dcf4SKowalski, Kamil * @internal 1579684bb4b8SJason M. Bills * @brief Formats QueryNotSupportedOnOperation message into JSON 1580684bb4b8SJason M. Bills * 1581684bb4b8SJason M. Bills * See header file for more information 1582684bb4b8SJason M. Bills * @endinternal 1583684bb4b8SJason M. Bills */ 1584d9fcfcc1SEd Tanous nlohmann::json queryNotSupportedOnOperation() 1585684bb4b8SJason M. Bills { 1586b6cd31e1SEd Tanous return getLog( 1587fffb8c1fSEd Tanous redfish::registries::base::Index::queryNotSupportedOnOperation, {}); 1588684bb4b8SJason M. Bills } 1589684bb4b8SJason M. Bills 1590684bb4b8SJason M. Bills void queryNotSupportedOnOperation(crow::Response& res) 1591684bb4b8SJason M. Bills { 15926a409c12SEd Tanous res.result(boost::beast::http::status::bad_request); 1593684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, queryNotSupportedOnOperation()); 1594684bb4b8SJason M. Bills } 1595684bb4b8SJason M. Bills 1596684bb4b8SJason M. Bills /** 1597684bb4b8SJason M. Bills * @internal 1598684bb4b8SJason M. Bills * @brief Formats QueryCombinationInvalid message into JSON 1599684bb4b8SJason M. Bills * 1600684bb4b8SJason M. Bills * See header file for more information 1601684bb4b8SJason M. Bills * @endinternal 1602684bb4b8SJason M. Bills */ 1603d9fcfcc1SEd Tanous nlohmann::json queryCombinationInvalid() 1604684bb4b8SJason M. Bills { 1605fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::queryCombinationInvalid, 1606fffb8c1fSEd Tanous {}); 1607684bb4b8SJason M. Bills } 1608684bb4b8SJason M. Bills 1609684bb4b8SJason M. Bills void queryCombinationInvalid(crow::Response& res) 1610684bb4b8SJason M. Bills { 1611684bb4b8SJason M. Bills res.result(boost::beast::http::status::bad_request); 1612684bb4b8SJason M. Bills addMessageToErrorJson(res.jsonValue, queryCombinationInvalid()); 1613684bb4b8SJason M. Bills } 1614684bb4b8SJason M. Bills 1615684bb4b8SJason M. Bills /** 1616684bb4b8SJason M. Bills * @internal 1617fa345c78SEd Tanous * @brief Formats EventBufferExceeded message into JSON 1618fa345c78SEd Tanous * 1619fa345c78SEd Tanous * See header file for more information 1620fa345c78SEd Tanous * @endinternal 1621fa345c78SEd Tanous */ 1622fa345c78SEd Tanous nlohmann::json eventBufferExceeded() 1623fa345c78SEd Tanous { 1624fa345c78SEd Tanous return getLog(redfish::registries::base::Index::eventBufferExceeded, {}); 1625fa345c78SEd Tanous } 1626fa345c78SEd Tanous 1627fa345c78SEd Tanous void eventBufferExceeded(crow::Response& res) 1628fa345c78SEd Tanous { 1629fa345c78SEd Tanous res.result(boost::beast::http::status::bad_request); 1630fa345c78SEd Tanous addMessageToErrorJson(res.jsonValue, eventBufferExceeded()); 1631fa345c78SEd Tanous } 1632fa345c78SEd Tanous 1633fa345c78SEd Tanous /** 1634fa345c78SEd Tanous * @internal 1635f4c4dcf4SKowalski, Kamil * @brief Formats InsufficientPrivilege message into JSON 1636f4c4dcf4SKowalski, Kamil * 1637f4c4dcf4SKowalski, Kamil * See header file for more information 1638f4c4dcf4SKowalski, Kamil * @endinternal 1639f4c4dcf4SKowalski, Kamil */ 1640d9fcfcc1SEd Tanous nlohmann::json insufficientPrivilege() 16411abe55efSEd Tanous { 1642fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::insufficientPrivilege, {}); 1643b5c07418SJames Feist } 1644b5c07418SJames Feist 1645b5c07418SJames Feist void insufficientPrivilege(crow::Response& res) 1646b5c07418SJames Feist { 1647b5c07418SJames Feist res.result(boost::beast::http::status::forbidden); 1648b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, insufficientPrivilege()); 1649f4c4dcf4SKowalski, Kamil } 1650f4c4dcf4SKowalski, Kamil 1651f4c4dcf4SKowalski, Kamil /** 1652f4c4dcf4SKowalski, Kamil * @internal 1653f4c4dcf4SKowalski, Kamil * @brief Formats PropertyValueModified message into JSON 1654f4c4dcf4SKowalski, Kamil * 1655f4c4dcf4SKowalski, Kamil * See header file for more information 1656f4c4dcf4SKowalski, Kamil * @endinternal 1657f4c4dcf4SKowalski, Kamil */ 16581668ce6dSEd Tanous nlohmann::json propertyValueModified(std::string_view arg1, 165995b3ad73SEd Tanous const nlohmann::json& arg2) 1660b5c07418SJames Feist { 1661bd79bce8SPatrick Williams std::string arg2Str = 1662034e1259SEd Tanous arg2.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 1663fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::propertyValueModified, 166495b3ad73SEd Tanous std::to_array<std::string_view>({arg1, arg2Str})); 1665b5c07418SJames Feist } 1666b5c07418SJames Feist 16671668ce6dSEd Tanous void propertyValueModified(crow::Response& res, std::string_view arg1, 166895b3ad73SEd Tanous const nlohmann::json& arg2) 16691abe55efSEd Tanous { 1670f12894f8SJason M. Bills res.result(boost::beast::http::status::ok); 1671b5c07418SJames Feist addMessageToJson(res.jsonValue, propertyValueModified(arg1, arg2), arg1); 1672f4c4dcf4SKowalski, Kamil } 1673f4c4dcf4SKowalski, Kamil 1674f4c4dcf4SKowalski, Kamil /** 1675f4c4dcf4SKowalski, Kamil * @internal 1676f4c4dcf4SKowalski, Kamil * @brief Formats AccountNotModified message into JSON 1677f4c4dcf4SKowalski, Kamil * 1678f4c4dcf4SKowalski, Kamil * See header file for more information 1679f4c4dcf4SKowalski, Kamil * @endinternal 1680f4c4dcf4SKowalski, Kamil */ 1681d9fcfcc1SEd Tanous nlohmann::json accountNotModified() 16821abe55efSEd Tanous { 1683fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::accountNotModified, {}); 1684b5c07418SJames Feist } 1685b5c07418SJames Feist 1686b5c07418SJames Feist void accountNotModified(crow::Response& res) 1687b5c07418SJames Feist { 1688b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1689b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, accountNotModified()); 1690f4c4dcf4SKowalski, Kamil } 1691f4c4dcf4SKowalski, Kamil 1692f4c4dcf4SKowalski, Kamil /** 1693f4c4dcf4SKowalski, Kamil * @internal 1694f4c4dcf4SKowalski, Kamil * @brief Formats QueryParameterValueFormatError message into JSON 1695f4c4dcf4SKowalski, Kamil * 1696f4c4dcf4SKowalski, Kamil * See header file for more information 1697f4c4dcf4SKowalski, Kamil * @endinternal 1698f4c4dcf4SKowalski, Kamil */ 169995b3ad73SEd Tanous nlohmann::json queryParameterValueFormatError(const nlohmann::json& arg1, 17001668ce6dSEd Tanous std::string_view arg2) 17011abe55efSEd Tanous { 1702bd79bce8SPatrick Williams std::string arg1Str = 1703034e1259SEd Tanous arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace); 1704fffb8c1fSEd Tanous return getLog( 1705fffb8c1fSEd Tanous redfish::registries::base::Index::queryParameterValueFormatError, 170695b3ad73SEd Tanous std::to_array<std::string_view>({arg1Str, arg2})); 1707b5c07418SJames Feist } 1708b5c07418SJames Feist 1709bd79bce8SPatrick Williams void queryParameterValueFormatError( 1710bd79bce8SPatrick Williams crow::Response& res, const nlohmann::json& arg1, std::string_view arg2) 1711b5c07418SJames Feist { 1712b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1713b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, 1714b5c07418SJames Feist queryParameterValueFormatError(arg1, arg2)); 1715f4c4dcf4SKowalski, Kamil } 1716f4c4dcf4SKowalski, Kamil 1717f4c4dcf4SKowalski, Kamil /** 1718f4c4dcf4SKowalski, Kamil * @internal 1719*7ccfe684SEd Tanous * @brief Formats PropertyMissing message into JSON 1720f12894f8SJason M. Bills * 1721f12894f8SJason M. Bills * See header file for more information 1722f12894f8SJason M. Bills * @endinternal 1723f12894f8SJason M. Bills */ 17241668ce6dSEd Tanous nlohmann::json propertyMissing(std::string_view arg1) 1725f12894f8SJason M. Bills { 1726fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::propertyMissing, 17271668ce6dSEd Tanous std::to_array({arg1})); 1728b5c07418SJames Feist } 1729b5c07418SJames Feist 17301668ce6dSEd Tanous void propertyMissing(crow::Response& res, std::string_view arg1) 1731b5c07418SJames Feist { 1732b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1733b5c07418SJames Feist addMessageToJson(res.jsonValue, propertyMissing(arg1), arg1); 1734f4c4dcf4SKowalski, Kamil } 1735f4c4dcf4SKowalski, Kamil 1736f4c4dcf4SKowalski, Kamil /** 1737f4c4dcf4SKowalski, Kamil * @internal 1738f4c4dcf4SKowalski, Kamil * @brief Formats ResourceExhaustion message into JSON 1739f4c4dcf4SKowalski, Kamil * 1740f4c4dcf4SKowalski, Kamil * See header file for more information 1741f4c4dcf4SKowalski, Kamil * @endinternal 1742f4c4dcf4SKowalski, Kamil */ 17431668ce6dSEd Tanous nlohmann::json resourceExhaustion(std::string_view arg1) 17441abe55efSEd Tanous { 1745fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::resourceExhaustion, 17461668ce6dSEd Tanous std::to_array({arg1})); 1747b5c07418SJames Feist } 1748b5c07418SJames Feist 17491668ce6dSEd Tanous void resourceExhaustion(crow::Response& res, std::string_view arg1) 1750b5c07418SJames Feist { 1751b5c07418SJames Feist res.result(boost::beast::http::status::service_unavailable); 1752b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, resourceExhaustion(arg1)); 1753f4c4dcf4SKowalski, Kamil } 1754f4c4dcf4SKowalski, Kamil 1755f4c4dcf4SKowalski, Kamil /** 1756f4c4dcf4SKowalski, Kamil * @internal 1757f4c4dcf4SKowalski, Kamil * @brief Formats AccountModified message into JSON 1758f4c4dcf4SKowalski, Kamil * 1759f4c4dcf4SKowalski, Kamil * See header file for more information 1760f4c4dcf4SKowalski, Kamil * @endinternal 1761f4c4dcf4SKowalski, Kamil */ 1762d9fcfcc1SEd Tanous nlohmann::json accountModified() 17631abe55efSEd Tanous { 1764fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::accountModified, {}); 1765b5c07418SJames Feist } 1766b5c07418SJames Feist 1767b5c07418SJames Feist void accountModified(crow::Response& res) 1768b5c07418SJames Feist { 1769b5c07418SJames Feist res.result(boost::beast::http::status::ok); 1770b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, accountModified()); 1771f4c4dcf4SKowalski, Kamil } 1772f4c4dcf4SKowalski, Kamil 1773f4c4dcf4SKowalski, Kamil /** 1774f4c4dcf4SKowalski, Kamil * @internal 1775f4c4dcf4SKowalski, Kamil * @brief Formats QueryParameterOutOfRange message into JSON 1776f4c4dcf4SKowalski, Kamil * 1777f4c4dcf4SKowalski, Kamil * See header file for more information 1778f4c4dcf4SKowalski, Kamil * @endinternal 1779f4c4dcf4SKowalski, Kamil */ 1780bd79bce8SPatrick Williams nlohmann::json queryParameterOutOfRange( 1781bd79bce8SPatrick Williams std::string_view arg1, std::string_view arg2, std::string_view arg3) 17821abe55efSEd Tanous { 1783fffb8c1fSEd Tanous return getLog(redfish::registries::base::Index::queryParameterOutOfRange, 17841668ce6dSEd Tanous std::to_array({arg1, arg2, arg3})); 1785b5c07418SJames Feist } 1786b5c07418SJames Feist 17871668ce6dSEd Tanous void queryParameterOutOfRange(crow::Response& res, std::string_view arg1, 17881668ce6dSEd Tanous std::string_view arg2, std::string_view arg3) 1789b5c07418SJames Feist { 1790b5c07418SJames Feist res.result(boost::beast::http::status::bad_request); 1791b5c07418SJames Feist addMessageToErrorJson(res.jsonValue, 1792b5c07418SJames Feist queryParameterOutOfRange(arg1, arg2, arg3)); 1793f4c4dcf4SKowalski, Kamil } 1794f4c4dcf4SKowalski, Kamil 17953bf4e632SJoseph Reynolds /** 17963bf4e632SJoseph Reynolds * @internal 17973bf4e632SJoseph Reynolds * @brief Formats PasswordChangeRequired message into JSON 17983bf4e632SJoseph Reynolds * 17993bf4e632SJoseph Reynolds * See header file for more information 18003bf4e632SJoseph Reynolds * @endinternal 18013bf4e632SJoseph Reynolds */ 1802*7ccfe684SEd Tanous nlohmann::json passwordChangeRequired(const boost::urls::url_view_base& arg1) 1803*7ccfe684SEd Tanous { 1804*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::passwordChangeRequired, 1805*7ccfe684SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1806*7ccfe684SEd Tanous } 1807*7ccfe684SEd Tanous 18084a7fbefdSEd Tanous void passwordChangeRequired(crow::Response& res, 18094a7fbefdSEd Tanous const boost::urls::url_view_base& arg1) 18103bf4e632SJoseph Reynolds { 1811*7ccfe684SEd Tanous addMessageToJsonRoot(res.jsonValue, passwordChangeRequired(arg1)); 18123bf4e632SJoseph Reynolds } 18133bf4e632SJoseph Reynolds 18144cde5d90SJames Feist /** 18154cde5d90SJames Feist * @internal 1816ae688313SNan Zhou * @brief Formats InsufficientStorage message into JSON 1817ae688313SNan Zhou * 1818ae688313SNan Zhou * See header file for more information 1819ae688313SNan Zhou * @endinternal 1820ae688313SNan Zhou */ 1821ae688313SNan Zhou nlohmann::json insufficientStorage() 1822ae688313SNan Zhou { 1823ae688313SNan Zhou return getLog(redfish::registries::base::Index::insufficientStorage, {}); 1824ae688313SNan Zhou } 1825ae688313SNan Zhou 1826ae688313SNan Zhou void insufficientStorage(crow::Response& res) 1827ae688313SNan Zhou { 1828ae688313SNan Zhou res.result(boost::beast::http::status::insufficient_storage); 1829ae688313SNan Zhou addMessageToErrorJson(res.jsonValue, insufficientStorage()); 1830ae688313SNan Zhou } 1831ae688313SNan Zhou 1832ae688313SNan Zhou /** 1833ae688313SNan Zhou * @internal 183444c70412SEd Tanous * @brief Formats OperationNotAllowed message into JSON 183544c70412SEd Tanous * 183644c70412SEd Tanous * See header file for more information 183744c70412SEd Tanous * @endinternal 183844c70412SEd Tanous */ 183944c70412SEd Tanous nlohmann::json operationNotAllowed() 184044c70412SEd Tanous { 184144c70412SEd Tanous return getLog(redfish::registries::base::Index::operationNotAllowed, {}); 184244c70412SEd Tanous } 184344c70412SEd Tanous 184444c70412SEd Tanous void operationNotAllowed(crow::Response& res) 184544c70412SEd Tanous { 184644c70412SEd Tanous res.result(boost::beast::http::status::method_not_allowed); 184744c70412SEd Tanous addMessageToErrorJson(res.jsonValue, operationNotAllowed()); 184844c70412SEd Tanous } 184944c70412SEd Tanous 1850600af5f1SAppaRao Puli /** 1851600af5f1SAppaRao Puli * @internal 1852600af5f1SAppaRao Puli * @brief Formats ArraySizeTooLong message into JSON 1853600af5f1SAppaRao Puli * 1854600af5f1SAppaRao Puli * See header file for more information 1855600af5f1SAppaRao Puli * @endinternal 1856600af5f1SAppaRao Puli */ 1857aaebeaafSEd Tanous nlohmann::json arraySizeTooLong(std::string_view arg1, uint64_t arg2) 1858600af5f1SAppaRao Puli { 1859aaebeaafSEd Tanous std::string arg2Str = std::to_string(arg2); 1860600af5f1SAppaRao Puli return getLog(redfish::registries::base::Index::arraySizeTooLong, 1861aaebeaafSEd Tanous std::to_array<std::string_view>({arg1, arg2Str})); 1862600af5f1SAppaRao Puli } 1863600af5f1SAppaRao Puli 1864aaebeaafSEd Tanous void arraySizeTooLong(crow::Response& res, std::string_view arg1, uint64_t arg2) 1865600af5f1SAppaRao Puli { 186699bf0262SDivya Jyoti res.result(boost::beast::http::status::bad_request); 1867aaebeaafSEd Tanous addMessageToErrorJson(res.jsonValue, arraySizeTooLong(arg1, arg2)); 1868600af5f1SAppaRao Puli } 1869600af5f1SAppaRao Puli 18707585b760SJishnu CM /** 18717585b760SJishnu CM * @internal 18727585b760SJishnu CM * @brief Formats GenerateSecretKeyRequired message into JSON 18737585b760SJishnu CM * 18747585b760SJishnu CM * See header file for more information 18757585b760SJishnu CM * @endinternal 18767585b760SJishnu CM */ 1877*7ccfe684SEd Tanous nlohmann::json generateSecretKeyRequired(const boost::urls::url_view_base& arg1) 1878*7ccfe684SEd Tanous { 1879*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::generateSecretKeyRequired, 1880*7ccfe684SEd Tanous std::to_array<std::string_view>({arg1.buffer()})); 1881*7ccfe684SEd Tanous } 1882*7ccfe684SEd Tanous 18837585b760SJishnu CM void generateSecretKeyRequired(crow::Response& res, 18847585b760SJishnu CM const boost::urls::url_view_base& arg1) 18857585b760SJishnu CM { 1886*7ccfe684SEd Tanous res.result(boost::beast::http::status::forbidden); 1887*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, generateSecretKeyRequired(arg1)); 1888*7ccfe684SEd Tanous } 1889*7ccfe684SEd Tanous 1890*7ccfe684SEd Tanous /** 1891*7ccfe684SEd Tanous * @internal 1892*7ccfe684SEd Tanous * @brief Formats PropertyNotUpdated message into JSON 1893*7ccfe684SEd Tanous * 1894*7ccfe684SEd Tanous * See header file for more information 1895*7ccfe684SEd Tanous * @endinternal 1896*7ccfe684SEd Tanous */ 1897*7ccfe684SEd Tanous nlohmann::json propertyNotUpdated(std::string_view arg1) 1898*7ccfe684SEd Tanous { 1899*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::propertyNotUpdated, 1900*7ccfe684SEd Tanous std::to_array({arg1})); 1901*7ccfe684SEd Tanous } 1902*7ccfe684SEd Tanous 1903*7ccfe684SEd Tanous void propertyNotUpdated(crow::Response& res, std::string_view arg1) 1904*7ccfe684SEd Tanous { 1905*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 1906*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, propertyNotUpdated(arg1)); 1907*7ccfe684SEd Tanous } 1908*7ccfe684SEd Tanous 1909*7ccfe684SEd Tanous /** 1910*7ccfe684SEd Tanous * @internal 1911*7ccfe684SEd Tanous * @brief Formats InvalidJSON message into JSON 1912*7ccfe684SEd Tanous * 1913*7ccfe684SEd Tanous * See header file for more information 1914*7ccfe684SEd Tanous * @endinternal 1915*7ccfe684SEd Tanous */ 1916*7ccfe684SEd Tanous nlohmann::json invalidJSON(std::string_view arg1) 1917*7ccfe684SEd Tanous { 1918*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::invalidJSON, 1919*7ccfe684SEd Tanous std::to_array({arg1})); 1920*7ccfe684SEd Tanous } 1921*7ccfe684SEd Tanous 1922*7ccfe684SEd Tanous void invalidJSON(crow::Response& res, std::string_view arg1) 1923*7ccfe684SEd Tanous { 1924*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 1925*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, invalidJSON(arg1)); 1926*7ccfe684SEd Tanous } 1927*7ccfe684SEd Tanous 1928*7ccfe684SEd Tanous /** 1929*7ccfe684SEd Tanous * @internal 1930*7ccfe684SEd Tanous * @brief Formats ActionParameterValueOutOfRange message into JSON 1931*7ccfe684SEd Tanous * 1932*7ccfe684SEd Tanous * See header file for more information 1933*7ccfe684SEd Tanous * @endinternal 1934*7ccfe684SEd Tanous */ 1935*7ccfe684SEd Tanous nlohmann::json actionParameterValueOutOfRange( 1936*7ccfe684SEd Tanous std::string_view arg1, std::string_view arg2, std::string_view arg3) 1937*7ccfe684SEd Tanous { 1938*7ccfe684SEd Tanous return getLog( 1939*7ccfe684SEd Tanous redfish::registries::base::Index::actionParameterValueOutOfRange, 1940*7ccfe684SEd Tanous std::to_array({arg1, arg2, arg3})); 1941*7ccfe684SEd Tanous } 1942*7ccfe684SEd Tanous 1943*7ccfe684SEd Tanous void actionParameterValueOutOfRange(crow::Response& res, std::string_view arg1, 1944*7ccfe684SEd Tanous std::string_view arg2, 1945*7ccfe684SEd Tanous std::string_view arg3) 1946*7ccfe684SEd Tanous { 1947*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 1948*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, 1949*7ccfe684SEd Tanous actionParameterValueOutOfRange(arg1, arg2, arg3)); 1950*7ccfe684SEd Tanous } 1951*7ccfe684SEd Tanous 1952*7ccfe684SEd Tanous /** 1953*7ccfe684SEd Tanous * @internal 1954*7ccfe684SEd Tanous * @brief Formats ArraySizeTooShort message into JSON 1955*7ccfe684SEd Tanous * 1956*7ccfe684SEd Tanous * See header file for more information 1957*7ccfe684SEd Tanous * @endinternal 1958*7ccfe684SEd Tanous */ 1959*7ccfe684SEd Tanous nlohmann::json arraySizeTooShort(std::string_view arg1, std::string_view arg2) 1960*7ccfe684SEd Tanous { 1961*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::arraySizeTooShort, 1962*7ccfe684SEd Tanous std::to_array({arg1, arg2})); 1963*7ccfe684SEd Tanous } 1964*7ccfe684SEd Tanous 1965*7ccfe684SEd Tanous void arraySizeTooShort(crow::Response& res, std::string_view arg1, 1966*7ccfe684SEd Tanous std::string_view arg2) 1967*7ccfe684SEd Tanous { 1968*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 1969*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, arraySizeTooShort(arg1, arg2)); 1970*7ccfe684SEd Tanous } 1971*7ccfe684SEd Tanous 1972*7ccfe684SEd Tanous /** 1973*7ccfe684SEd Tanous * @internal 1974*7ccfe684SEd Tanous * @brief Formats QueryParameterValueError message into JSON 1975*7ccfe684SEd Tanous * 1976*7ccfe684SEd Tanous * See header file for more information 1977*7ccfe684SEd Tanous * @endinternal 1978*7ccfe684SEd Tanous */ 1979*7ccfe684SEd Tanous nlohmann::json queryParameterValueError(std::string_view arg1) 1980*7ccfe684SEd Tanous { 1981*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::queryParameterValueError, 1982*7ccfe684SEd Tanous std::to_array({arg1})); 1983*7ccfe684SEd Tanous } 1984*7ccfe684SEd Tanous 1985*7ccfe684SEd Tanous void queryParameterValueError(crow::Response& res, std::string_view arg1) 1986*7ccfe684SEd Tanous { 1987*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 1988*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, queryParameterValueError(arg1)); 1989*7ccfe684SEd Tanous } 1990*7ccfe684SEd Tanous 1991*7ccfe684SEd Tanous /** 1992*7ccfe684SEd Tanous * @internal 1993*7ccfe684SEd Tanous * @brief Formats QueryParameterUnsupported message into JSON 1994*7ccfe684SEd Tanous * 1995*7ccfe684SEd Tanous * See header file for more information 1996*7ccfe684SEd Tanous * @endinternal 1997*7ccfe684SEd Tanous */ 1998*7ccfe684SEd Tanous nlohmann::json queryParameterUnsupported(std::string_view arg1) 1999*7ccfe684SEd Tanous { 2000*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::queryParameterUnsupported, 2001*7ccfe684SEd Tanous std::to_array({arg1})); 2002*7ccfe684SEd Tanous } 2003*7ccfe684SEd Tanous 2004*7ccfe684SEd Tanous void queryParameterUnsupported(crow::Response& res, std::string_view arg1) 2005*7ccfe684SEd Tanous { 2006*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2007*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, queryParameterUnsupported(arg1)); 2008*7ccfe684SEd Tanous } 2009*7ccfe684SEd Tanous 2010*7ccfe684SEd Tanous /** 2011*7ccfe684SEd Tanous * @internal 2012*7ccfe684SEd Tanous * @brief Formats PayloadTooLarge message into JSON 2013*7ccfe684SEd Tanous * 2014*7ccfe684SEd Tanous * See header file for more information 2015*7ccfe684SEd Tanous * @endinternal 2016*7ccfe684SEd Tanous */ 2017*7ccfe684SEd Tanous nlohmann::json payloadTooLarge() 2018*7ccfe684SEd Tanous { 2019*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::payloadTooLarge, {}); 2020*7ccfe684SEd Tanous } 2021*7ccfe684SEd Tanous 2022*7ccfe684SEd Tanous void payloadTooLarge(crow::Response& res) 2023*7ccfe684SEd Tanous { 2024*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2025*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, payloadTooLarge()); 2026*7ccfe684SEd Tanous } 2027*7ccfe684SEd Tanous 2028*7ccfe684SEd Tanous /** 2029*7ccfe684SEd Tanous * @internal 2030*7ccfe684SEd Tanous * @brief Formats MissingOrMalformedPart message into JSON 2031*7ccfe684SEd Tanous * 2032*7ccfe684SEd Tanous * See header file for more information 2033*7ccfe684SEd Tanous * @endinternal 2034*7ccfe684SEd Tanous */ 2035*7ccfe684SEd Tanous nlohmann::json missingOrMalformedPart() 2036*7ccfe684SEd Tanous { 2037*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::missingOrMalformedPart, {}); 2038*7ccfe684SEd Tanous } 2039*7ccfe684SEd Tanous 2040*7ccfe684SEd Tanous void missingOrMalformedPart(crow::Response& res) 2041*7ccfe684SEd Tanous { 2042*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2043*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, missingOrMalformedPart()); 2044*7ccfe684SEd Tanous } 2045*7ccfe684SEd Tanous 2046*7ccfe684SEd Tanous /** 2047*7ccfe684SEd Tanous * @internal 2048*7ccfe684SEd Tanous * @brief Formats InvalidURI message into JSON 2049*7ccfe684SEd Tanous * 2050*7ccfe684SEd Tanous * See header file for more information 2051*7ccfe684SEd Tanous * @endinternal 2052*7ccfe684SEd Tanous */ 2053*7ccfe684SEd Tanous nlohmann::json invalidURI(std::string_view arg1) 2054*7ccfe684SEd Tanous { 2055*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::invalidURI, 2056*7ccfe684SEd Tanous std::to_array({arg1})); 2057*7ccfe684SEd Tanous } 2058*7ccfe684SEd Tanous 2059*7ccfe684SEd Tanous void invalidURI(crow::Response& res, std::string_view arg1) 2060*7ccfe684SEd Tanous { 2061*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2062*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, invalidURI(arg1)); 2063*7ccfe684SEd Tanous } 2064*7ccfe684SEd Tanous 2065*7ccfe684SEd Tanous /** 2066*7ccfe684SEd Tanous * @internal 2067*7ccfe684SEd Tanous * @brief Formats StringValueTooShort message into JSON 2068*7ccfe684SEd Tanous * 2069*7ccfe684SEd Tanous * See header file for more information 2070*7ccfe684SEd Tanous * @endinternal 2071*7ccfe684SEd Tanous */ 2072*7ccfe684SEd Tanous nlohmann::json stringValueTooShort(std::string_view arg1, std::string_view arg2) 2073*7ccfe684SEd Tanous { 2074*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::stringValueTooShort, 2075*7ccfe684SEd Tanous std::to_array({arg1, arg2})); 2076*7ccfe684SEd Tanous } 2077*7ccfe684SEd Tanous 2078*7ccfe684SEd Tanous void stringValueTooShort(crow::Response& res, std::string_view arg1, 2079*7ccfe684SEd Tanous std::string_view arg2) 2080*7ccfe684SEd Tanous { 2081*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2082*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, stringValueTooShort(arg1, arg2)); 2083*7ccfe684SEd Tanous } 2084*7ccfe684SEd Tanous 2085*7ccfe684SEd Tanous /** 2086*7ccfe684SEd Tanous * @internal 2087*7ccfe684SEd Tanous * @brief Formats ResetRecommended message into JSON 2088*7ccfe684SEd Tanous * 2089*7ccfe684SEd Tanous * See header file for more information 2090*7ccfe684SEd Tanous * @endinternal 2091*7ccfe684SEd Tanous */ 2092*7ccfe684SEd Tanous nlohmann::json resetRecommended(std::string_view arg1, std::string_view arg2) 2093*7ccfe684SEd Tanous { 2094*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::resetRecommended, 2095*7ccfe684SEd Tanous std::to_array({arg1, arg2})); 2096*7ccfe684SEd Tanous } 2097*7ccfe684SEd Tanous 2098*7ccfe684SEd Tanous void resetRecommended(crow::Response& res, std::string_view arg1, 2099*7ccfe684SEd Tanous std::string_view arg2) 2100*7ccfe684SEd Tanous { 2101*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2102*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, resetRecommended(arg1, arg2)); 2103*7ccfe684SEd Tanous } 2104*7ccfe684SEd Tanous 2105*7ccfe684SEd Tanous /** 2106*7ccfe684SEd Tanous * @internal 2107*7ccfe684SEd Tanous * @brief Formats ActionParameterValueConflict message into JSON 2108*7ccfe684SEd Tanous * 2109*7ccfe684SEd Tanous * See header file for more information 2110*7ccfe684SEd Tanous * @endinternal 2111*7ccfe684SEd Tanous */ 2112*7ccfe684SEd Tanous nlohmann::json 2113*7ccfe684SEd Tanous actionParameterValueConflict(std::string_view arg1, std::string_view arg2) 2114*7ccfe684SEd Tanous { 2115*7ccfe684SEd Tanous return getLog( 2116*7ccfe684SEd Tanous redfish::registries::base::Index::actionParameterValueConflict, 2117*7ccfe684SEd Tanous std::to_array({arg1, arg2})); 2118*7ccfe684SEd Tanous } 2119*7ccfe684SEd Tanous 2120*7ccfe684SEd Tanous void actionParameterValueConflict(crow::Response& res, std::string_view arg1, 2121*7ccfe684SEd Tanous std::string_view arg2) 2122*7ccfe684SEd Tanous { 2123*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2124*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, 2125*7ccfe684SEd Tanous actionParameterValueConflict(arg1, arg2)); 2126*7ccfe684SEd Tanous } 2127*7ccfe684SEd Tanous 2128*7ccfe684SEd Tanous /** 2129*7ccfe684SEd Tanous * @internal 2130*7ccfe684SEd Tanous * @brief Formats HeaderMissing message into JSON 2131*7ccfe684SEd Tanous * 2132*7ccfe684SEd Tanous * See header file for more information 2133*7ccfe684SEd Tanous * @endinternal 2134*7ccfe684SEd Tanous */ 2135*7ccfe684SEd Tanous nlohmann::json headerMissing(std::string_view arg1) 2136*7ccfe684SEd Tanous { 2137*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::headerMissing, 2138*7ccfe684SEd Tanous std::to_array({arg1})); 2139*7ccfe684SEd Tanous } 2140*7ccfe684SEd Tanous 2141*7ccfe684SEd Tanous void headerMissing(crow::Response& res, std::string_view arg1) 2142*7ccfe684SEd Tanous { 2143*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2144*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, headerMissing(arg1)); 2145*7ccfe684SEd Tanous } 2146*7ccfe684SEd Tanous 2147*7ccfe684SEd Tanous /** 2148*7ccfe684SEd Tanous * @internal 2149*7ccfe684SEd Tanous * @brief Formats HeaderInvalid message into JSON 2150*7ccfe684SEd Tanous * 2151*7ccfe684SEd Tanous * See header file for more information 2152*7ccfe684SEd Tanous * @endinternal 2153*7ccfe684SEd Tanous */ 2154*7ccfe684SEd Tanous nlohmann::json headerInvalid(std::string_view arg1) 2155*7ccfe684SEd Tanous { 2156*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::headerInvalid, 2157*7ccfe684SEd Tanous std::to_array({arg1})); 2158*7ccfe684SEd Tanous } 2159*7ccfe684SEd Tanous 2160*7ccfe684SEd Tanous void headerInvalid(crow::Response& res, std::string_view arg1) 2161*7ccfe684SEd Tanous { 2162*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2163*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, headerInvalid(arg1)); 2164*7ccfe684SEd Tanous } 2165*7ccfe684SEd Tanous 2166*7ccfe684SEd Tanous /** 2167*7ccfe684SEd Tanous * @internal 2168*7ccfe684SEd Tanous * @brief Formats UndeterminedFault message into JSON 2169*7ccfe684SEd Tanous * 2170*7ccfe684SEd Tanous * See header file for more information 2171*7ccfe684SEd Tanous * @endinternal 2172*7ccfe684SEd Tanous */ 2173*7ccfe684SEd Tanous nlohmann::json undeterminedFault(std::string_view arg1) 2174*7ccfe684SEd Tanous { 2175*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::undeterminedFault, 2176*7ccfe684SEd Tanous std::to_array({arg1})); 2177*7ccfe684SEd Tanous } 2178*7ccfe684SEd Tanous 2179*7ccfe684SEd Tanous void undeterminedFault(crow::Response& res, std::string_view arg1) 2180*7ccfe684SEd Tanous { 2181*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2182*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, undeterminedFault(arg1)); 2183*7ccfe684SEd Tanous } 2184*7ccfe684SEd Tanous 2185*7ccfe684SEd Tanous /** 2186*7ccfe684SEd Tanous * @internal 2187*7ccfe684SEd Tanous * @brief Formats ConditionInRelatedResource message into JSON 2188*7ccfe684SEd Tanous * 2189*7ccfe684SEd Tanous * See header file for more information 2190*7ccfe684SEd Tanous * @endinternal 2191*7ccfe684SEd Tanous */ 2192*7ccfe684SEd Tanous nlohmann::json conditionInRelatedResource() 2193*7ccfe684SEd Tanous { 2194*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::conditionInRelatedResource, 2195*7ccfe684SEd Tanous {}); 2196*7ccfe684SEd Tanous } 2197*7ccfe684SEd Tanous 2198*7ccfe684SEd Tanous void conditionInRelatedResource(crow::Response& res) 2199*7ccfe684SEd Tanous { 2200*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2201*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, conditionInRelatedResource()); 2202*7ccfe684SEd Tanous } 2203*7ccfe684SEd Tanous 2204*7ccfe684SEd Tanous /** 2205*7ccfe684SEd Tanous * @internal 2206*7ccfe684SEd Tanous * @brief Formats RestrictedRole message into JSON 2207*7ccfe684SEd Tanous * 2208*7ccfe684SEd Tanous * See header file for more information 2209*7ccfe684SEd Tanous * @endinternal 2210*7ccfe684SEd Tanous */ 2211*7ccfe684SEd Tanous nlohmann::json restrictedRole(std::string_view arg1) 2212*7ccfe684SEd Tanous { 2213*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::restrictedRole, 2214*7ccfe684SEd Tanous std::to_array({arg1})); 2215*7ccfe684SEd Tanous } 2216*7ccfe684SEd Tanous 2217*7ccfe684SEd Tanous void restrictedRole(crow::Response& res, std::string_view arg1) 2218*7ccfe684SEd Tanous { 2219*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2220*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, restrictedRole(arg1)); 2221*7ccfe684SEd Tanous } 2222*7ccfe684SEd Tanous 2223*7ccfe684SEd Tanous /** 2224*7ccfe684SEd Tanous * @internal 2225*7ccfe684SEd Tanous * @brief Formats RestrictedPrivilege message into JSON 2226*7ccfe684SEd Tanous * 2227*7ccfe684SEd Tanous * See header file for more information 2228*7ccfe684SEd Tanous * @endinternal 2229*7ccfe684SEd Tanous */ 2230*7ccfe684SEd Tanous nlohmann::json restrictedPrivilege(std::string_view arg1) 2231*7ccfe684SEd Tanous { 2232*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::restrictedPrivilege, 2233*7ccfe684SEd Tanous std::to_array({arg1})); 2234*7ccfe684SEd Tanous } 2235*7ccfe684SEd Tanous 2236*7ccfe684SEd Tanous void restrictedPrivilege(crow::Response& res, std::string_view arg1) 2237*7ccfe684SEd Tanous { 2238*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2239*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, restrictedPrivilege(arg1)); 2240*7ccfe684SEd Tanous } 2241*7ccfe684SEd Tanous 2242*7ccfe684SEd Tanous /** 2243*7ccfe684SEd Tanous * @internal 2244*7ccfe684SEd Tanous * @brief Formats PropertyDeprecated message into JSON 2245*7ccfe684SEd Tanous * 2246*7ccfe684SEd Tanous * See header file for more information 2247*7ccfe684SEd Tanous * @endinternal 2248*7ccfe684SEd Tanous */ 2249*7ccfe684SEd Tanous nlohmann::json propertyDeprecated(std::string_view arg1) 2250*7ccfe684SEd Tanous { 2251*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::propertyDeprecated, 2252*7ccfe684SEd Tanous std::to_array({arg1})); 2253*7ccfe684SEd Tanous } 2254*7ccfe684SEd Tanous 2255*7ccfe684SEd Tanous void propertyDeprecated(crow::Response& res, std::string_view arg1) 2256*7ccfe684SEd Tanous { 2257*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2258*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, propertyDeprecated(arg1)); 2259*7ccfe684SEd Tanous } 2260*7ccfe684SEd Tanous 2261*7ccfe684SEd Tanous /** 2262*7ccfe684SEd Tanous * @internal 2263*7ccfe684SEd Tanous * @brief Formats ResourceDeprecated message into JSON 2264*7ccfe684SEd Tanous * 2265*7ccfe684SEd Tanous * See header file for more information 2266*7ccfe684SEd Tanous * @endinternal 2267*7ccfe684SEd Tanous */ 2268*7ccfe684SEd Tanous nlohmann::json resourceDeprecated(std::string_view arg1) 2269*7ccfe684SEd Tanous { 2270*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::resourceDeprecated, 2271*7ccfe684SEd Tanous std::to_array({arg1})); 2272*7ccfe684SEd Tanous } 2273*7ccfe684SEd Tanous 2274*7ccfe684SEd Tanous void resourceDeprecated(crow::Response& res, std::string_view arg1) 2275*7ccfe684SEd Tanous { 2276*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2277*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, resourceDeprecated(arg1)); 2278*7ccfe684SEd Tanous } 2279*7ccfe684SEd Tanous 2280*7ccfe684SEd Tanous /** 2281*7ccfe684SEd Tanous * @internal 2282*7ccfe684SEd Tanous * @brief Formats PropertyValueDeprecated message into JSON 2283*7ccfe684SEd Tanous * 2284*7ccfe684SEd Tanous * See header file for more information 2285*7ccfe684SEd Tanous * @endinternal 2286*7ccfe684SEd Tanous */ 2287*7ccfe684SEd Tanous nlohmann::json propertyValueDeprecated(std::string_view arg1, 2288*7ccfe684SEd Tanous std::string_view arg2) 2289*7ccfe684SEd Tanous { 2290*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::propertyValueDeprecated, 2291*7ccfe684SEd Tanous std::to_array({arg1, arg2})); 2292*7ccfe684SEd Tanous } 2293*7ccfe684SEd Tanous 2294*7ccfe684SEd Tanous void propertyValueDeprecated(crow::Response& res, std::string_view arg1, 2295*7ccfe684SEd Tanous std::string_view arg2) 2296*7ccfe684SEd Tanous { 2297*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2298*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, propertyValueDeprecated(arg1, arg2)); 2299*7ccfe684SEd Tanous } 2300*7ccfe684SEd Tanous 2301*7ccfe684SEd Tanous /** 2302*7ccfe684SEd Tanous * @internal 2303*7ccfe684SEd Tanous * @brief Formats ActionDeprecated message into JSON 2304*7ccfe684SEd Tanous * 2305*7ccfe684SEd Tanous * See header file for more information 2306*7ccfe684SEd Tanous * @endinternal 2307*7ccfe684SEd Tanous */ 2308*7ccfe684SEd Tanous nlohmann::json actionDeprecated(std::string_view arg1) 2309*7ccfe684SEd Tanous { 2310*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::actionDeprecated, 2311*7ccfe684SEd Tanous std::to_array({arg1})); 2312*7ccfe684SEd Tanous } 2313*7ccfe684SEd Tanous 2314*7ccfe684SEd Tanous void actionDeprecated(crow::Response& res, std::string_view arg1) 2315*7ccfe684SEd Tanous { 2316*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2317*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, actionDeprecated(arg1)); 2318*7ccfe684SEd Tanous } 2319*7ccfe684SEd Tanous 2320*7ccfe684SEd Tanous /** 2321*7ccfe684SEd Tanous * @internal 2322*7ccfe684SEd Tanous * @brief Formats NetworkNameResolutionNotConfigured message into JSON 2323*7ccfe684SEd Tanous * 2324*7ccfe684SEd Tanous * See header file for more information 2325*7ccfe684SEd Tanous * @endinternal 2326*7ccfe684SEd Tanous */ 2327*7ccfe684SEd Tanous nlohmann::json networkNameResolutionNotConfigured() 2328*7ccfe684SEd Tanous { 2329*7ccfe684SEd Tanous return getLog( 2330*7ccfe684SEd Tanous redfish::registries::base::Index::networkNameResolutionNotConfigured, 2331*7ccfe684SEd Tanous {}); 2332*7ccfe684SEd Tanous } 2333*7ccfe684SEd Tanous 2334*7ccfe684SEd Tanous void networkNameResolutionNotConfigured(crow::Response& res) 2335*7ccfe684SEd Tanous { 2336*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2337*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, networkNameResolutionNotConfigured()); 2338*7ccfe684SEd Tanous } 2339*7ccfe684SEd Tanous 2340*7ccfe684SEd Tanous /** 2341*7ccfe684SEd Tanous * @internal 2342*7ccfe684SEd Tanous * @brief Formats NetworkNameResolutionNotSupported message into JSON 2343*7ccfe684SEd Tanous * 2344*7ccfe684SEd Tanous * See header file for more information 2345*7ccfe684SEd Tanous * @endinternal 2346*7ccfe684SEd Tanous */ 2347*7ccfe684SEd Tanous nlohmann::json networkNameResolutionNotSupported() 2348*7ccfe684SEd Tanous { 2349*7ccfe684SEd Tanous return getLog( 2350*7ccfe684SEd Tanous redfish::registries::base::Index::networkNameResolutionNotSupported, 2351*7ccfe684SEd Tanous {}); 2352*7ccfe684SEd Tanous } 2353*7ccfe684SEd Tanous 2354*7ccfe684SEd Tanous void networkNameResolutionNotSupported(crow::Response& res) 2355*7ccfe684SEd Tanous { 2356*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2357*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, networkNameResolutionNotSupported()); 2358*7ccfe684SEd Tanous } 2359*7ccfe684SEd Tanous 2360*7ccfe684SEd Tanous /** 2361*7ccfe684SEd Tanous * @internal 2362*7ccfe684SEd Tanous * @brief Formats AuthenticationTokenRequired message into JSON 2363*7ccfe684SEd Tanous * 2364*7ccfe684SEd Tanous * See header file for more information 2365*7ccfe684SEd Tanous * @endinternal 2366*7ccfe684SEd Tanous */ 2367*7ccfe684SEd Tanous nlohmann::json authenticationTokenRequired() 2368*7ccfe684SEd Tanous { 2369*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::authenticationTokenRequired, 2370*7ccfe684SEd Tanous {}); 2371*7ccfe684SEd Tanous } 2372*7ccfe684SEd Tanous 2373*7ccfe684SEd Tanous void authenticationTokenRequired(crow::Response& res) 2374*7ccfe684SEd Tanous { 2375*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2376*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, authenticationTokenRequired()); 2377*7ccfe684SEd Tanous } 2378*7ccfe684SEd Tanous 2379*7ccfe684SEd Tanous /** 2380*7ccfe684SEd Tanous * @internal 2381*7ccfe684SEd Tanous * @brief Formats OneTimePasscodeSent message into JSON 2382*7ccfe684SEd Tanous * 2383*7ccfe684SEd Tanous * See header file for more information 2384*7ccfe684SEd Tanous * @endinternal 2385*7ccfe684SEd Tanous */ 2386*7ccfe684SEd Tanous nlohmann::json oneTimePasscodeSent(std::string_view arg1) 2387*7ccfe684SEd Tanous { 2388*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::oneTimePasscodeSent, 2389*7ccfe684SEd Tanous std::to_array({arg1})); 2390*7ccfe684SEd Tanous } 2391*7ccfe684SEd Tanous 2392*7ccfe684SEd Tanous void oneTimePasscodeSent(crow::Response& res, std::string_view arg1) 2393*7ccfe684SEd Tanous { 2394*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2395*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, oneTimePasscodeSent(arg1)); 2396*7ccfe684SEd Tanous } 2397*7ccfe684SEd Tanous 2398*7ccfe684SEd Tanous /** 2399*7ccfe684SEd Tanous * @internal 2400*7ccfe684SEd Tanous * @brief Formats LicenseRequired message into JSON 2401*7ccfe684SEd Tanous * 2402*7ccfe684SEd Tanous * See header file for more information 2403*7ccfe684SEd Tanous * @endinternal 2404*7ccfe684SEd Tanous */ 2405*7ccfe684SEd Tanous nlohmann::json licenseRequired(std::string_view arg1) 2406*7ccfe684SEd Tanous { 2407*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::licenseRequired, 2408*7ccfe684SEd Tanous std::to_array({arg1})); 2409*7ccfe684SEd Tanous } 2410*7ccfe684SEd Tanous 2411*7ccfe684SEd Tanous void licenseRequired(crow::Response& res, std::string_view arg1) 2412*7ccfe684SEd Tanous { 2413*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2414*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, licenseRequired(arg1)); 2415*7ccfe684SEd Tanous } 2416*7ccfe684SEd Tanous 2417*7ccfe684SEd Tanous /** 2418*7ccfe684SEd Tanous * @internal 2419*7ccfe684SEd Tanous * @brief Formats PropertyModified message into JSON 2420*7ccfe684SEd Tanous * 2421*7ccfe684SEd Tanous * See header file for more information 2422*7ccfe684SEd Tanous * @endinternal 2423*7ccfe684SEd Tanous */ 2424*7ccfe684SEd Tanous nlohmann::json propertyModified() 2425*7ccfe684SEd Tanous { 2426*7ccfe684SEd Tanous return getLog(redfish::registries::base::Index::propertyModified, {}); 2427*7ccfe684SEd Tanous } 2428*7ccfe684SEd Tanous 2429*7ccfe684SEd Tanous void propertyModified(crow::Response& res) 2430*7ccfe684SEd Tanous { 2431*7ccfe684SEd Tanous res.result(boost::beast::http::status::bad_request); 2432*7ccfe684SEd Tanous addMessageToErrorJson(res.jsonValue, propertyModified()); 24337585b760SJishnu CM } 24347585b760SJishnu CM 2435f4c4dcf4SKowalski, Kamil } // namespace messages 2436d425c6f6SEd Tanous } // namespace redfish 2437