Compare commits

..

No commits in common. "7bce87c19f777645a038a2a5fab28947bd2e5bdc" and "b9501bb508607a99667ce1c9e631147bf6e325d6" have entirely different histories.

3 changed files with 12 additions and 6 deletions

View File

@ -43,7 +43,6 @@ 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();
@ -63,7 +62,6 @@ public class TianyiProvider {
if (StringUtils.hasText(butler.getUrl())) {
this.PROTOCOL = butler.getUrl();
}
this.apiDomain = "http://ct-global.ctapi.ctyun.local:31167";
}
public boolean accessable() {
@ -83,7 +81,7 @@ public class TianyiProvider {
}
public String buildUrl(String apiUrl) {
return this.apiDomain + apiUrl;
return PROTOCOL + apiUrl;
}
public Result doGet(String url, Map<String, Object> headers) {
@ -102,6 +100,16 @@ public class TianyiProvider {
return httpClient.get(header, params, uri);
}
public Result doGet2(String url, Map<String, Object> headers, Map<String, Object> params) {
HttpClient httpClient = new HttpClient(60 * 1000, PostDataFormat.RAW);
httpClient.setDataFormat(null);
String uri = "http://ccse-global.ctapi.ctyun.local:31167" + url;
Map<String, Object> 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<String, Object> headers, Map<String, Object> params) {
try {
//创建httpclient对象

View File

@ -32,7 +32,6 @@ public class TianYiContainerClusterProvider extends TianyiProvider {
public TianYiContainerClusterProvider(Butler butler) {
super(butler);
this.butler = butler;
this.apiDomain = "http://ccse-global.ctapi.ctyun.local:31167";
}
@ -49,7 +48,7 @@ public class TianYiContainerClusterProvider extends TianyiProvider {
while (true) {
body.put("pageNow", pageNow);
Result result = doGet(url, header, body);
Result result = doGet2(url, header, body);
JSONObject returnObj = checkResult(result, "查询容器集群列表");
log.info("checkedResult:{}", JSON.toJSONString(returnObj));
records.addAll(JSONObject.parseObject(returnObj.getString("records"), List.class));

View File

@ -33,7 +33,6 @@ 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) {