From 30992c5dc6aaf6523ce7acfe339879aa61682d4e Mon Sep 17 00:00:00 2001 From: Ben Clouser Date: Wed, 4 Sep 2024 14:36:22 -0400 Subject: [PATCH] [OTA-2377] Add hardwareIdsWithPackages method to reposerverClient Signed-off-by: Ben Clouser --- .../libtuf_server/repo/client/ReposerverClient.scala | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libtuf-server/src/main/scala/com/advancedtelematic/libtuf_server/repo/client/ReposerverClient.scala b/libtuf-server/src/main/scala/com/advancedtelematic/libtuf_server/repo/client/ReposerverClient.scala index 128685c1..ae5452af 100644 --- a/libtuf-server/src/main/scala/com/advancedtelematic/libtuf_server/repo/client/ReposerverClient.scala +++ b/libtuf-server/src/main/scala/com/advancedtelematic/libtuf_server/repo/client/ReposerverClient.scala @@ -269,6 +269,8 @@ trait ReposerverClient { def fetchDelegationsInfo(namespace: Namespace): Future[Map[DelegatedRoleName, DelegationInfo]] def refreshDelegatedRole(namespace: Namespace, fileName: DelegatedRoleName): Future[Unit] + + def hardwareIdsWithPackages(namespace: Namespace): Future[PaginationResult[HardwareIdentifier]] } object ReposerverHttpClient extends ServiceHttpClientSupport { @@ -815,4 +817,10 @@ class ReposerverHttpClient(reposerverUri: Uri, } } + override def hardwareIdsWithPackages( + namespace: Namespace): Future[PaginationResult[HardwareIdentifier]] = { + val req = HttpRequest(HttpMethods.GET, uri = apiV2Uri(Path(s"user_repo/hardwareids-packages"))) + execHttpUnmarshalledWithNamespace[PaginationResult[HardwareIdentifier]](namespace, req).ok + } + }