...
|
...
|
@@ -77,11 +77,8 @@ public class TopoSwitchCtrl { |
|
|
Map<String, List<Map<String, Object>>> map = response.getData();
|
|
|
List<Map<String, Object>> awsList = map.get("awsList");
|
|
|
List<Map<String, Object>> qcloudList = map.get("qcloudList");
|
|
|
/*List<Host> grayHostLists=(List<Host>)map.get("grayServerHosts").get(0).get("grayServerHosts");
|
|
|
List<String> grayHostIps=new ArrayList<>();
|
|
|
for(Host host:grayHostLists){
|
|
|
grayHostIps.add(host.getIp());
|
|
|
}*/
|
|
|
List<String> grayHostIps=(List<String>)(map.get("grayServerHosts").get(0).get("grayServerHosts"));
|
|
|
|
|
|
String awsApiNginx = "aws";
|
|
|
String awsGrayNginx = "aws";
|
|
|
String qqApiNginx = "qq";
|
...
|
...
|
@@ -97,11 +94,22 @@ public class TopoSwitchCtrl { |
|
|
|
|
|
if (StringUtils.equals("grayapigateway", String.valueOf(apiMap.get("name")))) {
|
|
|
List<String> serverList = (List<String>) apiMap.get("server");
|
|
|
if (serverList.get(0).startsWith("10")) {
|
|
|
awsGrayNginx = "qq";
|
|
|
logger.error("awsgrayapigateway is === "+serverList.get(0));
|
|
|
logger.error("awsgrayapigateway is === "+serverList.get(0));
|
|
|
boolean grayFlag=false;
|
|
|
for(String grayIp:grayHostIps){
|
|
|
if(serverList.get(0).startsWith(grayIp)){
|
|
|
grayFlag=true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if(grayFlag){
|
|
|
awsGrayNginx = "gray";
|
|
|
}else{
|
|
|
awsGrayNginx="aws";
|
|
|
if (serverList.get(0).startsWith("10")) {
|
|
|
awsGrayNginx = "qq";
|
|
|
}else{
|
|
|
awsGrayNginx="aws";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -116,10 +124,22 @@ public class TopoSwitchCtrl { |
|
|
|
|
|
if (StringUtils.equals("grayapigateway", String.valueOf(apiMap.get("name")))) {
|
|
|
List<String> serverList = (List<String>) apiMap.get("server");
|
|
|
if (serverList.get(0).startsWith("172")) {
|
|
|
qqGrayNginx = "aws";
|
|
|
logger.error("qqgrayapigateway is === "+serverList.get(0));
|
|
|
boolean grayFlag=false;
|
|
|
for(String grayIp:grayHostIps){
|
|
|
if(serverList.get(0).startsWith(grayIp)){
|
|
|
grayFlag=true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if(grayFlag){
|
|
|
qqGrayNginx = "gray";
|
|
|
}else{
|
|
|
logger.error("qqgrayapigateway is === "+serverList.get(0));
|
|
|
if (serverList.get(0).startsWith("10")) {
|
|
|
qqGrayNginx = "qq";
|
|
|
}else{
|
|
|
qqGrayNginx="aws";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
|