Parse number types from the base registry
Rather than maintaining a list of arguments that are numbers (which is
error prone), update the script to just trust that the few parameters
labeled in Redfish as numbers should in fact show up in the API as
numbers.
Functionally this changes the APIs for only a few error messages, only
one of which (StringValueTooShort) is used and that usage was added
recently.
Tested: SRV passes.
Change-Id: I580523ecc0263688738bcb7f7925913e40e2a113
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/redfish-core/src/resource_messages.cpp b/redfish-core/src/resource_messages.cpp
index 74d8bd0..67fa51c 100644
--- a/redfish-core/src/resource_messages.cpp
+++ b/redfish-core/src/resource_messages.cpp
@@ -113,11 +113,12 @@
* @endinternal
*/
nlohmann::json::object_t resourceErrorThresholdExceeded(std::string_view arg1,
- std::string_view arg2)
+ uint64_t arg2)
{
+ std::string arg2Str = std::to_string(arg2);
return getLog(redfish::registries::ResourceEvent::Index::
resourceErrorThresholdExceeded,
- std::to_array({arg1, arg2}));
+ std::to_array<std::string_view>({arg1, arg2Str}));
}
/**
@@ -128,11 +129,12 @@
* @endinternal
*/
nlohmann::json::object_t resourceErrorThresholdCleared(std::string_view arg1,
- std::string_view arg2)
+ uint64_t arg2)
{
+ std::string arg2Str = std::to_string(arg2);
return getLog(redfish::registries::ResourceEvent::Index::
resourceErrorThresholdCleared,
- std::to_array({arg1, arg2}));
+ std::to_array<std::string_view>({arg1, arg2Str}));
}
/**
@@ -143,11 +145,12 @@
* @endinternal
*/
nlohmann::json::object_t resourceWarningThresholdExceeded(std::string_view arg1,
- std::string_view arg2)
+ uint64_t arg2)
{
+ std::string arg2Str = std::to_string(arg2);
return getLog(redfish::registries::ResourceEvent::Index::
resourceWarningThresholdExceeded,
- std::to_array({arg1, arg2}));
+ std::to_array<std::string_view>({arg1, arg2Str}));
}
/**
@@ -158,11 +161,12 @@
* @endinternal
*/
nlohmann::json::object_t resourceWarningThresholdCleared(std::string_view arg1,
- std::string_view arg2)
+ uint64_t arg2)
{
+ std::string arg2Str = std::to_string(arg2);
return getLog(redfish::registries::ResourceEvent::Index::
resourceWarningThresholdCleared,
- std::to_array({arg1, arg2}));
+ std::to_array<std::string_view>({arg1, arg2Str}));
}
/**