blob: 69a48a7cb5c4d44b235f9253c20f6e16306553de [file] [log] [blame]
Rapkiewicz, Pawele37f8452018-03-09 13:49:50 +01001/*
2// Copyright (c) 2018 Intel Corporation
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15*/
16#pragma once
17
James Feistb49ac872019-05-21 15:12:01 -070018#include "health.hpp"
James Feist1c8fba92019-12-20 15:12:07 -080019#include "led.hpp"
Rapkiewicz, Pawele37f8452018-03-09 13:49:50 +010020#include "node.hpp"
Ed Tanous1abe55e2018-09-05 08:30:59 -070021
Rapkiewicz, Pawele37f8452018-03-09 13:49:50 +010022#include <boost/container/flat_map.hpp>
Ed Tanousabf2add2019-01-22 16:40:12 -080023#include <variant>
Rapkiewicz, Pawele37f8452018-03-09 13:49:50 +010024
Ed Tanous1abe55e2018-09-05 08:30:59 -070025namespace redfish
26{
Rapkiewicz, Pawele37f8452018-03-09 13:49:50 +010027
28/**
Gunnar Millsbeeca0a2019-02-14 16:30:45 -060029 * @brief Retrieves chassis state properties over dbus
30 *
31 * @param[in] aResp - Shared pointer for completing asynchronous calls.
32 *
33 * @return None.
34 */
35void getChassisState(std::shared_ptr<AsyncResp> aResp)
36{
37 crow::connections::systemBus->async_method_call(
38 [aResp{std::move(aResp)}](
39 const boost::system::error_code ec,
40 const std::variant<std::string> &chassisState) {
41 if (ec)
42 {
43 BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
44 messages::internalError(aResp->res);
45 return;
46 }
47
48 const std::string *s = std::get_if<std::string>(&chassisState);
49 BMCWEB_LOG_DEBUG << "Chassis state: " << *s;
50 if (s != nullptr)
51 {
52 // Verify Chassis State
53 if (*s == "xyz.openbmc_project.State.Chassis.PowerState.On")
54 {
55 aResp->res.jsonValue["PowerState"] = "On";
56 aResp->res.jsonValue["Status"]["State"] = "Enabled";
57 }
58 else if (*s ==
59 "xyz.openbmc_project.State.Chassis.PowerState.Off")
60 {
61 aResp->res.jsonValue["PowerState"] = "Off";
62 aResp->res.jsonValue["Status"]["State"] = "StandbyOffline";
63 }
64 }
65 },
66 "xyz.openbmc_project.State.Chassis",
67 "/xyz/openbmc_project/state/chassis0",
68 "org.freedesktop.DBus.Properties", "Get",
69 "xyz.openbmc_project.State.Chassis", "CurrentPowerState");
70}
71
72/**
Rapkiewicz, Pawele37f8452018-03-09 13:49:50 +010073 * DBus types primitives for several generic DBus interfaces
74 * TODO(Pawel) consider move this to separate file into boost::dbus
75 */
Ed Tanous55c7b7a2018-05-22 15:27:24 -070076// Note, this is not a very useful Variant, but because it isn't used to get
Ed Tanousaa2e59c2018-04-12 12:17:20 -070077// values, it should be as simple as possible
78// TODO(ed) invent a nullvariant type
Cheng C Yang5fd7ba62019-11-28 15:58:08 +080079using VariantType = std::variant<bool, std::string, uint64_t, uint32_t>;
Ed Tanousaa2e59c2018-04-12 12:17:20 -070080using ManagedObjectsType = std::vector<std::pair<
81 sdbusplus::message::object_path,
82 std::vector<std::pair<std::string,
83 std::vector<std::pair<std::string, VariantType>>>>>>;
Rapkiewicz, Pawele37f8452018-03-09 13:49:50 +010084
Ed Tanousaa2e59c2018-04-12 12:17:20 -070085using PropertiesType = boost::container::flat_map<std::string, VariantType>;
Rapkiewicz, Pawele37f8452018-03-09 13:49:50 +010086
Qiang XUc1819422019-02-27 13:51:32 +080087void getIntrusionByService(std::shared_ptr<AsyncResp> aResp,
88 const std::string &service,
89 const std::string &objPath)
90{
91 BMCWEB_LOG_DEBUG << "Get intrusion status by service \n";
92
93 crow::connections::systemBus->async_method_call(
94 [aResp{std::move(aResp)}](const boost::system::error_code ec,
95 const std::variant<std::string> &value) {
96 if (ec)
97 {
98 // do not add err msg in redfish response, becaues this is not
99 // mandatory property
100 BMCWEB_LOG_ERROR << "DBUS response error " << ec << "\n";
101 return;
102 }
103
104 const std::string *status = std::get_if<std::string>(&value);
105
106 if (status == nullptr)
107 {
108 BMCWEB_LOG_ERROR << "intrusion status read error \n";
109 return;
110 }
111
112 aResp->res.jsonValue["PhysicalSecurity"] = {
113 {"IntrusionSensorNumber", 1}, {"IntrusionSensor", *status}};
114 },
115 service, objPath, "org.freedesktop.DBus.Properties", "Get",
116 "xyz.openbmc_project.Chassis.Intrusion", "Status");
117}
118
119/**
120 * Retrieves physical security properties over dbus
121 */
122void getPhysicalSecurityData(std::shared_ptr<AsyncResp> aResp)
123{
124 crow::connections::systemBus->async_method_call(
125 [aResp{std::move(aResp)}](
126 const boost::system::error_code ec,
127 const std::vector<std::pair<
128 std::string,
129 std::vector<std::pair<std::string, std::vector<std::string>>>>>
130 &subtree) {
131 if (ec)
132 {
133 // do not add err msg in redfish response, becaues this is not
134 // mandatory property
135 BMCWEB_LOG_ERROR << "DBUS error: no matched iface " << ec
136 << "\n";
137 return;
138 }
139 // Iterate over all retrieved ObjectPaths.
140 for (const auto &object : subtree)
141 {
142 for (const auto &service : object.second)
143 {
144 getIntrusionByService(aResp, service.first, object.first);
145 return;
146 }
147 }
148 },
149 "xyz.openbmc_project.ObjectMapper",
150 "/xyz/openbmc_project/object_mapper",
151 "xyz.openbmc_project.ObjectMapper", "GetSubTree",
Ed Tanous271584a2019-07-09 16:24:22 -0700152 "/xyz/openbmc_project/Intrusion", 1,
Qiang XUc1819422019-02-27 13:51:32 +0800153 std::array<const char *, 1>{"xyz.openbmc_project.Chassis.Intrusion"});
154}
155
Rapkiewicz, Pawele37f8452018-03-09 13:49:50 +0100156/**
Rapkiewicz, Pawele37f8452018-03-09 13:49:50 +0100157 * ChassisCollection derived class for delivering Chassis Collection Schema
158 */
Ed Tanous1abe55e2018-09-05 08:30:59 -0700159class ChassisCollection : public Node
160{
161 public:
162 ChassisCollection(CrowApp &app) : Node(app, "/redfish/v1/Chassis/")
163 {
Ed Tanous1abe55e2018-09-05 08:30:59 -0700164 entityPrivileges = {
165 {boost::beast::http::verb::get, {{"Login"}}},
166 {boost::beast::http::verb::head, {{"Login"}}},
167 {boost::beast::http::verb::patch, {{"ConfigureComponents"}}},
168 {boost::beast::http::verb::put, {{"ConfigureComponents"}}},
169 {boost::beast::http::verb::delete_, {{"ConfigureComponents"}}},
170 {boost::beast::http::verb::post, {{"ConfigureComponents"}}}};
171 }
Rapkiewicz, Pawele37f8452018-03-09 13:49:50 +0100172
Ed Tanous1abe55e2018-09-05 08:30:59 -0700173 private:
174 /**
175 * Functions triggers appropriate requests on DBus
176 */
177 void doGet(crow::Response &res, const crow::Request &req,
178 const std::vector<std::string> &params) override
179 {
Ed Tanous0f74e642018-11-12 15:17:05 -0800180 res.jsonValue["@odata.type"] = "#ChassisCollection.ChassisCollection";
181 res.jsonValue["@odata.id"] = "/redfish/v1/Chassis";
Ed Tanous0f74e642018-11-12 15:17:05 -0800182 res.jsonValue["Name"] = "Chassis Collection";
183
Shawn McCarneyadc4f0d2019-07-24 09:21:50 -0500184 const std::array<const char *, 2> interfaces = {
Gunnar Mills603a6642019-01-21 17:03:51 -0600185 "xyz.openbmc_project.Inventory.Item.Board",
Shawn McCarneyadc4f0d2019-07-24 09:21:50 -0500186 "xyz.openbmc_project.Inventory.Item.Chassis"};
Gunnar Mills603a6642019-01-21 17:03:51 -0600187
Ed Tanous62d5e2e2018-09-05 16:17:25 -0700188 auto asyncResp = std::make_shared<AsyncResp>(res);
189 crow::connections::systemBus->async_method_call(
190 [asyncResp](const boost::system::error_code ec,
191 const std::vector<std::string> &chassisList) {
192 if (ec)
Ed Tanous1abe55e2018-09-05 08:30:59 -0700193 {
Jason M. Billsf12894f2018-10-09 12:45:45 -0700194 messages::internalError(asyncResp->res);
Ed Tanous62d5e2e2018-09-05 16:17:25 -0700195 return;
Ed Tanous1abe55e2018-09-05 08:30:59 -0700196 }
Ed Tanous62d5e2e2018-09-05 16:17:25 -0700197 nlohmann::json &chassisArray =
198 asyncResp->res.jsonValue["Members"];
199 chassisArray = nlohmann::json::array();
200 for (const std::string &objpath : chassisList)
201 {
202 std::size_t lastPos = objpath.rfind("/");
203 if (lastPos == std::string::npos)
204 {
205 BMCWEB_LOG_ERROR << "Failed to find '/' in " << objpath;
206 continue;
207 }
208 chassisArray.push_back(
209 {{"@odata.id", "/redfish/v1/Chassis/" +
210 objpath.substr(lastPos + 1)}});
211 }
Rapkiewicz, Pawele37f8452018-03-09 13:49:50 +0100212
Ed Tanous62d5e2e2018-09-05 16:17:25 -0700213 asyncResp->res.jsonValue["Members@odata.count"] =
214 chassisArray.size();
215 },
216 "xyz.openbmc_project.ObjectMapper",
217 "/xyz/openbmc_project/object_mapper",
218 "xyz.openbmc_project.ObjectMapper", "GetSubTreePaths",
Ed Tanous271584a2019-07-09 16:24:22 -0700219 "/xyz/openbmc_project/inventory", 0, interfaces);
Ed Tanous62d5e2e2018-09-05 16:17:25 -0700220 }
Rapkiewicz, Pawele37f8452018-03-09 13:49:50 +0100221};
222
223/**
224 * Chassis override class for delivering Chassis Schema
225 */
Ed Tanous1abe55e2018-09-05 08:30:59 -0700226class Chassis : public Node
227{
228 public:
229 Chassis(CrowApp &app) :
230 Node(app, "/redfish/v1/Chassis/<str>/", std::string())
231 {
Ed Tanous1abe55e2018-09-05 08:30:59 -0700232 entityPrivileges = {
233 {boost::beast::http::verb::get, {{"Login"}}},
234 {boost::beast::http::verb::head, {{"Login"}}},
235 {boost::beast::http::verb::patch, {{"ConfigureComponents"}}},
236 {boost::beast::http::verb::put, {{"ConfigureComponents"}}},
237 {boost::beast::http::verb::delete_, {{"ConfigureComponents"}}},
238 {boost::beast::http::verb::post, {{"ConfigureComponents"}}}};
Rapkiewicz, Pawele37f8452018-03-09 13:49:50 +0100239 }
Rapkiewicz, Pawele37f8452018-03-09 13:49:50 +0100240
Ed Tanous1abe55e2018-09-05 08:30:59 -0700241 private:
242 /**
243 * Functions triggers appropriate requests on DBus
244 */
245 void doGet(crow::Response &res, const crow::Request &req,
246 const std::vector<std::string> &params) override
247 {
Shawn McCarneyadc4f0d2019-07-24 09:21:50 -0500248 const std::array<const char *, 2> interfaces = {
Gunnar Mills734bfe92019-01-21 16:33:50 -0600249 "xyz.openbmc_project.Inventory.Item.Board",
Shawn McCarneyadc4f0d2019-07-24 09:21:50 -0500250 "xyz.openbmc_project.Inventory.Item.Chassis"};
Gunnar Mills734bfe92019-01-21 16:33:50 -0600251
Ed Tanous1abe55e2018-09-05 08:30:59 -0700252 // Check if there is required param, truly entering this shall be
253 // impossible.
254 if (params.size() != 1)
255 {
Jason M. Billsf12894f2018-10-09 12:45:45 -0700256 messages::internalError(res);
Ed Tanousdaf36e22018-04-20 16:01:36 -0700257 res.end();
258 return;
Ed Tanous1abe55e2018-09-05 08:30:59 -0700259 }
Shawn McCarney99cffd72019-03-01 10:46:20 -0600260 const std::string &chassisId = params[0];
Ed Tanouse0d918b2018-03-27 17:41:04 -0700261
Ed Tanous62d5e2e2018-09-05 16:17:25 -0700262 auto asyncResp = std::make_shared<AsyncResp>(res);
Ed Tanous1abe55e2018-09-05 08:30:59 -0700263 crow::connections::systemBus->async_method_call(
Ed Tanous62d5e2e2018-09-05 16:17:25 -0700264 [asyncResp, chassisId(std::string(chassisId))](
265 const boost::system::error_code ec,
James Feist1c8fba92019-12-20 15:12:07 -0800266 const crow::openbmc_mapper::GetSubTreeType &subtree) {
Ed Tanous62d5e2e2018-09-05 16:17:25 -0700267 if (ec)
Ed Tanous1abe55e2018-09-05 08:30:59 -0700268 {
Jason M. Billsf12894f2018-10-09 12:45:45 -0700269 messages::internalError(asyncResp->res);
Ed Tanous1abe55e2018-09-05 08:30:59 -0700270 return;
271 }
272 // Iterate over all retrieved ObjectPaths.
273 for (const std::pair<
274 std::string,
275 std::vector<
276 std::pair<std::string, std::vector<std::string>>>>
277 &object : subtree)
278 {
279 const std::string &path = object.first;
280 const std::vector<
281 std::pair<std::string, std::vector<std::string>>>
282 &connectionNames = object.second;
Ed Tanouse0d918b2018-03-27 17:41:04 -0700283
Ed Tanous1abe55e2018-09-05 08:30:59 -0700284 if (!boost::ends_with(path, chassisId))
285 {
286 continue;
Ed Tanousdaf36e22018-04-20 16:01:36 -0700287 }
Shawn McCarney26f03892019-05-03 13:20:24 -0500288
James Feistb49ac872019-05-21 15:12:01 -0700289 auto health = std::make_shared<HealthPopulate>(asyncResp);
290
291 crow::connections::systemBus->async_method_call(
292 [health](const boost::system::error_code ec,
293 std::variant<std::vector<std::string>> &resp) {
294 if (ec)
295 {
296 return; // no sensors = no failures
297 }
298 std::vector<std::string> *data =
299 std::get_if<std::vector<std::string>>(&resp);
300 if (data == nullptr)
301 {
302 return;
303 }
304 health->inventory = std::move(*data);
305 },
306 "xyz.openbmc_project.ObjectMapper",
307 path + "/all_sensors",
308 "org.freedesktop.DBus.Properties", "Get",
309 "xyz.openbmc_project.Association", "endpoints");
310
311 health->populate();
312
Ed Tanous1abe55e2018-09-05 08:30:59 -0700313 if (connectionNames.size() < 1)
314 {
James Feist1c8fba92019-12-20 15:12:07 -0800315 BMCWEB_LOG_ERROR << "Got 0 Connection names";
Ed Tanous1abe55e2018-09-05 08:30:59 -0700316 continue;
317 }
Ed Tanouse0d918b2018-03-27 17:41:04 -0700318
Johnathan Mantey49c53ac2019-05-02 09:22:38 -0700319 asyncResp->res.jsonValue["@odata.type"] =
Jason M. Billsadbe1922019-10-14 15:44:35 -0700320 "#Chassis.v1_10_0.Chassis";
Johnathan Mantey49c53ac2019-05-02 09:22:38 -0700321 asyncResp->res.jsonValue["@odata.id"] =
322 "/redfish/v1/Chassis/" + chassisId;
Johnathan Mantey49c53ac2019-05-02 09:22:38 -0700323 asyncResp->res.jsonValue["Name"] = "Chassis Collection";
324 asyncResp->res.jsonValue["ChassisType"] = "RackMount";
Jason M. Billsadbe1922019-10-14 15:44:35 -0700325 asyncResp->res.jsonValue["PCIeDevices"] = {
326 {"@odata.id",
327 "/redfish/v1/Systems/system/PCIeDevices"}};
Johnathan Mantey49c53ac2019-05-02 09:22:38 -0700328
329 const std::string &connectionName =
330 connectionNames[0].first;
James Feist1c8fba92019-12-20 15:12:07 -0800331
332 const std::vector<std::string> &interfaces =
333 connectionNames[0].second;
334 const std::array<const char *, 2> hasIndicatorLed = {
335 "xyz.openbmc_project.Inventory.Item.Panel",
336 "xyz.openbmc_project.Inventory.Item.Board.Motherboard"};
337
338 for (const char *interface : hasIndicatorLed)
339 {
340 if (std::find(interfaces.begin(), interfaces.end(),
341 interface) != interfaces.end())
342 {
343 getIndicatorLedState(asyncResp);
344 break;
345 }
346 }
347
Ed Tanous1abe55e2018-09-05 08:30:59 -0700348 crow::connections::systemBus->async_method_call(
Ed Tanous62d5e2e2018-09-05 16:17:25 -0700349 [asyncResp, chassisId(std::string(chassisId))](
350 const boost::system::error_code ec,
Ed Tanous1abe55e2018-09-05 08:30:59 -0700351 const std::vector<std::pair<
352 std::string, VariantType>> &propertiesList) {
353 for (const std::pair<std::string, VariantType>
354 &property : propertiesList)
355 {
Shawn McCarney99cffd72019-03-01 10:46:20 -0600356 // Store DBus properties that are also Redfish
357 // properties with same name and a string value
358 const std::string &propertyName =
359 property.first;
360 if ((propertyName == "PartNumber") ||
361 (propertyName == "SerialNumber") ||
362 (propertyName == "Manufacturer") ||
363 (propertyName == "Model"))
Ed Tanous1abe55e2018-09-05 08:30:59 -0700364 {
Shawn McCarney99cffd72019-03-01 10:46:20 -0600365 const std::string *value =
366 std::get_if<std::string>(
367 &property.second);
368 if (value != nullptr)
369 {
370 asyncResp->res.jsonValue[propertyName] =
371 *value;
372 }
Ed Tanous1abe55e2018-09-05 08:30:59 -0700373 }
374 }
Ed Tanous62d5e2e2018-09-05 16:17:25 -0700375 asyncResp->res.jsonValue["Name"] = chassisId;
376 asyncResp->res.jsonValue["Id"] = chassisId;
377 asyncResp->res.jsonValue["Thermal"] = {
Ed Tanous1abe55e2018-09-05 08:30:59 -0700378 {"@odata.id", "/redfish/v1/Chassis/" +
379 chassisId + "/Thermal"}};
Ed Tanous2474adf2018-09-05 16:31:16 -0700380 // Power object
381 asyncResp->res.jsonValue["Power"] = {
382 {"@odata.id", "/redfish/v1/Chassis/" +
383 chassisId + "/Power"}};
Anthony Wilson95a3eca2019-06-11 10:44:47 -0500384 // SensorCollection
385 asyncResp->res.jsonValue["Sensors"] = {
386 {"@odata.id", "/redfish/v1/Chassis/" +
387 chassisId + "/Sensors"}};
Ed Tanous029573d2019-02-01 10:57:49 -0800388 asyncResp->res.jsonValue["Status"] = {
Ed Tanous029573d2019-02-01 10:57:49 -0800389 {"State", "Enabled"},
390 };
Ed Tanous2474adf2018-09-05 16:31:16 -0700391
Ed Tanous029573d2019-02-01 10:57:49 -0800392 asyncResp->res
393 .jsonValue["Links"]["ComputerSystems"] = {
394 {{"@odata.id", "/redfish/v1/Systems/system"}}};
395 asyncResp->res.jsonValue["Links"]["ManagedBy"] = {
396 {{"@odata.id", "/redfish/v1/Managers/bmc"}}};
Gunnar Millsbeeca0a2019-02-14 16:30:45 -0600397 getChassisState(asyncResp);
Ed Tanous1abe55e2018-09-05 08:30:59 -0700398 },
399 connectionName, path, "org.freedesktop.DBus.Properties",
400 "GetAll",
401 "xyz.openbmc_project.Inventory.Decorator.Asset");
Ed Tanous1abe55e2018-09-05 08:30:59 -0700402 return;
403 }
Ed Tanouse0d918b2018-03-27 17:41:04 -0700404
Ed Tanous1abe55e2018-09-05 08:30:59 -0700405 // Couldn't find an object with that name. return an error
Jason M. Billsf12894f2018-10-09 12:45:45 -0700406 messages::resourceNotFound(
Jason M. Billsadbe1922019-10-14 15:44:35 -0700407 asyncResp->res, "#Chassis.v1_10_0.Chassis", chassisId);
Ed Tanous1abe55e2018-09-05 08:30:59 -0700408 },
409 "xyz.openbmc_project.ObjectMapper",
410 "/xyz/openbmc_project/object_mapper",
411 "xyz.openbmc_project.ObjectMapper", "GetSubTree",
Ed Tanous271584a2019-07-09 16:24:22 -0700412 "/xyz/openbmc_project/inventory", 0, interfaces);
Qiang XUc1819422019-02-27 13:51:32 +0800413
414 getPhysicalSecurityData(asyncResp);
Ed Tanous1abe55e2018-09-05 08:30:59 -0700415 }
James Feist1c8fba92019-12-20 15:12:07 -0800416
417 void doPatch(crow::Response &res, const crow::Request &req,
418 const std::vector<std::string> &params) override
419 {
420 std::optional<std::string> indicatorLed;
421 auto asyncResp = std::make_shared<AsyncResp>(res);
422
423 if (params.size() != 1)
424 {
425 return;
426 }
427
428 if (!json_util::readJson(req, res, "IndicatorLED", indicatorLed))
429 {
430 return;
431 }
432
433 if (!indicatorLed)
434 {
435 return; // delete this when we support more patch properties
436 }
437
438 const std::array<const char *, 2> interfaces = {
439 "xyz.openbmc_project.Inventory.Item.Board",
440 "xyz.openbmc_project.Inventory.Item.Chassis"};
441
442 const std::string &chassisId = params[0];
443
444 crow::connections::systemBus->async_method_call(
445 [asyncResp, chassisId, indicatorLed](
446 const boost::system::error_code ec,
447 const crow::openbmc_mapper::GetSubTreeType &subtree) {
448 if (ec)
449 {
450 messages::internalError(asyncResp->res);
451 return;
452 }
453
454 // Iterate over all retrieved ObjectPaths.
455 for (const std::pair<
456 std::string,
457 std::vector<
458 std::pair<std::string, std::vector<std::string>>>>
459 &object : subtree)
460 {
461 const std::string &path = object.first;
462 const std::vector<
463 std::pair<std::string, std::vector<std::string>>>
464 &connectionNames = object.second;
465
466 if (!boost::ends_with(path, chassisId))
467 {
468 continue;
469 }
470
471 if (connectionNames.size() < 1)
472 {
473 BMCWEB_LOG_ERROR << "Got 0 Connection names";
474 continue;
475 }
476
477 const std::vector<std::string> &interfaces =
478 connectionNames[0].second;
479
480 if (indicatorLed)
481 {
482 const std::array<const char *, 2> hasIndicatorLed = {
483 "xyz.openbmc_project.Inventory.Item.Panel",
484 "xyz.openbmc_project.Inventory.Item.Board."
485 "Motherboard"};
486 bool indicatorChassis = false;
487 for (const char *interface : hasIndicatorLed)
488 {
489 if (std::find(interfaces.begin(), interfaces.end(),
490 interface) != interfaces.end())
491 {
492 indicatorChassis = true;
493 break;
494 }
495 }
496 if (indicatorChassis)
497 {
498 setIndicatorLedState(asyncResp,
499 std::move(*indicatorLed));
500 }
501 else
502 {
503 messages::propertyUnknown(asyncResp->res,
504 "IndicatorLED");
505 }
506 }
507 return;
508 }
509
510 messages::resourceNotFound(
511 asyncResp->res, "#Chassis.v1_10_0.Chassis", chassisId);
512 },
513 "xyz.openbmc_project.ObjectMapper",
514 "/xyz/openbmc_project/object_mapper",
515 "xyz.openbmc_project.ObjectMapper", "GetSubTree",
516 "/xyz/openbmc_project/inventory", 0, interfaces);
517 }
Ed Tanous62d5e2e2018-09-05 16:17:25 -0700518};
Ed Tanous1abe55e2018-09-05 08:30:59 -0700519} // namespace redfish