import request from '@/utils/request'

// 查询设备终端配置列表
export function listTerminal(query) {
  return request({
    url: '/device/terminal/list',
    method: 'get',
    params: query
  })
}

// 查询设备终端配置详细
export function getTerminal(id) {
  return request({
    url: '/device/terminal/' + id,
    method: 'get'
  })
}

// 新增设备终端配置
export function addTerminal(data) {
  return request({
    url: '/device/terminal',
    method: 'post',
    data: data
  })
}

// 修改设备终端配置
export function updateTerminal(data) {
  return request({
    url: '/device/terminal',
    method: 'put',
    data: data
  })
}

// 删除设备终端配置
export function delTerminal(id) {
  return request({
    url: '/device/terminal/' + id,
    method: 'delete'
  })
}

// 获取实例信息
export function getInstInfo(id) {
  return request({
    url: '/test/inst/context/' + id,
    method: 'get'
  })
}

// 暂停任务
export function pauseInst(id) {
   return request({
    url: `/test/inst/pause/${id}`,
    method: 'post'
  })
}

// 恢复任务
export function resumeInst(id) {
   return request({
    url: `/test/inst/resume/${id}`,
    method: 'post'
  })
}

// 恢复任务
export function stopInst(id) {
   return request({
    url: `/test/inst/stop/${id}`,
    method: 'post'
  })
}

export function getFlowParamsApi(taskId) {
  return request({
    url: '/test/orchestration',
    method: 'get',
    params: {
      taskId
    }
  })
}