mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 21:00:06 +01:00
feat: load balancers ui
Signed-off-by: allanice001 <allanice001@gmail.com>
This commit is contained in:
32
ui/src/api/loadbalancers.ts
Normal file
32
ui/src/api/loadbalancers.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { withRefresh } from "@/api/with-refresh"
|
||||
import type { DtoCreateLoadBalancerRequest, DtoUpdateLoadBalancerRequest } from "@/sdk"
|
||||
import { makeLoadBalancerApi } from "@/sdkClient"
|
||||
|
||||
const loadBalancers = makeLoadBalancerApi()
|
||||
export const loadBalancersApi = {
|
||||
listLoadBalancers: () =>
|
||||
withRefresh(async () => {
|
||||
return await loadBalancers.listLoadBalancers()
|
||||
}),
|
||||
getLoadBalancer: (id: string) =>
|
||||
withRefresh(async () => {
|
||||
return await loadBalancers.getLoadBalancers({ id })
|
||||
}),
|
||||
createLoadBalancer: (body: DtoCreateLoadBalancerRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await loadBalancers.createLoadBalancer({
|
||||
dtoCreateLoadBalancerRequest: body,
|
||||
})
|
||||
}),
|
||||
updateLoadBalancer: (id: string, body: DtoUpdateLoadBalancerRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await loadBalancers.updateLoadBalancer({
|
||||
id,
|
||||
dtoUpdateLoadBalancerRequest: body,
|
||||
})
|
||||
}),
|
||||
deleteLoadBalancer: (id: string) =>
|
||||
withRefresh(async () => {
|
||||
return await loadBalancers.deleteLoadBalancer({ id })
|
||||
}),
|
||||
}
|
||||
Reference in New Issue
Block a user