Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions redfish-core/include/registries_selector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
#include "registries/task_event_message_registry.hpp"
// NOLINTNEXTLINE(misc-include-cleaner)
#include "registries/telemetry_message_registry.hpp"
// NOLINTNEXTLINE(misc-include-cleaner)
#include "registries/bios_attribute_registry.hpp"
62 changes: 62 additions & 0 deletions redfish-core/lib/bios.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ inline void
asyncResp->res.jsonValue["@Redfish.Settings"]["SettingsObject"] = {
{"@odata.id", "/redfish/v1/Systems/system/Bios/SD"}};
asyncResp->res.jsonValue["Name"] = "BIOS Configuration";
asyncResp->res.jsonValue["AttributeRegistry"] = "BiosAttributeRegistry";
asyncResp->res.jsonValue["Description"] = "BIOS Configuration Service";
asyncResp->res.jsonValue["Id"] = "BIOS";
asyncResp->res.jsonValue["Actions"]["#Bios.ResetBios"]["target"] =
Expand Down Expand Up @@ -528,4 +529,65 @@ inline void requestRoutesBiosSettings(App& app)
std::bind_front(handleBiosSettingsGet, std::ref(app)));
}

inline void handleBiosAttributeRegistryGet(
crow::App& app, const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& systemName)
{
if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}

if (systemName != BMCWEB_REDFISH_SYSTEM_URI_NAME)
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
return;
}

asyncResp->res.jsonValue["@odata.type"] =
"#AttributeRegistry.v1_3_2.AttributeRegistry";
asyncResp->res.jsonValue["Id"] = "BiosAttributeRegistry";
asyncResp->res.jsonValue["Name"] = "BIOS Attribute Registry";
asyncResp->res.jsonValue["Language"] = "en";
asyncResp->res.jsonValue["RegistryVersion"] = "1.0.0";
asyncResp->res.jsonValue["RegistryPrefix"] = "BiosAttributeRegistry";
}

inline void requestRoutesBiosAttributeRegistry(App& app)
{
BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/Bios/BiosAttributeRegistry")
.privileges(redfish::privileges::getBios)
.methods(boost::beast::http::verb::get)(
std::bind_front(handleBiosAttributeRegistryGet, std::ref(app)));
}

inline void handleBiosAttributeRegistryMetadataGet(
crow::App& app, const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}

asyncResp->res.jsonValue["@odata.type"] = "#MessageRegistryFile.v1_1_0.MessageRegistryFile";
asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/Registries/BiosAttributeRegistry";
asyncResp->res.jsonValue["Id"] = "BiosAttributeRegistry";
asyncResp->res.jsonValue["Name"] = "BIOS Attribute Registry File";
asyncResp->res.jsonValue["Description"] = "BIOS Attribute Registry File Location";
asyncResp->res.jsonValue["Registry"] = "BiosAttributeRegistry.1.0.0";
asyncResp->res.jsonValue["Languages"] = {"en"};
asyncResp->res.jsonValue["Languages@odata.count"] = 1;

nlohmann::json::array_t location;
nlohmann::json::object_t obj;
obj["Language"] = "en";
obj["Uri"] = boost::urls::format("/redfish/v1/Systems/{}/Bios/BiosAttributeRegistry",
BMCWEB_REDFISH_SYSTEM_URI_NAME);
location.emplace_back(std::move(obj));
asyncResp->res.jsonValue["Location"] = std::move(location);
asyncResp->res.jsonValue["Location@odata.count"] = 1;
}

} // namespace redfish
8 changes: 8 additions & 0 deletions redfish-core/lib/message_registries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ inline void handleMessageRegistryFileCollectionGet(
"Collection of MessageRegistryFiles";

nlohmann::json& members = asyncResp->res.jsonValue["Members"];
members.push_back({{"@odata.id", "/redfish/v1/Registries/BiosAttributeRegistry"}});

for (const auto& memberName : std::views::keys(registries::allRegistries()))
{
Expand Down Expand Up @@ -74,6 +75,13 @@ inline void handleMessageRoutesMessageRegistryFileGet(
{
return;
}

if (registry == "BiosAttributeRegistry")
{
handleBiosAttributeRegistryMetadataGet(app, req, asyncResp);
return;
}

std::string dmtf = "DMTF ";
std::optional<registries::RegistryEntryRef> registryEntry =
registries::getRegistryFromPrefix(registry);
Expand Down
1 change: 1 addition & 0 deletions redfish-core/src/redfish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ RedfishService::RedfishService(App& app)
requestRoutesBiosService(app);
requestRoutesBiosReset(app);
requestRoutesBiosSettings(app);
requestRoutesBiosAttributeRegistry(app);

if constexpr (BMCWEB_VM_NBDPROXY)
{
Expand Down