main
ts 34 lines 1005 Bytes
Raw
1 import type { FlaskBaseResponse } from "@/types/flask.d"
2 import type { PortainerStack } from "@/types/portainer.d"
3 import { HttpClient } from "../httpClient"
4
5 export default {
6 getCustomerStackId(customerName: string) {
7 return HttpClient.get<FlaskBaseResponse & { stack_id: number }>(`/portainer/get-customer-stack-id`, {
8 params: { customer_name: customerName }
9 })
10 },
11 getStackDetails(stackId: number) {
12 return HttpClient.get<FlaskBaseResponse & { data: PortainerStack }>(`/portainer/stack-details`, {
13 params: { stack_id: stackId }
14 })
15 },
16 startWazuhCustomerStack(stackId: number) {
17 return HttpClient.post<FlaskBaseResponse & { data: PortainerStack }>(
18 `/portainer/start-wazuh-customer-stack`,
19 undefined,
20 {
21 params: { stack_id: stackId }
22 }
23 )
24 },
25 stopWazuhCustomerStack(stackId: number) {
26 return HttpClient.post<FlaskBaseResponse & { data: PortainerStack }>(
27 `/portainer/stop-wazuh-customer-stack`,
28 undefined,
29 {
30 params: { stack_id: stackId }
31 }
32 )
33 }
34 }