|
|
package com.monitor.switchs;
|
|
|
|
|
|
import com.model.HostInfo;
|
|
|
import com.monitor.common.HostTagConstant;
|
|
|
import com.monitor.model.response.BaseResponse;
|
|
|
import com.monitor.mysql.mapper.HostInfoMapper;
|
|
|
import com.yoho.ops.cmdb.qcloud.util.QcloudDnspotUtil;
|
...
|
...
|
@@ -39,7 +40,7 @@ public class LuaSwitchCtrl { |
|
|
@ResponseBody
|
|
|
public String viewConf() throws Exception {
|
|
|
try{
|
|
|
List<HostInfo> qcloudNginxHosts = hostInfoMapper.selectHostInfosByTag("lua-switch");
|
|
|
List<HostInfo> qcloudNginxHosts = hostInfoMapper.selectHostInfosByTag(HostTagConstant.tag_luaSwitch);
|
|
|
if (CollectionUtils.isEmpty(qcloudNginxHosts)) {
|
|
|
logger.error(" LuaSwitchCtrl - viewConf - init - error=没有找到lua切换nginx服务器");
|
|
|
return "没有找到lua切换nginx服务器";
|
...
|
...
|
@@ -86,7 +87,7 @@ public class LuaSwitchCtrl { |
|
|
@ResponseBody
|
|
|
public BaseResponse viewCurrentConf() {
|
|
|
try{
|
|
|
List<HostInfo> qcloudNginxHosts = hostInfoMapper.selectHostInfosByTag("lua-switch");
|
|
|
List<HostInfo> qcloudNginxHosts = hostInfoMapper.selectHostInfosByTag(HostTagConstant.tag_luaSwitch);
|
|
|
String result = exe("view", qcloudNginxHosts.get(0).getHostIp(), null);
|
|
|
return new BaseResponse(200, "success", result);
|
|
|
}catch (Exception e){
|
...
|
...
|
@@ -105,7 +106,7 @@ public class LuaSwitchCtrl { |
|
|
public BaseResponse switchConf(HttpServletRequest request) {
|
|
|
try{
|
|
|
//lua dns 只放在腾讯云nginx服务器上
|
|
|
List<HostInfo> nginxHosts = hostInfoMapper.selectHostInfosByTag("lua-switch");
|
|
|
List<HostInfo> nginxHosts = hostInfoMapper.selectHostInfosByTag(HostTagConstant.tag_luaSwitch);
|
|
|
if (CollectionUtils.isEmpty(nginxHosts)) {
|
|
|
return new BaseResponse(500, "腾讯云在cmdb中未找到对应的nginx服务器!");
|
|
|
}
|
...
|
...
|
|