...
|
...
|
@@ -181,30 +181,6 @@ public class NginxSwitchCtrl { |
|
|
@ResponseBody
|
|
|
public BaseResponse viewToChangeNginxConf(String cloudName, String target, String onlineOrGray) {
|
|
|
try{
|
|
|
//线上切换
|
|
|
/*String tag = StringUtils.equals("gray", target) ? HostTagConstant.tag_huidu_cn : HostTagConstant.tag_gateway;
|
|
|
|
|
|
//需要查询的gateway机子
|
|
|
int gatewayCloudType = StringUtils.equals("aws", target) ? 1 : 2;
|
|
|
|
|
|
//获取gateway或graygateway服务器
|
|
|
List<HostInfo> gatewayHosts = hostInfoMapper.selectHostInfosByTagAndCloudType(tag, gatewayCloudType);
|
|
|
|
|
|
if (CollectionUtils.isEmpty(gatewayHosts)) {
|
|
|
return new BaseResponse(500, cloudName + "在cmdb中未找到对应" + tag + "的服务器!");
|
|
|
}
|
|
|
Iterator<HostInfo> infoIterator = gatewayHosts.iterator();
|
|
|
while (infoIterator.hasNext()) {
|
|
|
HostInfo hostInfo = infoIterator.next();
|
|
|
if (HostTagConstant.tag_gateway.equals(tag)) {
|
|
|
if (hostInfo.getTags().indexOf(HostTagConstant.tag_huidu_cn) != -1) {
|
|
|
infoIterator.remove();
|
|
|
}
|
|
|
} else if (hostInfo.getTags().indexOf(HostTagConstant.tag_gateway) == -1) {
|
|
|
infoIterator.remove();
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
List<String> gatewayHostIps=new ArrayList<>();
|
|
|
if(StringUtils.equals("gray", target)){
|
|
|
gatewayHostIps = getGatewayHostIPs(HostTagConstant.tag_huidu_cn);
|
...
|
...
|
|