import request from '@/utils/request'

/**     --------------资源管理---------------     */
// 查询资源注册列表
export function listHandle(query) {
  return request({
    url: '/system/registration/list',
    method: 'post',
    data: query
  })
}
// 资源全部list
export function listAllResourList(data) {
  return request({
    url: '/system/registration/selectAllResourceNameByType',
    method: 'post',
    data: data
  })
}

// 查询资源注册详细
export function getHandle(Id) {
  return request({
    url: '/system/registration/' + Id,
    method: 'get'
  })
}

// 新增资源注册
export function addHandle(data) {
  return request({
    url: '/system/registration',
    method: 'post',
    data: data
  })
}

// 修改资源注册
export function updateHandle(data) {
  return request({
    url: '/system/registration',
    method: 'put',
    data: data
  })
}
// 修改注册状态
export function updateregisterType(data) {
  return request({
    url: '/system/registration/register',
    method: 'post',
    data: data
  })
}
// 交换机/服务器--节点名称查询
export function resNameBtType(data) {
  return request({
    url: '/system/registration/selectAllResourceNameByType',
    method: 'post',
    data: data
  })
}


/**   ----------------拓扑管理 ------------    */
// 查询列表
export function listTopology(query) {
  return request({
    url: '/system/management/list',
    method: 'post',
    data: query
  })
}
// 查询资源注册详细
export function getTopology(Id) {
  return request({
    url: '/system/management/' + Id,
    method: 'get'
  })
}

// 新增资源注册
export function addTopology(data) {
  return request({
    url: '/system/management',
    method: 'post',
    data: data
  })
}

// 修改资源注册
export function updateTopology(data) {
  return request({
    url: '/system/management',
    method: 'put',
    data: data
  })
}
// 删除
export function delTopology(Ids) {
  return request({
    url: '/system/management/' + Ids,
    method: 'delete'
  })
}
// 服务器网口
export function postInterFaceName(data) {
  return request({
    url: '/system/interfaceName/getAllNames',
    method: 'post',
    data: data
  })
}

/**   ----------------资源分组------------    */
// 查询列表
export function listGroup(query) {
  return request({
    url: '/system/group/list',
    method: 'post',
    data: query
  })
}
// 查询详细
export function getGroup(Id) {
  return request({
    url: '/system/group/' + Id,
    method: 'get'
  })
}

// 新增
export function addGroup(data) {
  return request({
    url: '/system/group',
    method: 'post',
    data: data
  })
}

// 修改
export function updateGroup(data) {
  return request({
    url: '/system/group',
    method: 'put',
    data: data
  })
}
// 删除
export function delGroup(Ids) {
  return request({
    url: '/system/group/' + Ids,
    method: 'delete'
  })
}
// 包含设备查询
export function resNameList() {
  return request({
    url: '/system/registration/selectAllResourceName',
    method: 'get'
  })
}
/**   ----------------监控模版管理------------    */
// 查询列表
export function listMonitorTemp(query) {
  return request({
    url: '/system/management/list',
    method: 'post',
    data: query
  })
}
// 查询资源注册详细
export function getMonitorTemp(Id) {
  return request({
    url: '/system/management/' + Id,
    method: 'get'
  })
}

// 新增资源注册
export function addMonitorTemp(data) {
  return request({
    url: '/system/management',
    method: 'post',
    data: data
  })
}

// 修改资源注册
export function updateMonitorTemp(data) {
  return request({
    url: '/system/management',
    method: 'put',
    data: data
  })
}
// 删除
export function delMonitorTemp(Ids) {
  return request({
    url: '/system/management/' + Ids,
    method: 'delete'
  })
}
