xref: /openbmc/bmcweb/features/redfish/lib/chassis.hpp (revision 26f0389959179b37bae5410dfd5a84831fbdaee6)
1e37f8451SRapkiewicz, Pawel /*
2e37f8451SRapkiewicz, Pawel // Copyright (c) 2018 Intel Corporation
3e37f8451SRapkiewicz, Pawel //
4e37f8451SRapkiewicz, Pawel // Licensed under the Apache License, Version 2.0 (the "License");
5e37f8451SRapkiewicz, Pawel // you may not use this file except in compliance with the License.
6e37f8451SRapkiewicz, Pawel // You may obtain a copy of the License at
7e37f8451SRapkiewicz, Pawel //
8e37f8451SRapkiewicz, Pawel //      http://www.apache.org/licenses/LICENSE-2.0
9e37f8451SRapkiewicz, Pawel //
10e37f8451SRapkiewicz, Pawel // Unless required by applicable law or agreed to in writing, software
11e37f8451SRapkiewicz, Pawel // distributed under the License is distributed on an "AS IS" BASIS,
12e37f8451SRapkiewicz, Pawel // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13e37f8451SRapkiewicz, Pawel // See the License for the specific language governing permissions and
14e37f8451SRapkiewicz, Pawel // limitations under the License.
15e37f8451SRapkiewicz, Pawel */
16e37f8451SRapkiewicz, Pawel #pragma once
17e37f8451SRapkiewicz, Pawel 
18e37f8451SRapkiewicz, Pawel #include "node.hpp"
191abe55efSEd Tanous 
20e37f8451SRapkiewicz, Pawel #include <boost/container/flat_map.hpp>
21abf2add6SEd Tanous #include <variant>
22e37f8451SRapkiewicz, Pawel 
231abe55efSEd Tanous namespace redfish
241abe55efSEd Tanous {
25e37f8451SRapkiewicz, Pawel 
26e37f8451SRapkiewicz, Pawel /**
27beeca0aeSGunnar Mills  * @brief Retrieves chassis state properties over dbus
28beeca0aeSGunnar Mills  *
29beeca0aeSGunnar Mills  * @param[in] aResp - Shared pointer for completing asynchronous calls.
30beeca0aeSGunnar Mills  *
31beeca0aeSGunnar Mills  * @return None.
32beeca0aeSGunnar Mills  */
33beeca0aeSGunnar Mills void getChassisState(std::shared_ptr<AsyncResp> aResp)
34beeca0aeSGunnar Mills {
35beeca0aeSGunnar Mills     crow::connections::systemBus->async_method_call(
36beeca0aeSGunnar Mills         [aResp{std::move(aResp)}](
37beeca0aeSGunnar Mills             const boost::system::error_code ec,
38beeca0aeSGunnar Mills             const std::variant<std::string> &chassisState) {
39beeca0aeSGunnar Mills             if (ec)
40beeca0aeSGunnar Mills             {
41beeca0aeSGunnar Mills                 BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
42beeca0aeSGunnar Mills                 messages::internalError(aResp->res);
43beeca0aeSGunnar Mills                 return;
44beeca0aeSGunnar Mills             }
45beeca0aeSGunnar Mills 
46beeca0aeSGunnar Mills             const std::string *s = std::get_if<std::string>(&chassisState);
47beeca0aeSGunnar Mills             BMCWEB_LOG_DEBUG << "Chassis state: " << *s;
48beeca0aeSGunnar Mills             if (s != nullptr)
49beeca0aeSGunnar Mills             {
50beeca0aeSGunnar Mills                 // Verify Chassis State
51beeca0aeSGunnar Mills                 if (*s == "xyz.openbmc_project.State.Chassis.PowerState.On")
52beeca0aeSGunnar Mills                 {
53beeca0aeSGunnar Mills                     aResp->res.jsonValue["PowerState"] = "On";
54beeca0aeSGunnar Mills                     aResp->res.jsonValue["Status"]["State"] = "Enabled";
55beeca0aeSGunnar Mills                 }
56beeca0aeSGunnar Mills                 else if (*s ==
57beeca0aeSGunnar Mills                          "xyz.openbmc_project.State.Chassis.PowerState.Off")
58beeca0aeSGunnar Mills                 {
59beeca0aeSGunnar Mills                     aResp->res.jsonValue["PowerState"] = "Off";
60beeca0aeSGunnar Mills                     aResp->res.jsonValue["Status"]["State"] = "StandbyOffline";
61beeca0aeSGunnar Mills                 }
62beeca0aeSGunnar Mills             }
63beeca0aeSGunnar Mills         },
64beeca0aeSGunnar Mills         "xyz.openbmc_project.State.Chassis",
65beeca0aeSGunnar Mills         "/xyz/openbmc_project/state/chassis0",
66beeca0aeSGunnar Mills         "org.freedesktop.DBus.Properties", "Get",
67beeca0aeSGunnar Mills         "xyz.openbmc_project.State.Chassis", "CurrentPowerState");
68beeca0aeSGunnar Mills }
69beeca0aeSGunnar Mills 
70beeca0aeSGunnar Mills /**
71e37f8451SRapkiewicz, Pawel  * DBus types primitives for several generic DBus interfaces
72e37f8451SRapkiewicz, Pawel  * TODO(Pawel) consider move this to separate file into boost::dbus
73e37f8451SRapkiewicz, Pawel  */
7455c7b7a2SEd Tanous // Note, this is not a very useful Variant, but because it isn't used to get
75aa2e59c1SEd Tanous // values, it should be as simple as possible
76aa2e59c1SEd Tanous // TODO(ed) invent a nullvariant type
77abf2add6SEd Tanous using VariantType = std::variant<bool, std::string, uint64_t>;
78aa2e59c1SEd Tanous using ManagedObjectsType = std::vector<std::pair<
79aa2e59c1SEd Tanous     sdbusplus::message::object_path,
80aa2e59c1SEd Tanous     std::vector<std::pair<std::string,
81aa2e59c1SEd Tanous                           std::vector<std::pair<std::string, VariantType>>>>>>;
82e37f8451SRapkiewicz, Pawel 
83aa2e59c1SEd Tanous using PropertiesType = boost::container::flat_map<std::string, VariantType>;
84e37f8451SRapkiewicz, Pawel 
85c181942fSQiang XU void getIntrusionByService(std::shared_ptr<AsyncResp> aResp,
86c181942fSQiang XU                            const std::string &service,
87c181942fSQiang XU                            const std::string &objPath)
88c181942fSQiang XU {
89c181942fSQiang XU     BMCWEB_LOG_DEBUG << "Get intrusion status by service \n";
90c181942fSQiang XU 
91c181942fSQiang XU     crow::connections::systemBus->async_method_call(
92c181942fSQiang XU         [aResp{std::move(aResp)}](const boost::system::error_code ec,
93c181942fSQiang XU                                   const std::variant<std::string> &value) {
94c181942fSQiang XU             if (ec)
95c181942fSQiang XU             {
96c181942fSQiang XU                 // do not add err msg in redfish response, becaues this is not
97c181942fSQiang XU                 //     mandatory property
98c181942fSQiang XU                 BMCWEB_LOG_ERROR << "DBUS response error " << ec << "\n";
99c181942fSQiang XU                 return;
100c181942fSQiang XU             }
101c181942fSQiang XU 
102c181942fSQiang XU             const std::string *status = std::get_if<std::string>(&value);
103c181942fSQiang XU 
104c181942fSQiang XU             if (status == nullptr)
105c181942fSQiang XU             {
106c181942fSQiang XU                 BMCWEB_LOG_ERROR << "intrusion status read error \n";
107c181942fSQiang XU                 return;
108c181942fSQiang XU             }
109c181942fSQiang XU 
110c181942fSQiang XU             aResp->res.jsonValue["PhysicalSecurity"] = {
111c181942fSQiang XU                 {"IntrusionSensorNumber", 1}, {"IntrusionSensor", *status}};
112c181942fSQiang XU         },
113c181942fSQiang XU         service, objPath, "org.freedesktop.DBus.Properties", "Get",
114c181942fSQiang XU         "xyz.openbmc_project.Chassis.Intrusion", "Status");
115c181942fSQiang XU }
116c181942fSQiang XU 
117c181942fSQiang XU /**
118c181942fSQiang XU  * Retrieves physical security properties over dbus
119c181942fSQiang XU  */
120c181942fSQiang XU void getPhysicalSecurityData(std::shared_ptr<AsyncResp> aResp)
121c181942fSQiang XU {
122c181942fSQiang XU     crow::connections::systemBus->async_method_call(
123c181942fSQiang XU         [aResp{std::move(aResp)}](
124c181942fSQiang XU             const boost::system::error_code ec,
125c181942fSQiang XU             const std::vector<std::pair<
126c181942fSQiang XU                 std::string,
127c181942fSQiang XU                 std::vector<std::pair<std::string, std::vector<std::string>>>>>
128c181942fSQiang XU                 &subtree) {
129c181942fSQiang XU             if (ec)
130c181942fSQiang XU             {
131c181942fSQiang XU                 // do not add err msg in redfish response, becaues this is not
132c181942fSQiang XU                 //     mandatory property
133c181942fSQiang XU                 BMCWEB_LOG_ERROR << "DBUS error: no matched iface " << ec
134c181942fSQiang XU                                  << "\n";
135c181942fSQiang XU                 return;
136c181942fSQiang XU             }
137c181942fSQiang XU             // Iterate over all retrieved ObjectPaths.
138c181942fSQiang XU             for (const auto &object : subtree)
139c181942fSQiang XU             {
140c181942fSQiang XU                 for (const auto &service : object.second)
141c181942fSQiang XU                 {
142c181942fSQiang XU                     getIntrusionByService(aResp, service.first, object.first);
143c181942fSQiang XU                     return;
144c181942fSQiang XU                 }
145c181942fSQiang XU             }
146c181942fSQiang XU         },
147c181942fSQiang XU         "xyz.openbmc_project.ObjectMapper",
148c181942fSQiang XU         "/xyz/openbmc_project/object_mapper",
149c181942fSQiang XU         "xyz.openbmc_project.ObjectMapper", "GetSubTree",
150c181942fSQiang XU         "/xyz/openbmc_project/Intrusion", int32_t(1),
151c181942fSQiang XU         std::array<const char *, 1>{"xyz.openbmc_project.Chassis.Intrusion"});
152c181942fSQiang XU }
153c181942fSQiang XU 
154e37f8451SRapkiewicz, Pawel /**
155e37f8451SRapkiewicz, Pawel  * ChassisCollection derived class for delivering Chassis Collection Schema
156e37f8451SRapkiewicz, Pawel  */
1571abe55efSEd Tanous class ChassisCollection : public Node
1581abe55efSEd Tanous {
159e37f8451SRapkiewicz, Pawel   public:
1601abe55efSEd Tanous     ChassisCollection(CrowApp &app) : Node(app, "/redfish/v1/Chassis/")
1611abe55efSEd Tanous     {
162e0d918bcSEd Tanous         entityPrivileges = {
163e0d918bcSEd Tanous             {boost::beast::http::verb::get, {{"Login"}}},
164e0d918bcSEd Tanous             {boost::beast::http::verb::head, {{"Login"}}},
165e0d918bcSEd Tanous             {boost::beast::http::verb::patch, {{"ConfigureComponents"}}},
166e0d918bcSEd Tanous             {boost::beast::http::verb::put, {{"ConfigureComponents"}}},
167e0d918bcSEd Tanous             {boost::beast::http::verb::delete_, {{"ConfigureComponents"}}},
168e0d918bcSEd Tanous             {boost::beast::http::verb::post, {{"ConfigureComponents"}}}};
169e37f8451SRapkiewicz, Pawel     }
170e37f8451SRapkiewicz, Pawel 
171e37f8451SRapkiewicz, Pawel   private:
172e37f8451SRapkiewicz, Pawel     /**
173e37f8451SRapkiewicz, Pawel      * Functions triggers appropriate requests on DBus
174e37f8451SRapkiewicz, Pawel      */
17555c7b7a2SEd Tanous     void doGet(crow::Response &res, const crow::Request &req,
1761abe55efSEd Tanous                const std::vector<std::string> &params) override
1771abe55efSEd Tanous     {
1780f74e643SEd Tanous         res.jsonValue["@odata.type"] = "#ChassisCollection.ChassisCollection";
1790f74e643SEd Tanous         res.jsonValue["@odata.id"] = "/redfish/v1/Chassis";
1800f74e643SEd Tanous         res.jsonValue["@odata.context"] =
1810f74e643SEd Tanous             "/redfish/v1/$metadata#ChassisCollection.ChassisCollection";
1820f74e643SEd Tanous         res.jsonValue["Name"] = "Chassis Collection";
1830f74e643SEd Tanous 
184603a6640SGunnar Mills         const std::array<const char *, 3> interfaces = {
185603a6640SGunnar Mills             "xyz.openbmc_project.Inventory.Item.Board",
186603a6640SGunnar Mills             "xyz.openbmc_project.Inventory.Item.Chassis",
187603a6640SGunnar Mills             "xyz.openbmc_project.Inventory.Item.PowerSupply"};
188603a6640SGunnar Mills 
18962d5e2e4SEd Tanous         auto asyncResp = std::make_shared<AsyncResp>(res);
19062d5e2e4SEd Tanous         crow::connections::systemBus->async_method_call(
19162d5e2e4SEd Tanous             [asyncResp](const boost::system::error_code ec,
19262d5e2e4SEd Tanous                         const std::vector<std::string> &chassisList) {
19362d5e2e4SEd Tanous                 if (ec)
1941abe55efSEd Tanous                 {
195f12894f8SJason M. Bills                     messages::internalError(asyncResp->res);
19662d5e2e4SEd Tanous                     return;
197e37f8451SRapkiewicz, Pawel                 }
19862d5e2e4SEd Tanous                 nlohmann::json &chassisArray =
19962d5e2e4SEd Tanous                     asyncResp->res.jsonValue["Members"];
20062d5e2e4SEd Tanous                 chassisArray = nlohmann::json::array();
20162d5e2e4SEd Tanous                 for (const std::string &objpath : chassisList)
20262d5e2e4SEd Tanous                 {
20362d5e2e4SEd Tanous                     std::size_t lastPos = objpath.rfind("/");
20462d5e2e4SEd Tanous                     if (lastPos == std::string::npos)
20562d5e2e4SEd Tanous                     {
20662d5e2e4SEd Tanous                         BMCWEB_LOG_ERROR << "Failed to find '/' in " << objpath;
20762d5e2e4SEd Tanous                         continue;
20862d5e2e4SEd Tanous                     }
20962d5e2e4SEd Tanous                     chassisArray.push_back(
21062d5e2e4SEd Tanous                         {{"@odata.id", "/redfish/v1/Chassis/" +
21162d5e2e4SEd Tanous                                            objpath.substr(lastPos + 1)}});
212e37f8451SRapkiewicz, Pawel                 }
213e37f8451SRapkiewicz, Pawel 
21462d5e2e4SEd Tanous                 asyncResp->res.jsonValue["Members@odata.count"] =
21562d5e2e4SEd Tanous                     chassisArray.size();
21662d5e2e4SEd Tanous             },
21762d5e2e4SEd Tanous             "xyz.openbmc_project.ObjectMapper",
21862d5e2e4SEd Tanous             "/xyz/openbmc_project/object_mapper",
21962d5e2e4SEd Tanous             "xyz.openbmc_project.ObjectMapper", "GetSubTreePaths",
220734bfe90SGunnar Mills             "/xyz/openbmc_project/inventory", int32_t(0), interfaces);
22162d5e2e4SEd Tanous     }
222e37f8451SRapkiewicz, Pawel };
223e37f8451SRapkiewicz, Pawel 
224e37f8451SRapkiewicz, Pawel /**
225e37f8451SRapkiewicz, Pawel  * Chassis override class for delivering Chassis Schema
226e37f8451SRapkiewicz, Pawel  */
2271abe55efSEd Tanous class Chassis : public Node
2281abe55efSEd Tanous {
229e37f8451SRapkiewicz, Pawel   public:
2301abe55efSEd Tanous     Chassis(CrowApp &app) :
2311abe55efSEd Tanous         Node(app, "/redfish/v1/Chassis/<str>/", std::string())
2321abe55efSEd Tanous     {
233e0d918bcSEd Tanous         entityPrivileges = {
234e0d918bcSEd Tanous             {boost::beast::http::verb::get, {{"Login"}}},
235e0d918bcSEd Tanous             {boost::beast::http::verb::head, {{"Login"}}},
236e0d918bcSEd Tanous             {boost::beast::http::verb::patch, {{"ConfigureComponents"}}},
237e0d918bcSEd Tanous             {boost::beast::http::verb::put, {{"ConfigureComponents"}}},
238e0d918bcSEd Tanous             {boost::beast::http::verb::delete_, {{"ConfigureComponents"}}},
239e0d918bcSEd Tanous             {boost::beast::http::verb::post, {{"ConfigureComponents"}}}};
240e37f8451SRapkiewicz, Pawel     }
241e37f8451SRapkiewicz, Pawel 
242e37f8451SRapkiewicz, Pawel   private:
243e37f8451SRapkiewicz, Pawel     /**
244e37f8451SRapkiewicz, Pawel      * Functions triggers appropriate requests on DBus
245e37f8451SRapkiewicz, Pawel      */
24655c7b7a2SEd Tanous     void doGet(crow::Response &res, const crow::Request &req,
2471abe55efSEd Tanous                const std::vector<std::string> &params) override
2481abe55efSEd Tanous     {
249734bfe90SGunnar Mills         const std::array<const char *, 3> interfaces = {
250734bfe90SGunnar Mills             "xyz.openbmc_project.Inventory.Item.Board",
251734bfe90SGunnar Mills             "xyz.openbmc_project.Inventory.Item.Chassis",
252734bfe90SGunnar Mills             "xyz.openbmc_project.Inventory.Item.PowerSupply"};
253734bfe90SGunnar Mills 
254e37f8451SRapkiewicz, Pawel         // Check if there is required param, truly entering this shall be
255e37f8451SRapkiewicz, Pawel         // impossible.
2561abe55efSEd Tanous         if (params.size() != 1)
2571abe55efSEd Tanous         {
258f12894f8SJason M. Bills             messages::internalError(res);
259e37f8451SRapkiewicz, Pawel             res.end();
260e37f8451SRapkiewicz, Pawel             return;
261e37f8451SRapkiewicz, Pawel         }
26299cffd7fSShawn McCarney         const std::string &chassisId = params[0];
263e37f8451SRapkiewicz, Pawel 
26462d5e2e4SEd Tanous         auto asyncResp = std::make_shared<AsyncResp>(res);
26555c7b7a2SEd Tanous         crow::connections::systemBus->async_method_call(
26662d5e2e4SEd Tanous             [asyncResp, chassisId(std::string(chassisId))](
26762d5e2e4SEd Tanous                 const boost::system::error_code ec,
268daf36e2eSEd Tanous                 const std::vector<std::pair<
2691abe55efSEd Tanous                     std::string, std::vector<std::pair<
2701abe55efSEd Tanous                                      std::string, std::vector<std::string>>>>>
271daf36e2eSEd Tanous                     &subtree) {
27262d5e2e4SEd Tanous                 if (ec)
2731abe55efSEd Tanous                 {
274f12894f8SJason M. Bills                     messages::internalError(asyncResp->res);
275daf36e2eSEd Tanous                     return;
276daf36e2eSEd Tanous                 }
277daf36e2eSEd Tanous                 // Iterate over all retrieved ObjectPaths.
2781abe55efSEd Tanous                 for (const std::pair<
2791abe55efSEd Tanous                          std::string,
2801abe55efSEd Tanous                          std::vector<
2811abe55efSEd Tanous                              std::pair<std::string, std::vector<std::string>>>>
2821abe55efSEd Tanous                          &object : subtree)
2831abe55efSEd Tanous                 {
284daf36e2eSEd Tanous                     const std::string &path = object.first;
2851abe55efSEd Tanous                     const std::vector<
2861abe55efSEd Tanous                         std::pair<std::string, std::vector<std::string>>>
287daf36e2eSEd Tanous                         &connectionNames = object.second;
288e0d918bcSEd Tanous 
2891abe55efSEd Tanous                     if (!boost::ends_with(path, chassisId))
2901abe55efSEd Tanous                     {
291daf36e2eSEd Tanous                         continue;
292daf36e2eSEd Tanous                     }
293*26f03899SShawn McCarney 
2941abe55efSEd Tanous                     if (connectionNames.size() < 1)
2951abe55efSEd Tanous                     {
2961abe55efSEd Tanous                         BMCWEB_LOG_ERROR << "Only got "
2971abe55efSEd Tanous                                          << connectionNames.size()
29855c7b7a2SEd Tanous                                          << " Connection names";
299e0d918bcSEd Tanous                         continue;
300daf36e2eSEd Tanous                     }
301e0d918bcSEd Tanous 
30249c53ac9SJohnathan Mantey                     asyncResp->res.jsonValue["@odata.type"] =
30349c53ac9SJohnathan Mantey                         "#Chassis.v1_4_0.Chassis";
30449c53ac9SJohnathan Mantey                     asyncResp->res.jsonValue["@odata.id"] =
30549c53ac9SJohnathan Mantey                         "/redfish/v1/Chassis/" + chassisId;
30649c53ac9SJohnathan Mantey                     asyncResp->res.jsonValue["@odata.context"] =
30749c53ac9SJohnathan Mantey                         "/redfish/v1/$metadata#Chassis.Chassis";
30849c53ac9SJohnathan Mantey                     asyncResp->res.jsonValue["Name"] = "Chassis Collection";
30949c53ac9SJohnathan Mantey                     asyncResp->res.jsonValue["ChassisType"] = "RackMount";
31049c53ac9SJohnathan Mantey 
31149c53ac9SJohnathan Mantey                     const std::string &connectionName =
31249c53ac9SJohnathan Mantey                         connectionNames[0].first;
31355c7b7a2SEd Tanous                     crow::connections::systemBus->async_method_call(
31462d5e2e4SEd Tanous                         [asyncResp, chassisId(std::string(chassisId))](
31562d5e2e4SEd Tanous                             const boost::system::error_code ec,
3161abe55efSEd Tanous                             const std::vector<std::pair<
3171abe55efSEd Tanous                                 std::string, VariantType>> &propertiesList) {
3181abe55efSEd Tanous                             for (const std::pair<std::string, VariantType>
3191abe55efSEd Tanous                                      &property : propertiesList)
3201abe55efSEd Tanous                             {
32199cffd7fSShawn McCarney                                 // Store DBus properties that are also Redfish
32299cffd7fSShawn McCarney                                 // properties with same name and a string value
32399cffd7fSShawn McCarney                                 const std::string &propertyName =
32499cffd7fSShawn McCarney                                     property.first;
32599cffd7fSShawn McCarney                                 if ((propertyName == "PartNumber") ||
32699cffd7fSShawn McCarney                                     (propertyName == "SerialNumber") ||
32799cffd7fSShawn McCarney                                     (propertyName == "Manufacturer") ||
32899cffd7fSShawn McCarney                                     (propertyName == "Model"))
32999cffd7fSShawn McCarney                                 {
330daf36e2eSEd Tanous                                     const std::string *value =
33199cffd7fSShawn McCarney                                         std::get_if<std::string>(
33299cffd7fSShawn McCarney                                             &property.second);
3331abe55efSEd Tanous                                     if (value != nullptr)
3341abe55efSEd Tanous                                     {
33599cffd7fSShawn McCarney                                         asyncResp->res.jsonValue[propertyName] =
33662d5e2e4SEd Tanous                                             *value;
337daf36e2eSEd Tanous                                     }
338daf36e2eSEd Tanous                                 }
33999cffd7fSShawn McCarney                             }
34062d5e2e4SEd Tanous                             asyncResp->res.jsonValue["Name"] = chassisId;
34162d5e2e4SEd Tanous                             asyncResp->res.jsonValue["Id"] = chassisId;
34262d5e2e4SEd Tanous                             asyncResp->res.jsonValue["Thermal"] = {
3431abe55efSEd Tanous                                 {"@odata.id", "/redfish/v1/Chassis/" +
3441abe55efSEd Tanous                                                   chassisId + "/Thermal"}};
3452474adfaSEd Tanous                             // Power object
3462474adfaSEd Tanous                             asyncResp->res.jsonValue["Power"] = {
3472474adfaSEd Tanous                                 {"@odata.id", "/redfish/v1/Chassis/" +
3482474adfaSEd Tanous                                                   chassisId + "/Power"}};
349029573d4SEd Tanous                             asyncResp->res.jsonValue["Status"] = {
350029573d4SEd Tanous                                 {"Health", "OK"},
351029573d4SEd Tanous                                 {"State", "Enabled"},
352029573d4SEd Tanous                             };
3532474adfaSEd Tanous 
354029573d4SEd Tanous                             asyncResp->res
355029573d4SEd Tanous                                 .jsonValue["Links"]["ComputerSystems"] = {
356029573d4SEd Tanous                                 {{"@odata.id", "/redfish/v1/Systems/system"}}};
357029573d4SEd Tanous                             asyncResp->res.jsonValue["Links"]["ManagedBy"] = {
358029573d4SEd Tanous                                 {{"@odata.id", "/redfish/v1/Managers/bmc"}}};
359beeca0aeSGunnar Mills                             getChassisState(asyncResp);
360daf36e2eSEd Tanous                         },
361daf36e2eSEd Tanous                         connectionName, path, "org.freedesktop.DBus.Properties",
3621abe55efSEd Tanous                         "GetAll",
3631abe55efSEd Tanous                         "xyz.openbmc_project.Inventory.Decorator.Asset");
364daf36e2eSEd Tanous                     return;
365daf36e2eSEd Tanous                 }
366e0d918bcSEd Tanous 
367daf36e2eSEd Tanous                 // Couldn't find an object with that name.  return an error
368f12894f8SJason M. Bills                 messages::resourceNotFound(
369f12894f8SJason M. Bills                     asyncResp->res, "#Chassis.v1_4_0.Chassis", chassisId);
370daf36e2eSEd Tanous             },
371daf36e2eSEd Tanous             "xyz.openbmc_project.ObjectMapper",
372daf36e2eSEd Tanous             "/xyz/openbmc_project/object_mapper",
373daf36e2eSEd Tanous             "xyz.openbmc_project.ObjectMapper", "GetSubTree",
374734bfe90SGunnar Mills             "/xyz/openbmc_project/inventory", int32_t(0), interfaces);
375c181942fSQiang XU 
376c181942fSQiang XU         getPhysicalSecurityData(asyncResp);
377e37f8451SRapkiewicz, Pawel     }
37862d5e2e4SEd Tanous };
379e37f8451SRapkiewicz, Pawel } // namespace redfish
380