diff --git a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/TianyiProvider.java b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/TianyiProvider.java index eec80cad..069051c1 100644 --- a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/TianyiProvider.java +++ b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/TianyiProvider.java @@ -43,6 +43,7 @@ public class TianyiProvider { private String regionId = "cn-jssz1"; public static final Integer SUCCESS_STATUS_CODE = 800; public String PROTOCOL = "http://70.10.130.186:12315"; + public String apiDomain = ""; public Integer PAGE_SIZE = 50; private final HttpClient client = new HttpClient(60 * 1000, PostDataFormat.RAW); protected ResultBuilder resultBuilder = new CommonResultBuilder(); @@ -62,6 +63,7 @@ public class TianyiProvider { if (StringUtils.hasText(butler.getUrl())) { this.PROTOCOL = butler.getUrl(); } + this.apiDomain = "http://ct-global.ctapi.ctyun.local:31167"; } public boolean accessable() { @@ -81,7 +83,7 @@ public class TianyiProvider { } public String buildUrl(String apiUrl) { - return PROTOCOL + apiUrl; + return this.apiDomain + apiUrl; } public Result doGet(String url, Map headers) { @@ -100,16 +102,6 @@ public class TianyiProvider { return httpClient.get(header, params, uri); } - public Result doGet2(String url, Map headers, Map params) { - HttpClient httpClient = new HttpClient(60 * 1000, PostDataFormat.RAW); - httpClient.setDataFormat(null); - - String uri = "http://ccse-global.ctapi.ctyun.local:31167" + url; - Map header = buildHeader(HttpRequestMethod.GET, url, headers, params); - printCurl(HttpRequestMethod.GET, uri, header, params); - return httpClient.get(header, params, uri); - } - public Result doGetWithBody(String url, Map headers, Map params) { try { //创建httpclient对象 diff --git a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/container/TianYiContainerClusterProvider.java b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/container/TianYiContainerClusterProvider.java index 90de90de..90b167e1 100644 --- a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/container/TianYiContainerClusterProvider.java +++ b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/container/TianYiContainerClusterProvider.java @@ -32,6 +32,7 @@ public class TianYiContainerClusterProvider extends TianyiProvider { public TianYiContainerClusterProvider(Butler butler) { super(butler); this.butler = butler; + this.apiDomain = "http://ccse-global.ctapi.ctyun.local:31167"; } @@ -48,7 +49,7 @@ public class TianYiContainerClusterProvider extends TianyiProvider { while (true) { body.put("pageNow", pageNow); - Result result = doGet2(url, header, body); + Result result = doGet(url, header, body); JSONObject returnObj = checkResult(result, "查询容器集群列表"); log.info("checkedResult:{}", JSON.toJSONString(returnObj)); records.addAll(JSONObject.parseObject(returnObj.getString("records"), List.class)); diff --git a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/container/TianYiContainerNodeProvider.java b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/container/TianYiContainerNodeProvider.java index b9210e77..bd3667f1 100644 --- a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/container/TianYiContainerNodeProvider.java +++ b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/container/TianYiContainerNodeProvider.java @@ -33,6 +33,7 @@ public class TianYiContainerNodeProvider extends TianyiProvider { public TianYiContainerNodeProvider(Butler butler) { super(butler); this.butler = butler; + this.apiDomain = "http://ccse-global.ctapi.ctyun.local:31167"; } public GeneralResult listNodes(String clusterName) {