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
  })
}
// 查询all列表
export function listAllTopology(query) {
  return request({
    url: '/system/management/getListChart',
    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 exitsResourceById(data) {
  return request({
    url: '/system/group/exitsResourceById',
    method: 'post',
    data: data
  })
}
// 包含设备查询
export function resNameList() {
  return request({
    url: '/system/registration/selectAllResourceName',
    method: 'get'
  })
}
/**   ----------------监控模版管理------------    */
// 查询列表
export function listMonitorTemp(query) {
  return request({
    url: '/rocketmq/template/list',
    method: 'post',
    data: query
  })
}
// 查询详细
export function getMonitorTemp(Id) {
  return request({
    url: '/rocketmq/template/' + Id,
    method: 'get'
  })
}
// 查询资源监控项
export function getMonitorTempList(query) {
  return request({
    url: '/rocketmq/initialMonitorItem/list',
    method: 'post',
    data: query
  })
}

// 新增
export function addMonitorTemp(data) {
  return request({
    url: '/rocketmq/template',
    method: 'post',
    data: data
  })
}

// 修改
export function updateMonitorTemp(data) {
  return request({
    url: '/rocketmq/template',
    method: 'put',
    data: data
  })
}
// 删除
export function delMonitorTemp(Ids) {
  return request({
    url: '/rocketmq/template/' + Ids,
    method: 'delete'
  })
}

/**   ----------------资源监控策略------------    */
// 查询列表
export function listMonitorPolicy(query) {
  return request({
    url: '/rocketmq/monitorPolicy/list',
    method: 'post',
    data: query
  })
}
// 查询详细
export function getMonitorPolicy(Id) {
  return request({
    url: '/rocketmq/monitorPolicy/' + Id,
    method: 'get'
  })
}
// 下发策略
export function getMonitorPolicyList(Id) {
  return request({
    url: '/rocketmq/monitorPolicy/issuePolicy?id=' + Id,
    method: 'get'
  })
}

// 新增
export function addMonitorPolicy(data) {
  return request({
    url: '/rocketmq/monitorPolicy',
    method: 'post',
    data: data
  })
}

// 修改
export function updateMonitorPolicy(data) {
  return request({
    url: '/rocketmq/monitorPolicy',
    method: 'put',
    data: data
  })
}
// 删除
export function delMonitorPolicy(Ids) {
  return request({
    url: '/rocketmq/monitorPolicy/' + Ids,
    method: 'delete'
  })
}
// 关联监控模板下拉接口
export function getMonitorPolicyTemp() {
  return request({
    url: '/rocketmq/template/getAllTemplate',
    method: 'get'
  })
}
// 关联资源组下拉接口
export function getResMonitorGroup() {
  return request({
    url: '/system/resourceMonitor/resourceGroupList ',
    method: 'get'
  })
}
/**   ----------------交换机监控策略------------    */
// 新增
export function addResourcePolicy(data) {
  return request({
    url: '/rocketmq/monitorPolicy/addResourcePolicy',
    method: 'post',
    data: data
  })
}
// 修改
export function updateResourcePolicy(data) {
  return request({
    url: '/rocketmq/monitorPolicy/updateResourcePolicy',
    method: 'post',
    data: data
  })
}

/**   ----------------脚本服务器策略------------    */
// 查询列表
export function listPolicy(query) {
  return request({
    url: '/rocketmq/policy/list',
    method: 'post',
    data: query
  })
}
// 查询详细
export function getPolicy(Id) {
  return request({
    url: '/rocketmq/policy/' + Id,
    method: 'get'
  })
}
// 下发策略
export function getPolicyList(Id) {
  return request({
    url: '/rocketmq/policy/issueDeploymentPolicy?id=' + Id,
    method: 'get'
  })
}

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

// 修改
export function updatePolicy(data) {
  return request({
    url: '/rocketmq/policy',
    method: 'put',
    data: data
  })
}
// 删除
export function delPolicy(Ids) {
  return request({
    url: '/rocketmq/policy/' + Ids,
    method: 'delete'
  })
}
/**   ----------------脚本执行结果------------    */
export function getScriptResultBySn(data) {
  return request({
    url: '/rocketmq/remote/getScriptResultBySn',
    method: 'post',
    data: data
  })
}
//  获取资源分组列表
export function getResGroupList() {
  return request({
    url: '/system/resourceMonitor/resourceGroupList',
    method: 'get'
  })
}
// 传参 分页参数和 资源组id
export function listRegisterList(data) {
  return request({
    url: '/system/resourceMonitor/getRegisterListByGroupId',
    method: 'post',
    data: data
  })
}
// 通过资源查包含设备
export function listArrRegisterList(data) {
  return request({
    url: '/system/resourceMonitor/getAllRegisterListByGroupId',
    method: 'post',
    data: data
  })
}
/**   ----------------AGENT更新------------    */
// 查询列表
export function listAgentManage(query) {
  return request({
    url: '/rocketmq/agentManagement/list',
    method: 'post',
    data: query
  })
}
// 查询详细
export function getAgentManage(Id) {
  return request({
    url: '/rocketmq/agentManagement/' + Id,
    method: 'get'
  })
}

// 新增
export function addAgentManage(data) {
  return request({
    url: '/rocketmq/agentManagement/addUpdatePolicy',
    method: 'post',
    data: data
  })
}

// 修改
export function updateAgentManage(data) {
  return request({
    url: '/rocketmq/agentManagement/updateAgentNow',
    method: 'post',
    data: data
  })
}
// 删除
export function delAgentManage(Ids) {
  return request({
    url: '/rocketmq/agentManagement/' + Ids,
    method: 'delete'
  })
}

/**     --------------交换机管理---------------     */
// 查询列表
export function listSwitchManage(query) {
  return request({
    url: '/system/switchManagement/list',
    method: 'post',
    data: query
  })
}
// 所有列表
export function listAllSwitchName(query) {
  return request({
    url: '/system/switchManagement/getAllSwitchName',
    method: 'post',
    data: query
  })
}

// 查询详细
export function getSwitchManage(Id) {
  return request({
    url: '/system/switchManagement/' + Id,
    method: 'get'
  })
}

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

// 修改
export function updateSwitchManage(data) {
  return request({
    url: '/system/switchManagement',
    method: 'put',
    data: data
  })
}
// 图形监控-基础信息
export function switchMonitorData(data) {
  return request({
    url: '/rocketmq/switchOtherData/getSwitchMonitorMsg',
    method: 'post',
    data: data
  })
}
// 图形监控-设备cpu使用率
export function switchCpuData(data) {
  return request({
    url: '/rocketmq/switchOtherData/getSwitchCpuUseMsg',
    method: 'post',
    data: data
  })
}
// 图形监控-设备内存使用率
export function switchMemData(data) {
  return request({
    url: '/rocketmq/switchOtherData/getSwitchMemUseMsg',
    method: 'post',
    data: data
  })
}
// 图形监控-功率
export function switchPowerData(data) {
  return request({
    url: '/rocketmq/switchOtherData/getSwitchPowerMsg',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-基础信息
export function switchNetDetails(data) {
  return request({
    url: '/rocketmq/switchInfo/getSwitchNetDetailsMsg',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-丢包
export function switchNetDiscards(data) {
  return request({
    url: '/rocketmq/switchInfo/switchNetDiscardsEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-总流量
export function switchNeTotal(data) {
  return request({
    url: '/rocketmq/switchInfo/switchNetTotalEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-错误丢包
export function switchNetErrDiscard(data) {
  return request({
    url: '/rocketmq/switchInfo/switchNetErrDiscardsEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-实时流量
export function switchNetSpeed(data) {
  return request({
    url: '/rocketmq/switchInfo/switchNetSpeedEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-光模块AllName
export function moduleAllName(data) {
  return request({
    url: '/rocketmq/switchOpticalModule/getAllModuleName',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-光模块-基本信息
export function moduleMsg(data) {
  return request({
    url: '/rocketmq/switchOpticalModule/switchOpticalModuleMsg',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-光模块-光衰阈值
export function moduleLowThreshold(data) {
  return request({
    url: '/rocketmq/switchOpticalModule/opticalModuleLowThreshold',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-光模块-功率
export function modulePower(data) {
  return request({
    url: '/rocketmq/switchOpticalModule/opticalModulePower',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-MPU1 AllName
export function mpuAllName(data) {
  return request({
    url: '/rocketmq/switchMpuInfo/getAllMpuName',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-MPU1-基本信息
export function mpuMsg(data) {
  return request({
    url: '/rocketmq/switchMpuInfo/getMpuMsg',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-MPU1-cpu使用率
export function mpuCpuUse(data) {
  return request({
    url: '/rocketmq/switchMpuInfo/getMpuCpuUse',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-MPU1-内存使用率
export function mpuMemUse(data) {
  return request({
    url: '/rocketmq/switchMpuInfo/getMpuMemUse',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-MPU1-温度
export function mpuTemperature(data) {
  return request({
    url: '/rocketmq/switchMpuInfo/getMpuTemperature',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-电源AllName
export function pwrAllName(data) {
  return request({
    url: '/rocketmq/switchPowerSupply/getAllPwrName',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-电源-基本信息
export function pwrMsg(data) {
  return request({
    url: '/rocketmq/switchPowerSupply/getPwrMsg',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-电源-光衰阈值
export function pwrCurrent(data) {
  return request({
    url: '/rocketmq/switchPowerSupply/getPwrCurrent',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-电源-功率
export function pwrVoltage(data) {
  return request({
    url: '/rocketmq/switchPowerSupply/getPwrVoltage',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-风扇AllName
export function fanAllName(data) {
  return request({
    url: '/rocketmq/switchFanInfo/getAllFanName',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-风扇-基本信息
export function fanMsg(data) {
  return request({
    url: '/rocketmq/switchFanInfo/getFanMsg',
    method: 'post',
    data: data
  })
}

/**     --------------接口备注信息---------------     */
// 查询列表
// export function listAllSwitchInterface(query) {
//   return request({
//     url: '/system/switchInterfaceInfo/list',
//     method: 'post',
//     data: query
//   })
// }

// 查询详细
export function getSwitchInterface(Id) {
  return request({
    url: '/system/switchInterfaceInfo/' + Id,
    method: 'get'
  })
}
// 新增
export function addSwitchInterface(data) {
  return request({
    url: '/system/switchInterfaceInfo',
    method: 'post',
    data: data
  })
}
// 修改
export function updateSwitchInterface(data) {
  return request({
    url: '/system/switchInterfaceInfo',
    method: 'put',
    data: data
  })
}
// 删除
export function delSwitchInterface(Ids) {
  return request({
    url: '/system/switchInterfaceInfo/' + Ids,
    method: 'delete'
  })
}


/**     --------------服务器资源注册--------------     */
// 查询列表
export function addMachine(query) {
  return request({
    url: '/system/machine',
    method: 'post',
    data: query
  })
}
export function getLogicalNode() {
  return request({
    url: '/system/registration/getAllLogicalNodeId',
    method: 'get',
  })
}

export function getRegistList(query) {
  return request({
    url: '/system/registration/getRegistList',
    method: 'post',
    data: query
  })
}
export function bindBusByClient(query) {
  return request({
    url: 'system/registration/bindBusinessByClientIds',
    method: 'post',
    data: query
  })
}
export function networkList(query) {
  return request({
    url: '/rocketmq/networkInterface/list',
    method: 'post',
    data: query
  })
}
// 图形监控-基础信息
export function serverMonitorData(data) {
  return request({
    url: '/rocketmq/systemOtherCollectData/getMontiorMsg',
    method: 'post',
    data: data
  })
}
// 图形监控-cpu负载
export function cpuLoadData(data) {
  return request({
    url: '/rocketmq/cpuInfo/cpuLoadEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-cpu时间
export function cpuTimeData(data) {
  return request({
    url: '/rocketmq/cpuInfo/cpuTimeEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-进程
export function procNum(data) {
  return request({
    url: '/rocketmq/systemOtherCollectData/procNumEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-登录用户数
export function serverUserNum(data) {
  return request({
    url: '/rocketmq/systemOtherCollectData/systemUserNumEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-交换卷/文件的可用空间
export function swapSizeFree(data) {
  return request({
    url: '/rocketmq/systemOtherCollectData/systemSwapSizeFreeEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-内存利用率
export function memoryUtilization(data) {
  return request({
    url: '/rocketmq/systemOtherCollectData/memoryUtilizationEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-可用交换空间百分比
export function swapSizePercent(data) {
  return request({
    url: '/rocketmq/systemOtherCollectData/systemSwapSizePercentEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-可用内存
export function memorySizeAvailable(data) {
  return request({
    url: '/rocketmq/systemOtherCollectData/memorySizeAvailableEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-可用内存百分比
export function memorySizePercent(data) {
  return request({
    url: '/rocketmq/systemOtherCollectData/memorySizePercentEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-所有挂载名称
export function mountNameList(data) {
  return request({
    url: '/rocketmq/mountPointInfo/getAllMountName',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-挂载的-基础信息
export function pointDetails(data) {
  return request({
    url: '/rocketmq/mountPointInfo/pointDetailsMsg',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-挂载的-空间
export function spaceEcharts(data) {
  return request({
    url: '/rocketmq/mountPointInfo/spaceEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-挂载的-空间利用率
export function spaceRate(data) {
  return request({
    url: '/rocketmq/mountPointInfo/spaceRateEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-网络接口的-基础信息
export function netDetails(data) {
  return request({
    url: '/rocketmq/traffic/netInterfaceDetailsMsg',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-网络接口的-流量
export function trafficEcharts(data) {
  return request({
    url: '/rocketmq/traffic/netInterfaceTrafficEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-网络接口的-丢数
export function droppedEcharts(data) {
  return request({
    url: '/rocketmq/traffic/netInterfaceDroppedEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-硬盘设备的-所有名称
export function diskAllNames(data) {
  return request({
    url: '/rocketmq/diskInfo/getAllDistName',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-硬盘设备的-基础信息
export function diskDetails(data) {
  return request({
    url: '/rocketmq/diskInfo/getDistDetailsMsg',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-硬盘设备的-读写速率
export function speedEcharts(data) {
  return request({
    url: '/rocketmq/diskInfo/rwSpeedEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-硬盘设备的-读写次数
export function timesEcharts(data) {
  return request({
    url: '/rocketmq/diskInfo/rwTimesEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-硬盘设备的-读写字节
export function bytesEcharts(data) {
  return request({
    url: '/rocketmq/diskInfo/rwBytesEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-容器的-所有名称
export function dockerAllNames(data) {
  return request({
    url: '/rocketmq/dockerInfo/getAllDockerId',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-容器的-基础信息
export function dockerDetails(data) {
  return request({
    url: '/rocketmq/dockerInfo/getDockerDetailsMsg',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-容器的-CPU利用率
export function cpuUtilEcharts(data) {
  return request({
    url: '/rocketmq/dockerInfo/cpuUtilEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-容器的-内存利用率
export function dockerMemEcharts(data) {
  return request({
    url: '/rocketmq/dockerInfo/memUtilEcharts',
    method: 'post',
    data: data
  })
}
// 图形监控-自动发现项-容器的-网络速率
export function dockerSpeedEcharts(data) {
  return request({
    url: '/rocketmq/dockerInfo/netSpeedEcharts',
    method: 'post',
    data: data
  })
}
