diff options
author | Ed Tanous <ed.tanous@intel.com> | 2018-09-05 18:30:59 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2018-09-05 18:44:12 +0300 |
commit | 1abe55ef9844afcddcab9d862ae06118f3a2390c (patch) | |
tree | d0b5fcfd0b1cd679a8995af3eb0b6d31b368380e /redfish-core/src/error_messages.cpp | |
parent | a38b0b206300c792979b900f506b85e535f5708a (diff) | |
download | bmcweb-1abe55ef9844afcddcab9d862ae06118f3a2390c.tar.xz |
Move to clang-format-6.0
This commit moves the codebase to the lastest clang-format file from
upstream, as well as clang-format-6.0.
Change-Id: Ice8313468097c0c42317fbb9e10ddf036e8cff4c
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Diffstat (limited to 'redfish-core/src/error_messages.cpp')
-rw-r--r-- | redfish-core/src/error_messages.cpp | 1286 |
1 files changed, 683 insertions, 603 deletions
diff --git a/redfish-core/src/error_messages.cpp b/redfish-core/src/error_messages.cpp index 4773e3d8a7..a8077629ac 100644 --- a/redfish-core/src/error_messages.cpp +++ b/redfish-core/src/error_messages.cpp @@ -13,78 +13,93 @@ // See the License for the specific language governing permissions and // limitations under the License. */ -#include <error_messages.hpp> #include <crow/logging.h> -namespace redfish { +#include <error_messages.hpp> -namespace messages { +namespace redfish +{ -void addMessageToErrorJson(nlohmann::json& target, - const nlohmann::json& message) { - auto& error = target["error"]; - - // If this is the first error message, fill in the information from the first - // error message to the top level struct - if (!error.is_object()) { - auto message_id_iterator = message.find("MessageId"); - if (message_id_iterator == message.end()) { - BMCWEB_LOG_CRITICAL << "Attempt to add error message without MessageId"; - return; - } +namespace messages +{ - auto message_field_iterator = message.find("Message"); - if (message_field_iterator == message.end()) { - BMCWEB_LOG_CRITICAL << "Attempt to add error message without Message"; - return; - } - // clang-format off +void addMessageToErrorJson(nlohmann::json& target, + const nlohmann::json& message) +{ + auto& error = target["error"]; + + // If this is the first error message, fill in the information from the + // first error message to the top level struct + if (!error.is_object()) + { + auto message_id_iterator = message.find("MessageId"); + if (message_id_iterator == message.end()) + { + BMCWEB_LOG_CRITICAL + << "Attempt to add error message without MessageId"; + return; + } + + auto message_field_iterator = message.find("Message"); + if (message_field_iterator == message.end()) + { + BMCWEB_LOG_CRITICAL + << "Attempt to add error message without Message"; + return; + } + // clang-format off error = { {"code", *message_id_iterator}, {"message", *message_field_iterator} }; - // clang-format on - } else { - // More than 1 error occurred, so the message has to be generic - error["code"] = std::string(messageVersionPrefix) + "GeneralError"; - error["message"] = - "A general error has occurred. See ExtendedInfo for more" - "information."; - } - - // This check could technically be done in in the default construction - // branch above, but because we need the pointer to the extended info field - // anyway, it's more efficient to do it here. - auto& extended_info = error[messages::messageAnnotation]; - if (!extended_info.is_array()) { - extended_info = nlohmann::json::array(); - } - - extended_info.push_back(message); + // clang-format on + } + else + { + // More than 1 error occurred, so the message has to be generic + error["code"] = std::string(messageVersionPrefix) + "GeneralError"; + error["message"] = + "A general error has occurred. See ExtendedInfo for more" + "information."; + } + + // This check could technically be done in in the default construction + // branch above, but because we need the pointer to the extended info field + // anyway, it's more efficient to do it here. + auto& extended_info = error[messages::messageAnnotation]; + if (!extended_info.is_array()) + { + extended_info = nlohmann::json::array(); + } + + extended_info.push_back(message); } -void addMessageToJsonRoot(nlohmann::json& target, - const nlohmann::json& message) { - if (!target[messages::messageAnnotation].is_array()) { - // Force object to be an array - target[messages::messageAnnotation] = nlohmann::json::array(); - } +void addMessageToJsonRoot(nlohmann::json& target, const nlohmann::json& message) +{ + if (!target[messages::messageAnnotation].is_array()) + { + // Force object to be an array + target[messages::messageAnnotation] = nlohmann::json::array(); + } - target[messages::messageAnnotation].push_back(message); + target[messages::messageAnnotation].push_back(message); } void addMessageToJson(nlohmann::json& target, const nlohmann::json& message, - const std::string& fieldPath) { - nlohmann::json_pointer<nlohmann::json> extendedInfo( - fieldPath + messages::messageAnnotation); - - if (!target[extendedInfo].is_array()) { - // Force object to be an array - target[extendedInfo] = nlohmann::json::array(); - } + const std::string& fieldPath) +{ + nlohmann::json_pointer<nlohmann::json> extendedInfo( + fieldPath + messages::messageAnnotation); + + if (!target[extendedInfo].is_array()) + { + // Force object to be an array + target[extendedInfo] = nlohmann::json::array(); + } - // Object exists and it is an array so we can just push in the message - target[extendedInfo].push_back(message); + // Object exists and it is an array so we can just push in the message + target[extendedInfo].push_back(message); } /********************************* @@ -98,17 +113,18 @@ void addMessageToJson(nlohmann::json& target, const nlohmann::json& message, * See header file for more information * @endinternal */ -nlohmann::json resourceInUse() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.ResourceInUse"}, - {"Message", - "The change to the requested resource failed because the resource is in " - "use or in transition."}, - {"Severity", "Warning"}, - {"Resolution", - "Remove the condition and resubmit the request if the operation " - "failed."}}; +nlohmann::json resourceInUse() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.ResourceInUse"}, + {"Message", "The change to the requested resource failed because the " + "resource is in " + "use or in transition."}, + {"Severity", "Warning"}, + {"Resolution", + "Remove the condition and resubmit the request if the operation " + "failed."}}; } /** @@ -118,16 +134,17 @@ nlohmann::json resourceInUse() { * See header file for more information * @endinternal */ -nlohmann::json malformedJSON() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.MalformedJSON"}, - {"Message", - "The request body submitted was malformed JSON and could not be parsed " - "by the receiving service."}, - {"Severity", "Critical"}, - {"Resolution", - "Ensure that the request body is valid JSON and resubmit the request."}}; +nlohmann::json malformedJSON() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.MalformedJSON"}, + {"Message", "The request body submitted was malformed JSON and could " + "not be parsed " + "by the receiving service."}, + {"Severity", "Critical"}, + {"Resolution", "Ensure that the request body is valid JSON and " + "resubmit the request."}}; } /** @@ -137,15 +154,16 @@ nlohmann::json malformedJSON() { * See header file for more information * @endinternal */ -nlohmann::json resourceMissingAtURI(const std::string& arg1) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.ResourceMissingAtURI"}, - {"Message", "The resource at the URI " + arg1 + " was not found."}, - {"Severity", "Critical"}, - {"Resolution", - "Place a valid resource at the URI or correct the URI and resubmit the " - "request."}}; +nlohmann::json resourceMissingAtURI(const std::string& arg1) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.ResourceMissingAtURI"}, + {"Message", "The resource at the URI " + arg1 + " was not found."}, + {"Severity", "Critical"}, + {"Resolution", "Place a valid resource at the URI or correct the URI " + "and resubmit the " + "request."}}; } /** @@ -157,17 +175,19 @@ nlohmann::json resourceMissingAtURI(const std::string& arg1) { */ nlohmann::json actionParameterValueFormatError(const std::string& arg1, const std::string& arg2, - const std::string& arg3) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.ActionParameterValueFormatError"}, - {"Message", - "The value " + arg1 + " for the parameter " + arg2 + " in the action " + - arg3 + " is of a different format than the parameter can accept."}, - {"Severity", "Warning"}, - {"Resolution", - "Correct the value for the parameter in the request body and resubmit " - "the request if the operation failed."}}; + const std::string& arg3) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.ActionParameterValueFormatError"}, + {"Message", + "The value " + arg1 + " for the parameter " + arg2 + + " in the action " + arg3 + + " is of a different format than the parameter can accept."}, + {"Severity", "Warning"}, + {"Resolution", + "Correct the value for the parameter in the request body and resubmit " + "the request if the operation failed."}}; } /** @@ -177,17 +197,18 @@ nlohmann::json actionParameterValueFormatError(const std::string& arg1, * See header file for more information * @endinternal */ -nlohmann::json internalError() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.InternalError"}, - {"Message", - "The request failed due to an internal service error. The service is " - "still operational."}, - {"Severity", "Critical"}, - {"Resolution", - "Resubmit the request. If the problem persists, consider resetting the " - "service."}}; +nlohmann::json internalError() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.InternalError"}, + {"Message", + "The request failed due to an internal service error. The service is " + "still operational."}, + {"Severity", "Critical"}, + {"Resolution", "Resubmit the request. If the problem persists, " + "consider resetting the " + "service."}}; } /** @@ -197,16 +218,17 @@ nlohmann::json internalError() { * See header file for more information * @endinternal */ -nlohmann::json unrecognizedRequestBody() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.UnrecognizedRequestBody"}, - {"Message", - "The service detected a malformed request body that it was unable to " - "interpret."}, - {"Severity", "Warning"}, - {"Resolution", - "Correct the request body and resubmit the request if it failed."}}; +nlohmann::json unrecognizedRequestBody() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.UnrecognizedRequestBody"}, + {"Message", + "The service detected a malformed request body that it was unable to " + "interpret."}, + {"Severity", "Warning"}, + {"Resolution", + "Correct the request body and resubmit the request if it failed."}}; } /** @@ -217,17 +239,18 @@ nlohmann::json unrecognizedRequestBody() { * @endinternal */ nlohmann::json resourceAtUriUnauthorized(const std::string& arg1, - const std::string& arg2) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.ResourceAtUriUnauthorized"}, - {"Message", "While accessing the resource at " + arg1 + - ", the service received an authorization error " + arg2 + - "."}, - {"Severity", "Critical"}, - {"Resolution", - "Ensure that the appropriate access is provided for the service in " - "order for it to access the URI."}}; + const std::string& arg2) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.ResourceAtUriUnauthorized"}, + {"Message", "While accessing the resource at " + arg1 + + ", the service received an authorization error " + + arg2 + "."}, + {"Severity", "Critical"}, + {"Resolution", + "Ensure that the appropriate access is provided for the service in " + "order for it to access the URI."}}; } /** @@ -238,17 +261,18 @@ nlohmann::json resourceAtUriUnauthorized(const std::string& arg1, * @endinternal */ nlohmann::json actionParameterUnknown(const std::string& arg1, - const std::string& arg2) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.ActionParameterUnknown"}, - {"Message", "The action " + arg1 + - " was submitted with the invalid parameter " + arg2 + - "."}, - {"Severity", "Warning"}, - {"Resolution", - "Correct the invalid parameter and resubmit the request if the " - "operation failed."}}; + const std::string& arg2) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.ActionParameterUnknown"}, + {"Message", "The action " + arg1 + + " was submitted with the invalid parameter " + arg2 + + "."}, + {"Severity", "Warning"}, + {"Resolution", + "Correct the invalid parameter and resubmit the request if the " + "operation failed."}}; } /** @@ -258,15 +282,16 @@ nlohmann::json actionParameterUnknown(const std::string& arg1, * See header file for more information * @endinternal */ -nlohmann::json resourceCannotBeDeleted() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.ResourceCannotBeDeleted"}, - {"Message", - "The delete request failed because the resource requested cannot be " - "deleted."}, - {"Severity", "Critical"}, - {"Resolution", "Do not attempt to delete a non-deletable resource."}}; +nlohmann::json resourceCannotBeDeleted() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.ResourceCannotBeDeleted"}, + {"Message", + "The delete request failed because the resource requested cannot be " + "deleted."}, + {"Severity", "Critical"}, + {"Resolution", "Do not attempt to delete a non-deletable resource."}}; } /** @@ -276,15 +301,16 @@ nlohmann::json resourceCannotBeDeleted() { * See header file for more information * @endinternal */ -nlohmann::json propertyDuplicate(const std::string& arg1) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.PropertyDuplicate"}, - {"Message", "The property " + arg1 + " was duplicated in the request."}, - {"Severity", "Warning"}, - {"Resolution", - "Remove the duplicate property from the request body and resubmit the " - "request if the operation failed."}}; +nlohmann::json propertyDuplicate(const std::string& arg1) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.PropertyDuplicate"}, + {"Message", "The property " + arg1 + " was duplicated in the request."}, + {"Severity", "Warning"}, + {"Resolution", + "Remove the duplicate property from the request body and resubmit the " + "request if the operation failed."}}; } /** @@ -294,15 +320,16 @@ nlohmann::json propertyDuplicate(const std::string& arg1) { * See header file for more information * @endinternal */ -nlohmann::json serviceTemporarilyUnavailable(const std::string& arg1) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.ServiceTemporarilyUnavailable"}, - {"Message", "The service is temporarily unavailable. Retry in " + arg1 + - " seconds."}, - {"Severity", "Critical"}, - {"Resolution", - "Wait for the indicated retry duration and retry the operation."}}; +nlohmann::json serviceTemporarilyUnavailable(const std::string& arg1) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.ServiceTemporarilyUnavailable"}, + {"Message", "The service is temporarily unavailable. Retry in " + + arg1 + " seconds."}, + {"Severity", "Critical"}, + {"Resolution", + "Wait for the indicated retry duration and retry the operation."}}; } /** @@ -314,17 +341,18 @@ nlohmann::json serviceTemporarilyUnavailable(const std::string& arg1) { */ nlohmann::json resourceAlreadyExists(const std::string& arg1, const std::string& arg2, - const std::string& arg3) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.ResourceAlreadyExists"}, - {"Message", "The requested resource of type " + arg1 + - " with the property " + arg2 + " with the value " + arg3 + - " already exists."}, - {"Severity", "Critical"}, - {"Resolution", - "Do not repeat the create operation as the resource has already been " - "created."}}; + const std::string& arg3) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.ResourceAlreadyExists"}, + {"Message", "The requested resource of type " + arg1 + + " with the property " + arg2 + " with the value " + + arg3 + " already exists."}, + {"Severity", "Critical"}, + {"Resolution", + "Do not repeat the create operation as the resource has already been " + "created."}}; } /** @@ -334,15 +362,16 @@ nlohmann::json resourceAlreadyExists(const std::string& arg1, * See header file for more information * @endinternal */ -nlohmann::json accountForSessionNoLongerExists() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.AccountForSessionNoLongerExists"}, - {"Message", - "The account for the current session has been removed, thus the current " - "session has been removed as well."}, - {"Severity", "OK"}, - {"Resolution", "Attempt to connect with a valid account."}}; +nlohmann::json accountForSessionNoLongerExists() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.AccountForSessionNoLongerExists"}, + {"Message", "The account for the current session has been removed, " + "thus the current " + "session has been removed as well."}, + {"Severity", "OK"}, + {"Resolution", "Attempt to connect with a valid account."}}; } /** @@ -352,16 +381,18 @@ nlohmann::json accountForSessionNoLongerExists() { * See header file for more information * @endinternal */ -nlohmann::json createFailedMissingReqProperties(const std::string& arg1) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.CreateFailedMissingReqProperties"}, - {"Message", "The create operation failed because the required property " + - arg1 + " was missing from the request."}, - {"Severity", "Critical"}, - {"Resolution", - "Correct the body to include the required property with a valid value " - "and resubmit the request if the operation failed."}}; +nlohmann::json createFailedMissingReqProperties(const std::string& arg1) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.CreateFailedMissingReqProperties"}, + {"Message", + "The create operation failed because the required property " + arg1 + + " was missing from the request."}, + {"Severity", "Critical"}, + {"Resolution", + "Correct the body to include the required property with a valid value " + "and resubmit the request if the operation failed."}}; } /** @@ -372,17 +403,18 @@ nlohmann::json createFailedMissingReqProperties(const std::string& arg1) { * @endinternal */ nlohmann::json propertyValueFormatError(const std::string& arg1, - const std::string& arg2) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.PropertyValueFormatError"}, - {"Message", - "The value " + arg1 + " for the property " + arg2 + - " is of a different format than the property can accept."}, - {"Severity", "Warning"}, - {"Resolution", - "Correct the value for the property in the request body and resubmit " - "the request if the operation failed."}}; + const std::string& arg2) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.PropertyValueFormatError"}, + {"Message", + "The value " + arg1 + " for the property " + arg2 + + " is of a different format than the property can accept."}, + {"Severity", "Warning"}, + {"Resolution", + "Correct the value for the property in the request body and resubmit " + "the request if the operation failed."}}; } /** @@ -393,16 +425,17 @@ nlohmann::json propertyValueFormatError(const std::string& arg1, * @endinternal */ nlohmann::json propertyValueNotInList(const std::string& arg1, - const std::string& arg2) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.PropertyValueNotInList"}, - {"Message", "The value " + arg1 + " for the property " + arg2 + - " is not in the list of acceptable values."}, - {"Severity", "Warning"}, - {"Resolution", - "Choose a value from the enumeration list that the implementation can " - "support and resubmit the request if the operation failed."}}; + const std::string& arg2) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.PropertyValueNotInList"}, + {"Message", "The value " + arg1 + " for the property " + arg2 + + " is not in the list of acceptable values."}, + {"Severity", "Warning"}, + {"Resolution", + "Choose a value from the enumeration list that the implementation can " + "support and resubmit the request if the operation failed."}}; } /** @@ -412,16 +445,17 @@ nlohmann::json propertyValueNotInList(const std::string& arg1, * See header file for more information * @endinternal */ -nlohmann::json resourceAtUriInUnknownFormat(const std::string& arg1) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.ResourceAtUriInUnknownFormat"}, - {"Message", "The resource at " + arg1 + - " is in a format not recognized by the service."}, - {"Severity", "Critical"}, - {"Resolution", - "Place an image or resource or file that is recognized by the service " - "at the URI."}}; +nlohmann::json resourceAtUriInUnknownFormat(const std::string& arg1) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.ResourceAtUriInUnknownFormat"}, + {"Message", "The resource at " + arg1 + + " is in a format not recognized by the service."}, + {"Severity", "Critical"}, + {"Resolution", + "Place an image or resource or file that is recognized by the service " + "at the URI."}}; } /** @@ -431,17 +465,18 @@ nlohmann::json resourceAtUriInUnknownFormat(const std::string& arg1) { * See header file for more information * @endinternal */ -nlohmann::json serviceInUnknownState() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.ServiceInUnknownState"}, - {"Message", - "The operation failed because the service is in an unknown state and " - "can no longer take incoming requests."}, - {"Severity", "Critical"}, - {"Resolution", - "Restart the service and resubmit the request if the operation " - "failed."}}; +nlohmann::json serviceInUnknownState() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.ServiceInUnknownState"}, + {"Message", + "The operation failed because the service is in an unknown state and " + "can no longer take incoming requests."}, + {"Severity", "Critical"}, + {"Resolution", + "Restart the service and resubmit the request if the operation " + "failed."}}; } /** @@ -451,18 +486,19 @@ nlohmann::json serviceInUnknownState() { * See header file for more information * @endinternal */ -nlohmann::json eventSubscriptionLimitExceeded() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.EventSubscriptionLimitExceeded"}, - {"Message", - "The event subscription failed due to the number of simultaneous " - "subscriptions exceeding the limit of the implementation."}, - {"Severity", "Critical"}, - {"Resolution", - "Reduce the number of other subscriptions before trying to establish " - "the event subscription or increase the limit of simultaneous " - "subscriptions (if supported)."}}; +nlohmann::json eventSubscriptionLimitExceeded() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.EventSubscriptionLimitExceeded"}, + {"Message", + "The event subscription failed due to the number of simultaneous " + "subscriptions exceeding the limit of the implementation."}, + {"Severity", "Critical"}, + {"Resolution", + "Reduce the number of other subscriptions before trying to establish " + "the event subscription or increase the limit of simultaneous " + "subscriptions (if supported)."}}; } /** @@ -473,16 +509,17 @@ nlohmann::json eventSubscriptionLimitExceeded() { * @endinternal */ nlohmann::json actionParameterMissing(const std::string& arg1, - const std::string& arg2) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.ActionParameterMissing"}, - {"Message", "The action " + arg1 + " requires the parameter " + arg2 + - " to be present in the request body."}, - {"Severity", "Critical"}, - {"Resolution", - "Supply the action with the required parameter in the request body when " - "the request is resubmitted."}}; + const std::string& arg2) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.ActionParameterMissing"}, + {"Message", "The action " + arg1 + " requires the parameter " + arg2 + + " to be present in the request body."}, + {"Severity", "Critical"}, + {"Resolution", "Supply the action with the required parameter in the " + "request body when " + "the request is resubmitted."}}; } /** @@ -492,15 +529,16 @@ nlohmann::json actionParameterMissing(const std::string& arg1, * See header file for more information * @endinternal */ -nlohmann::json stringValueTooLong(const std::string& arg1, const int& arg2) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.StringValueTooLong"}, - {"Message", "The string " + arg1 + " exceeds the length limit " + - std::to_string(arg2) + "."}, - {"Severity", "Warning"}, - {"Resolution", - "Resubmit the request with an appropriate string length."}}; +nlohmann::json stringValueTooLong(const std::string& arg1, const int& arg2) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.StringValueTooLong"}, + {"Message", "The string " + arg1 + " exceeds the length limit " + + std::to_string(arg2) + "."}, + {"Severity", "Warning"}, + {"Resolution", + "Resubmit the request with an appropriate string length."}}; } /** @@ -511,16 +549,18 @@ nlohmann::json stringValueTooLong(const std::string& arg1, const int& arg2) { * @endinternal */ nlohmann::json propertyValueTypeError(const std::string& arg1, - const std::string& arg2) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.PropertyValueTypeError"}, - {"Message", "The value " + arg1 + " for the property " + arg2 + - " is of a different type than the property can accept."}, - {"Severity", "Warning"}, - {"Resolution", - "Correct the value for the property in the request body and resubmit " - "the request if the operation failed."}}; + const std::string& arg2) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.PropertyValueTypeError"}, + {"Message", + "The value " + arg1 + " for the property " + arg2 + + " is of a different type than the property can accept."}, + {"Severity", "Warning"}, + {"Resolution", + "Correct the value for the property in the request body and resubmit " + "the request if the operation failed."}}; } /** @@ -531,15 +571,16 @@ nlohmann::json propertyValueTypeError(const std::string& arg1, * @endinternal */ nlohmann::json resourceNotFound(const std::string& arg1, - const std::string& arg2) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.ResourceNotFound"}, - {"Message", "The requested resource of type " + arg1 + " named " + arg2 + - " was not found."}, - {"Severity", "Critical"}, - {"Resolution", - "Provide a valid resource identifier and resubmit the request."}}; + const std::string& arg2) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.ResourceNotFound"}, + {"Message", "The requested resource of type " + arg1 + " named " + + arg2 + " was not found."}, + {"Severity", "Critical"}, + {"Resolution", + "Provide a valid resource identifier and resubmit the request."}}; } /** @@ -549,16 +590,18 @@ nlohmann::json resourceNotFound(const std::string& arg1, * See header file for more information * @endinternal */ -nlohmann::json couldNotEstablishConnection(const std::string& arg1) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.CouldNotEstablishConnection"}, - {"Message", "The service failed to establish a Connection with the URI " + - arg1 + "."}, - {"Severity", "Critical"}, - {"Resolution", - "Ensure that the URI contains a valid and reachable node name, protocol " - "information and other URI components."}}; +nlohmann::json couldNotEstablishConnection(const std::string& arg1) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.CouldNotEstablishConnection"}, + {"Message", + "The service failed to establish a Connection with the URI " + arg1 + + "."}, + {"Severity", "Critical"}, + {"Resolution", "Ensure that the URI contains a valid and reachable " + "node name, protocol " + "information and other URI components."}}; } /** @@ -568,17 +611,18 @@ nlohmann::json couldNotEstablishConnection(const std::string& arg1) { * See header file for more information * @endinternal */ -nlohmann::json propertyNotWritable(const std::string& arg1) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.PropertyNotWritable"}, - {"Message", - "The property " + arg1 + - " is a read only property and cannot be assigned a value."}, - {"Severity", "Warning"}, - {"Resolution", - "Remove the property from the request body and resubmit the request if " - "the operation failed."}}; +nlohmann::json propertyNotWritable(const std::string& arg1) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.PropertyNotWritable"}, + {"Message", + "The property " + arg1 + + " is a read only property and cannot be assigned a value."}, + {"Severity", "Warning"}, + {"Resolution", "Remove the property from the request body and resubmit " + "the request if " + "the operation failed."}}; } /** @@ -589,16 +633,18 @@ nlohmann::json propertyNotWritable(const std::string& arg1) { * @endinternal */ nlohmann::json queryParameterValueTypeError(const std::string& arg1, - const std::string& arg2) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.QueryParameterValueTypeError"}, - {"Message", "The value " + arg1 + " for the query parameter " + arg2 + - " is of a different type than the parameter can accept."}, - {"Severity", "Warning"}, - {"Resolution", - "Correct the value for the query parameter in the request and resubmit " - "the request if the operation failed."}}; + const std::string& arg2) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.QueryParameterValueTypeError"}, + {"Message", + "The value " + arg1 + " for the query parameter " + arg2 + + " is of a different type than the parameter can accept."}, + {"Severity", "Warning"}, + {"Resolution", "Correct the value for the query parameter in the " + "request and resubmit " + "the request if the operation failed."}}; } /** @@ -608,17 +654,18 @@ nlohmann::json queryParameterValueTypeError(const std::string& arg1, * See header file for more information * @endinternal */ -nlohmann::json serviceShuttingDown() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.ServiceShuttingDown"}, - {"Message", - "The operation failed because the service is shutting down and can no " - "longer take incoming requests."}, - {"Severity", "Critical"}, - {"Resolution", - "When the service becomes available, resubmit the request if the " - "operation failed."}}; +nlohmann::json serviceShuttingDown() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.ServiceShuttingDown"}, + {"Message", + "The operation failed because the service is shutting down and can no " + "longer take incoming requests."}, + {"Severity", "Critical"}, + {"Resolution", + "When the service becomes available, resubmit the request if the " + "operation failed."}}; } /** @@ -629,18 +676,19 @@ nlohmann::json serviceShuttingDown() { * @endinternal */ nlohmann::json actionParameterDuplicate(const std::string& arg1, - const std::string& arg2) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.ActionParameterDuplicate"}, - {"Message", - "The action " + arg1 + - " was submitted with more than one value for the parameter " + arg2 + - "."}, - {"Severity", "Warning"}, - {"Resolution", - "Resubmit the action with only one instance of the parameter in the " - "request body if the operation failed."}}; + const std::string& arg2) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.ActionParameterDuplicate"}, + {"Message", + "The action " + arg1 + + " was submitted with more than one value for the parameter " + + arg2 + "."}, + {"Severity", "Warning"}, + {"Resolution", + "Resubmit the action with only one instance of the parameter in the " + "request body if the operation failed."}}; } /** @@ -651,16 +699,17 @@ nlohmann::json actionParameterDuplicate(const std::string& arg1, * @endinternal */ nlohmann::json actionParameterNotSupported(const std::string& arg1, - const std::string& arg2) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.ActionParameterNotSupported"}, - {"Message", "The parameter " + arg1 + " for the action " + arg2 + - " is not supported on the target resource."}, - {"Severity", "Warning"}, - {"Resolution", - "Remove the parameter supplied and resubmit the request if the " - "operation failed."}}; + const std::string& arg2) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.ActionParameterNotSupported"}, + {"Message", "The parameter " + arg1 + " for the action " + arg2 + + " is not supported on the target resource."}, + {"Severity", "Warning"}, + {"Resolution", + "Remove the parameter supplied and resubmit the request if the " + "operation failed."}}; } /** @@ -671,14 +720,16 @@ nlohmann::json actionParameterNotSupported(const std::string& arg1, * @endinternal */ nlohmann::json sourceDoesNotSupportProtocol(const std::string& arg1, - const std::string& arg2) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.SourceDoesNotSupportProtocol"}, - {"Message", "The other end of the Connection at " + arg1 + - " does not support the specified protocol " + arg2 + "."}, - {"Severity", "Critical"}, - {"Resolution", "Change protocols or URIs. "}}; + const std::string& arg2) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.SourceDoesNotSupportProtocol"}, + {"Message", "The other end of the Connection at " + arg1 + + " does not support the specified protocol " + arg2 + + "."}, + {"Severity", "Critical"}, + {"Resolution", "Change protocols or URIs. "}}; } /** @@ -688,13 +739,14 @@ nlohmann::json sourceDoesNotSupportProtocol(const std::string& arg1, * See header file for more information * @endinternal */ -nlohmann::json accountRemoved() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.AccountRemoved"}, - {"Message", "The account was successfully removed."}, - {"Severity", "OK"}, - {"Resolution", "No resolution is required."}}; +nlohmann::json accountRemoved() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.AccountRemoved"}, + {"Message", "The account was successfully removed."}, + {"Severity", "OK"}, + {"Resolution", "No resolution is required."}}; } /** @@ -704,16 +756,17 @@ nlohmann::json accountRemoved() { * See header file for more information * @endinternal */ -nlohmann::json accessDenied(const std::string& arg1) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.AccessDenied"}, - {"Message", "While attempting to establish a Connection to " + arg1 + - ", the service denied access."}, - {"Severity", "Critical"}, - {"Resolution", - "Attempt to ensure that the URI is correct and that the service has the " - "appropriate credentials."}}; +nlohmann::json accessDenied(const std::string& arg1) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.AccessDenied"}, + {"Message", "While attempting to establish a Connection to " + arg1 + + ", the service denied access."}, + {"Severity", "Critical"}, + {"Resolution", "Attempt to ensure that the URI is correct and that the " + "service has the " + "appropriate credentials."}}; } /** @@ -723,15 +776,16 @@ nlohmann::json accessDenied(const std::string& arg1) { * See header file for more information * @endinternal */ -nlohmann::json queryNotSupported() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.QueryNotSupported"}, - {"Message", "Querying is not supported by the implementation."}, - {"Severity", "Warning"}, - {"Resolution", - "Remove the query parameters and resubmit the request if the operation " - "failed."}}; +nlohmann::json queryNotSupported() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.QueryNotSupported"}, + {"Message", "Querying is not supported by the implementation."}, + {"Severity", "Warning"}, + {"Resolution", "Remove the query parameters and resubmit the request " + "if the operation " + "failed."}}; } /** @@ -741,17 +795,18 @@ nlohmann::json queryNotSupported() { * See header file for more information * @endinternal */ -nlohmann::json createLimitReachedForResource() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.CreateLimitReachedForResource"}, - {"Message", - "The create operation failed because the resource has reached the limit " - "of possible resources."}, - {"Severity", "Critical"}, - {"Resolution", - "Either delete resources and resubmit the request if the operation " - "failed or do not resubmit the request."}}; +nlohmann::json createLimitReachedForResource() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.CreateLimitReachedForResource"}, + {"Message", "The create operation failed because the resource has " + "reached the limit " + "of possible resources."}, + {"Severity", "Critical"}, + {"Resolution", + "Either delete resources and resubmit the request if the operation " + "failed or do not resubmit the request."}}; } /** @@ -761,14 +816,15 @@ nlohmann::json createLimitReachedForResource() { * See header file for more information * @endinternal */ -nlohmann::json generalError() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.GeneralError"}, - {"Message", - "A general error has occurred. See ExtendedInfo for more information."}, - {"Severity", "Critical"}, - {"Resolution", "See ExtendedInfo for more information."}}; +nlohmann::json generalError() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.GeneralError"}, + {"Message", "A general error has occurred. See ExtendedInfo for more " + "information."}, + {"Severity", "Critical"}, + {"Resolution", "See ExtendedInfo for more information."}}; } /** @@ -778,13 +834,14 @@ nlohmann::json generalError() { * See header file for more information * @endinternal */ -nlohmann::json success() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.Success"}, - {"Message", "Successfully Completed Request"}, - {"Severity", "OK"}, - {"Resolution", "None"}}; +nlohmann::json success() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.Success"}, + {"Message", "Successfully Completed Request"}, + {"Severity", "OK"}, + {"Resolution", "None"}}; } /** @@ -794,13 +851,14 @@ nlohmann::json success() { * See header file for more information * @endinternal */ -nlohmann::json created() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.Created"}, - {"Message", "The resource has been created successfully"}, - {"Severity", "OK"}, - {"Resolution", "None"}}; +nlohmann::json created() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.Created"}, + {"Message", "The resource has been created successfully"}, + {"Severity", "OK"}, + {"Resolution", "None"}}; } /** @@ -810,17 +868,18 @@ nlohmann::json created() { * See header file for more information * @endinternal */ -nlohmann::json propertyUnknown(const std::string& arg1) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.PropertyUnknown"}, - {"Message", - "The property " + arg1 + - " is not in the list of valid properties for the resource."}, - {"Severity", "Warning"}, - {"Resolution", - "Remove the unknown property from the request body and resubmit the " - "request if the operation failed."}}; +nlohmann::json propertyUnknown(const std::string& arg1) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.PropertyUnknown"}, + {"Message", + "The property " + arg1 + + " is not in the list of valid properties for the resource."}, + {"Severity", "Warning"}, + {"Resolution", + "Remove the unknown property from the request body and resubmit the " + "request if the operation failed."}}; } /** @@ -830,14 +889,16 @@ nlohmann::json propertyUnknown(const std::string& arg1) { * See header file for more information * @endinternal */ -nlohmann::json noValidSession() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.NoValidSession"}, - {"Message", - "There is no valid session established with the implementation."}, - {"Severity", "Critical"}, - {"Resolution", "Establish as session before attempting any operations."}}; +nlohmann::json noValidSession() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.NoValidSession"}, + {"Message", + "There is no valid session established with the implementation."}, + {"Severity", "Critical"}, + {"Resolution", + "Establish as session before attempting any operations."}}; } /** @@ -847,15 +908,16 @@ nlohmann::json noValidSession() { * See header file for more information * @endinternal */ -nlohmann::json invalidObject(const std::string& arg1) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.InvalidObject"}, - {"Message", "The object at " + arg1 + " is invalid."}, - {"Severity", "Critical"}, - {"Resolution", - "Either the object is malformed or the URI is not correct. Correct the " - "condition and resubmit the request if it failed."}}; +nlohmann::json invalidObject(const std::string& arg1) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.InvalidObject"}, + {"Message", "The object at " + arg1 + " is invalid."}, + {"Severity", "Critical"}, + {"Resolution", "Either the object is malformed or the URI is not " + "correct. Correct the " + "condition and resubmit the request if it failed."}}; } /** @@ -865,17 +927,18 @@ nlohmann::json invalidObject(const std::string& arg1) { * See header file for more information * @endinternal */ -nlohmann::json resourceInStandby() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.ResourceInStandby"}, - {"Message", - "The request could not be performed because the resource is in " - "standby."}, - {"Severity", "Critical"}, - {"Resolution", - "Ensure that the resource is in the correct power state and resubmit " - "the request."}}; +nlohmann::json resourceInStandby() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.ResourceInStandby"}, + {"Message", + "The request could not be performed because the resource is in " + "standby."}, + {"Severity", "Critical"}, + {"Resolution", + "Ensure that the resource is in the correct power state and resubmit " + "the request."}}; } /** @@ -887,17 +950,19 @@ nlohmann::json resourceInStandby() { */ nlohmann::json actionParameterValueTypeError(const std::string& arg1, const std::string& arg2, - const std::string& arg3) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.ActionParameterValueTypeError"}, - {"Message", "The value " + arg1 + " for the parameter " + arg2 + - " in the action " + arg3 + - " is of a different type than the parameter can accept."}, - {"Severity", "Warning"}, - {"Resolution", - "Correct the value for the parameter in the request body and resubmit " - "the request if the operation failed."}}; + const std::string& arg3) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.ActionParameterValueTypeError"}, + {"Message", + "The value " + arg1 + " for the parameter " + arg2 + + " in the action " + arg3 + + " is of a different type than the parameter can accept."}, + {"Severity", "Warning"}, + {"Resolution", + "Correct the value for the parameter in the request body and resubmit " + "the request if the operation failed."}}; } /** @@ -907,18 +972,19 @@ nlohmann::json actionParameterValueTypeError(const std::string& arg1, * See header file for more information * @endinternal */ -nlohmann::json sessionLimitExceeded() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.SessionLimitExceeded"}, - {"Message", - "The session establishment failed due to the number of simultaneous " - "sessions exceeding the limit of the implementation."}, - {"Severity", "Critical"}, - {"Resolution", - "Reduce the number of other sessions before trying to establish the " - "session or increase the limit of simultaneous sessions (if " - "supported)."}}; +nlohmann::json sessionLimitExceeded() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.SessionLimitExceeded"}, + {"Message", + "The session establishment failed due to the number of simultaneous " + "sessions exceeding the limit of the implementation."}, + {"Severity", "Critical"}, + {"Resolution", + "Reduce the number of other sessions before trying to establish the " + "session or increase the limit of simultaneous sessions (if " + "supported)."}}; } /** @@ -928,16 +994,18 @@ nlohmann::json sessionLimitExceeded() { * See header file for more information * @endinternal */ -nlohmann::json actionNotSupported(const std::string& arg1) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.ActionNotSupported"}, - {"Message", "The action " + arg1 + " is not supported by the resource."}, - {"Severity", "Critical"}, - {"Resolution", - "The action supplied cannot be resubmitted to the implementation. " - "Perhaps the action was invalid, the wrong resource was the target or " - "the implementation documentation may be of assistance."}}; +nlohmann::json actionNotSupported(const std::string& arg1) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.ActionNotSupported"}, + {"Message", + "The action " + arg1 + " is not supported by the resource."}, + {"Severity", "Critical"}, + {"Resolution", + "The action supplied cannot be resubmitted to the implementation. " + "Perhaps the action was invalid, the wrong resource was the target or " + "the implementation documentation may be of assistance."}}; } /** @@ -947,15 +1015,16 @@ nlohmann::json actionNotSupported(const std::string& arg1) { * See header file for more information * @endinternal */ -nlohmann::json invalidIndex(const int& arg1) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.InvalidIndex"}, - {"Message", "The index " + std::to_string(arg1) + - " is not a valid offset into the array."}, - {"Severity", "Warning"}, - {"Resolution", - "Verify the index value provided is within the bounds of the array."}}; +nlohmann::json invalidIndex(const int& arg1) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.InvalidIndex"}, + {"Message", "The index " + std::to_string(arg1) + + " is not a valid offset into the array."}, + {"Severity", "Warning"}, + {"Resolution", + "Verify the index value provided is within the bounds of the array."}}; } /** @@ -965,16 +1034,17 @@ nlohmann::json invalidIndex(const int& arg1) { * See header file for more information * @endinternal */ -nlohmann::json emptyJSON() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.EmptyJSON"}, - {"Message", - "The request body submitted contained an empty JSON object and the " - "service is unable to process it."}, - {"Severity", "Warning"}, - {"Resolution", - "Add properties in the JSON object and resubmit the request."}}; +nlohmann::json emptyJSON() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.EmptyJSON"}, + {"Message", + "The request body submitted contained an empty JSON object and the " + "service is unable to process it."}, + {"Severity", "Warning"}, + {"Resolution", + "Add properties in the JSON object and resubmit the request."}}; } /** @@ -984,15 +1054,16 @@ nlohmann::json emptyJSON() { * See header file for more information * @endinternal */ -nlohmann::json queryNotSupportedOnResource() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.QueryNotSupportedOnResource"}, - {"Message", "Querying is not supported on the requested resource."}, - {"Severity", "Warning"}, - {"Resolution", - "Remove the query parameters and resubmit the request if the operation " - "failed."}}; +nlohmann::json queryNotSupportedOnResource() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.QueryNotSupportedOnResource"}, + {"Message", "Querying is not supported on the requested resource."}, + {"Severity", "Warning"}, + {"Resolution", "Remove the query parameters and resubmit the request " + "if the operation " + "failed."}}; } /** @@ -1002,18 +1073,19 @@ nlohmann::json queryNotSupportedOnResource() { * See header file for more information * @endinternal */ -nlohmann::json insufficientPrivilege() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.InsufficientPrivilege"}, - {"Message", - "There are insufficient privileges for the account or credentials " - "associated with the current session to perform the requested " - "operation."}, - {"Severity", "Critical"}, - {"Resolution", - "Either abandon the operation or change the associated access rights " - "and resubmit the request if the operation failed."}}; +nlohmann::json insufficientPrivilege() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.InsufficientPrivilege"}, + {"Message", + "There are insufficient privileges for the account or credentials " + "associated with the current session to perform the requested " + "operation."}, + {"Severity", "Critical"}, + {"Resolution", + "Either abandon the operation or change the associated access rights " + "and resubmit the request if the operation failed."}}; } /** @@ -1024,14 +1096,15 @@ nlohmann::json insufficientPrivilege() { * @endinternal */ nlohmann::json propertyValueModified(const std::string& arg1, - const std::string& arg2) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.PropertyValueModified"}, - {"Message", "The property " + arg1 + " was assigned the value " + arg2 + - " due to modification by the service."}, - {"Severity", "Warning"}, - {"Resolution", "No resolution is required."}}; + const std::string& arg2) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.PropertyValueModified"}, + {"Message", "The property " + arg1 + " was assigned the value " + arg2 + + " due to modification by the service."}, + {"Severity", "Warning"}, + {"Resolution", "No resolution is required."}}; } /** @@ -1041,15 +1114,16 @@ nlohmann::json propertyValueModified(const std::string& arg1, * See header file for more information * @endinternal */ -nlohmann::json accountNotModified() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.AccountNotModified"}, - {"Message", "The account modification request failed."}, - {"Severity", "Warning"}, - {"Resolution", - "The modification may have failed due to permission issues or issues " - "with the request body."}}; +nlohmann::json accountNotModified() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.AccountNotModified"}, + {"Message", "The account modification request failed."}, + {"Severity", "Warning"}, + {"Resolution", + "The modification may have failed due to permission issues or issues " + "with the request body."}}; } /** @@ -1060,17 +1134,18 @@ nlohmann::json accountNotModified() { * @endinternal */ nlohmann::json queryParameterValueFormatError(const std::string& arg1, - const std::string& arg2) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.QueryParameterValueFormatError"}, - {"Message", - "The value " + arg1 + " for the parameter " + arg2 + - " is of a different format than the parameter can accept."}, - {"Severity", "Warning"}, - {"Resolution", - "Correct the value for the query parameter in the request and resubmit " - "the request if the operation failed."}}; + const std::string& arg2) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.QueryParameterValueFormatError"}, + {"Message", + "The value " + arg1 + " for the parameter " + arg2 + + " is of a different format than the parameter can accept."}, + {"Severity", "Warning"}, + {"Resolution", "Correct the value for the query parameter in the " + "request and resubmit " + "the request if the operation failed."}}; } /** @@ -1080,17 +1155,18 @@ nlohmann::json queryParameterValueFormatError(const std::string& arg1, * See header file for more information * @endinternal */ -nlohmann::json propertyMissing(const std::string& arg1) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.PropertyMissing"}, - {"Message", - "The property " + arg1 + - " is a required property and must be included in the request."}, - {"Severity", "Warning"}, - {"Resolution", - "Ensure that the property is in the request body and has a valid value " - "and resubmit the request if the operation failed."}}; +nlohmann::json propertyMissing(const std::string& arg1) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.PropertyMissing"}, + {"Message", + "The property " + arg1 + + " is a required property and must be included in the request."}, + {"Severity", "Warning"}, + {"Resolution", "Ensure that the property is in the request body and " + "has a valid value " + "and resubmit the request if the operation failed."}}; } /** @@ -1100,17 +1176,18 @@ nlohmann::json propertyMissing(const std::string& arg1) { * See header file for more information * @endinternal */ -nlohmann::json resourceExhaustion(const std::string& arg1) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.ResourceExhaustion"}, - {"Message", "The resource " + arg1 + - " was unable to satisfy the request " - "due to unavailability of " - "resources."}, - {"Severity", "Critical"}, - {"Resolution", - "Ensure that the resources are available and resubmit the request."}}; +nlohmann::json resourceExhaustion(const std::string& arg1) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.ResourceExhaustion"}, + {"Message", "The resource " + arg1 + + " was unable to satisfy the request " + "due to unavailability of " + "resources."}, + {"Severity", "Critical"}, + {"Resolution", + "Ensure that the resources are available and resubmit the request."}}; } /** @@ -1120,13 +1197,14 @@ nlohmann::json resourceExhaustion(const std::string& arg1) { * See header file for more information * @endinternal */ -nlohmann::json accountModified() { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.AccountModified"}, - {"Message", "The account was successfully modified."}, - {"Severity", "OK"}, - {"Resolution", "No resolution is required."}}; +nlohmann::json accountModified() +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.AccountModified"}, + {"Message", "The account was successfully modified."}, + {"Severity", "OK"}, + {"Resolution", "No resolution is required."}}; } /** @@ -1138,24 +1216,26 @@ nlohmann::json accountModified() { */ nlohmann::json queryParameterOutOfRange(const std::string& arg1, const std::string& arg2, - const std::string& arg3) { - return nlohmann::json{ - {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, - {"MessageId", "Base.1.2.0.QueryParameterOutOfRange"}, - {"Message", "The value " + arg1 + " for the query parameter " + arg2 + - " is out of range " + arg3 + "."}, - {"Severity", "Warning"}, - {"Resolution", - "Reduce the value for the query parameter to a value that is within " - "range, such as a start or count value that is within bounds of the " - "number of resources in a collection or a page that is within the range " - "of valid pages."}}; + const std::string& arg3) +{ + return nlohmann::json{ + {"@odata.type", "/redfish/v1/$metadata#Message.v1_0_0.Message"}, + {"MessageId", "Base.1.2.0.QueryParameterOutOfRange"}, + {"Message", "The value " + arg1 + " for the query parameter " + arg2 + + " is out of range " + arg3 + "."}, + {"Severity", "Warning"}, + {"Resolution", + "Reduce the value for the query parameter to a value that is within " + "range, such as a start or count value that is within bounds of the " + "number of resources in a collection or a page that is within the " + "range " + "of valid pages."}}; } /********************************* * AUTOGENERATED FUNCTIONS END * *********************************/ -} // namespace messages +} // namespace messages -} // namespace redfish +} // namespace redfish |