Skip to content

Commit

Permalink
testing: use new logic in systems.hpp
Browse files Browse the repository at this point in the history
Change-Id: I3b825e42c52f017659553ff22a7bacf9e07cfa6f
  • Loading branch information
Oliver Brewka committed Aug 22, 2024
1 parent 1a9a823 commit 798f21a
Showing 1 changed file with 45 additions and 36 deletions.
81 changes: 45 additions & 36 deletions redfish-core/lib/systems.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,16 @@ inline void
*
* @return None.
*/
inline void getHostState(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
inline void getHostState(
const std::map<std::string, std::string>& /*reqParams*/,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& /*systemName*/,
const sdbusplus::message::object_path& path, const std::string& service)
{
BMCWEB_LOG_DEBUG("Get host information.");
sdbusplus::asio::getProperty<std::string>(
*crow::connections::systemBus, "xyz.openbmc_project.State.Host",
"/xyz/openbmc_project/state/host0", "xyz.openbmc_project.State.Host",
"CurrentHostState",
*crow::connections::systemBus, service, path,
"xyz.openbmc_project.State.Host", "CurrentHostState",
[asyncResp](const boost::system::error_code& ec,
const std::string& hostState) {
if (ec)
Expand Down Expand Up @@ -2995,26 +2998,26 @@ inline void
return;
}

if constexpr (BMCWEB_EXPERIMENTAL_REDFISH_MULTI_COMPUTER_SYSTEM)
{
// Option currently returns no systems. TBD
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
systemName);
return;
}
// if constexpr (BMCWEB_EXPERIMENTAL_REDFISH_MULTI_COMPUTER_SYSTEM)
// {
// // Option currently returns no systems. TBD
// messages::resourceNotFound(asyncResp->res, "ComputerSystem",
// systemName);
// return;
// }

if (systemName == "hypervisor")
{
handleHypervisorSystemGet(asyncResp);
return;
}

if (systemName != BMCWEB_REDFISH_SYSTEM_URI_NAME)
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
systemName);
return;
}
// if (systemName != BMCWEB_REDFISH_SYSTEM_URI_NAME)
// {
// messages::resourceNotFound(asyncResp->res, "ComputerSystem",
// systemName);
// return;
// }
asyncResp->res.addHeader(
boost::beast::http::field::link,
"</redfish/v1/JsonSchemas/ComputerSystem/ComputerSystem.json>; rel=describedby");
Expand Down Expand Up @@ -3094,28 +3097,34 @@ inline void
aRsp->res.jsonValue["Links"]["Chassis"] = std::move(chassisArray);
});

const std::map<std::string, std::string> reqParams;

getSystemLocationIndicatorActive(asyncResp);
// TODO (Gunnar): Remove IndicatorLED after enough time has passed
getIndicatorLedState(asyncResp);
getComputerSystem(asyncResp);
getHostState(asyncResp);
getBootProperties(asyncResp);
getBootProgress(asyncResp);
getBootProgressLastStateTime(asyncResp);
pcie_util::getPCIeDeviceList(asyncResp,
nlohmann::json::json_pointer("/PCIeDevices"));
getHostWatchdogTimer(asyncResp);
getPowerRestorePolicy(asyncResp);
getStopBootOnFault(asyncResp);
getAutomaticRetryPolicy(asyncResp);
getLastResetTime(asyncResp);
if constexpr (BMCWEB_REDFISH_PROVISIONING_FEATURE)
{
getProvisioningStatus(asyncResp);
}
getTrustedModuleRequiredToBoot(asyncResp);
getPowerMode(asyncResp);
getIdlePowerSaver(asyncResp);
// getComputerSystem(asyncResp);

// getHostState(asyncResp);
getComputerSystemDBusResources(reqParams, asyncResp, systemName,
"xyz.openbmc_project.State.Host",
getHostState);
// getBootProperties(asyncResp);
// getBootProgress(asyncResp);
// getBootProgressLastStateTime(asyncResp);
// pcie_util::getPCIeDeviceList(asyncResp,
// nlohmann::json::json_pointer("/PCIeDevices"));
// getHostWatchdogTimer(asyncResp);
// getPowerRestorePolicy(asyncResp);
// getStopBootOnFault(asyncResp);
// getAutomaticRetryPolicy(asyncResp);
// getLastResetTime(asyncResp);
// if constexpr (BMCWEB_REDFISH_PROVISIONING_FEATURE)
// {
// getProvisioningStatus(asyncResp);
// }
// getTrustedModuleRequiredToBoot(asyncResp);
// getPowerMode(asyncResp);
// getIdlePowerSaver(asyncResp);
}

inline void handleComputerSystemPatch(
Expand Down

0 comments on commit 798f21a

Please sign in to comment.