Lines Matching +full:milli +full:- +full:seconds
1 // SPDX-License-Identifier: Apache-2.0
2 // SPDX-FileCopyrightText: Copyright OpenBMC Authors
3 // SPDX-FileCopyrightText: Copyright 2018 Intel Corporation
32 #include <asm-generic/errno.h>
63 {{"SSH", "obmc-console-ssh"}, {"IPMI", "phosphor-ipmi-net"}}};
81 asyncResp->res.jsonValue["ProcessorSummary"]["Count"];
108 messages::internalError(asyncResp->res);
115 asyncResp->res.jsonValue["ProcessorSummary"]["CoreCount"];
165 messages::internalError(asyncResp->res);
199 messages::internalError(asyncResp->res);
206 asyncResp->res.jsonValue["MemorySummary"]["TotalSystemMemoryGiB"];
210 asyncResp->res.jsonValue["MemorySummary"]["TotalSystemMemoryGiB"] =
215 asyncResp->res.jsonValue["MemorySummary"]["TotalSystemMemoryGiB"] =
243 messages::internalError(asyncResp->res);
257 messages::internalError(asyncResp->res);
269 messages::internalError(asyncResp->res);
278 valueStr.insert(8, 1, '-');
279 valueStr.insert(13, 1, '-');
280 valueStr.insert(18, 1, '-');
281 valueStr.insert(23, 1, '-');
284 asyncResp->res.jsonValue["UUID"] = valueStr;
311 messages::internalError(asyncResp->res);
317 asyncResp->res.jsonValue["SubModel"] = *subModel;
336 asyncResp->res.jsonValue["AssetTag"] = value;
347 messages::internalError(asyncResp->res);
473 messages::internalError(asyncResp->res);
481 asyncResp->res.jsonValue["PowerState"] =
483 asyncResp->res.jsonValue["Status"]["State"] =
489 asyncResp->res.jsonValue["PowerState"] =
491 asyncResp->res.jsonValue["Status"]["State"] =
497 asyncResp->res.jsonValue["PowerState"] =
499 asyncResp->res.jsonValue["Status"]["State"] =
506 asyncResp->res.jsonValue["PowerState"] =
508 asyncResp->res.jsonValue["Status"]["State"] =
515 asyncResp->res.jsonValue["PowerState"] =
517 asyncResp->res.jsonValue["Status"]["State"] =
522 asyncResp->res.jsonValue["PowerState"] =
524 asyncResp->res.jsonValue["Status"]["State"] =
621 // Now convert the D-Bus BootProgress to the appropriate Redfish
685 BMCWEB_LOG_DEBUG("Unsupported D-Bus BootProgress {}", dbusBootProgress);
742 messages::propertyValueNotInList(asyncResp->res, rfSource,
744 return -1;
776 asyncResp->res.jsonValue["BootProgress"]["LastState"] =
802 BMCWEB_LOG_DEBUG("D-BUS response error {}", ec);
809 // https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/
813 asyncResp->res.jsonValue["BootProgress"]["LastStateTime"] =
847 asyncResp->res
855 messages::internalError(asyncResp->res);
859 asyncResp->res.jsonValue["Boot"]["BootSourceOverrideMode"] = rfType;
886 messages::internalError(asyncResp->res);
901 asyncResp->res
911 asyncResp->res
946 BMCWEB_LOG_ERROR("D-Bus response error: {}", ec);
947 messages::internalError(asyncResp->res);
957 asyncResp->res.jsonValue["Boot"]["BootSourceOverrideTarget"] =
985 asyncResp->res.jsonValue["Boot"]["BootSourceOverrideEnabled"] =
1004 messages::internalError(asyncResp->res);
1010 asyncResp->res.jsonValue["Boot"]["BootSourceOverrideEnabled"] =
1015 asyncResp->res.jsonValue["Boot"]["BootSourceOverrideEnabled"] =
1049 BMCWEB_LOG_ERROR("D-Bus response error: {}", ec);
1050 messages::internalError(asyncResp->res);
1084 * chassis D-Bus interface for the LastStateChangeTime since this has the
1105 BMCWEB_LOG_DEBUG("D-BUS response error {}", ec);
1110 // https://github.com/openbmc/phosphor-dbus-interfaces/blob/33e8e1dd64da53a66e888d33dc82001305cd0bf9/xyz/openbmc_project/State/Chassis.interface.yaml#L19
1114 asyncResp->res.jsonValue["LastResetTime"] =
1124 * automatic retry attempts left are hosted in phosphor-state-manager through
1152 BMCWEB_LOG_ERROR("D-Bus responses error: {}", ec);
1153 messages::internalError(asyncResp->res);
1167 messages::internalError(asyncResp->res);
1173 asyncResp->res
1180 asyncResp->res.jsonValue["Boot"]["AutomaticRetryAttempts"] =
1187 * @brief Retrieves Automatic Retry properties. Known on D-Bus as AutoReboot.
1216 BMCWEB_LOG_ERROR("D-Bus responses error: {}", ec);
1217 messages::internalError(asyncResp->res);
1225 asyncResp->res.jsonValue["Boot"]["AutomaticRetryConfig"] =
1230 asyncResp->res.jsonValue["Boot"]["AutomaticRetryConfig"] =
1241 asyncResp->res
1326 messages::internalError(asyncResp->res);
1330 asyncResp->res.jsonValue["PowerRestorePolicy"] = restore;
1358 messages::internalError(asyncResp->res);
1365 asyncResp->res.jsonValue["Boot"]["StopBootOnFault"] =
1370 asyncResp->res.jsonValue["Boot"]["StopBootOnFault"] =
1384 // This is an optional D-Bus object so just return if
1413 messages::internalError(asyncResp->res);
1418 service = subtree[0].second.begin()->first;
1430 BMCWEB_LOG_ERROR("D-BUS response error on TPM.Policy Get{}",
1432 messages::internalError(asyncResp->res);
1438 asyncResp->res
1444 asyncResp->res
1482 messages::internalError(asyncResp->res);
1487 messages::propertyValueNotInList(asyncResp->res, "ComputerSystem",
1501 messages::internalError(asyncResp->res);
1512 messages::internalError(asyncResp->res);
1517 serv = subtree[0].second.begin()->first;
1523 messages::internalError(asyncResp->res);
1591 messages::propertyValueNotInList(asyncResp->res, *bootType,
1650 messages::propertyValueNotInList(asyncResp->res, *bootEnable,
1714 messages::propertyValueNotInList(asyncResp->res, *bootSource,
1782 BMCWEB_LOG_DEBUG("D-Bus response error on GetSubTree {}", ec);
1783 messages::internalError(asyncResp->res);
1788 BMCWEB_LOG_DEBUG("Can't find system D-Bus object!");
1789 messages::internalError(asyncResp->res);
1792 // Assume only 1 system D-Bus object
1796 BMCWEB_LOG_DEBUG("Found more than 1 system D-Bus object!");
1797 messages::internalError(asyncResp->res);
1803 messages::internalError(asyncResp->res);
1808 const std::string& service = subtree[0].second.begin()->first;
1813 messages::internalError(asyncResp->res);
1867 messages::propertyValueNotInList(asyncResp->res, stopBootOnFault,
1910 messages::propertyValueNotInList(asyncResp->res, automaticRetryConfig,
1960 messages::propertyValueNotInList(asyncResp->res, policy,
1992 asyncResp->res
1994 asyncResp->res.jsonValue["Oem"]["OpenBmc"]["@odata.type"] =
2017 messages::internalError(asyncResp->res);
2024 messages::internalError(asyncResp->res);
2107 messages::internalError(asyncResp->res);
2119 messages::internalError(asyncResp->res);
2138 messages::internalError(asyncResp->res);
2144 asyncResp->res.jsonValue["PowerMode@Redfish.AllowableValues"] = modeList;
2151 messages::internalError(asyncResp->res);
2154 asyncResp->res.jsonValue["PowerMode"] = modeValue;
2178 // This is an optional D-Bus object so just return if
2193 "Found more than 1 system D-Bus Power.Mode objects: {}",
2195 messages::internalError(asyncResp->res);
2201 messages::internalError(asyncResp->res);
2205 const std::string& service = subtree[0].second.begin()->first;
2209 messages::internalError(asyncResp->res);
2271 messages::propertyValueNotInList(asyncResp->res, modeValue.dump(),
2308 // This is an optional D-Bus object, but user attempted to patch
2309 messages::internalError(asyncResp->res);
2314 // This is an optional D-Bus object, but user attempted to patch
2315 messages::resourceNotFound(asyncResp->res, "ComputerSystem",
2324 "Found more than 1 system D-Bus Power.Mode objects: {}",
2326 messages::internalError(asyncResp->res);
2332 messages::internalError(asyncResp->res);
2336 const std::string& service = subtree[0].second.begin()->first;
2340 messages::internalError(asyncResp->res);
2344 BMCWEB_LOG_DEBUG("Setting power mode({}) -> {}", powerMode, path);
2356 * @param[in] dbusAction The watchdog timeout action in D-BUS.
2440 asyncResp->res.jsonValue["HostWatchdogTimer"];
2454 messages::internalError(asyncResp->res);
2468 messages::internalError(asyncResp->res);
2501 messages::propertyValueNotInList(asyncResp->res, *wdtTimeOutAction,
2556 asyncResp->res.jsonValue["IdlePowerSaver"]["Enabled"] = *enabled;
2561 asyncResp->res.jsonValue["IdlePowerSaver"]["EnterUtilizationPercent"] =
2567 const std::chrono::duration<uint64_t, std::milli> ms(*enterDwellTime);
2568 asyncResp->res.jsonValue["IdlePowerSaver"]["EnterDwellTimeSeconds"] =
2575 asyncResp->res.jsonValue["IdlePowerSaver"]["ExitUtilizationPercent"] =
2581 const std::chrono::duration<uint64_t, std::milli> ms(*exitDwellTime);
2582 asyncResp->res.jsonValue["IdlePowerSaver"]["ExitDwellTimeSeconds"] =
2614 messages::internalError(asyncResp->res);
2629 "Found more than 1 system D-Bus Power.IdlePowerSaver objects: {}",
2631 messages::internalError(asyncResp->res);
2637 messages::internalError(asyncResp->res);
2641 const std::string& service = subtree[0].second.begin()->first;
2645 messages::internalError(asyncResp->res);
2661 messages::internalError(asyncResp->res);
2667 messages::internalError(asyncResp->res);
2714 messages::internalError(asyncResp->res);
2719 // This is an optional D-Bus object, but user attempted to patch
2720 messages::resourceNotFound(asyncResp->res, "ComputerSystem",
2729 "Found more than 1 system D-Bus Power.IdlePowerSaver objects: {}",
2731 messages::internalError(asyncResp->res);
2737 messages::internalError(asyncResp->res);
2741 const std::string& service = subtree[0].second.begin()->first;
2745 messages::internalError(asyncResp->res);
2769 // Convert from seconds into milliseconds for DBus
2785 // Convert from seconds into milliseconds for DBus
2805 asyncResp->res.addHeader(
2819 asyncResp->res.addHeader(
2822 asyncResp->res.jsonValue["@odata.type"] =
2824 asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/Systems";
2825 asyncResp->res.jsonValue["Name"] = "Computer System Collection";
2846 BMCWEB_LOG_ERROR(" Bad D-Bus request error: {}", ec);
2847 messages::internalError(asyncResp->res);
2850 messages::success(asyncResp->res);
2910 messages::actionParameterUnknown(asyncResp->res, "Reset", resetType);
2955 messages::resourceNotFound(asyncResp->res, "ComputerSystem",
2962 if (!json_util::readJsonAction(req, asyncResp->res, "ResetType", resetType))
2982 asyncResp->res.addHeader(
2995 messages::internalError(asyncResp->res);
3003 nlohmann::json& dataJson = asyncResp->res.jsonValue["SerialConsole"];
3006 // obmc-console-ssh service
3015 messages::internalError(asyncResp->res);
3019 asyncResp->res.jsonValue["SerialConsole"];
3040 asyncResp->res.addHeader(
3043 asyncResp->res.jsonValue["@odata.type"] =
3045 asyncResp->res.jsonValue["Name"] = systemName;
3046 asyncResp->res.jsonValue["Id"] = systemName;
3047 asyncResp->res.jsonValue["SystemType"] =
3049 asyncResp->res.jsonValue["Description"] = "Computer System";
3050 asyncResp->res.jsonValue["ProcessorSummary"]["Count"] = 0;
3051 asyncResp->res.jsonValue["MemorySummary"]["TotalSystemMemoryGiB"] =
3053 asyncResp->res.jsonValue["@odata.id"] =
3056 // Currently not supported on multi-host. TBD
3059 asyncResp->res.jsonValue["Bios"]["@odata.id"] =
3061 asyncResp->res.jsonValue["Processors"]["@odata.id"] =
3064 asyncResp->res.jsonValue["Memory"]["@odata.id"] =
3066 asyncResp->res.jsonValue["Storage"]["@odata.id"] =
3068 asyncResp->res.jsonValue["FabricAdapters"]["@odata.id"] =
3073 asyncResp->res.jsonValue["Actions"]["#ComputerSystem.Reset"]["target"] =
3076 asyncResp->res
3081 asyncResp->res.jsonValue["LogServices"]["@odata.id"] =
3088 asyncResp->res.jsonValue["Links"]["ManagedBy"] = std::move(managedBy);
3089 asyncResp->res.jsonValue["Status"]["Health"] = resource::Health::OK;
3090 asyncResp->res.jsonValue["Status"]["State"] = resource::State::Enabled;
3093 asyncResp->res.jsonValue["SerialConsole"]["MaxConcurrentSessions"] = 15;
3094 asyncResp->res.jsonValue["SerialConsole"]["IPMI"]["ServiceEnabled"] = true;
3096 asyncResp->res.jsonValue["SerialConsole"]["SSH"]["ServiceEnabled"] = true;
3097 asyncResp->res.jsonValue["SerialConsole"]["SSH"]["Port"] = 2200;
3098 asyncResp->res.jsonValue["SerialConsole"]["SSH"]["HotKeySequenceDisplay"] =
3106 asyncResp->res.jsonValue["GraphicalConsole"]["ServiceEnabled"] = true;
3107 asyncResp->res.jsonValue["GraphicalConsole"]["MaxConcurrentSessions"] =
3109 asyncResp->res.jsonValue["GraphicalConsole"]["ConnectTypesSupported"] =
3135 // Currently not supported on multi-host.
3148 aRsp->res.jsonValue["Links"]["Chassis"] =
3196 messages::resourceNotFound(asyncResp->res, "ComputerSystem",
3252 messages::propertyUnknown(asyncResp->res, "IndicatorLED");
3315 messages::resourceNotFound(asyncResp->res, "Systems",
3330 asyncResp->res.addHeader(boost::beast::http::field::warning,
3331 "299 - \"IndicatorLED is deprecated. Use "
3373 messages::resourceNotFound(asyncResp->res, "ComputerSystem",
3379 asyncResp->res.addHeader(
3384 req, asyncResp->res, //
3425 asyncResp->res.addHeader(
3499 messages::internalError(asyncResp->res);
3519 asyncResp->res.jsonValue["Parameters"] = std::move(parameters);
3557 messages::resourceNotFound(asyncResp->res, "ComputerSystem",
3563 asyncResp->res.addHeader(
3567 asyncResp->res.jsonValue["@odata.id"] = boost::urls::format(
3569 asyncResp->res.jsonValue["@odata.type"] = "#ActionInfo.v1_1_2.ActionInfo";
3570 asyncResp->res.jsonValue["Name"] = "Reset Action Info";
3571 asyncResp->res.jsonValue["Id"] = "ResetActionInfo";