From 20aefd5e26e7fe0853983e4802abaee61e1131f6 Mon Sep 17 00:00:00 2001
From: Brad White <brad.white@elastic.co>
Date: Tue, 26 Sep 2023 14:58:45 -0600
Subject: [PATCH] Pick Infra UI from #166813

---
 x-pack/plugins/asset_manager/server/routes/assets/hosts.ts | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/x-pack/plugins/asset_manager/server/routes/assets/hosts.ts b/x-pack/plugins/asset_manager/server/routes/assets/hosts.ts
index 2b1088990334c..68ed4baaeb5c8 100644
--- a/x-pack/plugins/asset_manager/server/routes/assets/hosts.ts
+++ b/x-pack/plugins/asset_manager/server/routes/assets/hosts.ts
@@ -47,12 +47,15 @@ export function hostsRoutes<T extends RequestHandlerContext>({
     async (context, req, res) => {
       const { from = 'now-24h', to = 'now' } = req.query || {};
       const esClient = await getEsClientFromContext(context);
+      const coreContext = await context.core;
+      const soClient = coreContext.savedObjects.client;
 
       try {
         const response = await assetAccessor.getHosts({
           from: datemath.parse(from)!.toISOString(),
           to: datemath.parse(to)!.toISOString(),
           esClient,
+          soClient,
         });
 
         return res.ok({ body: response });