blob: 87015dd3c55482235ad74a0301855a3cce962eee [file] [log] [blame]
Sunny Srivastava31791052021-03-12 10:39:16 -06001#pragma once
2
3#include "app.hpp"
4#include "dbus_utility.hpp"
Ed Tanousa8e884f2023-01-13 17:40:03 -08005#include "query.hpp"
6#include "registries/privilege_registry.hpp"
Sunny Srivastava31791052021-03-12 10:39:16 -06007#include "utils/collection.hpp"
Lakshmi Yadlapati6177a302023-02-17 10:29:34 -06008#include "utils/dbus_utils.hpp"
Sunny Srivastava31791052021-03-12 10:39:16 -06009#include "utils/json_utils.hpp"
10
11#include <boost/system/error_code.hpp>
Ed Tanousef4c65b2023-04-24 15:28:50 -070012#include <boost/url/format.hpp>
Gunnar Millsf05e9162023-02-16 20:23:30 -060013#include <sdbusplus/asio/property.hpp>
Lakshmi Yadlapati6177a302023-02-17 10:29:34 -060014#include <sdbusplus/unpack_properties.hpp>
Sunny Srivastava31791052021-03-12 10:39:16 -060015
16#include <array>
17#include <functional>
18#include <memory>
Myung Bae78c90202024-02-19 13:39:56 -050019#include <optional>
Sunny Srivastava31791052021-03-12 10:39:16 -060020#include <string>
21#include <string_view>
22
23namespace redfish
24{
25
Ed Tanousac106bf2023-06-07 09:24:59 -070026inline void getFabricAdapterLocation(
27 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
28 const std::string& serviceName, const std::string& fabricAdapterPath)
Lakshmi Yadlapati53ffeca2023-01-27 15:12:23 -060029{
30 sdbusplus::asio::getProperty<std::string>(
31 *crow::connections::systemBus, serviceName, fabricAdapterPath,
32 "xyz.openbmc_project.Inventory.Decorator.LocationCode", "LocationCode",
Ed Tanousac106bf2023-06-07 09:24:59 -070033 [asyncResp](const boost::system::error_code& ec,
34 const std::string& property) {
Lakshmi Yadlapati53ffeca2023-01-27 15:12:23 -060035 if (ec)
36 {
37 if (ec.value() != EBADR)
38 {
Ed Tanous62598e32023-07-17 17:06:25 -070039 BMCWEB_LOG_ERROR("DBUS response error for Location");
Ed Tanousac106bf2023-06-07 09:24:59 -070040 messages::internalError(asyncResp->res);
Lakshmi Yadlapati53ffeca2023-01-27 15:12:23 -060041 }
42 return;
43 }
44
Ed Tanousac106bf2023-06-07 09:24:59 -070045 asyncResp->res.jsonValue["Location"]["PartLocation"]["ServiceLabel"] =
Lakshmi Yadlapati53ffeca2023-01-27 15:12:23 -060046 property;
Patrick Williams5a39f772023-10-20 11:20:21 -050047 });
Lakshmi Yadlapati53ffeca2023-01-27 15:12:23 -060048}
49
Lakshmi Yadlapati63694212023-01-27 16:35:22 -060050inline void
Ed Tanousac106bf2023-06-07 09:24:59 -070051 getFabricAdapterAsset(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
Lakshmi Yadlapati63694212023-01-27 16:35:22 -060052 const std::string& serviceName,
53 const std::string& fabricAdapterPath)
54{
55 sdbusplus::asio::getAllProperties(
56 *crow::connections::systemBus, serviceName, fabricAdapterPath,
57 "xyz.openbmc_project.Inventory.Decorator.Asset",
Ed Tanousac106bf2023-06-07 09:24:59 -070058 [fabricAdapterPath, asyncResp{asyncResp}](
59 const boost::system::error_code& ec,
60 const dbus::utility::DBusPropertiesMap& propertiesList) {
Lakshmi Yadlapati63694212023-01-27 16:35:22 -060061 if (ec)
62 {
63 if (ec.value() != EBADR)
64 {
Ed Tanous62598e32023-07-17 17:06:25 -070065 BMCWEB_LOG_ERROR("DBUS response error for Properties");
Ed Tanousac106bf2023-06-07 09:24:59 -070066 messages::internalError(asyncResp->res);
Lakshmi Yadlapati63694212023-01-27 16:35:22 -060067 }
68 return;
69 }
70
71 const std::string* serialNumber = nullptr;
72 const std::string* model = nullptr;
73 const std::string* partNumber = nullptr;
74 const std::string* sparePartNumber = nullptr;
75
76 const bool success = sdbusplus::unpackPropertiesNoThrow(
77 dbus_utils::UnpackErrorPrinter(), propertiesList, "SerialNumber",
78 serialNumber, "Model", model, "PartNumber", partNumber,
79 "SparePartNumber", sparePartNumber);
80
81 if (!success)
82 {
Ed Tanousac106bf2023-06-07 09:24:59 -070083 messages::internalError(asyncResp->res);
Lakshmi Yadlapati63694212023-01-27 16:35:22 -060084 return;
85 }
86
87 if (serialNumber != nullptr)
88 {
Ed Tanousac106bf2023-06-07 09:24:59 -070089 asyncResp->res.jsonValue["SerialNumber"] = *serialNumber;
Lakshmi Yadlapati63694212023-01-27 16:35:22 -060090 }
91
92 if (model != nullptr)
93 {
Ed Tanousac106bf2023-06-07 09:24:59 -070094 asyncResp->res.jsonValue["Model"] = *model;
Lakshmi Yadlapati63694212023-01-27 16:35:22 -060095 }
96
97 if (partNumber != nullptr)
98 {
Ed Tanousac106bf2023-06-07 09:24:59 -070099 asyncResp->res.jsonValue["PartNumber"] = *partNumber;
Lakshmi Yadlapati63694212023-01-27 16:35:22 -0600100 }
101
102 if (sparePartNumber != nullptr && !sparePartNumber->empty())
103 {
Ed Tanousac106bf2023-06-07 09:24:59 -0700104 asyncResp->res.jsonValue["SparePartNumber"] = *sparePartNumber;
Lakshmi Yadlapati63694212023-01-27 16:35:22 -0600105 }
Patrick Williams5a39f772023-10-20 11:20:21 -0500106 });
Lakshmi Yadlapati63694212023-01-27 16:35:22 -0600107}
108
Lakshmi Yadlapaticd7af442023-01-27 17:31:40 -0600109inline void
Ed Tanousac106bf2023-06-07 09:24:59 -0700110 getFabricAdapterState(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
Lakshmi Yadlapaticd7af442023-01-27 17:31:40 -0600111 const std::string& serviceName,
112 const std::string& fabricAdapterPath)
113{
114 sdbusplus::asio::getProperty<bool>(
115 *crow::connections::systemBus, serviceName, fabricAdapterPath,
116 "xyz.openbmc_project.Inventory.Item", "Present",
Ed Tanousac106bf2023-06-07 09:24:59 -0700117 [asyncResp](const boost::system::error_code& ec, const bool present) {
Lakshmi Yadlapaticd7af442023-01-27 17:31:40 -0600118 if (ec)
119 {
120 if (ec.value() != EBADR)
121 {
Ed Tanous62598e32023-07-17 17:06:25 -0700122 BMCWEB_LOG_ERROR("DBUS response error for State");
Ed Tanousac106bf2023-06-07 09:24:59 -0700123 messages::internalError(asyncResp->res);
Lakshmi Yadlapaticd7af442023-01-27 17:31:40 -0600124 }
125 return;
126 }
127
128 if (!present)
129 {
Ed Tanousac106bf2023-06-07 09:24:59 -0700130 asyncResp->res.jsonValue["Status"]["State"] = "Absent";
Lakshmi Yadlapaticd7af442023-01-27 17:31:40 -0600131 }
Patrick Williams5a39f772023-10-20 11:20:21 -0500132 });
Lakshmi Yadlapaticd7af442023-01-27 17:31:40 -0600133}
134
Lakshmi Yadlapati7da847b2023-01-27 17:53:18 -0600135inline void
Ed Tanousac106bf2023-06-07 09:24:59 -0700136 getFabricAdapterHealth(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
Lakshmi Yadlapati7da847b2023-01-27 17:53:18 -0600137 const std::string& serviceName,
138 const std::string& fabricAdapterPath)
139{
140 sdbusplus::asio::getProperty<bool>(
141 *crow::connections::systemBus, serviceName, fabricAdapterPath,
142 "xyz.openbmc_project.State.Decorator.OperationalStatus", "Functional",
Ed Tanousac106bf2023-06-07 09:24:59 -0700143 [asyncResp](const boost::system::error_code& ec,
144 const bool functional) {
Lakshmi Yadlapati7da847b2023-01-27 17:53:18 -0600145 if (ec)
146 {
147 if (ec.value() != EBADR)
148 {
Ed Tanous62598e32023-07-17 17:06:25 -0700149 BMCWEB_LOG_ERROR("DBUS response error for Health");
Ed Tanousac106bf2023-06-07 09:24:59 -0700150 messages::internalError(asyncResp->res);
Lakshmi Yadlapati7da847b2023-01-27 17:53:18 -0600151 }
152 return;
153 }
154
155 if (!functional)
156 {
Ed Tanousac106bf2023-06-07 09:24:59 -0700157 asyncResp->res.jsonValue["Status"]["Health"] = "Critical";
Lakshmi Yadlapati7da847b2023-01-27 17:53:18 -0600158 }
Patrick Williams5a39f772023-10-20 11:20:21 -0500159 });
Lakshmi Yadlapati7da847b2023-01-27 17:53:18 -0600160}
161
Ed Tanousac106bf2023-06-07 09:24:59 -0700162inline void doAdapterGet(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
Sunny Srivastava31791052021-03-12 10:39:16 -0600163 const std::string& systemName,
Lakshmi Yadlapati53ffeca2023-01-27 15:12:23 -0600164 const std::string& adapterId,
165 const std::string& fabricAdapterPath,
166 const std::string& serviceName)
Sunny Srivastava31791052021-03-12 10:39:16 -0600167{
Ed Tanousac106bf2023-06-07 09:24:59 -0700168 asyncResp->res.addHeader(
Sunny Srivastava31791052021-03-12 10:39:16 -0600169 boost::beast::http::field::link,
170 "</redfish/v1/JsonSchemas/FabricAdapter/FabricAdapter.json>; rel=describedby");
Ed Tanousac106bf2023-06-07 09:24:59 -0700171 asyncResp->res.jsonValue["@odata.type"] =
172 "#FabricAdapter.v1_4_0.FabricAdapter";
173 asyncResp->res.jsonValue["Name"] = "Fabric Adapter";
174 asyncResp->res.jsonValue["Id"] = adapterId;
175 asyncResp->res.jsonValue["@odata.id"] = boost::urls::format(
Ed Tanousef4c65b2023-04-24 15:28:50 -0700176 "/redfish/v1/Systems/{}/FabricAdapters/{}", systemName, adapterId);
Lakshmi Yadlapati53ffeca2023-01-27 15:12:23 -0600177
Ed Tanousac106bf2023-06-07 09:24:59 -0700178 asyncResp->res.jsonValue["Status"]["State"] = "Enabled";
179 asyncResp->res.jsonValue["Status"]["Health"] = "OK";
Lakshmi Yadlapaticd7af442023-01-27 17:31:40 -0600180
Ed Tanousac106bf2023-06-07 09:24:59 -0700181 getFabricAdapterLocation(asyncResp, serviceName, fabricAdapterPath);
182 getFabricAdapterAsset(asyncResp, serviceName, fabricAdapterPath);
183 getFabricAdapterState(asyncResp, serviceName, fabricAdapterPath);
184 getFabricAdapterHealth(asyncResp, serviceName, fabricAdapterPath);
Sunny Srivastava31791052021-03-12 10:39:16 -0600185}
186
Myung Bae78c90202024-02-19 13:39:56 -0500187inline void afterGetValidFabricAdapterPath(
188 const std::string& adapterId,
189 std::function<void(const boost::system::error_code&,
190 const std::string& fabricAdapterPath,
191 const std::string& serviceName)>& callback,
192 const boost::system::error_code& ec,
193 const dbus::utility::MapperGetSubTreeResponse& subtree)
Sunny Srivastava31791052021-03-12 10:39:16 -0600194{
Myung Bae78c90202024-02-19 13:39:56 -0500195 std::string fabricAdapterPath;
196 std::string serviceName;
197 if (ec)
198 {
199 callback(ec, fabricAdapterPath, serviceName);
200 return;
201 }
Sunny Srivastava31791052021-03-12 10:39:16 -0600202
Myung Bae78c90202024-02-19 13:39:56 -0500203 for (const auto& [adapterPath, serviceMap] : subtree)
204 {
205 std::string fabricAdapterName =
206 sdbusplus::message::object_path(adapterPath).filename();
207 if (fabricAdapterName == adapterId)
208 {
209 fabricAdapterPath = adapterPath;
210 serviceName = serviceMap.begin()->first;
211 break;
212 }
213 }
214 callback(ec, fabricAdapterPath, serviceName);
Sunny Srivastava31791052021-03-12 10:39:16 -0600215}
216
217inline void getValidFabricAdapterPath(
Myung Bae78c90202024-02-19 13:39:56 -0500218 const std::string& adapterId,
219 std::function<void(const boost::system::error_code& ec,
220 const std::string& fabricAdapterPath,
Sunny Srivastava31791052021-03-12 10:39:16 -0600221 const std::string& serviceName)>&& callback)
222{
Sunny Srivastava31791052021-03-12 10:39:16 -0600223 constexpr std::array<std::string_view, 1> interfaces{
224 "xyz.openbmc_project.Inventory.Item.FabricAdapter"};
Myung Bae78c90202024-02-19 13:39:56 -0500225 dbus::utility::getSubTree("/xyz/openbmc_project/inventory", 0, interfaces,
226 std::bind_front(afterGetValidFabricAdapterPath,
227 adapterId, std::move(callback)));
228}
Sunny Srivastava31791052021-03-12 10:39:16 -0600229
Myung Bae78c90202024-02-19 13:39:56 -0500230inline void afterHandleFabricAdapterGet(
231 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
232 const std::string& systemName, const std::string& adapterId,
233 const boost::system::error_code& ec, const std::string& fabricAdapterPath,
234 const std::string& serviceName)
235{
236 if (ec)
237 {
238 if (ec.value() == boost::system::errc::io_error)
Sunny Srivastava31791052021-03-12 10:39:16 -0600239 {
Myung Bae78c90202024-02-19 13:39:56 -0500240 messages::resourceNotFound(asyncResp->res, "FabricAdapter",
241 adapterId);
Sunny Srivastava31791052021-03-12 10:39:16 -0600242 return;
243 }
Myung Bae78c90202024-02-19 13:39:56 -0500244
245 BMCWEB_LOG_ERROR("DBus method call failed with error {}", ec.value());
246 messages::internalError(asyncResp->res);
247 return;
248 }
249 if (fabricAdapterPath.empty() || serviceName.empty())
250 {
Ed Tanous62598e32023-07-17 17:06:25 -0700251 BMCWEB_LOG_WARNING("Adapter not found");
Ed Tanousac106bf2023-06-07 09:24:59 -0700252 messages::resourceNotFound(asyncResp->res, "FabricAdapter", adapterId);
Myung Bae78c90202024-02-19 13:39:56 -0500253 return;
254 }
255 doAdapterGet(asyncResp, systemName, adapterId, fabricAdapterPath,
256 serviceName);
Sunny Srivastava31791052021-03-12 10:39:16 -0600257}
258
259inline void
260 handleFabricAdapterGet(App& app, const crow::Request& req,
Ed Tanousac106bf2023-06-07 09:24:59 -0700261 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
Sunny Srivastava31791052021-03-12 10:39:16 -0600262 const std::string& systemName,
263 const std::string& adapterId)
264{
Ed Tanousac106bf2023-06-07 09:24:59 -0700265 if (!redfish::setUpRedfishRoute(app, req, asyncResp))
Sunny Srivastava31791052021-03-12 10:39:16 -0600266 {
267 return;
268 }
Ed Tanous7f3e84a2022-12-28 16:22:54 -0800269 if constexpr (bmcwebEnableMultiHost)
270 {
271 // Option currently returns no systems. TBD
272 messages::resourceNotFound(asyncResp->res, "ComputerSystem",
273 systemName);
274 return;
275 }
Myung Bae78c90202024-02-19 13:39:56 -0500276 if (systemName != "system")
277 {
278 messages::resourceNotFound(asyncResp->res, "ComputerSystem",
279 systemName);
280 return;
281 }
Sunny Srivastava31791052021-03-12 10:39:16 -0600282 getValidFabricAdapterPath(
Myung Bae78c90202024-02-19 13:39:56 -0500283 adapterId, std::bind_front(afterHandleFabricAdapterGet, asyncResp,
284 systemName, adapterId));
Sunny Srivastava31791052021-03-12 10:39:16 -0600285}
286
287inline void handleFabricAdapterCollectionGet(
288 crow::App& app, const crow::Request& req,
Ed Tanousac106bf2023-06-07 09:24:59 -0700289 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
Sunny Srivastava31791052021-03-12 10:39:16 -0600290 const std::string& systemName)
291{
Ed Tanousac106bf2023-06-07 09:24:59 -0700292 if (!redfish::setUpRedfishRoute(app, req, asyncResp))
Sunny Srivastava31791052021-03-12 10:39:16 -0600293 {
294 return;
295 }
Ed Tanous7f3e84a2022-12-28 16:22:54 -0800296 if constexpr (bmcwebEnableMultiHost)
297 {
298 // Option currently returns no systems. TBD
299 messages::resourceNotFound(asyncResp->res, "ComputerSystem",
300 systemName);
301 return;
302 }
Sunny Srivastava31791052021-03-12 10:39:16 -0600303 if (systemName != "system")
304 {
Ed Tanousac106bf2023-06-07 09:24:59 -0700305 messages::resourceNotFound(asyncResp->res, "ComputerSystem",
306 systemName);
Sunny Srivastava31791052021-03-12 10:39:16 -0600307 return;
308 }
309
Ed Tanousac106bf2023-06-07 09:24:59 -0700310 asyncResp->res.addHeader(
Sunny Srivastava31791052021-03-12 10:39:16 -0600311 boost::beast::http::field::link,
312 "</redfish/v1/JsonSchemas/FabricAdapterCollection/FabricAdapterCollection.json>; rel=describedby");
Ed Tanousac106bf2023-06-07 09:24:59 -0700313 asyncResp->res.jsonValue["@odata.type"] =
Sunny Srivastava31791052021-03-12 10:39:16 -0600314 "#FabricAdapterCollection.FabricAdapterCollection";
Ed Tanousac106bf2023-06-07 09:24:59 -0700315 asyncResp->res.jsonValue["Name"] = "Fabric Adapter Collection";
316 asyncResp->res.jsonValue["@odata.id"] = boost::urls::format(
Ed Tanousef4c65b2023-04-24 15:28:50 -0700317 "/redfish/v1/Systems/{}/FabricAdapters", systemName);
Sunny Srivastava31791052021-03-12 10:39:16 -0600318
319 constexpr std::array<std::string_view, 1> interfaces{
320 "xyz.openbmc_project.Inventory.Item.FabricAdapter"};
321 collection_util::getCollectionMembers(
Ed Tanousac106bf2023-06-07 09:24:59 -0700322 asyncResp,
323 boost::urls::url("/redfish/v1/Systems/system/FabricAdapters"),
Lakshmi Yadlapati36b5f1e2023-09-26 23:53:28 -0500324 interfaces, "/xyz/openbmc_project/inventory");
Sunny Srivastava31791052021-03-12 10:39:16 -0600325}
326
327inline void handleFabricAdapterCollectionHead(
328 crow::App& app, const crow::Request& req,
Ed Tanousac106bf2023-06-07 09:24:59 -0700329 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
Sunny Srivastava31791052021-03-12 10:39:16 -0600330 const std::string& systemName)
331{
Ed Tanousac106bf2023-06-07 09:24:59 -0700332 if (!redfish::setUpRedfishRoute(app, req, asyncResp))
Sunny Srivastava31791052021-03-12 10:39:16 -0600333 {
334 return;
335 }
Ed Tanous7f3e84a2022-12-28 16:22:54 -0800336 if constexpr (bmcwebEnableMultiHost)
337 {
338 // Option currently returns no systems. TBD
339 messages::resourceNotFound(asyncResp->res, "ComputerSystem",
340 systemName);
341 return;
342 }
Sunny Srivastava31791052021-03-12 10:39:16 -0600343 if (systemName != "system")
344 {
Ed Tanousac106bf2023-06-07 09:24:59 -0700345 messages::resourceNotFound(asyncResp->res, "ComputerSystem",
346 systemName);
Sunny Srivastava31791052021-03-12 10:39:16 -0600347 return;
348 }
Ed Tanousac106bf2023-06-07 09:24:59 -0700349 asyncResp->res.addHeader(
Sunny Srivastava31791052021-03-12 10:39:16 -0600350 boost::beast::http::field::link,
351 "</redfish/v1/JsonSchemas/FabricAdapterCollection/FabricAdapterCollection.json>; rel=describedby");
352}
353
Myung Bae78c90202024-02-19 13:39:56 -0500354inline void afterHandleFabricAdapterHead(
355 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
356 const std::string& adapterId, const boost::system::error_code& ec,
357 const std::string& fabricAdapterPath, const std::string& serviceName)
358{
359 if (ec)
360 {
361 if (ec.value() == boost::system::errc::io_error)
362 {
363 messages::resourceNotFound(asyncResp->res, "FabricAdapter",
364 adapterId);
365 return;
366 }
367
368 BMCWEB_LOG_ERROR("DBus method call failed with error {}", ec.value());
369 messages::internalError(asyncResp->res);
370 return;
371 }
372 if (fabricAdapterPath.empty() || serviceName.empty())
373 {
374 BMCWEB_LOG_WARNING("Adapter not found");
375 messages::resourceNotFound(asyncResp->res, "FabricAdapter", adapterId);
376 return;
377 }
378 asyncResp->res.addHeader(
379 boost::beast::http::field::link,
380 "</redfish/v1/JsonSchemas/FabricAdapter/FabricAdapter.json>; rel=describedby");
381}
382
Sunny Srivastava31791052021-03-12 10:39:16 -0600383inline void
384 handleFabricAdapterHead(crow::App& app, const crow::Request& req,
Ed Tanousac106bf2023-06-07 09:24:59 -0700385 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
Sunny Srivastava31791052021-03-12 10:39:16 -0600386 const std::string& systemName,
387 const std::string& adapterId)
388{
Ed Tanousac106bf2023-06-07 09:24:59 -0700389 if (!redfish::setUpRedfishRoute(app, req, asyncResp))
Sunny Srivastava31791052021-03-12 10:39:16 -0600390 {
391 return;
392 }
393
Ed Tanous7f3e84a2022-12-28 16:22:54 -0800394 if constexpr (bmcwebEnableMultiHost)
395 {
396 // Option currently returns no systems. TBD
397 messages::resourceNotFound(asyncResp->res, "ComputerSystem",
398 systemName);
399 return;
400 }
Myung Bae78c90202024-02-19 13:39:56 -0500401 if (systemName != "system")
402 {
403 messages::resourceNotFound(asyncResp->res, "ComputerSystem",
404 systemName);
405 return;
406 }
407 getValidFabricAdapterPath(
408 adapterId,
409 std::bind_front(afterHandleFabricAdapterHead, asyncResp, adapterId));
Sunny Srivastava31791052021-03-12 10:39:16 -0600410}
411
412inline void requestRoutesFabricAdapterCollection(App& app)
413{
414 BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/FabricAdapters/")
415 .privileges(redfish::privileges::getFabricAdapterCollection)
416 .methods(boost::beast::http::verb::get)(
417 std::bind_front(handleFabricAdapterCollectionGet, std::ref(app)));
418
419 BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/FabricAdapters/")
420 .privileges(redfish::privileges::headFabricAdapterCollection)
421 .methods(boost::beast::http::verb::head)(
422 std::bind_front(handleFabricAdapterCollectionHead, std::ref(app)));
423}
424
425inline void requestRoutesFabricAdapters(App& app)
426{
427 BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/FabricAdapters/<str>/")
428 .privileges(redfish::privileges::getFabricAdapter)
429 .methods(boost::beast::http::verb::get)(
430 std::bind_front(handleFabricAdapterGet, std::ref(app)));
431
432 BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/FabricAdapters/<str>/")
433 .privileges(redfish::privileges::headFabricAdapter)
434 .methods(boost::beast::http::verb::head)(
435 std::bind_front(handleFabricAdapterHead, std::ref(app)));
436}
437} // namespace redfish