mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 12:50:05 +01:00
feat: load balancers ui
Signed-off-by: allanice001 <allanice001@gmail.com>
This commit is contained in:
@@ -10,7 +10,9 @@ export const annotationsApi = {
|
||||
}),
|
||||
createAnnotation: (body: DtoCreateAnnotationRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await annotations.createAnnotation({ body })
|
||||
return await annotations.createAnnotation({
|
||||
dtoCreateAnnotationRequest: body,
|
||||
})
|
||||
}),
|
||||
getAnnotation: (id: string) =>
|
||||
withRefresh(async () => {
|
||||
@@ -22,6 +24,9 @@ export const annotationsApi = {
|
||||
}),
|
||||
updateAnnotation: (id: string, body: DtoUpdateAnnotationRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await annotations.updateAnnotation({ id, body })
|
||||
return await annotations.updateAnnotation({
|
||||
id,
|
||||
dtoUpdateAnnotationRequest: body,
|
||||
})
|
||||
}),
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export const archerAdminApi = {
|
||||
run_at?: string
|
||||
}) => {
|
||||
return withRefresh(async () => {
|
||||
return await archerAdmin.adminEnqueueArcherJob({ body })
|
||||
return await archerAdmin.adminEnqueueArcherJob({ dtoEnqueueRequest: body })
|
||||
})
|
||||
},
|
||||
retryJob: (id: string) => {
|
||||
|
||||
@@ -11,7 +11,7 @@ export const credentialsApi = {
|
||||
}),
|
||||
createCredential: async (body: DtoCreateCredentialRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await credentials.createCredential({ body })
|
||||
return await credentials.createCredential({ dtoCreateCredentialRequest: body })
|
||||
}),
|
||||
getCredential: async (id: string) =>
|
||||
withRefresh(async () => {
|
||||
@@ -23,7 +23,7 @@ export const credentialsApi = {
|
||||
}),
|
||||
updateCredential: async (id: string, body: DtoUpdateCredentialRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await credentials.updateCredential({ id, body })
|
||||
return await credentials.updateCredential({ id, dtoUpdateCredentialRequest: body })
|
||||
}),
|
||||
revealCredential: async (id: string) =>
|
||||
withRefresh(async () => {
|
||||
|
||||
@@ -20,11 +20,11 @@ export const dnsApi = {
|
||||
}),
|
||||
createDomain: async (body: DtoCreateDomainRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await dns.createDomain({ body })
|
||||
return await dns.createDomain({ dtoCreateDomainRequest: body })
|
||||
}),
|
||||
updateDomain: async (id: string, body: DtoUpdateDomainRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await dns.updateDomain({ id, body })
|
||||
return await dns.updateDomain({ id, dtoUpdateDomainRequest: body })
|
||||
}),
|
||||
deleteDomain: async (id: string) =>
|
||||
withRefresh(async () => {
|
||||
@@ -36,11 +36,11 @@ export const dnsApi = {
|
||||
}),
|
||||
createRecordSetsByDomain: async (domainId: string, body: DtoCreateRecordSetRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await dns.createRecordSet({ domainId, body })
|
||||
return await dns.createRecordSet({ domainId, dtoCreateRecordSetRequest: body })
|
||||
}),
|
||||
updateRecordSetsByDomain: async (id: string, body: DtoUpdateRecordSetRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await dns.updateRecordSet({ id, body })
|
||||
return await dns.updateRecordSet({ id, dtoUpdateRecordSetRequest: body })
|
||||
}),
|
||||
deleteRecordSetsByDomain: async (id: string) =>
|
||||
withRefresh(async () => {
|
||||
|
||||
@@ -11,7 +11,7 @@ export const labelsApi = {
|
||||
}),
|
||||
createLabel: (body: DtoCreateLabelRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await labels.createLabel({ body })
|
||||
return await labels.createLabel({ dtoCreateLabelRequest: body })
|
||||
}),
|
||||
getLabel: (id: string) =>
|
||||
withRefresh(async () => {
|
||||
@@ -23,6 +23,6 @@ export const labelsApi = {
|
||||
}),
|
||||
updateLabel: (id: string, body: DtoUpdateLabelRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await labels.updateLabel({ id, body })
|
||||
return await labels.updateLabel({ id, dtoUpdateLabelRequest: body })
|
||||
}),
|
||||
}
|
||||
|
||||
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 })
|
||||
}),
|
||||
}
|
||||
@@ -19,7 +19,7 @@ export const meApi = {
|
||||
|
||||
updateMe: (body: HandlersUpdateMeRequest) =>
|
||||
withRefresh(async (): Promise<ModelsUser> => {
|
||||
return await me.updateMe({ body })
|
||||
return await me.updateMe({ handlersUpdateMeRequest: body })
|
||||
}),
|
||||
|
||||
listKeys: () =>
|
||||
@@ -29,7 +29,7 @@ export const meApi = {
|
||||
|
||||
createKey: (body: HandlersCreateUserKeyRequest) =>
|
||||
withRefresh(async (): Promise<HandlersUserAPIKeyOut> => {
|
||||
return await keys.createUserAPIKey({ body })
|
||||
return await keys.createUserAPIKey({ handlersCreateUserKeyRequest: body })
|
||||
}),
|
||||
|
||||
deleteKey: (id: string) =>
|
||||
|
||||
@@ -22,7 +22,7 @@ export const nodePoolsApi = {
|
||||
}),
|
||||
createNodePool: (body: DtoCreateNodePoolRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await nodePools.createNodePool({ body })
|
||||
return await nodePools.createNodePool({ dtoCreateNodePoolRequest: body })
|
||||
}),
|
||||
getNodePool: (id: string) =>
|
||||
withRefresh(async () => {
|
||||
@@ -34,7 +34,7 @@ export const nodePoolsApi = {
|
||||
}),
|
||||
updateNodePool: (id: string, body: DtoUpdateNodePoolRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await nodePools.updateNodePool({ id, body })
|
||||
return await nodePools.updateNodePool({ id, dtoUpdateNodePoolRequest: body })
|
||||
}),
|
||||
// Servers
|
||||
listNodePoolServers: (id: string) =>
|
||||
@@ -43,7 +43,7 @@ export const nodePoolsApi = {
|
||||
}),
|
||||
attachNodePoolServer: (id: string, body: DtoAttachServersRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await nodePools.attachNodePoolServers({ id, body })
|
||||
return await nodePools.attachNodePoolServers({ id, dtoAttachServersRequest: body })
|
||||
}),
|
||||
detachNodePoolServers: (id: string, serverId: string) =>
|
||||
withRefresh(async () => {
|
||||
@@ -56,7 +56,7 @@ export const nodePoolsApi = {
|
||||
}),
|
||||
attachNodePoolTaints: (id: string, body: DtoAttachTaintsRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await nodePools.attachNodePoolTaints({ id, body })
|
||||
return await nodePools.attachNodePoolTaints({ id, dtoAttachTaintsRequest: body })
|
||||
}),
|
||||
detachNodePoolTaints: (id: string, taintId: string) =>
|
||||
withRefresh(async () => {
|
||||
@@ -69,7 +69,7 @@ export const nodePoolsApi = {
|
||||
}),
|
||||
attachNodePoolLabels: (id: string, body: DtoAttachLabelsRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await nodePools.attachNodePoolLabels({ id, body })
|
||||
return await nodePools.attachNodePoolLabels({ id, dtoAttachLabelsRequest: body })
|
||||
}),
|
||||
detachNodePoolLabels: (id: string, labelId: string) =>
|
||||
withRefresh(async () => {
|
||||
@@ -82,7 +82,7 @@ export const nodePoolsApi = {
|
||||
}),
|
||||
attachNodePoolAnnotations: (id: string, body: DtoAttachAnnotationsRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await nodePools.attachNodePoolAnnotations({ id, body })
|
||||
return await nodePools.attachNodePoolAnnotations({ id, dtoAttachAnnotationsRequest: body })
|
||||
}),
|
||||
detachNodePoolAnnotations: (id: string, annotationId: string) =>
|
||||
withRefresh(async () => {
|
||||
|
||||
@@ -11,7 +11,7 @@ export const serversApi = {
|
||||
}),
|
||||
createServer: (body: DtoCreateServerRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await servers.createServer({ body })
|
||||
return await servers.createServer({ dtoCreateServerRequest: body })
|
||||
}),
|
||||
getServer: (id: string) =>
|
||||
withRefresh(async () => {
|
||||
@@ -19,7 +19,7 @@ export const serversApi = {
|
||||
}),
|
||||
updateServer: (id: string, body: DtoUpdateServerRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await servers.updateServer({ id, body })
|
||||
return await servers.updateServer({ id, dtoUpdateServerRequest: body })
|
||||
}),
|
||||
deleteServer: (id: string) =>
|
||||
withRefresh(async () => {
|
||||
|
||||
@@ -33,7 +33,7 @@ export const sshApi = {
|
||||
createSshKey: (body: DtoCreateSSHRequest) =>
|
||||
withRefresh(async (): Promise<DtoSshResponse> => {
|
||||
// SDK expects { body }
|
||||
return await ssh.createSSHKey({ body })
|
||||
return await ssh.createSSHKey({ dtoCreateSSHRequest: body })
|
||||
}),
|
||||
|
||||
getSshKeyById: (id: string) =>
|
||||
|
||||
@@ -10,7 +10,7 @@ export const taintsApi = {
|
||||
}),
|
||||
createTaint: (body: DtoCreateTaintRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await taints.createTaint({ body })
|
||||
return await taints.createTaint({ dtoCreateTaintRequest: body })
|
||||
}),
|
||||
getTaint: (id: string) =>
|
||||
withRefresh(async () => {
|
||||
@@ -22,6 +22,6 @@ export const taintsApi = {
|
||||
}),
|
||||
updateTaint: (id: string, body: DtoUpdateTaintRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await taints.updateTaint({ id, body })
|
||||
return await taints.updateTaint({ id, dtoUpdateTaintRequest: body })
|
||||
}),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user