...
|
...
|
@@ -65,14 +65,14 @@ public class NginxSwitchCtrl { |
|
|
return new BaseResponse(map);
|
|
|
}*/
|
|
|
|
|
|
List<HostInfo> awsNginxHosts = hostInfoMapper.selectHostInfosByTagAndCloudType("nginx", 1);
|
|
|
List<HostInfo> awsNginxHosts = hostInfoMapper.selectHostInfosByTagAndCloudType("upstream-switch", 1);
|
|
|
if(CollectionUtils.isEmpty(awsNginxHosts)){
|
|
|
map.put("awsList", Lists.newArrayList());
|
|
|
}else {
|
|
|
List<Map<String, Object>> awsList = analyseConfigFile(exe("view", awsNginxHosts.get(0).getHostIp(), null));
|
|
|
map.put("awsList", awsList);
|
|
|
}
|
|
|
List<HostInfo> qcloudNginxHosts = hostInfoMapper.selectHostInfosByTagAndCloudType("nginx", 2);
|
|
|
List<HostInfo> qcloudNginxHosts = hostInfoMapper.selectHostInfosByTagAndCloudType("upstream-switch", 2);
|
|
|
if(CollectionUtils.isEmpty(qcloudNginxHosts)){
|
|
|
map.put("qcloudList", Lists.newArrayList());
|
|
|
}else {
|
...
|
...
|
@@ -152,7 +152,7 @@ public class NginxSwitchCtrl { |
|
|
return new BaseResponse(500, "没有匹配到要切换的云");
|
|
|
}
|
|
|
//获取对应cloud的机器 aws 1 qcloud 2
|
|
|
List<HostInfo> nginxHosts = hostInfoMapper.selectHostInfosByTagAndCloudType("nginx", nginxCloudType);
|
|
|
List<HostInfo> nginxHosts = hostInfoMapper.selectHostInfosByTagAndCloudType("upstream-switch", nginxCloudType);
|
|
|
if (CollectionUtils.isEmpty(nginxHosts)) {
|
|
|
return new BaseResponse(500, cloudName + "在cmdb中未找到对应的nginx服务器!");
|
|
|
}
|
...
|
...
|
|