import { request } from '@/api/request'

export interface TrafficRuntimeStatus {
  status?: 'running' | 'stopped' | string
  message?: string
}

export const fetchTrafficRuntimeStatus = () =>
  request.get<{ code: number; details?: TrafficRuntimeStatus; message?: string }>('/dc-network/v1/api/traffic/status')

export const startTrafficRuntime = () =>
  request.post<{ code: number; details?: TrafficRuntimeStatus; message?: string }>('/dc-network/v1/api/traffic/start')

export const stopTrafficRuntime = () =>
  request.post<{ code: number; details?: TrafficRuntimeStatus; message?: string }>('/dc-network/v1/api/traffic/stop')
