import request from '@/utils/request'

// 获取特定事件告警策略
export function listPolicy(query) {
  return request({
    url: '/api/v1/alert-policy',
    method: 'get',
    params: query
  })
}

export function getPolicy(id) {
  return request({
    url: '/api/v1/alert-policy/' + id,
    method: 'get'
  })
}

// 新增
export function addPolicy(data) {
  return request({
    url: '/api/v1/alert-policy',
    method: 'post',
    data: data
  })
}

// 修改
export function updatePolicy(data, id) {
  return request({
    url: '/api/v1/alert-policy/' + id,
    method: 'put',
    data: data
  })
}


// 删除
export function delPolicy(id) {
  return request({
    url: '/api/v1/alert-policy',
    method: 'delete',
    data: id
  })
}

//10.5 业务系统 —— 事件规则一键导入    //observe-server.cestong.com.cn/api/v1/alert-policy/import post
export function importPolicy(data) {
  return request({
    url: '/api/v1/alert-policy/import',
    method: 'post',
    data: data
  })
}


