import request from '@/utils/request'

// 获取事件监控规则 /api/v1/monitor-rules?pageIndex=1&pageSize=20
export function listRules(query) {
  return request({
    url: '/api/v1/monitor-rules',
    method: 'get',
    params: query
  })
}

// 获取单条事件监控规则 /api/v1/monitor-rules/{id}
export function getRules(id) {
  return request({
    url: '/api/v1/monitor-rules/' + id,
    method: 'get'
  })
}

// 添加事件监控规则
export function addRules(data) {
  return request({
    url: '/api/v1/monitor-rules',
    method: 'post',
    data: data
  })
}

// 修改事件
export function updateRules(data, id) {
  return request({
    url: '/api/v1/monitor-rules/' + id,
    method: 'put',
    data: data
  })
}

// 删除
export function delRules(id) {
  return request({
    url: '/api/v1/monitor-rules',
    method: 'delete',
    data: id
  })
}

