From 0d4e38b75282ac293367fbc3bad757a226e5fda7 Mon Sep 17 00:00:00 2001 From: Johanna Szepanski <johanna.szepanski@softhouse.se> Date: Thu, 16 Jan 2025 08:24:06 +0100 Subject: [PATCH] updated backend --- src/store/deployApi.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/store/deployApi.ts b/src/store/deployApi.ts index abcb3b50..46d056d2 100644 --- a/src/store/deployApi.ts +++ b/src/store/deployApi.ts @@ -304,6 +304,12 @@ const injectedRtkApi = api.injectEndpoints({ url: `/api/v1/hosts/${queryArg.hostId}/info_by_host_id` }) }), + checkHostExists: build.query< + CheckHostExistsApiResponse, + CheckHostExistsApiArg + >({ + query: (queryArg) => ({ url: `/api/v1/hosts/${queryArg.hostId}/exists` }) + }), findHostAlerts: build.query< FindHostAlertsApiResponse, FindHostAlertsApiArg @@ -465,7 +471,8 @@ export type UpdateIocApiArg = { iocUpdateRequest: IocUpdateRequest; }; export type UnDeployInDbApiResponse = - /** status 200 Undeployment created */ Deployment[]; + /** status 200 Undeployment created */ + Deployment[] | /** status 204 No Content */ void; export type UnDeployInDbApiArg = { /** The id of the IOC to undeploy */ iocId: number; @@ -657,6 +664,12 @@ export type FindNetBoxHostByHostIdApiArg = { /** The host's Host ID */ hostId: string; }; +export type CheckHostExistsApiResponse = + /** status 200 Hosts exists in NetBox */ void; +export type CheckHostExistsApiArg = { + /** Host identifier */ + hostId: string; +}; export type FindHostAlertsApiResponse = /** status 200 Host alerts */ HostAlertResponse; export type FindHostAlertsApiArg = { @@ -1188,6 +1201,8 @@ export const { useLazyFindAssociatedIocsByHostIdQuery, useFindNetBoxHostByHostIdQuery, useLazyFindNetBoxHostByHostIdQuery, + useCheckHostExistsQuery, + useLazyCheckHostExistsQuery, useFindHostAlertsQuery, useLazyFindHostAlertsQuery, useFindNetBoxHostByFqdnQuery, -- GitLab