1f4c4dcf4SKowalski, Kamil /* 2f4c4dcf4SKowalski, Kamil // Copyright (c) 2018 Intel Corporation 3f4c4dcf4SKowalski, Kamil // 4f4c4dcf4SKowalski, Kamil // Licensed under the Apache License, Version 2.0 (the "License"); 5f4c4dcf4SKowalski, Kamil // you may not use this file except in compliance with the License. 6f4c4dcf4SKowalski, Kamil // You may obtain a copy of the License at 7f4c4dcf4SKowalski, Kamil // 8f4c4dcf4SKowalski, Kamil // http://www.apache.org/licenses/LICENSE-2.0 9f4c4dcf4SKowalski, Kamil // 10f4c4dcf4SKowalski, Kamil // Unless required by applicable law or agreed to in writing, software 11f4c4dcf4SKowalski, Kamil // distributed under the License is distributed on an "AS IS" BASIS, 12f4c4dcf4SKowalski, Kamil // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13f4c4dcf4SKowalski, Kamil // See the License for the specific language governing permissions and 14f4c4dcf4SKowalski, Kamil // limitations under the License. 15f4c4dcf4SKowalski, Kamil */ 16f4c4dcf4SKowalski, Kamil #pragma once 1704e438cbSEd Tanous #include "http_response.hpp" 18f12894f8SJason M. Bills 191214b7e7SGunnar Mills #include <nlohmann/json.hpp> 20df5415fcSEd Tanous #include <source_location.hpp> 211214b7e7SGunnar Mills 22*9ea15c35SEd Tanous #include <string> 23*9ea15c35SEd Tanous 241abe55efSEd Tanous namespace redfish 251abe55efSEd Tanous { 26f4c4dcf4SKowalski, Kamil 271abe55efSEd Tanous namespace messages 281abe55efSEd Tanous { 29f4c4dcf4SKowalski, Kamil 3081856681SAsmitha Karunanithi constexpr const char* messageVersionPrefix = "Base.1.11.0."; 3155c7b7a2SEd Tanous constexpr const char* messageAnnotation = "@Message.ExtendedInfo"; 32f4c4dcf4SKowalski, Kamil 33f4c4dcf4SKowalski, Kamil /** 34f4c4dcf4SKowalski, Kamil * @brief Formats ResourceInUse message into JSON 35f4c4dcf4SKowalski, Kamil * Message body: "The change to the requested resource failed because the 36f4c4dcf4SKowalski, Kamil * resource is in use or in transition." 37f4c4dcf4SKowalski, Kamil * 38f4c4dcf4SKowalski, Kamil * 39f4c4dcf4SKowalski, Kamil * @returns Message ResourceInUse formatted to JSON */ 4065176d39SEd Tanous nlohmann::json resourceInUse(); 41b5c07418SJames Feist 42f12894f8SJason M. Bills void resourceInUse(crow::Response& res); 43f4c4dcf4SKowalski, Kamil 44f4c4dcf4SKowalski, Kamil /** 45f4c4dcf4SKowalski, Kamil * @brief Formats MalformedJSON message into JSON 46f4c4dcf4SKowalski, Kamil * Message body: "The request body submitted was malformed JSON and could not be 47f4c4dcf4SKowalski, Kamil * parsed by the receiving service." 48f4c4dcf4SKowalski, Kamil * 49f4c4dcf4SKowalski, Kamil * 50f4c4dcf4SKowalski, Kamil * @returns Message MalformedJSON formatted to JSON */ 5165176d39SEd Tanous nlohmann::json malformedJSON(); 52b5c07418SJames Feist 53f12894f8SJason M. Bills void malformedJSON(crow::Response& res); 54f4c4dcf4SKowalski, Kamil 55f4c4dcf4SKowalski, Kamil /** 56f4c4dcf4SKowalski, Kamil * @brief Formats ResourceMissingAtURI message into JSON 5766ac2b8cSJason M. Bills * Message body: "The resource at the URI <arg1> was not found." 58f4c4dcf4SKowalski, Kamil * 59f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 60f4c4dcf4SKowalski, Kamil * 61f4c4dcf4SKowalski, Kamil * @returns Message ResourceMissingAtURI formatted to JSON */ 62b5c07418SJames Feist nlohmann::json resourceMissingAtURI(const std::string& arg1); 63b5c07418SJames Feist 64f12894f8SJason M. Bills void resourceMissingAtURI(crow::Response& res, const std::string& arg1); 65f4c4dcf4SKowalski, Kamil 66f4c4dcf4SKowalski, Kamil /** 67f4c4dcf4SKowalski, Kamil * @brief Formats ActionParameterValueFormatError message into JSON 6866ac2b8cSJason M. Bills * Message body: "The value <arg1> for the parameter <arg2> in the action <arg3> 69f4c4dcf4SKowalski, Kamil * is of a different format than the parameter can accept." 70f4c4dcf4SKowalski, Kamil * 71f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 72f4c4dcf4SKowalski, Kamil * @param[in] arg2 Parameter of message that will replace %2 in its body. 73f4c4dcf4SKowalski, Kamil * @param[in] arg3 Parameter of message that will replace %3 in its body. 74f4c4dcf4SKowalski, Kamil * 75f4c4dcf4SKowalski, Kamil * @returns Message ActionParameterValueFormatError formatted to JSON */ 76b5c07418SJames Feist nlohmann::json actionParameterValueFormatError(const std::string& arg1, 77b5c07418SJames Feist const std::string& arg2, 78b5c07418SJames Feist const std::string& arg3); 79b5c07418SJames Feist 80f12894f8SJason M. Bills void actionParameterValueFormatError(crow::Response& res, 81f12894f8SJason M. Bills const std::string& arg1, 82f4c4dcf4SKowalski, Kamil const std::string& arg2, 83f4c4dcf4SKowalski, Kamil const std::string& arg3); 84f4c4dcf4SKowalski, Kamil 85f4c4dcf4SKowalski, Kamil /** 86f4c4dcf4SKowalski, Kamil * @brief Formats InternalError message into JSON 87f4c4dcf4SKowalski, Kamil * Message body: "The request failed due to an internal service error. The 88f4c4dcf4SKowalski, Kamil * service is still operational." 89f4c4dcf4SKowalski, Kamil * 90f4c4dcf4SKowalski, Kamil * 91f4c4dcf4SKowalski, Kamil * @returns Message InternalError formatted to JSON */ 9265176d39SEd Tanous nlohmann::json internalError(); 93b5c07418SJames Feist 94df5415fcSEd Tanous void internalError(crow::Response& res, const bmcweb::source_location location = 95df5415fcSEd Tanous bmcweb::source_location::current()); 96f12894f8SJason M. Bills 97f12894f8SJason M. Bills /** 98f4c4dcf4SKowalski, Kamil * @brief Formats UnrecognizedRequestBody message into JSON 99f4c4dcf4SKowalski, Kamil * Message body: "The service detected a malformed request body that it was 100f4c4dcf4SKowalski, Kamil * unable to interpret." 101f4c4dcf4SKowalski, Kamil * 102f4c4dcf4SKowalski, Kamil * 103f4c4dcf4SKowalski, Kamil * @returns Message UnrecognizedRequestBody formatted to JSON */ 10465176d39SEd Tanous nlohmann::json unrecognizedRequestBody(); 105b5c07418SJames Feist 106f12894f8SJason M. Bills void unrecognizedRequestBody(crow::Response& res); 107f4c4dcf4SKowalski, Kamil 108f4c4dcf4SKowalski, Kamil /** 109f4c4dcf4SKowalski, Kamil * @brief Formats ResourceAtUriUnauthorized message into JSON 11066ac2b8cSJason M. Bills * Message body: "While accessing the resource at <arg1>, the service received 11166ac2b8cSJason M. Bills * an authorization error <arg2>." 112f4c4dcf4SKowalski, Kamil * 113f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 114f4c4dcf4SKowalski, Kamil * @param[in] arg2 Parameter of message that will replace %2 in its body. 115f4c4dcf4SKowalski, Kamil * 116f4c4dcf4SKowalski, Kamil * @returns Message ResourceAtUriUnauthorized formatted to JSON */ 117b5c07418SJames Feist nlohmann::json resourceAtUriUnauthorized(const std::string& arg1, 118b5c07418SJames Feist const std::string& arg2); 119b5c07418SJames Feist 120f12894f8SJason M. Bills void resourceAtUriUnauthorized(crow::Response& res, const std::string& arg1, 121f4c4dcf4SKowalski, Kamil const std::string& arg2); 122f4c4dcf4SKowalski, Kamil 123f4c4dcf4SKowalski, Kamil /** 124f4c4dcf4SKowalski, Kamil * @brief Formats ActionParameterUnknown message into JSON 12566ac2b8cSJason M. Bills * Message body: "The action <arg1> was submitted with the invalid parameter 12666ac2b8cSJason M. Bills * <arg2>." 127f4c4dcf4SKowalski, Kamil * 128f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 129f4c4dcf4SKowalski, Kamil * @param[in] arg2 Parameter of message that will replace %2 in its body. 130f4c4dcf4SKowalski, Kamil * 131f4c4dcf4SKowalski, Kamil * @returns Message ActionParameterUnknown formatted to JSON */ 132b5c07418SJames Feist nlohmann::json actionParameterUnknown(const std::string& arg1, 133b5c07418SJames Feist const std::string& arg2); 134b5c07418SJames Feist 135f12894f8SJason M. Bills void actionParameterUnknown(crow::Response& res, const std::string& arg1, 136f4c4dcf4SKowalski, Kamil const std::string& arg2); 137f4c4dcf4SKowalski, Kamil 138f4c4dcf4SKowalski, Kamil /** 139f4c4dcf4SKowalski, Kamil * @brief Formats ResourceCannotBeDeleted message into JSON 140f4c4dcf4SKowalski, Kamil * Message body: "The delete request failed because the resource requested 141f4c4dcf4SKowalski, Kamil * cannot be deleted." 142f4c4dcf4SKowalski, Kamil * 143f4c4dcf4SKowalski, Kamil * 144f4c4dcf4SKowalski, Kamil * @returns Message ResourceCannotBeDeleted formatted to JSON */ 14565176d39SEd Tanous nlohmann::json resourceCannotBeDeleted(); 146b5c07418SJames Feist 147f12894f8SJason M. Bills void resourceCannotBeDeleted(crow::Response& res); 148f4c4dcf4SKowalski, Kamil 149f4c4dcf4SKowalski, Kamil /** 150f4c4dcf4SKowalski, Kamil * @brief Formats PropertyDuplicate message into JSON 15166ac2b8cSJason M. Bills * Message body: "The property <arg1> was duplicated in the request." 152f4c4dcf4SKowalski, Kamil * 153f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 154f4c4dcf4SKowalski, Kamil * 155f4c4dcf4SKowalski, Kamil * @returns Message PropertyDuplicate formatted to JSON */ 156b5c07418SJames Feist nlohmann::json propertyDuplicate(const std::string& arg1); 157b5c07418SJames Feist 158f12894f8SJason M. Bills void propertyDuplicate(crow::Response& res, const std::string& arg1); 159f4c4dcf4SKowalski, Kamil 160f4c4dcf4SKowalski, Kamil /** 161f4c4dcf4SKowalski, Kamil * @brief Formats ServiceTemporarilyUnavailable message into JSON 16266ac2b8cSJason M. Bills * Message body: "The service is temporarily unavailable. Retry in <arg1> 163f4c4dcf4SKowalski, Kamil * seconds." 164f4c4dcf4SKowalski, Kamil * 165f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 166f4c4dcf4SKowalski, Kamil * 167f4c4dcf4SKowalski, Kamil * @returns Message ServiceTemporarilyUnavailable formatted to JSON */ 168b5c07418SJames Feist nlohmann::json serviceTemporarilyUnavailable(const std::string& arg1); 169b5c07418SJames Feist 170f12894f8SJason M. Bills void serviceTemporarilyUnavailable(crow::Response& res, 171f12894f8SJason M. Bills const std::string& arg1); 172f4c4dcf4SKowalski, Kamil 173f4c4dcf4SKowalski, Kamil /** 174f4c4dcf4SKowalski, Kamil * @brief Formats ResourceAlreadyExists message into JSON 17566ac2b8cSJason M. Bills * Message body: "The requested resource of type <arg1> with the property <arg2> 17666ac2b8cSJason M. Bills * with the value <arg3> already exists." 177f4c4dcf4SKowalski, Kamil * 178f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 179f4c4dcf4SKowalski, Kamil * @param[in] arg2 Parameter of message that will replace %2 in its body. 180f4c4dcf4SKowalski, Kamil * @param[in] arg3 Parameter of message that will replace %3 in its body. 181f4c4dcf4SKowalski, Kamil * 182f4c4dcf4SKowalski, Kamil * @returns Message ResourceAlreadyExists formatted to JSON */ 183b5c07418SJames Feist nlohmann::json resourceAlreadyExists(const std::string& arg1, 184b5c07418SJames Feist const std::string& arg2, 185b5c07418SJames Feist const std::string& arg3); 186b5c07418SJames Feist 187f12894f8SJason M. Bills void resourceAlreadyExists(crow::Response& res, const std::string& arg1, 188f12894f8SJason M. Bills const std::string& arg2, const std::string& arg3); 189f4c4dcf4SKowalski, Kamil 190f4c4dcf4SKowalski, Kamil /** 191f4c4dcf4SKowalski, Kamil * @brief Formats AccountForSessionNoLongerExists message into JSON 192f4c4dcf4SKowalski, Kamil * Message body: "The account for the current session has been removed, thus the 193f4c4dcf4SKowalski, Kamil * current session has been removed as well." 194f4c4dcf4SKowalski, Kamil * 195f4c4dcf4SKowalski, Kamil * 196f4c4dcf4SKowalski, Kamil * @returns Message AccountForSessionNoLongerExists formatted to JSON */ 19765176d39SEd Tanous nlohmann::json accountForSessionNoLongerExists(); 198b5c07418SJames Feist 199f12894f8SJason M. Bills void accountForSessionNoLongerExists(crow::Response& res); 200f4c4dcf4SKowalski, Kamil 201f4c4dcf4SKowalski, Kamil /** 202f4c4dcf4SKowalski, Kamil * @brief Formats CreateFailedMissingReqProperties message into JSON 203f4c4dcf4SKowalski, Kamil * Message body: "The create operation failed because the required property 20466ac2b8cSJason M. Bills * <arg1> was missing from the request." 205f4c4dcf4SKowalski, Kamil * 206f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 207f4c4dcf4SKowalski, Kamil * 208f4c4dcf4SKowalski, Kamil * @returns Message CreateFailedMissingReqProperties formatted to JSON */ 209b5c07418SJames Feist nlohmann::json createFailedMissingReqProperties(const std::string& arg1); 210b5c07418SJames Feist 211f12894f8SJason M. Bills void createFailedMissingReqProperties(crow::Response& res, 212f12894f8SJason M. Bills const std::string& arg1); 213f4c4dcf4SKowalski, Kamil 214f4c4dcf4SKowalski, Kamil /** 215f4c4dcf4SKowalski, Kamil * @brief Formats PropertyValueFormatError message into JSON 21666ac2b8cSJason M. Bills * Message body: "The value <arg1> for the property <arg2> is of a different 217f4c4dcf4SKowalski, Kamil * format than the property can accept." 218f4c4dcf4SKowalski, Kamil * 219f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 220f4c4dcf4SKowalski, Kamil * @param[in] arg2 Parameter of message that will replace %2 in its body. 221f4c4dcf4SKowalski, Kamil * 222f4c4dcf4SKowalski, Kamil * @returns Message PropertyValueFormatError formatted to JSON */ 223b5c07418SJames Feist nlohmann::json propertyValueFormatError(const std::string& arg1, 224b5c07418SJames Feist const std::string& arg2); 225b5c07418SJames Feist 226f12894f8SJason M. Bills void propertyValueFormatError(crow::Response& res, const std::string& arg1, 227f4c4dcf4SKowalski, Kamil const std::string& arg2); 228f4c4dcf4SKowalski, Kamil 229f4c4dcf4SKowalski, Kamil /** 230f4c4dcf4SKowalski, Kamil * @brief Formats PropertyValueNotInList message into JSON 23166ac2b8cSJason M. Bills * Message body: "The value <arg1> for the property <arg2> is not in the list of 232f4c4dcf4SKowalski, Kamil * acceptable values." 233f4c4dcf4SKowalski, Kamil * 234f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 235f4c4dcf4SKowalski, Kamil * @param[in] arg2 Parameter of message that will replace %2 in its body. 236f4c4dcf4SKowalski, Kamil * 237f4c4dcf4SKowalski, Kamil * @returns Message PropertyValueNotInList formatted to JSON */ 238b5c07418SJames Feist nlohmann::json propertyValueNotInList(const std::string& arg1, 239b5c07418SJames Feist const std::string& arg2); 240b5c07418SJames Feist 241f12894f8SJason M. Bills void propertyValueNotInList(crow::Response& res, const std::string& arg1, 242f4c4dcf4SKowalski, Kamil const std::string& arg2); 243f4c4dcf4SKowalski, Kamil 244f4c4dcf4SKowalski, Kamil /** 245f4c4dcf4SKowalski, Kamil * @brief Formats ResourceAtUriInUnknownFormat message into JSON 24666ac2b8cSJason M. Bills * Message body: "The resource at <arg1> is in a format not recognized by the 247f4c4dcf4SKowalski, Kamil * service." 248f4c4dcf4SKowalski, Kamil * 249f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 250f4c4dcf4SKowalski, Kamil * 251f4c4dcf4SKowalski, Kamil * @returns Message ResourceAtUriInUnknownFormat formatted to JSON */ 252b5c07418SJames Feist nlohmann::json resourceAtUriInUnknownFormat(const std::string& arg1); 253b5c07418SJames Feist 254f12894f8SJason M. Bills void resourceAtUriInUnknownFormat(crow::Response& res, const std::string& arg1); 255f4c4dcf4SKowalski, Kamil 256f4c4dcf4SKowalski, Kamil /** 25781856681SAsmitha Karunanithi * @brief Formats ServiceDisabled message into JSON 25881856681SAsmitha Karunanithi * Message body: "The operation failed because the service at <arg1> is disabled 25981856681SAsmitha Karunanithi * and " cannot accept requests." 26081856681SAsmitha Karunanithi * 26181856681SAsmitha Karunanithi * @param[in] arg1 Parameter of message that will replace %1 in its body. 26281856681SAsmitha Karunanithi * 26381856681SAsmitha Karunanithi * @returns Message ServiceDisabled formatted to JSON */ 26481856681SAsmitha Karunanithi nlohmann::json serviceDisabled(const std::string& arg1); 26581856681SAsmitha Karunanithi 26681856681SAsmitha Karunanithi void serviceDisabled(crow::Response& res, const std::string& arg1); 26781856681SAsmitha Karunanithi 26881856681SAsmitha Karunanithi /** 269f4c4dcf4SKowalski, Kamil * @brief Formats ServiceInUnknownState message into JSON 270f4c4dcf4SKowalski, Kamil * Message body: "The operation failed because the service is in an unknown 271f4c4dcf4SKowalski, Kamil * state and can no longer take incoming requests." 272f4c4dcf4SKowalski, Kamil * 273f4c4dcf4SKowalski, Kamil * 274f4c4dcf4SKowalski, Kamil * @returns Message ServiceInUnknownState formatted to JSON */ 27565176d39SEd Tanous nlohmann::json serviceInUnknownState(); 276b5c07418SJames Feist 277f12894f8SJason M. Bills void serviceInUnknownState(crow::Response& res); 278f4c4dcf4SKowalski, Kamil 279f4c4dcf4SKowalski, Kamil /** 280f4c4dcf4SKowalski, Kamil * @brief Formats EventSubscriptionLimitExceeded message into JSON 281f4c4dcf4SKowalski, Kamil * Message body: "The event subscription failed due to the number of 282f4c4dcf4SKowalski, Kamil * simultaneous subscriptions exceeding the limit of the implementation." 283f4c4dcf4SKowalski, Kamil * 284f4c4dcf4SKowalski, Kamil * 285f4c4dcf4SKowalski, Kamil * @returns Message EventSubscriptionLimitExceeded formatted to JSON */ 28665176d39SEd Tanous nlohmann::json eventSubscriptionLimitExceeded(); 287b5c07418SJames Feist 288f12894f8SJason M. Bills void eventSubscriptionLimitExceeded(crow::Response& res); 289f4c4dcf4SKowalski, Kamil 290f4c4dcf4SKowalski, Kamil /** 291f4c4dcf4SKowalski, Kamil * @brief Formats ActionParameterMissing message into JSON 29266ac2b8cSJason M. Bills * Message body: "The action <arg1> requires the parameter <arg2> to be present 293f4c4dcf4SKowalski, Kamil * in the request body." 294f4c4dcf4SKowalski, Kamil * 295f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 296f4c4dcf4SKowalski, Kamil * @param[in] arg2 Parameter of message that will replace %2 in its body. 297f4c4dcf4SKowalski, Kamil * 298f4c4dcf4SKowalski, Kamil * @returns Message ActionParameterMissing formatted to JSON */ 299b5c07418SJames Feist nlohmann::json actionParameterMissing(const std::string& arg1, 300b5c07418SJames Feist const std::string& arg2); 301b5c07418SJames Feist 302f12894f8SJason M. Bills void actionParameterMissing(crow::Response& res, const std::string& arg1, 303f4c4dcf4SKowalski, Kamil const std::string& arg2); 304f4c4dcf4SKowalski, Kamil 305f4c4dcf4SKowalski, Kamil /** 306f4c4dcf4SKowalski, Kamil * @brief Formats StringValueTooLong message into JSON 30766ac2b8cSJason M. Bills * Message body: "The string <arg1> exceeds the length limit <arg2>." 308f4c4dcf4SKowalski, Kamil * 309f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 310f4c4dcf4SKowalski, Kamil * @param[in] arg2 Parameter of message that will replace %2 in its body. 311f4c4dcf4SKowalski, Kamil * 312f4c4dcf4SKowalski, Kamil * @returns Message StringValueTooLong formatted to JSON */ 313b5c07418SJames Feist nlohmann::json stringValueTooLong(const std::string& arg1, const int& arg2); 314b5c07418SJames Feist 315f12894f8SJason M. Bills void stringValueTooLong(crow::Response& res, const std::string& arg1, 316f12894f8SJason M. Bills const int& arg2); 317f4c4dcf4SKowalski, Kamil 318f4c4dcf4SKowalski, Kamil /** 319cc9139ecSJason M. Bills * @brief Formats SessionTerminated message into JSON 320cc9139ecSJason M. Bills * Message body: "The session was successfully terminated." 321cc9139ecSJason M. Bills * 322cc9139ecSJason M. Bills * 323cc9139ecSJason M. Bills * @returns Message SessionTerminated formatted to JSON */ 32465176d39SEd Tanous nlohmann::json sessionTerminated(); 325b5c07418SJames Feist 326cc9139ecSJason M. Bills void sessionTerminated(crow::Response& res); 327cc9139ecSJason M. Bills 328cc9139ecSJason M. Bills /** 329684bb4b8SJason M. Bills * @brief Formats SubscriptionTerminated message into JSON 330684bb4b8SJason M. Bills * Message body: "The event subscription has been terminated." 331684bb4b8SJason M. Bills * 332684bb4b8SJason M. Bills * 333684bb4b8SJason M. Bills * @returns Message SubscriptionTerminated formatted to JSON */ 33465176d39SEd Tanous nlohmann::json subscriptionTerminated(); 335684bb4b8SJason M. Bills 336684bb4b8SJason M. Bills void subscriptionTerminated(crow::Response& res); 337684bb4b8SJason M. Bills 338684bb4b8SJason M. Bills /** 339cc9139ecSJason M. Bills * @brief Formats ResourceTypeIncompatible message into JSON 340cc9139ecSJason M. Bills * Message body: "The @odata.type of the request body <arg1> is incompatible 341cc9139ecSJason M. Bills * with the @odata.type of the resource which is <arg2>." 342cc9139ecSJason M. Bills * 343cc9139ecSJason M. Bills * @param[in] arg1 Parameter of message that will replace %1 in its body. 344cc9139ecSJason M. Bills * @param[in] arg2 Parameter of message that will replace %2 in its body. 345cc9139ecSJason M. Bills * 346cc9139ecSJason M. Bills * @returns Message ResourceTypeIncompatible formatted to JSON */ 347b5c07418SJames Feist nlohmann::json resourceTypeIncompatible(const std::string& arg1, 348b5c07418SJames Feist const std::string& arg2); 349b5c07418SJames Feist 350cc9139ecSJason M. Bills void resourceTypeIncompatible(crow::Response& res, const std::string& arg1, 351cc9139ecSJason M. Bills const std::string& arg2); 352cc9139ecSJason M. Bills 353cc9139ecSJason M. Bills /** 354684bb4b8SJason M. Bills * @brief Formats ResetRequired message into JSON 355684bb4b8SJason M. Bills * Message body: "In order to complete the operation, a component reset is 356684bb4b8SJason M. Bills * required with the Reset action URI '<arg1>' and ResetType '<arg2>'." 357684bb4b8SJason M. Bills * 358684bb4b8SJason M. Bills * @param[in] arg1 Parameter of message that will replace %1 in its body. 359684bb4b8SJason M. Bills * @param[in] arg2 Parameter of message that will replace %2 in its body. 360684bb4b8SJason M. Bills * 361684bb4b8SJason M. Bills * @returns Message ResetRequired formatted to JSON */ 362684bb4b8SJason M. Bills nlohmann::json resetRequired(const std::string& arg1, const std::string& arg2); 363684bb4b8SJason M. Bills 364684bb4b8SJason M. Bills void resetRequired(crow::Response& res, const std::string& arg1, 365684bb4b8SJason M. Bills const std::string& arg2); 366684bb4b8SJason M. Bills 367684bb4b8SJason M. Bills /** 368684bb4b8SJason M. Bills * @brief Formats ChassisPowerStateOnRequired message into JSON 369684bb4b8SJason M. Bills * Message body: "The Chassis with Id '<arg1>' requires to be powered on to 370684bb4b8SJason M. Bills * perform this request." 371684bb4b8SJason M. Bills * 372684bb4b8SJason M. Bills * @param[in] arg1 Parameter of message that will replace %1 in its body. 373684bb4b8SJason M. Bills * 374684bb4b8SJason M. Bills * @returns Message ChassisPowerStateOnRequired formatted to JSON */ 375684bb4b8SJason M. Bills nlohmann::json chassisPowerStateOnRequired(const std::string& arg1); 376684bb4b8SJason M. Bills 377684bb4b8SJason M. Bills void chassisPowerStateOnRequired(crow::Response& res, const std::string& arg1); 378684bb4b8SJason M. Bills 379684bb4b8SJason M. Bills /** 380684bb4b8SJason M. Bills * @brief Formats ChassisPowerStateOffRequired message into JSON 381684bb4b8SJason M. Bills * Message body: "The Chassis with Id '<arg1>' requires to be powered off to 382684bb4b8SJason M. Bills * perform this request." 383684bb4b8SJason M. Bills * 384684bb4b8SJason M. Bills * @param[in] arg1 Parameter of message that will replace %1 in its body. 385684bb4b8SJason M. Bills * 386684bb4b8SJason M. Bills * @returns Message ChassisPowerStateOffRequired formatted to JSON */ 387684bb4b8SJason M. Bills nlohmann::json chassisPowerStateOffRequired(const std::string& arg1); 388684bb4b8SJason M. Bills 389684bb4b8SJason M. Bills void chassisPowerStateOffRequired(crow::Response& res, const std::string& arg1); 390684bb4b8SJason M. Bills 391684bb4b8SJason M. Bills /** 392684bb4b8SJason M. Bills * @brief Formats PropertyValueConflict message into JSON 393684bb4b8SJason M. Bills * Message body: "The property '<arg1>' could not be written because its value 394684bb4b8SJason M. Bills * would conflict with the value of the '<arg2>' property." 395684bb4b8SJason M. Bills * 396684bb4b8SJason M. Bills * @param[in] arg1 Parameter of message that will replace %1 in its body. 397684bb4b8SJason M. Bills * @param[in] arg2 Parameter of message that will replace %2 in its body. 398684bb4b8SJason M. Bills * 399684bb4b8SJason M. Bills * @returns Message PropertyValueConflict formatted to JSON */ 400684bb4b8SJason M. Bills nlohmann::json propertyValueConflict(const std::string& arg1, 401684bb4b8SJason M. Bills const std::string& arg2); 402684bb4b8SJason M. Bills 403684bb4b8SJason M. Bills void propertyValueConflict(crow::Response& res, const std::string& arg1, 404684bb4b8SJason M. Bills const std::string& arg2); 405684bb4b8SJason M. Bills 406684bb4b8SJason M. Bills /** 407684bb4b8SJason M. Bills * @brief Formats PropertyValueIncorrect message into JSON 408684bb4b8SJason M. Bills * Message body: "The property '<arg1>' with the requested value of '<arg2>' 409684bb4b8SJason M. Bills * could not be written because the value does not meet the constraints of the 410684bb4b8SJason M. Bills * implementation." 411684bb4b8SJason M. Bills * 412684bb4b8SJason M. Bills * @param[in] arg1 Parameter of message that will replace %1 in its body. 413684bb4b8SJason M. Bills * @param[in] arg2 Parameter of message that will replace %2 in its body. 414684bb4b8SJason M. Bills * 415684bb4b8SJason M. Bills * @returns Message PropertyValueIncorrect formatted to JSON */ 416684bb4b8SJason M. Bills nlohmann::json propertyValueIncorrect(const std::string& arg1, 417684bb4b8SJason M. Bills const std::string& arg2); 418684bb4b8SJason M. Bills 419684bb4b8SJason M. Bills void propertyValueIncorrect(crow::Response& res, const std::string& arg1, 420684bb4b8SJason M. Bills const std::string& arg2); 421684bb4b8SJason M. Bills 422684bb4b8SJason M. Bills /** 423684bb4b8SJason M. Bills * @brief Formats ResourceCreationConflict message into JSON 424684bb4b8SJason M. Bills * Message body: "The resource could not be created. The service has a resource 425684bb4b8SJason M. Bills * at URI '<arg1>' that conflicts with the creation request." 426684bb4b8SJason M. Bills * 427684bb4b8SJason M. Bills * @param[in] arg1 Parameter of message that will replace %1 in its body. 428684bb4b8SJason M. Bills * 429684bb4b8SJason M. Bills * @returns Message ResourceCreationConflict formatted to JSON */ 430684bb4b8SJason M. Bills nlohmann::json resourceCreationConflict(const std::string& arg1); 431684bb4b8SJason M. Bills 432684bb4b8SJason M. Bills void resourceCreationConflict(crow::Response& res, const std::string& arg1); 433684bb4b8SJason M. Bills 434684bb4b8SJason M. Bills /** 435684bb4b8SJason M. Bills * @brief Formats MaximumErrorsExceeded message into JSON 436684bb4b8SJason M. Bills * Message body: "Too many errors have occurred to report them all." 437684bb4b8SJason M. Bills * 438684bb4b8SJason M. Bills * 439684bb4b8SJason M. Bills * @returns Message MaximumErrorsExceeded formatted to JSON */ 44065176d39SEd Tanous nlohmann::json maximumErrorsExceeded(); 441684bb4b8SJason M. Bills 442684bb4b8SJason M. Bills void maximumErrorsExceeded(crow::Response& res); 443684bb4b8SJason M. Bills 444684bb4b8SJason M. Bills /** 445684bb4b8SJason M. Bills * @brief Formats PreconditionFailed message into JSON 446684bb4b8SJason M. Bills * Message body: "The ETag supplied did not match the ETag required to change 447684bb4b8SJason M. Bills * this resource." 448684bb4b8SJason M. Bills * 449684bb4b8SJason M. Bills * 450684bb4b8SJason M. Bills * @returns Message PreconditionFailed formatted to JSON */ 45165176d39SEd Tanous nlohmann::json preconditionFailed(); 452684bb4b8SJason M. Bills 453684bb4b8SJason M. Bills void preconditionFailed(crow::Response& res); 454684bb4b8SJason M. Bills 455684bb4b8SJason M. Bills /** 456684bb4b8SJason M. Bills * @brief Formats PreconditionRequired message into JSON 457684bb4b8SJason M. Bills * Message body: "A precondition header or annotation is required to change this 458684bb4b8SJason M. Bills * resource." 459684bb4b8SJason M. Bills * 460684bb4b8SJason M. Bills * 461684bb4b8SJason M. Bills * @returns Message PreconditionRequired formatted to JSON */ 46265176d39SEd Tanous nlohmann::json preconditionRequired(); 463684bb4b8SJason M. Bills 464684bb4b8SJason M. Bills void preconditionRequired(crow::Response& res); 465684bb4b8SJason M. Bills 466684bb4b8SJason M. Bills /** 467684bb4b8SJason M. Bills * @brief Formats OperationFailed message into JSON 468684bb4b8SJason M. Bills * Message body: "An error occurred internal to the service as part of the 469684bb4b8SJason M. Bills * overall request. Partial results may have been returned." 470684bb4b8SJason M. Bills * 471684bb4b8SJason M. Bills * 472684bb4b8SJason M. Bills * @returns Message OperationFailed formatted to JSON */ 47365176d39SEd Tanous nlohmann::json operationFailed(); 474684bb4b8SJason M. Bills 475684bb4b8SJason M. Bills void operationFailed(crow::Response& res); 476684bb4b8SJason M. Bills 477684bb4b8SJason M. Bills /** 478684bb4b8SJason M. Bills * @brief Formats OperationTimeout message into JSON 479684bb4b8SJason M. Bills * Message body: "A timeout internal to the service occured as part of the 480684bb4b8SJason M. Bills * request. Partial results may have been returned." 481684bb4b8SJason M. Bills * 482684bb4b8SJason M. Bills * 483684bb4b8SJason M. Bills * @returns Message OperationTimeout formatted to JSON */ 48465176d39SEd Tanous nlohmann::json operationTimeout(); 485684bb4b8SJason M. Bills 486684bb4b8SJason M. Bills void operationTimeout(crow::Response& res); 487684bb4b8SJason M. Bills 488684bb4b8SJason M. Bills /** 489f4c4dcf4SKowalski, Kamil * @brief Formats PropertyValueTypeError message into JSON 49066ac2b8cSJason M. Bills * Message body: "The value <arg1> for the property <arg2> is of a different 491f4c4dcf4SKowalski, Kamil * type than the property can accept." 492f4c4dcf4SKowalski, Kamil * 493f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 494f4c4dcf4SKowalski, Kamil * @param[in] arg2 Parameter of message that will replace %2 in its body. 495f4c4dcf4SKowalski, Kamil * 496f4c4dcf4SKowalski, Kamil * @returns Message PropertyValueTypeError formatted to JSON */ 497b5c07418SJames Feist nlohmann::json propertyValueTypeError(const std::string& arg1, 498b5c07418SJames Feist const std::string& arg2); 499b5c07418SJames Feist 500f12894f8SJason M. Bills void propertyValueTypeError(crow::Response& res, const std::string& arg1, 501f4c4dcf4SKowalski, Kamil const std::string& arg2); 502f4c4dcf4SKowalski, Kamil 503f4c4dcf4SKowalski, Kamil /** 504f4c4dcf4SKowalski, Kamil * @brief Formats ResourceNotFound message into JSON 50566ac2b8cSJason M. Bills * Message body: "The requested resource of type <arg1> named <arg2> was not 506f4c4dcf4SKowalski, Kamil * found." 507f4c4dcf4SKowalski, Kamil * 508f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 509f4c4dcf4SKowalski, Kamil * @param[in] arg2 Parameter of message that will replace %2 in its body. 510f4c4dcf4SKowalski, Kamil * 511f4c4dcf4SKowalski, Kamil * @returns Message ResourceNotFound formatted to JSON */ 512b5c07418SJames Feist nlohmann::json resourceNotFound(const std::string& arg1, 513b5c07418SJames Feist const std::string& arg2); 514b5c07418SJames Feist 515f12894f8SJason M. Bills void resourceNotFound(crow::Response& res, const std::string& arg1, 516f4c4dcf4SKowalski, Kamil const std::string& arg2); 517f4c4dcf4SKowalski, Kamil 518f4c4dcf4SKowalski, Kamil /** 519f4c4dcf4SKowalski, Kamil * @brief Formats CouldNotEstablishConnection message into JSON 52055c7b7a2SEd Tanous * Message body: "The service failed to establish a Connection with the URI 52166ac2b8cSJason M. Bills * <arg1>." 522f4c4dcf4SKowalski, Kamil * 523f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 524f4c4dcf4SKowalski, Kamil * 525f4c4dcf4SKowalski, Kamil * @returns Message CouldNotEstablishConnection formatted to JSON */ 526b5c07418SJames Feist nlohmann::json couldNotEstablishConnection(const std::string& arg1); 527b5c07418SJames Feist 528f12894f8SJason M. Bills void couldNotEstablishConnection(crow::Response& res, const std::string& arg1); 529f4c4dcf4SKowalski, Kamil 530f4c4dcf4SKowalski, Kamil /** 531f4c4dcf4SKowalski, Kamil * @brief Formats PropertyNotWritable message into JSON 53266ac2b8cSJason M. Bills * Message body: "The property <arg1> is a read only property and cannot be 533f4c4dcf4SKowalski, Kamil * assigned a value." 534f4c4dcf4SKowalski, Kamil * 535f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 536f4c4dcf4SKowalski, Kamil * 537f4c4dcf4SKowalski, Kamil * @returns Message PropertyNotWritable formatted to JSON */ 538b5c07418SJames Feist nlohmann::json propertyNotWritable(const std::string& arg1); 539b5c07418SJames Feist 540f12894f8SJason M. Bills void propertyNotWritable(crow::Response& res, const std::string& arg1); 541f12894f8SJason M. Bills 542f12894f8SJason M. Bills /** 543f4c4dcf4SKowalski, Kamil * @brief Formats QueryParameterValueTypeError message into JSON 54466ac2b8cSJason M. Bills * Message body: "The value <arg1> for the query parameter <arg2> is of a 545f4c4dcf4SKowalski, Kamil * different type than the parameter can accept." 546f4c4dcf4SKowalski, Kamil * 547f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 548f4c4dcf4SKowalski, Kamil * @param[in] arg2 Parameter of message that will replace %2 in its body. 549f4c4dcf4SKowalski, Kamil * 550f4c4dcf4SKowalski, Kamil * @returns Message QueryParameterValueTypeError formatted to JSON */ 551b5c07418SJames Feist nlohmann::json queryParameterValueTypeError(const std::string& arg1, 552b5c07418SJames Feist const std::string& arg2); 553b5c07418SJames Feist 554f12894f8SJason M. Bills void queryParameterValueTypeError(crow::Response& res, const std::string& arg1, 555f4c4dcf4SKowalski, Kamil const std::string& arg2); 556f4c4dcf4SKowalski, Kamil 557f4c4dcf4SKowalski, Kamil /** 558f4c4dcf4SKowalski, Kamil * @brief Formats ServiceShuttingDown message into JSON 559f4c4dcf4SKowalski, Kamil * Message body: "The operation failed because the service is shutting down and 560f4c4dcf4SKowalski, Kamil * can no longer take incoming requests." 561f4c4dcf4SKowalski, Kamil * 562f4c4dcf4SKowalski, Kamil * 563f4c4dcf4SKowalski, Kamil * @returns Message ServiceShuttingDown formatted to JSON */ 56465176d39SEd Tanous nlohmann::json serviceShuttingDown(); 565b5c07418SJames Feist 566f12894f8SJason M. Bills void serviceShuttingDown(crow::Response& res); 567f4c4dcf4SKowalski, Kamil 568f4c4dcf4SKowalski, Kamil /** 569f4c4dcf4SKowalski, Kamil * @brief Formats ActionParameterDuplicate message into JSON 57066ac2b8cSJason M. Bills * Message body: "The action <arg1> was submitted with more than one value for 57166ac2b8cSJason M. Bills * the parameter <arg2>." 572f4c4dcf4SKowalski, Kamil * 573f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 574f4c4dcf4SKowalski, Kamil * @param[in] arg2 Parameter of message that will replace %2 in its body. 575f4c4dcf4SKowalski, Kamil * 576f4c4dcf4SKowalski, Kamil * @returns Message ActionParameterDuplicate formatted to JSON */ 577b5c07418SJames Feist nlohmann::json actionParameterDuplicate(const std::string& arg1, 578b5c07418SJames Feist const std::string& arg2); 579b5c07418SJames Feist 580f12894f8SJason M. Bills void actionParameterDuplicate(crow::Response& res, const std::string& arg1, 581f4c4dcf4SKowalski, Kamil const std::string& arg2); 582f4c4dcf4SKowalski, Kamil 583f4c4dcf4SKowalski, Kamil /** 584f4c4dcf4SKowalski, Kamil * @brief Formats ActionParameterNotSupported message into JSON 58566ac2b8cSJason M. Bills * Message body: "The parameter <arg1> for the action <arg2> is not supported on 586f4c4dcf4SKowalski, Kamil * the target resource." 587f4c4dcf4SKowalski, Kamil * 588f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 589f4c4dcf4SKowalski, Kamil * @param[in] arg2 Parameter of message that will replace %2 in its body. 590f4c4dcf4SKowalski, Kamil * 591f4c4dcf4SKowalski, Kamil * @returns Message ActionParameterNotSupported formatted to JSON */ 592b5c07418SJames Feist nlohmann::json actionParameterNotSupported(const std::string& arg1, 593b5c07418SJames Feist const std::string& arg2); 594b5c07418SJames Feist 595f12894f8SJason M. Bills void actionParameterNotSupported(crow::Response& res, const std::string& arg1, 596f4c4dcf4SKowalski, Kamil const std::string& arg2); 597f4c4dcf4SKowalski, Kamil 598f4c4dcf4SKowalski, Kamil /** 599f4c4dcf4SKowalski, Kamil * @brief Formats SourceDoesNotSupportProtocol message into JSON 60066ac2b8cSJason M. Bills * Message body: "The other end of the Connection at <arg1> does not support the 60166ac2b8cSJason M. Bills * specified protocol <arg2>." 602f4c4dcf4SKowalski, Kamil * 603f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 604f4c4dcf4SKowalski, Kamil * @param[in] arg2 Parameter of message that will replace %2 in its body. 605f4c4dcf4SKowalski, Kamil * 606f4c4dcf4SKowalski, Kamil * @returns Message SourceDoesNotSupportProtocol formatted to JSON */ 607b5c07418SJames Feist nlohmann::json sourceDoesNotSupportProtocol(const std::string& arg1, 608b5c07418SJames Feist const std::string& arg2); 609b5c07418SJames Feist 610f12894f8SJason M. Bills void sourceDoesNotSupportProtocol(crow::Response& res, const std::string& arg1, 611f4c4dcf4SKowalski, Kamil const std::string& arg2); 612f4c4dcf4SKowalski, Kamil 613f4c4dcf4SKowalski, Kamil /** 614f4c4dcf4SKowalski, Kamil * @brief Formats AccountRemoved message into JSON 615f4c4dcf4SKowalski, Kamil * Message body: "The account was successfully removed." 616f4c4dcf4SKowalski, Kamil * 617f4c4dcf4SKowalski, Kamil * 618f4c4dcf4SKowalski, Kamil * @returns Message AccountRemoved formatted to JSON */ 61965176d39SEd Tanous nlohmann::json accountRemoved(); 620b5c07418SJames Feist 621f12894f8SJason M. Bills void accountRemoved(crow::Response& res); 622f4c4dcf4SKowalski, Kamil 623f4c4dcf4SKowalski, Kamil /** 624f4c4dcf4SKowalski, Kamil * @brief Formats AccessDenied message into JSON 62566ac2b8cSJason M. Bills * Message body: "While attempting to establish a Connection to <arg1>, the 626f4c4dcf4SKowalski, Kamil * service denied access." 627f4c4dcf4SKowalski, Kamil * 628f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 629f4c4dcf4SKowalski, Kamil * 630f4c4dcf4SKowalski, Kamil * @returns Message AccessDenied formatted to JSON */ 631b5c07418SJames Feist nlohmann::json accessDenied(const std::string& arg1); 632b5c07418SJames Feist 633f12894f8SJason M. Bills void accessDenied(crow::Response& res, const std::string& arg1); 634f4c4dcf4SKowalski, Kamil 635f4c4dcf4SKowalski, Kamil /** 636f4c4dcf4SKowalski, Kamil * @brief Formats QueryNotSupported message into JSON 637f4c4dcf4SKowalski, Kamil * Message body: "Querying is not supported by the implementation." 638f4c4dcf4SKowalski, Kamil * 639f4c4dcf4SKowalski, Kamil * 640f4c4dcf4SKowalski, Kamil * @returns Message QueryNotSupported formatted to JSON */ 64165176d39SEd Tanous nlohmann::json queryNotSupported(); 642b5c07418SJames Feist 643f12894f8SJason M. Bills void queryNotSupported(crow::Response& res); 644f4c4dcf4SKowalski, Kamil 645f4c4dcf4SKowalski, Kamil /** 646f4c4dcf4SKowalski, Kamil * @brief Formats CreateLimitReachedForResource message into JSON 647f4c4dcf4SKowalski, Kamil * Message body: "The create operation failed because the resource has reached 648f4c4dcf4SKowalski, Kamil * the limit of possible resources." 649f4c4dcf4SKowalski, Kamil * 650f4c4dcf4SKowalski, Kamil * 651f4c4dcf4SKowalski, Kamil * @returns Message CreateLimitReachedForResource formatted to JSON */ 65265176d39SEd Tanous nlohmann::json createLimitReachedForResource(); 653b5c07418SJames Feist 654f12894f8SJason M. Bills void createLimitReachedForResource(crow::Response& res); 655f4c4dcf4SKowalski, Kamil 656f4c4dcf4SKowalski, Kamil /** 657f4c4dcf4SKowalski, Kamil * @brief Formats GeneralError message into JSON 658f4c4dcf4SKowalski, Kamil * Message body: "A general error has occurred. See ExtendedInfo for more 659f4c4dcf4SKowalski, Kamil * information." 660f4c4dcf4SKowalski, Kamil * 661f4c4dcf4SKowalski, Kamil * 662f4c4dcf4SKowalski, Kamil * @returns Message GeneralError formatted to JSON */ 66365176d39SEd Tanous nlohmann::json generalError(); 664b5c07418SJames Feist 665f12894f8SJason M. Bills void generalError(crow::Response& res); 666f4c4dcf4SKowalski, Kamil 667f4c4dcf4SKowalski, Kamil /** 668f4c4dcf4SKowalski, Kamil * @brief Formats Success message into JSON 669f4c4dcf4SKowalski, Kamil * Message body: "Successfully Completed Request" 670f4c4dcf4SKowalski, Kamil * 671f4c4dcf4SKowalski, Kamil * 672f4c4dcf4SKowalski, Kamil * @returns Message Success formatted to JSON */ 67365176d39SEd Tanous nlohmann::json success(); 674b5c07418SJames Feist 675f12894f8SJason M. Bills void success(crow::Response& res); 676f12894f8SJason M. Bills 677f12894f8SJason M. Bills /** 678f4c4dcf4SKowalski, Kamil * @brief Formats Created message into JSON 679f4c4dcf4SKowalski, Kamil * Message body: "The resource has been created successfully" 680f4c4dcf4SKowalski, Kamil * 681f4c4dcf4SKowalski, Kamil * 682f4c4dcf4SKowalski, Kamil * @returns Message Created formatted to JSON */ 68365176d39SEd Tanous nlohmann::json created(); 684b5c07418SJames Feist 685f12894f8SJason M. Bills void created(crow::Response& res); 686f4c4dcf4SKowalski, Kamil 687f4c4dcf4SKowalski, Kamil /** 688cc9139ecSJason M. Bills * @brief Formats NoOperation message into JSON 689cc9139ecSJason M. Bills * Message body: "The request body submitted contain no data to act upon and 690cc9139ecSJason M. Bills * no changes to the resource took place." 691cc9139ecSJason M. Bills * 692cc9139ecSJason M. Bills * 693cc9139ecSJason M. Bills * @returns Message NoOperation formatted to JSON */ 69465176d39SEd Tanous nlohmann::json noOperation(); 695b5c07418SJames Feist 696cc9139ecSJason M. Bills void noOperation(crow::Response& res); 697cc9139ecSJason M. Bills 698cc9139ecSJason M. Bills /** 699f4c4dcf4SKowalski, Kamil * @brief Formats PropertyUnknown message into JSON 70066ac2b8cSJason M. Bills * Message body: "The property <arg1> is not in the list of valid properties for 701f4c4dcf4SKowalski, Kamil * the resource." 702f4c4dcf4SKowalski, Kamil * 703f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 704f4c4dcf4SKowalski, Kamil * 705f4c4dcf4SKowalski, Kamil * @returns Message PropertyUnknown formatted to JSON */ 706b5c07418SJames Feist nlohmann::json propertyUnknown(const std::string& arg1); 707b5c07418SJames Feist 708f12894f8SJason M. Bills void propertyUnknown(crow::Response& res, const std::string& arg1); 709f12894f8SJason M. Bills 710f12894f8SJason M. Bills /** 711f4c4dcf4SKowalski, Kamil * @brief Formats NoValidSession message into JSON 712f4c4dcf4SKowalski, Kamil * Message body: "There is no valid session established with the 713f4c4dcf4SKowalski, Kamil * implementation." 714f4c4dcf4SKowalski, Kamil * 715f4c4dcf4SKowalski, Kamil * 716f4c4dcf4SKowalski, Kamil * @returns Message NoValidSession formatted to JSON */ 71765176d39SEd Tanous nlohmann::json noValidSession(); 718b5c07418SJames Feist 719f12894f8SJason M. Bills void noValidSession(crow::Response& res); 720f4c4dcf4SKowalski, Kamil 721f4c4dcf4SKowalski, Kamil /** 722f4c4dcf4SKowalski, Kamil * @brief Formats InvalidObject message into JSON 72366ac2b8cSJason M. Bills * Message body: "The object at <arg1> is invalid." 724f4c4dcf4SKowalski, Kamil * 725f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 726f4c4dcf4SKowalski, Kamil * 727f4c4dcf4SKowalski, Kamil * @returns Message InvalidObject formatted to JSON */ 728b5c07418SJames Feist nlohmann::json invalidObject(const std::string& arg1); 729b5c07418SJames Feist 730f12894f8SJason M. Bills void invalidObject(crow::Response& res, const std::string& arg1); 731f4c4dcf4SKowalski, Kamil 732f4c4dcf4SKowalski, Kamil /** 733f4c4dcf4SKowalski, Kamil * @brief Formats ResourceInStandby message into JSON 734f4c4dcf4SKowalski, Kamil * Message body: "The request could not be performed because the resource is in 735f4c4dcf4SKowalski, Kamil * standby." 736f4c4dcf4SKowalski, Kamil * 737f4c4dcf4SKowalski, Kamil * 738f4c4dcf4SKowalski, Kamil * @returns Message ResourceInStandby formatted to JSON */ 73965176d39SEd Tanous nlohmann::json resourceInStandby(); 740b5c07418SJames Feist 741f12894f8SJason M. Bills void resourceInStandby(crow::Response& res); 742f4c4dcf4SKowalski, Kamil 743f4c4dcf4SKowalski, Kamil /** 744f4c4dcf4SKowalski, Kamil * @brief Formats ActionParameterValueTypeError message into JSON 74566ac2b8cSJason M. Bills * Message body: "The value <arg1> for the parameter <arg2> in the action <arg3> 746f4c4dcf4SKowalski, Kamil * is of a different type than the parameter can accept." 747f4c4dcf4SKowalski, Kamil * 748f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 749f4c4dcf4SKowalski, Kamil * @param[in] arg2 Parameter of message that will replace %2 in its body. 750f4c4dcf4SKowalski, Kamil * @param[in] arg3 Parameter of message that will replace %3 in its body. 751f4c4dcf4SKowalski, Kamil * 752f4c4dcf4SKowalski, Kamil * @returns Message ActionParameterValueTypeError formatted to JSON */ 753b5c07418SJames Feist nlohmann::json actionParameterValueTypeError(const std::string& arg1, 754b5c07418SJames Feist const std::string& arg2, 755b5c07418SJames Feist const std::string& arg3); 756b5c07418SJames Feist 757f12894f8SJason M. Bills void actionParameterValueTypeError(crow::Response& res, const std::string& arg1, 758f4c4dcf4SKowalski, Kamil const std::string& arg2, 759f4c4dcf4SKowalski, Kamil const std::string& arg3); 760f4c4dcf4SKowalski, Kamil 761f4c4dcf4SKowalski, Kamil /** 762f4c4dcf4SKowalski, Kamil * @brief Formats SessionLimitExceeded message into JSON 763f4c4dcf4SKowalski, Kamil * Message body: "The session establishment failed due to the number of 764f4c4dcf4SKowalski, Kamil * simultaneous sessions exceeding the limit of the implementation." 765f4c4dcf4SKowalski, Kamil * 766f4c4dcf4SKowalski, Kamil * 767f4c4dcf4SKowalski, Kamil * @returns Message SessionLimitExceeded formatted to JSON */ 76865176d39SEd Tanous nlohmann::json sessionLimitExceeded(); 769b5c07418SJames Feist 770f12894f8SJason M. Bills void sessionLimitExceeded(crow::Response& res); 771f4c4dcf4SKowalski, Kamil 772f4c4dcf4SKowalski, Kamil /** 773f4c4dcf4SKowalski, Kamil * @brief Formats ActionNotSupported message into JSON 77466ac2b8cSJason M. Bills * Message body: "The action <arg1> is not supported by the resource." 775f4c4dcf4SKowalski, Kamil * 776f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 777f4c4dcf4SKowalski, Kamil * 778f4c4dcf4SKowalski, Kamil * @returns Message ActionNotSupported formatted to JSON */ 779b5c07418SJames Feist nlohmann::json actionNotSupported(const std::string& arg1); 780b5c07418SJames Feist 781f12894f8SJason M. Bills void actionNotSupported(crow::Response& res, const std::string& arg1); 782f4c4dcf4SKowalski, Kamil 783f4c4dcf4SKowalski, Kamil /** 784f4c4dcf4SKowalski, Kamil * @brief Formats InvalidIndex message into JSON 78566ac2b8cSJason M. Bills * Message body: "The index <arg1> is not a valid offset into the array." 786f4c4dcf4SKowalski, Kamil * 787f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 788f4c4dcf4SKowalski, Kamil * 789f4c4dcf4SKowalski, Kamil * @returns Message InvalidIndex formatted to JSON */ 7905187e09bSJosh Lehan nlohmann::json invalidIndex(int64_t arg1); 791b5c07418SJames Feist 7925187e09bSJosh Lehan void invalidIndex(crow::Response& res, int64_t arg1); 793f4c4dcf4SKowalski, Kamil 794f4c4dcf4SKowalski, Kamil /** 795f4c4dcf4SKowalski, Kamil * @brief Formats EmptyJSON message into JSON 796f4c4dcf4SKowalski, Kamil * Message body: "The request body submitted contained an empty JSON object and 797f4c4dcf4SKowalski, Kamil * the service is unable to process it." 798f4c4dcf4SKowalski, Kamil * 799f4c4dcf4SKowalski, Kamil * 800f4c4dcf4SKowalski, Kamil * @returns Message EmptyJSON formatted to JSON */ 80165176d39SEd Tanous nlohmann::json emptyJSON(); 802b5c07418SJames Feist 803f12894f8SJason M. Bills void emptyJSON(crow::Response& res); 804f4c4dcf4SKowalski, Kamil 805f4c4dcf4SKowalski, Kamil /** 806f4c4dcf4SKowalski, Kamil * @brief Formats QueryNotSupportedOnResource message into JSON 807f4c4dcf4SKowalski, Kamil * Message body: "Querying is not supported on the requested resource." 808f4c4dcf4SKowalski, Kamil * 809f4c4dcf4SKowalski, Kamil * 810f4c4dcf4SKowalski, Kamil * @returns Message QueryNotSupportedOnResource formatted to JSON */ 81165176d39SEd Tanous nlohmann::json queryNotSupportedOnResource(); 812b5c07418SJames Feist 813f12894f8SJason M. Bills void queryNotSupportedOnResource(crow::Response& res); 814f4c4dcf4SKowalski, Kamil 815f4c4dcf4SKowalski, Kamil /** 816684bb4b8SJason M. Bills * @brief Formats QueryNotSupportedOnOperation message into JSON 817684bb4b8SJason M. Bills * Message body: "Querying is not supported with the requested operation." 818684bb4b8SJason M. Bills * 819684bb4b8SJason M. Bills * 820684bb4b8SJason M. Bills * @returns Message QueryNotSupportedOnOperation formatted to JSON */ 82165176d39SEd Tanous nlohmann::json queryNotSupportedOnOperation(); 822684bb4b8SJason M. Bills 823684bb4b8SJason M. Bills void queryNotSupportedOnOperation(crow::Response& res); 824684bb4b8SJason M. Bills 825684bb4b8SJason M. Bills /** 826684bb4b8SJason M. Bills * @brief Formats QueryCombinationInvalid message into JSON 827684bb4b8SJason M. Bills * Message body: "Two or more query parameters in the request cannot be used 828684bb4b8SJason M. Bills * together." 829684bb4b8SJason M. Bills * 830684bb4b8SJason M. Bills * 831684bb4b8SJason M. Bills * @returns Message QueryCombinationInvalid formatted to JSON */ 83265176d39SEd Tanous nlohmann::json queryCombinationInvalid(); 833684bb4b8SJason M. Bills 834684bb4b8SJason M. Bills void queryCombinationInvalid(crow::Response& res); 835684bb4b8SJason M. Bills 836684bb4b8SJason M. Bills /** 837f4c4dcf4SKowalski, Kamil * @brief Formats InsufficientPrivilege message into JSON 838f4c4dcf4SKowalski, Kamil * Message body: "There are insufficient privileges for the account or 839f4c4dcf4SKowalski, Kamil * credentials associated with the current session to perform the requested 840f4c4dcf4SKowalski, Kamil * operation." 841f4c4dcf4SKowalski, Kamil * 842f4c4dcf4SKowalski, Kamil * 843f4c4dcf4SKowalski, Kamil * @returns Message InsufficientPrivilege formatted to JSON */ 84465176d39SEd Tanous nlohmann::json insufficientPrivilege(); 845b5c07418SJames Feist 846f12894f8SJason M. Bills void insufficientPrivilege(crow::Response& res); 847f4c4dcf4SKowalski, Kamil 848f4c4dcf4SKowalski, Kamil /** 849f4c4dcf4SKowalski, Kamil * @brief Formats PropertyValueModified message into JSON 85066ac2b8cSJason M. Bills * Message body: "The property <arg1> was assigned the value <arg2> due to 851f4c4dcf4SKowalski, Kamil * modification by the service." 852f4c4dcf4SKowalski, Kamil * 853f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 854f4c4dcf4SKowalski, Kamil * @param[in] arg2 Parameter of message that will replace %2 in its body. 855f4c4dcf4SKowalski, Kamil * 856f4c4dcf4SKowalski, Kamil * @returns Message PropertyValueModified formatted to JSON */ 857b5c07418SJames Feist nlohmann::json propertyValueModified(const std::string& arg1, 858b5c07418SJames Feist const std::string& arg2); 859b5c07418SJames Feist 860f12894f8SJason M. Bills void propertyValueModified(crow::Response& res, const std::string& arg1, 861f4c4dcf4SKowalski, Kamil const std::string& arg2); 862f4c4dcf4SKowalski, Kamil 863f4c4dcf4SKowalski, Kamil /** 864f4c4dcf4SKowalski, Kamil * @brief Formats AccountNotModified message into JSON 865f4c4dcf4SKowalski, Kamil * Message body: "The account modification request failed." 866f4c4dcf4SKowalski, Kamil * 867f4c4dcf4SKowalski, Kamil * 868f4c4dcf4SKowalski, Kamil * @returns Message AccountNotModified formatted to JSON */ 86965176d39SEd Tanous nlohmann::json accountNotModified(); 870b5c07418SJames Feist 871f12894f8SJason M. Bills void accountNotModified(crow::Response& res); 872f4c4dcf4SKowalski, Kamil 873f4c4dcf4SKowalski, Kamil /** 874f4c4dcf4SKowalski, Kamil * @brief Formats QueryParameterValueFormatError message into JSON 87566ac2b8cSJason M. Bills * Message body: "The value <arg1> for the parameter <arg2> is of a different 876f4c4dcf4SKowalski, Kamil * format than the parameter can accept." 877f4c4dcf4SKowalski, Kamil * 878f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 879f4c4dcf4SKowalski, Kamil * @param[in] arg2 Parameter of message that will replace %2 in its body. 880f4c4dcf4SKowalski, Kamil * 881f4c4dcf4SKowalski, Kamil * @returns Message QueryParameterValueFormatError formatted to JSON */ 882b5c07418SJames Feist 883b5c07418SJames Feist nlohmann::json queryParameterValueFormatError(const std::string& arg1, 884b5c07418SJames Feist const std::string& arg2); 885b5c07418SJames Feist 886f12894f8SJason M. Bills void queryParameterValueFormatError(crow::Response& res, 887f12894f8SJason M. Bills const std::string& arg1, 888f4c4dcf4SKowalski, Kamil const std::string& arg2); 889f4c4dcf4SKowalski, Kamil 890f4c4dcf4SKowalski, Kamil /** 891f4c4dcf4SKowalski, Kamil * @brief Formats PropertyMissing message into JSON 89266ac2b8cSJason M. Bills * Message body: "The property <arg1> is a required property and must be 893f4c4dcf4SKowalski, Kamil * included in the request." 894f4c4dcf4SKowalski, Kamil * 895f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 896f4c4dcf4SKowalski, Kamil * 897f4c4dcf4SKowalski, Kamil * @returns Message PropertyMissing formatted to JSON */ 898b5c07418SJames Feist nlohmann::json propertyMissing(const std::string& arg1); 899b5c07418SJames Feist 900f12894f8SJason M. Bills void propertyMissing(crow::Response& res, const std::string& arg1); 901f12894f8SJason M. Bills 902f12894f8SJason M. Bills /** 903f4c4dcf4SKowalski, Kamil * @brief Formats ResourceExhaustion message into JSON 90466ac2b8cSJason M. Bills * Message body: "The resource <arg1> was unable to satisfy the request due to 905f4c4dcf4SKowalski, Kamil * unavailability of resources." 906f4c4dcf4SKowalski, Kamil * 907f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 908f4c4dcf4SKowalski, Kamil * 909f4c4dcf4SKowalski, Kamil * @returns Message ResourceExhaustion formatted to JSON */ 910b5c07418SJames Feist nlohmann::json resourceExhaustion(const std::string& arg1); 911b5c07418SJames Feist 912f12894f8SJason M. Bills void resourceExhaustion(crow::Response& res, const std::string& arg1); 913f4c4dcf4SKowalski, Kamil 914f4c4dcf4SKowalski, Kamil /** 915f4c4dcf4SKowalski, Kamil * @brief Formats AccountModified message into JSON 916f4c4dcf4SKowalski, Kamil * Message body: "The account was successfully modified." 917f4c4dcf4SKowalski, Kamil * 918f4c4dcf4SKowalski, Kamil * 919f4c4dcf4SKowalski, Kamil * @returns Message AccountModified formatted to JSON */ 92065176d39SEd Tanous nlohmann::json accountModified(); 921b5c07418SJames Feist 922a08b46ccSJason M. Bills void accountModified(crow::Response& res); 923f4c4dcf4SKowalski, Kamil 924f4c4dcf4SKowalski, Kamil /** 925f4c4dcf4SKowalski, Kamil * @brief Formats QueryParameterOutOfRange message into JSON 92666ac2b8cSJason M. Bills * Message body: "The value <arg1> for the query parameter <arg2> is out of 92766ac2b8cSJason M. Bills * range <arg3>." 928f4c4dcf4SKowalski, Kamil * 929f4c4dcf4SKowalski, Kamil * @param[in] arg1 Parameter of message that will replace %1 in its body. 930f4c4dcf4SKowalski, Kamil * @param[in] arg2 Parameter of message that will replace %2 in its body. 931f4c4dcf4SKowalski, Kamil * @param[in] arg3 Parameter of message that will replace %3 in its body. 932f4c4dcf4SKowalski, Kamil * 933f4c4dcf4SKowalski, Kamil * @returns Message QueryParameterOutOfRange formatted to JSON */ 934b5c07418SJames Feist nlohmann::json queryParameterOutOfRange(const std::string& arg1, 935b5c07418SJames Feist const std::string& arg2, 936b5c07418SJames Feist const std::string& arg3); 937b5c07418SJames Feist 938f12894f8SJason M. Bills void queryParameterOutOfRange(crow::Response& res, const std::string& arg1, 939f12894f8SJason M. Bills const std::string& arg2, const std::string& arg3); 940f4c4dcf4SKowalski, Kamil 9413bf4e632SJoseph Reynolds /** 9423bf4e632SJoseph Reynolds * @brief Formats PasswordChangeRequired message into JSON 9433bf4e632SJoseph Reynolds * Message body: The password provided for this account must be changed 9443bf4e632SJoseph Reynolds * before access is granted. PATCH the 'Password' property for this 9453bf4e632SJoseph Reynolds * account located at the target URI '%1' to complete this process. 9463bf4e632SJoseph Reynolds * 9473bf4e632SJoseph Reynolds * @param[in] arg1 Parameter of message that will replace %1 in its body. 9483bf4e632SJoseph Reynolds * 9493bf4e632SJoseph Reynolds * @returns Message PasswordChangeRequired formatted to JSON */ 9503bf4e632SJoseph Reynolds void passwordChangeRequired(crow::Response& res, const std::string& arg1); 9513bf4e632SJoseph Reynolds 9524cde5d90SJames Feist /** 9534cde5d90SJames Feist * @brief Formats InvalidUpload message into JSON 9544cde5d90SJames Feist * Message body: Invalid file uploaded to %1: %2.* 9554cde5d90SJames Feist * @param[in] arg1 Parameter of message that will replace %1 in its body. 9564cde5d90SJames Feist * @param[in] arg2 Parameter of message that will replace %2 in its body. 9574cde5d90SJames Feist * 9584cde5d90SJames Feist * @returns Message InvalidUpload formatted to JSON */ 9594cde5d90SJames Feist nlohmann::json invalidUpload(const std::string& arg1, const std::string& arg2); 9604cde5d90SJames Feist 9614cde5d90SJames Feist void invalidUpload(crow::Response& res, const std::string& arg1, 9624cde5d90SJames Feist const std::string& arg2); 9634cde5d90SJames Feist 964dd28ba82SAppaRao Puli /** 965dd28ba82SAppaRao Puli * @brief Formats MutualExclusiveProperties message into JSON 966dd28ba82SAppaRao Puli * Message body: "The properties <arg1> and <arg2> are mutually exclusive." 967dd28ba82SAppaRao Puli * 968dd28ba82SAppaRao Puli * @param[in] arg1 Parameter of message that will replace %1 in its body. 969dd28ba82SAppaRao Puli * @param[in] arg2 Parameter of message that will replace %2 in its body. 970dd28ba82SAppaRao Puli * 971dd28ba82SAppaRao Puli * @returns Message MutualExclusiveProperties formatted to JSON */ 972dd28ba82SAppaRao Puli nlohmann::json mutualExclusiveProperties(const std::string& arg1, 973dd28ba82SAppaRao Puli const std::string& arg2); 974dd28ba82SAppaRao Puli 975dd28ba82SAppaRao Puli void mutualExclusiveProperties(crow::Response& res, const std::string& arg1, 976dd28ba82SAppaRao Puli const std::string& arg2); 977dd28ba82SAppaRao Puli 978f4c4dcf4SKowalski, Kamil } // namespace messages 979f4c4dcf4SKowalski, Kamil 980f4c4dcf4SKowalski, Kamil } // namespace redfish 981