Change message_registries namespace to registries
The message_registries namespace is overly wordy, and results in very
long defines. Doing this one minor change reduces the code by 50 lines.
This seems worthwhile.
Tested: Unit tests pass. Namespace change only.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ib1401580b3fa47596eb56cdc86e60eeeb1c2f952
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index e879f9e..0892df9 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -51,7 +51,7 @@
static constexpr const char* eventServiceFile =
"/var/lib/bmcweb/eventservice_config.json";
-namespace message_registries
+namespace registries
{
inline std::span<const MessageEntry>
getRegistryFromPrefix(const std::string& registryName)
@@ -70,7 +70,7 @@
}
return {openbmc::registry};
}
-} // namespace message_registries
+} // namespace registries
#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
static std::optional<boost::asio::posix::stream_descriptor> inotifyConn;
@@ -86,7 +86,7 @@
std::tuple<std::string, std::string, std::string, std::string, std::string,
std::vector<std::string>>;
-namespace message_registries
+namespace registries
{
static const Message*
getMsgFromRegistry(const std::string& messageKey,
@@ -123,7 +123,7 @@
// Find the right registry and check it for the MessageKey
return getMsgFromRegistry(messageKey, getRegistryFromPrefix(registryName));
}
-} // namespace message_registries
+} // namespace registries
namespace event_log
{
@@ -229,8 +229,7 @@
nlohmann::json& logEntryJson)
{
// Get the Message from the MessageRegistry
- const message_registries::Message* message =
- message_registries::formatMessage(messageID);
+ const registries::Message* message = registries::formatMessage(messageID);
std::string msg;
std::string severity;
@@ -240,7 +239,7 @@
severity = message->severity;
}
- redfish::message_registries::fillMessageArgs(messageArgs, msg);
+ redfish::registries::fillMessageArgs(messageArgs, msg);
// Get the Created time from the timestamp. The log timestamp is in
// RFC3339 format which matches the Redfish format except for the
diff --git a/redfish-core/include/registries.hpp b/redfish-core/include/registries.hpp
index f85d2a5..eff91a4 100644
--- a/redfish-core/include/registries.hpp
+++ b/redfish-core/include/registries.hpp
@@ -19,7 +19,7 @@
#include <string>
#include <string_view>
-namespace redfish::message_registries
+namespace redfish::registries
{
struct Header
{
@@ -62,4 +62,4 @@
}
}
-} // namespace redfish::message_registries
+} // namespace redfish::registries
diff --git a/redfish-core/include/registries/base_message_registry.hpp b/redfish-core/include/registries/base_message_registry.hpp
index f43f7e7..ef7ba62 100644
--- a/redfish-core/include/registries/base_message_registry.hpp
+++ b/redfish-core/include/registries/base_message_registry.hpp
@@ -13,7 +13,7 @@
// clang-format off
-namespace redfish::message_registries::base
+namespace redfish::registries::base
{
const Header header = {
"Copyright 2014-2021 DMTF. All rights reserved.",
@@ -1300,4 +1300,4 @@
undeterminedFault = 91,
unrecognizedRequestBody = 92,
};
-} // namespace redfish::message_registries::base
+} // namespace redfish::registries::base
diff --git a/redfish-core/include/registries/openbmc_message_registry.hpp b/redfish-core/include/registries/openbmc_message_registry.hpp
index b0a081c..401babf 100644
--- a/redfish-core/include/registries/openbmc_message_registry.hpp
+++ b/redfish-core/include/registries/openbmc_message_registry.hpp
@@ -16,7 +16,7 @@
#pragma once
#include <registries.hpp>
-namespace redfish::message_registries::openbmc
+namespace redfish::registries::openbmc
{
const Header header = {
"Copyright 2022 OpenBMC. All rights reserved.",
@@ -2436,4 +2436,4 @@
}},
};
-} // namespace redfish::message_registries::openbmc
+} // namespace redfish::registries::openbmc
diff --git a/redfish-core/include/registries/resource_event_message_registry.hpp b/redfish-core/include/registries/resource_event_message_registry.hpp
index f769c77..de122d0 100644
--- a/redfish-core/include/registries/resource_event_message_registry.hpp
+++ b/redfish-core/include/registries/resource_event_message_registry.hpp
@@ -13,7 +13,7 @@
// clang-format off
-namespace redfish::message_registries::resource_event
+namespace redfish::registries::resource_event
{
const Header header = {
"Copyright 2014-2020 DMTF in cooperation with the Storage Networking Industry Association (SNIA). All rights reserved.",
@@ -305,4 +305,4 @@
resourceWarningThresholdExceeded = 17,
uRIForResourceChanged = 18,
};
-} // namespace redfish::message_registries::resource_event
+} // namespace redfish::registries::resource_event
diff --git a/redfish-core/include/registries/task_event_message_registry.hpp b/redfish-core/include/registries/task_event_message_registry.hpp
index 8f6ec43..bbc51e7 100644
--- a/redfish-core/include/registries/task_event_message_registry.hpp
+++ b/redfish-core/include/registries/task_event_message_registry.hpp
@@ -13,7 +13,7 @@
// clang-format off
-namespace redfish::message_registries::task_event
+namespace redfish::registries::task_event
{
const Header header = {
"Copyright 2014-2020 DMTF in cooperation with the Storage Networking Industry Association (SNIA). All rights reserved.",
@@ -164,4 +164,4 @@
taskResumed = 7,
taskStarted = 8,
};
-} // namespace redfish::message_registries::task_event
+} // namespace redfish::registries::task_event
diff --git a/redfish-core/lib/event_service.hpp b/redfish-core/lib/event_service.hpp
index bcb30aa..ba39140 100644
--- a/redfish-core/lib/event_service.hpp
+++ b/redfish-core/lib/event_service.hpp
@@ -202,304 +202,298 @@
});
BMCWEB_ROUTE(app, "/redfish/v1/EventService/Subscriptions/")
.privileges(redfish::privileges::postEventDestinationCollection)
- .methods(boost::beast::http::verb::post)(
- [](const crow::Request& req,
- const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (EventServiceManager::getInstance()
- .getNumberOfSubscriptions() >= maxNoOfSubscriptions)
+ .methods(
+ boost::beast::http::verb::
+ post)([](const crow::Request& req,
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+ if (EventServiceManager::getInstance().getNumberOfSubscriptions() >=
+ maxNoOfSubscriptions)
+ {
+ messages::eventSubscriptionLimitExceeded(asyncResp->res);
+ return;
+ }
+ std::string destUrl;
+ std::string protocol;
+ std::optional<std::string> context;
+ std::optional<std::string> subscriptionType;
+ std::optional<std::string> eventFormatType2;
+ std::optional<std::string> retryPolicy;
+ std::optional<std::vector<std::string>> msgIds;
+ std::optional<std::vector<std::string>> regPrefixes;
+ std::optional<std::vector<std::string>> resTypes;
+ std::optional<std::vector<nlohmann::json>> headers;
+ std::optional<std::vector<nlohmann::json>> mrdJsonArray;
+
+ if (!json_util::readJsonPatch(
+ req, asyncResp->res, "Destination", destUrl, "Context",
+ context, "Protocol", protocol, "SubscriptionType",
+ subscriptionType, "EventFormatType", eventFormatType2,
+ "HttpHeaders", headers, "RegistryPrefixes", regPrefixes,
+ "MessageIds", msgIds, "DeliveryRetryPolicy", retryPolicy,
+ "MetricReportDefinitions", mrdJsonArray, "ResourceTypes",
+ resTypes))
+ {
+ return;
+ }
+
+ if (regPrefixes && msgIds)
+ {
+ if (!regPrefixes->empty() && !msgIds->empty())
{
- messages::eventSubscriptionLimitExceeded(asyncResp->res);
+ messages::propertyValueConflict(
+ asyncResp->res, "MessageIds", "RegistryPrefixes");
return;
}
- std::string destUrl;
- std::string protocol;
- std::optional<std::string> context;
- std::optional<std::string> subscriptionType;
- std::optional<std::string> eventFormatType2;
- std::optional<std::string> retryPolicy;
- std::optional<std::vector<std::string>> msgIds;
- std::optional<std::vector<std::string>> regPrefixes;
- std::optional<std::vector<std::string>> resTypes;
- std::optional<std::vector<nlohmann::json>> headers;
- std::optional<std::vector<nlohmann::json>> mrdJsonArray;
+ }
- if (!json_util::readJsonPatch(
- req, asyncResp->res, "Destination", destUrl, "Context",
- context, "Protocol", protocol, "SubscriptionType",
- subscriptionType, "EventFormatType", eventFormatType2,
- "HttpHeaders", headers, "RegistryPrefixes", regPrefixes,
- "MessageIds", msgIds, "DeliveryRetryPolicy",
- retryPolicy, "MetricReportDefinitions", mrdJsonArray,
- "ResourceTypes", resTypes))
- {
- return;
- }
+ // Validate the URL using regex expression
+ // Format: <protocol>://<host>:<port>/<uri>
+ // protocol: http/https
+ // host: Exclude ' ', ':', '#', '?'
+ // port: Empty or numeric value with ':' separator.
+ // uri: Start with '/' and Exclude '#', ' '
+ // Can include query params(ex: '/event?test=1')
+ // TODO: Need to validate hostname extensively(as per rfc)
+ const std::regex urlRegex(
+ "(http|https)://([^/\\x20\\x3f\\x23\\x3a]+):?([0-9]*)(/"
+ "([^\\x20\\x23\\x3f]*\\x3f?([^\\x20\\x23\\x3f])*)?)");
+ std::cmatch match;
+ if (!std::regex_match(destUrl.c_str(), match, urlRegex))
+ {
+ messages::propertyValueFormatError(asyncResp->res, destUrl,
+ "Destination");
+ return;
+ }
- if (regPrefixes && msgIds)
- {
- if (!regPrefixes->empty() && !msgIds->empty())
- {
- messages::propertyValueConflict(
- asyncResp->res, "MessageIds", "RegistryPrefixes");
- return;
- }
- }
+ std::string uriProto = std::string(match[1].first, match[1].second);
+ if (uriProto == "http")
+ {
+#ifndef BMCWEB_INSECURE_ENABLE_HTTP_PUSH_STYLE_EVENTING
+ messages::propertyValueFormatError(asyncResp->res, destUrl,
+ "Destination");
+ return;
+#endif
+ }
- // Validate the URL using regex expression
- // Format: <protocol>://<host>:<port>/<uri>
- // protocol: http/https
- // host: Exclude ' ', ':', '#', '?'
- // port: Empty or numeric value with ':' separator.
- // uri: Start with '/' and Exclude '#', ' '
- // Can include query params(ex: '/event?test=1')
- // TODO: Need to validate hostname extensively(as per rfc)
- const std::regex urlRegex(
- "(http|https)://([^/\\x20\\x3f\\x23\\x3a]+):?([0-9]*)(/"
- "([^\\x20\\x23\\x3f]*\\x3f?([^\\x20\\x23\\x3f])*)?)");
- std::cmatch match;
- if (!std::regex_match(destUrl.c_str(), match, urlRegex))
- {
- messages::propertyValueFormatError(asyncResp->res, destUrl,
- "Destination");
- return;
- }
-
- std::string uriProto =
- std::string(match[1].first, match[1].second);
+ std::string host = std::string(match[2].first, match[2].second);
+ std::string port = std::string(match[3].first, match[3].second);
+ std::string path = std::string(match[4].first, match[4].second);
+ if (port.empty())
+ {
if (uriProto == "http")
{
-#ifndef BMCWEB_INSECURE_ENABLE_HTTP_PUSH_STYLE_EVENTING
- messages::propertyValueFormatError(asyncResp->res, destUrl,
- "Destination");
- return;
-#endif
- }
-
- std::string host = std::string(match[2].first, match[2].second);
- std::string port = std::string(match[3].first, match[3].second);
- std::string path = std::string(match[4].first, match[4].second);
- if (port.empty())
- {
- if (uriProto == "http")
- {
- port = "80";
- }
- else
- {
- port = "443";
- }
- }
- if (path.empty())
- {
- path = "/";
- }
-
- std::shared_ptr<Subscription> subValue =
- std::make_shared<Subscription>(host, port, path, uriProto);
-
- subValue->destinationUrl = destUrl;
-
- if (subscriptionType)
- {
- if (*subscriptionType != "RedfishEvent")
- {
- messages::propertyValueNotInList(asyncResp->res,
- *subscriptionType,
- "SubscriptionType");
- return;
- }
- subValue->subscriptionType = *subscriptionType;
+ port = "80";
}
else
{
- subValue->subscriptionType = "RedfishEvent"; // Default
+ port = "443";
}
+ }
+ if (path.empty())
+ {
+ path = "/";
+ }
- if (protocol != "Redfish")
+ std::shared_ptr<Subscription> subValue =
+ std::make_shared<Subscription>(host, port, path, uriProto);
+
+ subValue->destinationUrl = destUrl;
+
+ if (subscriptionType)
+ {
+ if (*subscriptionType != "RedfishEvent")
{
- messages::propertyValueNotInList(asyncResp->res, protocol,
- "Protocol");
+ messages::propertyValueNotInList(
+ asyncResp->res, *subscriptionType, "SubscriptionType");
return;
}
- subValue->protocol = protocol;
+ subValue->subscriptionType = *subscriptionType;
+ }
+ else
+ {
+ subValue->subscriptionType = "RedfishEvent"; // Default
+ }
- if (eventFormatType2)
+ if (protocol != "Redfish")
+ {
+ messages::propertyValueNotInList(asyncResp->res, protocol,
+ "Protocol");
+ return;
+ }
+ subValue->protocol = protocol;
+
+ if (eventFormatType2)
+ {
+ if (std::find(supportedEvtFormatTypes.begin(),
+ supportedEvtFormatTypes.end(),
+ *eventFormatType2) ==
+ supportedEvtFormatTypes.end())
{
- if (std::find(supportedEvtFormatTypes.begin(),
- supportedEvtFormatTypes.end(),
- *eventFormatType2) ==
- supportedEvtFormatTypes.end())
+ messages::propertyValueNotInList(
+ asyncResp->res, *eventFormatType2, "EventFormatType");
+ return;
+ }
+ subValue->eventFormatType = *eventFormatType2;
+ }
+ else
+ {
+ // If not specified, use default "Event"
+ subValue->eventFormatType = "Event";
+ }
+
+ if (context)
+ {
+ subValue->customText = *context;
+ }
+
+ if (headers)
+ {
+ for (const nlohmann::json& headerChunk : *headers)
+ {
+ for (const auto& item : headerChunk.items())
{
- messages::propertyValueNotInList(asyncResp->res,
- *eventFormatType2,
- "EventFormatType");
+ const std::string* value =
+ item.value().get_ptr<const std::string*>();
+ if (value == nullptr)
+ {
+ messages::propertyValueFormatError(
+ asyncResp->res, item.value().dump(2, 1),
+ "HttpHeaders/" + item.key());
+ return;
+ }
+ subValue->httpHeaders.set(item.key(), *value);
+ }
+ }
+ }
+
+ if (regPrefixes)
+ {
+ for (const std::string& it : *regPrefixes)
+ {
+ if (std::find(supportedRegPrefixes.begin(),
+ supportedRegPrefixes.end(),
+ it) == supportedRegPrefixes.end())
+ {
+ messages::propertyValueNotInList(asyncResp->res, it,
+ "RegistryPrefixes");
return;
}
- subValue->eventFormatType = *eventFormatType2;
+ }
+ subValue->registryPrefixes = *regPrefixes;
+ }
+
+ if (resTypes)
+ {
+ for (const std::string& it : *resTypes)
+ {
+ if (std::find(supportedResourceTypes.begin(),
+ supportedResourceTypes.end(),
+ it) == supportedResourceTypes.end())
+ {
+ messages::propertyValueNotInList(asyncResp->res, it,
+ "ResourceTypes");
+ return;
+ }
+ }
+ subValue->resourceTypes = *resTypes;
+ }
+
+ if (msgIds)
+ {
+ std::vector<std::string> registryPrefix;
+
+ // If no registry prefixes are mentioned, consider all
+ // supported prefixes
+ if (subValue->registryPrefixes.empty())
+ {
+ registryPrefix.assign(supportedRegPrefixes.begin(),
+ supportedRegPrefixes.end());
}
else
{
- // If not specified, use default "Event"
- subValue->eventFormatType = "Event";
+ registryPrefix = subValue->registryPrefixes;
}
- if (context)
+ for (const std::string& id : *msgIds)
{
- subValue->customText = *context;
- }
+ bool validId = false;
- if (headers)
- {
- for (const nlohmann::json& headerChunk : *headers)
+ // Check for Message ID in each of the selected Registry
+ for (const std::string& it : registryPrefix)
{
- for (const auto& item : headerChunk.items())
+ const std::span<const redfish::registries::MessageEntry>
+ registry =
+ redfish::registries::getRegistryFromPrefix(it);
+
+ if (std::any_of(
+ registry.begin(), registry.end(),
+ [&id](const redfish::registries::MessageEntry&
+ messageEntry) {
+ return id.compare(messageEntry.first) == 0;
+ }))
{
- const std::string* value =
- item.value().get_ptr<const std::string*>();
- if (value == nullptr)
- {
- messages::propertyValueFormatError(
- asyncResp->res, item.value().dump(2, 1),
- "HttpHeaders/" + item.key());
- return;
- }
- subValue->httpHeaders.set(item.key(), *value);
- }
- }
- }
-
- if (regPrefixes)
- {
- for (const std::string& it : *regPrefixes)
- {
- if (std::find(supportedRegPrefixes.begin(),
- supportedRegPrefixes.end(),
- it) == supportedRegPrefixes.end())
- {
- messages::propertyValueNotInList(
- asyncResp->res, it, "RegistryPrefixes");
- return;
- }
- }
- subValue->registryPrefixes = *regPrefixes;
- }
-
- if (resTypes)
- {
- for (const std::string& it : *resTypes)
- {
- if (std::find(supportedResourceTypes.begin(),
- supportedResourceTypes.end(),
- it) == supportedResourceTypes.end())
- {
- messages::propertyValueNotInList(asyncResp->res, it,
- "ResourceTypes");
- return;
- }
- }
- subValue->resourceTypes = *resTypes;
- }
-
- if (msgIds)
- {
- std::vector<std::string> registryPrefix;
-
- // If no registry prefixes are mentioned, consider all
- // supported prefixes
- if (subValue->registryPrefixes.empty())
- {
- registryPrefix.assign(supportedRegPrefixes.begin(),
- supportedRegPrefixes.end());
- }
- else
- {
- registryPrefix = subValue->registryPrefixes;
- }
-
- for (const std::string& id : *msgIds)
- {
- bool validId = false;
-
- // Check for Message ID in each of the selected Registry
- for (const std::string& it : registryPrefix)
- {
- const std::span<
- const redfish::message_registries::MessageEntry>
- registry = redfish::message_registries::
- getRegistryFromPrefix(it);
-
- if (std::any_of(
- registry.begin(), registry.end(),
- [&id](const redfish::message_registries::
- MessageEntry& messageEntry) {
- return id.compare(messageEntry.first) ==
- 0;
- }))
- {
- validId = true;
- break;
- }
- }
-
- if (!validId)
- {
- messages::propertyValueNotInList(asyncResp->res, id,
- "MessageIds");
- return;
+ validId = true;
+ break;
}
}
- subValue->registryMsgIds = *msgIds;
- }
-
- if (retryPolicy)
- {
- if (std::find(supportedRetryPolicies.begin(),
- supportedRetryPolicies.end(),
- *retryPolicy) == supportedRetryPolicies.end())
+ if (!validId)
{
- messages::propertyValueNotInList(asyncResp->res,
- *retryPolicy,
- "DeliveryRetryPolicy");
+ messages::propertyValueNotInList(asyncResp->res, id,
+ "MessageIds");
return;
}
- subValue->retryPolicy = *retryPolicy;
- }
- else
- {
- // Default "TerminateAfterRetries"
- subValue->retryPolicy = "TerminateAfterRetries";
}
- if (mrdJsonArray)
+ subValue->registryMsgIds = *msgIds;
+ }
+
+ if (retryPolicy)
+ {
+ if (std::find(supportedRetryPolicies.begin(),
+ supportedRetryPolicies.end(),
+ *retryPolicy) == supportedRetryPolicies.end())
{
- for (nlohmann::json& mrdObj : *mrdJsonArray)
- {
- std::string mrdUri;
-
- if (!json_util::readJson(mrdObj, asyncResp->res,
- "@odata.id", mrdUri))
-
- {
- return;
- }
- subValue->metricReportDefinitions.emplace_back(mrdUri);
- }
- }
-
- std::string id =
- EventServiceManager::getInstance().addSubscription(
- subValue);
- if (id.empty())
- {
- messages::internalError(asyncResp->res);
+ messages::propertyValueNotInList(
+ asyncResp->res, *retryPolicy, "DeliveryRetryPolicy");
return;
}
+ subValue->retryPolicy = *retryPolicy;
+ }
+ else
+ {
+ // Default "TerminateAfterRetries"
+ subValue->retryPolicy = "TerminateAfterRetries";
+ }
- messages::created(asyncResp->res);
- asyncResp->res.addHeader(
- "Location", "/redfish/v1/EventService/Subscriptions/" + id);
- });
+ if (mrdJsonArray)
+ {
+ for (nlohmann::json& mrdObj : *mrdJsonArray)
+ {
+ std::string mrdUri;
+
+ if (!json_util::readJson(mrdObj, asyncResp->res,
+ "@odata.id", mrdUri))
+
+ {
+ return;
+ }
+ subValue->metricReportDefinitions.emplace_back(mrdUri);
+ }
+ }
+
+ std::string id =
+ EventServiceManager::getInstance().addSubscription(subValue);
+ if (id.empty())
+ {
+ messages::internalError(asyncResp->res);
+ return;
+ }
+
+ messages::created(asyncResp->res);
+ asyncResp->res.addHeader(
+ "Location", "/redfish/v1/EventService/Subscriptions/" + id);
+ });
}
inline void requestRoutesEventDestination(App& app)
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 59ebf51..5a27fe9 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -56,7 +56,7 @@
constexpr char const* crashdumpTelemetryInterface =
"com.intel.crashdump.Telemetry";
-namespace message_registries
+namespace registries
{
static const Message*
getMessageFromRegistry(const std::string& messageKey,
@@ -99,7 +99,7 @@
}
return nullptr;
}
-} // namespace message_registries
+} // namespace registries
namespace fs = std::filesystem;
@@ -1117,8 +1117,7 @@
std::string& messageID = logEntryFields[0];
// Get the Message from the MessageRegistry
- const message_registries::Message* message =
- message_registries::getMessage(messageID);
+ const registries::Message* message = registries::getMessage(messageID);
std::string msg;
std::string severity;
@@ -3101,8 +3100,8 @@
const uint64_t skip = 0, const uint64_t top = 0)
{
// Get the Message from the MessageRegistry
- const message_registries::Message* message =
- message_registries::getMessage("OpenBMC.0.2.BIOSPOSTCode");
+ const registries::Message* message =
+ registries::getMessage("OpenBMC.0.2.BIOSPOSTCode");
uint64_t currentCodeIndex = 0;
nlohmann::json& logEntryArray = aResp->res.jsonValue["Members"];
diff --git a/redfish-core/lib/message_registries.hpp b/redfish-core/lib/message_registries.hpp
index c2848c3..c0c6205 100644
--- a/redfish-core/lib/message_registries.hpp
+++ b/redfish-core/lib/message_registries.hpp
@@ -64,29 +64,29 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& registry)
{
- const message_registries::Header* header = nullptr;
+ const registries::Header* header = nullptr;
std::string dmtf = "DMTF ";
const char* url = nullptr;
if (registry == "Base")
{
- header = &message_registries::base::header;
- url = message_registries::base::url;
+ header = ®istries::base::header;
+ url = registries::base::url;
}
else if (registry == "TaskEvent")
{
- header = &message_registries::task_event::header;
- url = message_registries::task_event::url;
+ header = ®istries::task_event::header;
+ url = registries::task_event::url;
}
else if (registry == "OpenBMC")
{
- header = &message_registries::openbmc::header;
+ header = ®istries::openbmc::header;
dmtf.clear();
}
else if (registry == "ResourceEvent")
{
- header = &message_registries::resource_event::header;
- url = message_registries::resource_event::url;
+ header = ®istries::resource_event::header;
+ url = registries::resource_event::url;
}
else
{
@@ -130,40 +130,39 @@
const std::string& registry, const std::string& registryMatch)
{
- const message_registries::Header* header = nullptr;
- std::vector<const message_registries::MessageEntry*> registryEntries;
+ const registries::Header* header = nullptr;
+ std::vector<const registries::MessageEntry*> registryEntries;
if (registry == "Base")
{
- header = &message_registries::base::header;
- for (const message_registries::MessageEntry& entry :
- message_registries::base::registry)
+ header = ®istries::base::header;
+ for (const registries::MessageEntry& entry : registries::base::registry)
{
registryEntries.emplace_back(&entry);
}
}
else if (registry == "TaskEvent")
{
- header = &message_registries::task_event::header;
- for (const message_registries::MessageEntry& entry :
- message_registries::task_event::registry)
+ header = ®istries::task_event::header;
+ for (const registries::MessageEntry& entry :
+ registries::task_event::registry)
{
registryEntries.emplace_back(&entry);
}
}
else if (registry == "OpenBMC")
{
- header = &message_registries::openbmc::header;
- for (const message_registries::MessageEntry& entry :
- message_registries::openbmc::registry)
+ header = ®istries::openbmc::header;
+ for (const registries::MessageEntry& entry :
+ registries::openbmc::registry)
{
registryEntries.emplace_back(&entry);
}
}
else if (registry == "ResourceEvent")
{
- header = &message_registries::resource_event::header;
- for (const message_registries::MessageEntry& entry :
- message_registries::resource_event::registry)
+ header = ®istries::resource_event::header;
+ for (const registries::MessageEntry& entry :
+ registries::resource_event::registry)
{
registryEntries.emplace_back(&entry);
}
@@ -195,7 +194,7 @@
nlohmann::json& messageObj = asyncResp->res.jsonValue["Messages"];
// Go through the Message Registry and populate each Message
- for (const message_registries::MessageEntry* message : registryEntries)
+ for (const registries::MessageEntry* message : registryEntries)
{
nlohmann::json& obj = messageObj[message->first];
obj = {{"Description", message->second.description},
diff --git a/redfish-core/src/error_messages.cpp b/redfish-core/src/error_messages.cpp
index 1897f29..8bc8da0 100644
--- a/redfish-core/src/error_messages.cpp
+++ b/redfish-core/src/error_messages.cpp
@@ -107,26 +107,26 @@
field.push_back(message);
}
-nlohmann::json getLog(redfish::message_registries::base::Index name,
+nlohmann::json getLog(redfish::registries::base::Index name,
std::span<const std::string_view> args)
{
size_t index = static_cast<size_t>(name);
- if (index >= redfish::message_registries::base::registry.size())
+ if (index >= redfish::registries::base::registry.size())
{
return {};
}
- const redfish::message_registries::MessageEntry& entry =
- redfish::message_registries::base::registry[index];
+ const redfish::registries::MessageEntry& entry =
+ redfish::registries::base::registry[index];
// Intentionally make a copy of the string, so we can append in the
// parameters.
std::string msg = entry.second.message;
- redfish::message_registries::fillMessageArgs(args, msg);
+ redfish::registries::fillMessageArgs(args, msg);
nlohmann::json jArgs = nlohmann::json::array();
for (const std::string_view arg : args)
{
jArgs.push_back(arg);
}
- std::string msgId = redfish::message_registries::base::header.id;
+ std::string msgId = redfish::registries::base::header.id;
msgId += ".";
msgId += entry.first;
return {{"@odata.type", "#Message.v1_1_1.Message"},
@@ -146,7 +146,7 @@
*/
nlohmann::json resourceInUse(void)
{
- return getLog(redfish::message_registries::base::Index::resourceInUse, {});
+ return getLog(redfish::registries::base::Index::resourceInUse, {});
}
void resourceInUse(crow::Response& res)
@@ -164,7 +164,7 @@
*/
nlohmann::json malformedJSON(void)
{
- return getLog(redfish::message_registries::base::Index::malformedJSON, {});
+ return getLog(redfish::registries::base::Index::malformedJSON, {});
}
void malformedJSON(crow::Response& res)
@@ -184,8 +184,7 @@
{
std::array<std::string_view, 1> args{
std::string_view{arg1.data(), arg1.size()}};
- return getLog(
- redfish::message_registries::base::Index::resourceMissingAtURI, args);
+ return getLog(redfish::registries::base::Index::resourceMissingAtURI, args);
}
void resourceMissingAtURI(crow::Response& res,
@@ -206,9 +205,9 @@
std::string_view arg2,
std::string_view arg3)
{
- return getLog(redfish::message_registries::base::Index::
- actionParameterValueFormatError,
- std::to_array({arg1, arg2, arg3}));
+ return getLog(
+ redfish::registries::base::Index::actionParameterValueFormatError,
+ std::to_array({arg1, arg2, arg3}));
}
void actionParameterValueFormatError(crow::Response& res, std::string_view arg1,
@@ -229,7 +228,7 @@
*/
nlohmann::json internalError(void)
{
- return getLog(redfish::message_registries::base::Index::internalError, {});
+ return getLog(redfish::registries::base::Index::internalError, {});
}
void internalError(crow::Response& res, const bmcweb::source_location location)
@@ -250,8 +249,8 @@
*/
nlohmann::json unrecognizedRequestBody(void)
{
- return getLog(
- redfish::message_registries::base::Index::unrecognizedRequestBody, {});
+ return getLog(redfish::registries::base::Index::unrecognizedRequestBody,
+ {});
}
void unrecognizedRequestBody(crow::Response& res)
@@ -271,7 +270,7 @@
std::string_view arg2)
{
return getLog(
- redfish::message_registries::base::Index::resourceAtUriUnauthorized,
+ redfish::registries::base::Index::resourceAtUriUnauthorized,
std::to_array({std::string_view{arg1.data(), arg1.size()}, arg2}));
}
@@ -293,9 +292,8 @@
nlohmann::json actionParameterUnknown(std::string_view arg1,
std::string_view arg2)
{
- return getLog(
- redfish::message_registries::base::Index::actionParameterUnknown,
- std::to_array({arg1, arg2}));
+ return getLog(redfish::registries::base::Index::actionParameterUnknown,
+ std::to_array({arg1, arg2}));
}
void actionParameterUnknown(crow::Response& res, std::string_view arg1,
@@ -314,8 +312,8 @@
*/
nlohmann::json resourceCannotBeDeleted(void)
{
- return getLog(
- redfish::message_registries::base::Index::resourceCannotBeDeleted, {});
+ return getLog(redfish::registries::base::Index::resourceCannotBeDeleted,
+ {});
}
void resourceCannotBeDeleted(crow::Response& res)
@@ -333,7 +331,7 @@
*/
nlohmann::json propertyDuplicate(std::string_view arg1)
{
- return getLog(redfish::message_registries::base::Index::propertyDuplicate,
+ return getLog(redfish::registries::base::Index::propertyDuplicate,
std::to_array({arg1}));
}
@@ -353,7 +351,7 @@
nlohmann::json serviceTemporarilyUnavailable(std::string_view arg1)
{
return getLog(
- redfish::message_registries::base::Index::serviceTemporarilyUnavailable,
+ redfish::registries::base::Index::serviceTemporarilyUnavailable,
std::to_array({arg1}));
}
@@ -375,9 +373,8 @@
std::string_view arg2,
std::string_view arg3)
{
- return getLog(
- redfish::message_registries::base::Index::resourceAlreadyExists,
- std::to_array({arg1, arg2, arg3}));
+ return getLog(redfish::registries::base::Index::resourceAlreadyExists,
+ std::to_array({arg1, arg2, arg3}));
}
void resourceAlreadyExists(crow::Response& res, std::string_view arg1,
@@ -397,9 +394,8 @@
*/
nlohmann::json accountForSessionNoLongerExists(void)
{
- return getLog(redfish::message_registries::base::Index::
- accountForSessionNoLongerExists,
- {});
+ return getLog(
+ redfish::registries::base::Index::accountForSessionNoLongerExists, {});
}
void accountForSessionNoLongerExists(crow::Response& res)
@@ -417,9 +413,9 @@
*/
nlohmann::json createFailedMissingReqProperties(std::string_view arg1)
{
- return getLog(redfish::message_registries::base::Index::
- createFailedMissingReqProperties,
- std::to_array({arg1}));
+ return getLog(
+ redfish::registries::base::Index::createFailedMissingReqProperties,
+ std::to_array({arg1}));
}
void createFailedMissingReqProperties(crow::Response& res,
@@ -441,9 +437,8 @@
nlohmann::json propertyValueFormatError(std::string_view arg1,
std::string_view arg2)
{
- return getLog(
- redfish::message_registries::base::Index::propertyValueFormatError,
- std::to_array({arg1, arg2}));
+ return getLog(redfish::registries::base::Index::propertyValueFormatError,
+ std::to_array({arg1, arg2}));
}
void propertyValueFormatError(crow::Response& res, std::string_view arg1,
@@ -464,9 +459,8 @@
nlohmann::json propertyValueNotInList(std::string_view arg1,
std::string_view arg2)
{
- return getLog(
- redfish::message_registries::base::Index::propertyValueNotInList,
- std::to_array({arg1, arg2}));
+ return getLog(redfish::registries::base::Index::propertyValueNotInList,
+ std::to_array({arg1, arg2}));
}
void propertyValueNotInList(crow::Response& res, std::string_view arg1,
@@ -487,7 +481,7 @@
{
std::string_view arg1str{arg1.data(), arg1.size()};
return getLog(
- redfish::message_registries::base::Index::resourceAtUriInUnknownFormat,
+ redfish::registries::base::Index::resourceAtUriInUnknownFormat,
std::to_array({arg1str}));
}
@@ -507,7 +501,7 @@
*/
nlohmann::json serviceDisabled(std::string_view arg1)
{
- return getLog(redfish::message_registries::base::Index::serviceDisabled,
+ return getLog(redfish::registries::base::Index::serviceDisabled,
std::to_array({arg1}));
}
@@ -526,8 +520,7 @@
*/
nlohmann::json serviceInUnknownState(void)
{
- return getLog(
- redfish::message_registries::base::Index::serviceInUnknownState, {});
+ return getLog(redfish::registries::base::Index::serviceInUnknownState, {});
}
void serviceInUnknownState(crow::Response& res)
@@ -545,9 +538,8 @@
*/
nlohmann::json eventSubscriptionLimitExceeded(void)
{
- return getLog(redfish::message_registries::base::Index::
- eventSubscriptionLimitExceeded,
- {});
+ return getLog(
+ redfish::registries::base::Index::eventSubscriptionLimitExceeded, {});
}
void eventSubscriptionLimitExceeded(crow::Response& res)
@@ -566,9 +558,8 @@
nlohmann::json actionParameterMissing(std::string_view arg1,
std::string_view arg2)
{
- return getLog(
- redfish::message_registries::base::Index::actionParameterMissing,
- std::to_array({arg1, arg2}));
+ return getLog(redfish::registries::base::Index::actionParameterMissing,
+ std::to_array({arg1, arg2}));
}
void actionParameterMissing(crow::Response& res, std::string_view arg1,
@@ -588,7 +579,7 @@
nlohmann::json stringValueTooLong(std::string_view arg1, int arg2)
{
std::string arg2String = std::to_string(arg2);
- return getLog(redfish::message_registries::base::Index::stringValueTooLong,
+ return getLog(redfish::registries::base::Index::stringValueTooLong,
std::to_array({arg1, std::string_view(arg2String)}));
}
@@ -607,8 +598,7 @@
*/
nlohmann::json sessionTerminated(void)
{
- return getLog(redfish::message_registries::base::Index::sessionTerminated,
- {});
+ return getLog(redfish::registries::base::Index::sessionTerminated, {});
}
void sessionTerminated(crow::Response& res)
@@ -626,8 +616,7 @@
*/
nlohmann::json subscriptionTerminated(void)
{
- return getLog(
- redfish::message_registries::base::Index::subscriptionTerminated, {});
+ return getLog(redfish::registries::base::Index::subscriptionTerminated, {});
}
void subscriptionTerminated(crow::Response& res)
@@ -646,9 +635,8 @@
nlohmann::json resourceTypeIncompatible(std::string_view arg1,
std::string_view arg2)
{
- return getLog(
- redfish::message_registries::base::Index::resourceTypeIncompatible,
- std::to_array({arg1, arg2}));
+ return getLog(redfish::registries::base::Index::resourceTypeIncompatible,
+ std::to_array({arg1, arg2}));
}
void resourceTypeIncompatible(crow::Response& res, std::string_view arg1,
@@ -669,7 +657,7 @@
std::string_view arg2)
{
std::string_view arg1str(arg1.data(), arg1.size());
- return getLog(redfish::message_registries::base::Index::resetRequired,
+ return getLog(redfish::registries::base::Index::resetRequired,
std::to_array({arg1str, arg2}));
}
@@ -689,7 +677,7 @@
*/
nlohmann::json chassisPowerStateOnRequired(std::string_view arg1)
{
- return getLog(redfish::message_registries::base::Index::resetRequired,
+ return getLog(redfish::registries::base::Index::resetRequired,
std::to_array({arg1}));
}
@@ -709,7 +697,7 @@
nlohmann::json chassisPowerStateOffRequired(std::string_view arg1)
{
return getLog(
- redfish::message_registries::base::Index::chassisPowerStateOffRequired,
+ redfish::registries::base::Index::chassisPowerStateOffRequired,
std::to_array({arg1}));
}
@@ -729,9 +717,8 @@
nlohmann::json propertyValueConflict(std::string_view arg1,
std::string_view arg2)
{
- return getLog(
- redfish::message_registries::base::Index::propertyValueConflict,
- std::to_array({arg1, arg2}));
+ return getLog(redfish::registries::base::Index::propertyValueConflict,
+ std::to_array({arg1, arg2}));
}
void propertyValueConflict(crow::Response& res, std::string_view arg1,
@@ -751,9 +738,8 @@
nlohmann::json propertyValueIncorrect(std::string_view arg1,
std::string_view arg2)
{
- return getLog(
- redfish::message_registries::base::Index::propertyValueIncorrect,
- std::to_array({arg1, arg2}));
+ return getLog(redfish::registries::base::Index::propertyValueIncorrect,
+ std::to_array({arg1, arg2}));
}
void propertyValueIncorrect(crow::Response& res, std::string_view arg1,
@@ -773,9 +759,8 @@
nlohmann::json resourceCreationConflict(const boost::urls::url_view& arg1)
{
std::string_view arg1str(arg1.data(), arg1.size());
- return getLog(
- redfish::message_registries::base::Index::resourceCreationConflict,
- std::to_array({arg1str}));
+ return getLog(redfish::registries::base::Index::resourceCreationConflict,
+ std::to_array({arg1str}));
}
void resourceCreationConflict(crow::Response& res,
@@ -794,8 +779,7 @@
*/
nlohmann::json maximumErrorsExceeded(void)
{
- return getLog(
- redfish::message_registries::base::Index::maximumErrorsExceeded, {});
+ return getLog(redfish::registries::base::Index::maximumErrorsExceeded, {});
}
void maximumErrorsExceeded(crow::Response& res)
@@ -813,8 +797,7 @@
*/
nlohmann::json preconditionFailed(void)
{
- return getLog(redfish::message_registries::base::Index::preconditionFailed,
- {});
+ return getLog(redfish::registries::base::Index::preconditionFailed, {});
}
void preconditionFailed(crow::Response& res)
@@ -832,8 +815,7 @@
*/
nlohmann::json preconditionRequired(void)
{
- return getLog(
- redfish::message_registries::base::Index::preconditionRequired, {});
+ return getLog(redfish::registries::base::Index::preconditionRequired, {});
}
void preconditionRequired(crow::Response& res)
@@ -851,8 +833,7 @@
*/
nlohmann::json operationFailed(void)
{
- return getLog(redfish::message_registries::base::Index::operationFailed,
- {});
+ return getLog(redfish::registries::base::Index::operationFailed, {});
}
void operationFailed(crow::Response& res)
@@ -870,8 +851,7 @@
*/
nlohmann::json operationTimeout(void)
{
- return getLog(redfish::message_registries::base::Index::operationTimeout,
- {});
+ return getLog(redfish::registries::base::Index::operationTimeout, {});
}
void operationTimeout(crow::Response& res)
@@ -891,9 +871,8 @@
nlohmann::json propertyValueTypeError(std::string_view arg1,
std::string_view arg2)
{
- return getLog(
- redfish::message_registries::base::Index::propertyValueTypeError,
- std::to_array({arg1, arg2}));
+ return getLog(redfish::registries::base::Index::propertyValueTypeError,
+ std::to_array({arg1, arg2}));
}
void propertyValueTypeError(crow::Response& res, std::string_view arg1,
@@ -912,7 +891,7 @@
*/
nlohmann::json resourceNotFound(std::string_view arg1, std::string_view arg2)
{
- return getLog(redfish::message_registries::base::Index::resourceNotFound,
+ return getLog(redfish::registries::base::Index::resourceNotFound,
std::to_array({arg1, arg2}));
}
@@ -933,9 +912,8 @@
nlohmann::json couldNotEstablishConnection(const boost::urls::url_view& arg1)
{
std::string_view arg1str(arg1.data(), arg1.size());
- return getLog(
- redfish::message_registries::base::Index::couldNotEstablishConnection,
- std::to_array({arg1str}));
+ return getLog(redfish::registries::base::Index::couldNotEstablishConnection,
+ std::to_array({arg1str}));
}
void couldNotEstablishConnection(crow::Response& res,
@@ -955,7 +933,7 @@
*/
nlohmann::json propertyNotWritable(std::string_view arg1)
{
- return getLog(redfish::message_registries::base::Index::propertyNotWritable,
+ return getLog(redfish::registries::base::Index::propertyNotWritable,
std::to_array({arg1}));
}
@@ -976,7 +954,7 @@
std::string_view arg2)
{
return getLog(
- redfish::message_registries::base::Index::queryParameterValueTypeError,
+ redfish::registries::base::Index::queryParameterValueTypeError,
std::to_array({arg1, arg2}));
}
@@ -997,8 +975,7 @@
*/
nlohmann::json serviceShuttingDown(void)
{
- return getLog(redfish::message_registries::base::Index::serviceShuttingDown,
- {});
+ return getLog(redfish::registries::base::Index::serviceShuttingDown, {});
}
void serviceShuttingDown(crow::Response& res)
@@ -1017,9 +994,8 @@
nlohmann::json actionParameterDuplicate(std::string_view arg1,
std::string_view arg2)
{
- return getLog(
- redfish::message_registries::base::Index::actionParameterDuplicate,
- std::to_array({arg1, arg2}));
+ return getLog(redfish::registries::base::Index::actionParameterDuplicate,
+ std::to_array({arg1, arg2}));
}
void actionParameterDuplicate(crow::Response& res, std::string_view arg1,
@@ -1039,9 +1015,8 @@
nlohmann::json actionParameterNotSupported(std::string_view arg1,
std::string_view arg2)
{
- return getLog(
- redfish::message_registries::base::Index::actionParameterNotSupported,
- std::to_array({arg1, arg2}));
+ return getLog(redfish::registries::base::Index::actionParameterNotSupported,
+ std::to_array({arg1, arg2}));
}
void actionParameterNotSupported(crow::Response& res, std::string_view arg1,
@@ -1064,7 +1039,7 @@
{
std::string_view arg1str(arg1.data(), arg1.size());
return getLog(
- redfish::message_registries::base::Index::sourceDoesNotSupportProtocol,
+ redfish::registries::base::Index::sourceDoesNotSupportProtocol,
std::to_array({arg1str, arg2}));
}
@@ -1086,7 +1061,7 @@
*/
nlohmann::json accountRemoved(void)
{
- return getLog(redfish::message_registries::base::Index::accountRemoved, {});
+ return getLog(redfish::registries::base::Index::accountRemoved, {});
}
void accountRemoved(crow::Response& res)
@@ -1105,7 +1080,7 @@
nlohmann::json accessDenied(const boost::urls::url_view& arg1)
{
std::string_view arg1str(arg1.data(), arg1.size());
- return getLog(redfish::message_registries::base::Index::accessDenied,
+ return getLog(redfish::registries::base::Index::accessDenied,
std::to_array({arg1str}));
}
@@ -1124,8 +1099,7 @@
*/
nlohmann::json queryNotSupported(void)
{
- return getLog(redfish::message_registries::base::Index::queryNotSupported,
- {});
+ return getLog(redfish::registries::base::Index::queryNotSupported, {});
}
void queryNotSupported(crow::Response& res)
@@ -1144,8 +1118,7 @@
nlohmann::json createLimitReachedForResource(void)
{
return getLog(
- redfish::message_registries::base::Index::createLimitReachedForResource,
- {});
+ redfish::registries::base::Index::createLimitReachedForResource, {});
}
void createLimitReachedForResource(crow::Response& res)
@@ -1163,7 +1136,7 @@
*/
nlohmann::json generalError(void)
{
- return getLog(redfish::message_registries::base::Index::generalError, {});
+ return getLog(redfish::registries::base::Index::generalError, {});
}
void generalError(crow::Response& res)
@@ -1181,7 +1154,7 @@
*/
nlohmann::json success(void)
{
- return getLog(redfish::message_registries::base::Index::success, {});
+ return getLog(redfish::registries::base::Index::success, {});
}
void success(crow::Response& res)
@@ -1200,7 +1173,7 @@
*/
nlohmann::json created(void)
{
- return getLog(redfish::message_registries::base::Index::created, {});
+ return getLog(redfish::registries::base::Index::created, {});
}
void created(crow::Response& res)
@@ -1218,7 +1191,7 @@
*/
nlohmann::json noOperation(void)
{
- return getLog(redfish::message_registries::base::Index::noOperation, {});
+ return getLog(redfish::registries::base::Index::noOperation, {});
}
void noOperation(crow::Response& res)
@@ -1237,7 +1210,7 @@
*/
nlohmann::json propertyUnknown(std::string_view arg1)
{
- return getLog(redfish::message_registries::base::Index::propertyUnknown,
+ return getLog(redfish::registries::base::Index::propertyUnknown,
std::to_array({arg1}));
}
@@ -1256,7 +1229,7 @@
*/
nlohmann::json noValidSession(void)
{
- return getLog(redfish::message_registries::base::Index::noValidSession, {});
+ return getLog(redfish::registries::base::Index::noValidSession, {});
}
void noValidSession(crow::Response& res)
@@ -1275,7 +1248,7 @@
nlohmann::json invalidObject(const boost::urls::url_view& arg1)
{
std::string_view arg1str(arg1.data(), arg1.size());
- return getLog(redfish::message_registries::base::Index::invalidObject,
+ return getLog(redfish::registries::base::Index::invalidObject,
std::to_array({arg1str}));
}
@@ -1294,8 +1267,7 @@
*/
nlohmann::json resourceInStandby(void)
{
- return getLog(redfish::message_registries::base::Index::resourceInStandby,
- {});
+ return getLog(redfish::registries::base::Index::resourceInStandby, {});
}
void resourceInStandby(crow::Response& res)
@@ -1316,7 +1288,7 @@
std::string_view arg3)
{
return getLog(
- redfish::message_registries::base::Index::actionParameterValueTypeError,
+ redfish::registries::base::Index::actionParameterValueTypeError,
std::to_array({arg1, arg2, arg3}));
}
@@ -1337,8 +1309,7 @@
*/
nlohmann::json sessionLimitExceeded(void)
{
- return getLog(
- redfish::message_registries::base::Index::sessionLimitExceeded, {});
+ return getLog(redfish::registries::base::Index::sessionLimitExceeded, {});
}
void sessionLimitExceeded(crow::Response& res)
@@ -1356,7 +1327,7 @@
*/
nlohmann::json actionNotSupported(std::string_view arg1)
{
- return getLog(redfish::message_registries::base::Index::actionNotSupported,
+ return getLog(redfish::registries::base::Index::actionNotSupported,
std::to_array({arg1}));
}
@@ -1376,7 +1347,7 @@
nlohmann::json invalidIndex(int64_t arg1)
{
std::string arg1Str = std::to_string(arg1);
- return getLog(redfish::message_registries::base::Index::invalidIndex,
+ return getLog(redfish::registries::base::Index::invalidIndex,
std::to_array<std::string_view>({arg1Str}));
}
@@ -1395,7 +1366,7 @@
*/
nlohmann::json emptyJSON(void)
{
- return getLog(redfish::message_registries::base::Index::emptyJSON, {});
+ return getLog(redfish::registries::base::Index::emptyJSON, {});
}
void emptyJSON(crow::Response& res)
@@ -1413,9 +1384,8 @@
*/
nlohmann::json queryNotSupportedOnResource(void)
{
- return getLog(
- redfish::message_registries::base::Index::queryNotSupportedOnResource,
- {});
+ return getLog(redfish::registries::base::Index::queryNotSupportedOnResource,
+ {});
}
void queryNotSupportedOnResource(crow::Response& res)
@@ -1434,8 +1404,7 @@
nlohmann::json queryNotSupportedOnOperation(void)
{
return getLog(
- redfish::message_registries::base::Index::queryNotSupportedOnOperation,
- {});
+ redfish::registries::base::Index::queryNotSupportedOnOperation, {});
}
void queryNotSupportedOnOperation(crow::Response& res)
@@ -1453,8 +1422,8 @@
*/
nlohmann::json queryCombinationInvalid(void)
{
- return getLog(
- redfish::message_registries::base::Index::queryCombinationInvalid, {});
+ return getLog(redfish::registries::base::Index::queryCombinationInvalid,
+ {});
}
void queryCombinationInvalid(crow::Response& res)
@@ -1472,8 +1441,7 @@
*/
nlohmann::json insufficientPrivilege(void)
{
- return getLog(
- redfish::message_registries::base::Index::insufficientPrivilege, {});
+ return getLog(redfish::registries::base::Index::insufficientPrivilege, {});
}
void insufficientPrivilege(crow::Response& res)
@@ -1492,9 +1460,8 @@
nlohmann::json propertyValueModified(std::string_view arg1,
std::string_view arg2)
{
- return getLog(
- redfish::message_registries::base::Index::propertyValueModified,
- std::to_array({arg1, arg2}));
+ return getLog(redfish::registries::base::Index::propertyValueModified,
+ std::to_array({arg1, arg2}));
}
void propertyValueModified(crow::Response& res, std::string_view arg1,
@@ -1513,8 +1480,7 @@
*/
nlohmann::json accountNotModified(void)
{
- return getLog(redfish::message_registries::base::Index::accountNotModified,
- {});
+ return getLog(redfish::registries::base::Index::accountNotModified, {});
}
void accountNotModified(crow::Response& res)
@@ -1533,9 +1499,9 @@
nlohmann::json queryParameterValueFormatError(std::string_view arg1,
std::string_view arg2)
{
- return getLog(redfish::message_registries::base::Index::
- queryParameterValueFormatError,
- std::to_array({arg1, arg2}));
+ return getLog(
+ redfish::registries::base::Index::queryParameterValueFormatError,
+ std::to_array({arg1, arg2}));
}
void queryParameterValueFormatError(crow::Response& res, std::string_view arg1,
@@ -1556,7 +1522,7 @@
*/
nlohmann::json propertyMissing(std::string_view arg1)
{
- return getLog(redfish::message_registries::base::Index::propertyMissing,
+ return getLog(redfish::registries::base::Index::propertyMissing,
std::to_array({arg1}));
}
@@ -1575,7 +1541,7 @@
*/
nlohmann::json resourceExhaustion(std::string_view arg1)
{
- return getLog(redfish::message_registries::base::Index::resourceExhaustion,
+ return getLog(redfish::registries::base::Index::resourceExhaustion,
std::to_array({arg1}));
}
@@ -1594,8 +1560,7 @@
*/
nlohmann::json accountModified(void)
{
- return getLog(redfish::message_registries::base::Index::accountModified,
- {});
+ return getLog(redfish::registries::base::Index::accountModified, {});
}
void accountModified(crow::Response& res)
@@ -1615,9 +1580,8 @@
std::string_view arg2,
std::string_view arg3)
{
- return getLog(
- redfish::message_registries::base::Index::queryParameterOutOfRange,
- std::to_array({arg1, arg2, arg3}));
+ return getLog(redfish::registries::base::Index::queryParameterOutOfRange,
+ std::to_array({arg1, arg2, arg3}));
}
void queryParameterOutOfRange(crow::Response& res, std::string_view arg1,
@@ -1631,9 +1595,8 @@
nlohmann::json passwordChangeRequired(const boost::urls::url_view& arg1)
{
std::string_view arg1str(arg1.data(), arg1.size());
- return getLog(
- redfish::message_registries::base::Index::passwordChangeRequired,
- std::to_array({arg1str}));
+ return getLog(redfish::registries::base::Index::passwordChangeRequired,
+ std::to_array({arg1str}));
}
/**
diff --git a/redfish-core/ut/registries_test.cpp b/redfish-core/ut/registries_test.cpp
index 8340340..b75883c 100644
--- a/redfish-core/ut/registries_test.cpp
+++ b/redfish-core/ut/registries_test.cpp
@@ -4,7 +4,7 @@
TEST(RedfishRegistries, fillMessageArgs)
{
- using redfish::message_registries::fillMessageArgs;
+ using redfish::registries::fillMessageArgs;
std::string toFill("%1");
fillMessageArgs({{"foo"}}, toFill);
EXPECT_EQ(toFill, "foo");
diff --git a/scripts/parse_registries.py b/scripts/parse_registries.py
index a8b50bf..63dcbca 100755
--- a/scripts/parse_registries.py
+++ b/scripts/parse_registries.py
@@ -30,7 +30,7 @@
// clang-format off
-namespace redfish::message_registries::{}
+namespace redfish::registries::{}
{{
'''
@@ -142,7 +142,7 @@
" {} = {},\n".format(messageId, index))
registry.write(
"}};\n"
- "}} // namespace redfish::message_registries::{}\n"
+ "}} // namespace redfish::registries::{}\n"
.format(namespace))