Files
autoglue/ui/src/api/archer_admin.ts
allanice001 d163a050d8 feat: load balancers ui
Signed-off-by: allanice001 <allanice001@gmail.com>
2025-11-17 15:16:20 +00:00

39 lines
1.0 KiB
TypeScript

import { withRefresh } from "@/api/with-refresh.ts"
import type { AdminListArcherJobsRequest } from "@/sdk"
import { makeArcherAdminApi } from "@/sdkClient.ts"
const archerAdmin = makeArcherAdminApi()
export const archerAdminApi = {
listJobs: (params: AdminListArcherJobsRequest = {}) => {
return withRefresh(async () => {
return await archerAdmin.adminListArcherJobs(params)
})
},
enqueue: (body: {
queue: string
type: string
payload?: object | undefined
run_at?: string
}) => {
return withRefresh(async () => {
return await archerAdmin.adminEnqueueArcherJob({ dtoEnqueueRequest: body })
})
},
retryJob: (id: string) => {
return withRefresh(async () => {
return await archerAdmin.adminRetryArcherJob({ id })
})
},
cancelJob: (id: string) => {
return withRefresh(async () => {
return await archerAdmin.adminCancelArcherJob({ id })
})
},
listQueues: () => {
return withRefresh(async () => {
return await archerAdmin.adminListArcherQueues()
})
},
}