Compare commits
No commits in common. "7bce87c19f777645a038a2a5fab28947bd2e5bdc" and "b9501bb508607a99667ce1c9e631147bf6e325d6" have entirely different histories.
7bce87c19f
...
b9501bb508
|
@ -43,7 +43,6 @@ public class TianyiProvider {
|
||||||
private String regionId = "cn-jssz1";
|
private String regionId = "cn-jssz1";
|
||||||
public static final Integer SUCCESS_STATUS_CODE = 800;
|
public static final Integer SUCCESS_STATUS_CODE = 800;
|
||||||
public String PROTOCOL = "http://70.10.130.186:12315";
|
public String PROTOCOL = "http://70.10.130.186:12315";
|
||||||
public String apiDomain = "";
|
|
||||||
public Integer PAGE_SIZE = 50;
|
public Integer PAGE_SIZE = 50;
|
||||||
private final HttpClient client = new HttpClient(60 * 1000, PostDataFormat.RAW);
|
private final HttpClient client = new HttpClient(60 * 1000, PostDataFormat.RAW);
|
||||||
protected ResultBuilder resultBuilder = new CommonResultBuilder();
|
protected ResultBuilder resultBuilder = new CommonResultBuilder();
|
||||||
|
@ -63,7 +62,6 @@ public class TianyiProvider {
|
||||||
if (StringUtils.hasText(butler.getUrl())) {
|
if (StringUtils.hasText(butler.getUrl())) {
|
||||||
this.PROTOCOL = butler.getUrl();
|
this.PROTOCOL = butler.getUrl();
|
||||||
}
|
}
|
||||||
this.apiDomain = "http://ct-global.ctapi.ctyun.local:31167";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean accessable() {
|
public boolean accessable() {
|
||||||
|
@ -83,7 +81,7 @@ public class TianyiProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String buildUrl(String apiUrl) {
|
public String buildUrl(String apiUrl) {
|
||||||
return this.apiDomain + apiUrl;
|
return PROTOCOL + apiUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Result doGet(String url, Map<String, Object> headers) {
|
public Result doGet(String url, Map<String, Object> headers) {
|
||||||
|
@ -102,6 +100,16 @@ public class TianyiProvider {
|
||||||
return httpClient.get(header, params, uri);
|
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) {
|
public Result doGetWithBody(String url, Map<String, Object> headers, Map<String, Object> params) {
|
||||||
try {
|
try {
|
||||||
//创建httpclient对象
|
//创建httpclient对象
|
||||||
|
|
|
@ -32,7 +32,6 @@ public class TianYiContainerClusterProvider extends TianyiProvider {
|
||||||
public TianYiContainerClusterProvider(Butler butler) {
|
public TianYiContainerClusterProvider(Butler butler) {
|
||||||
super(butler);
|
super(butler);
|
||||||
this.butler = butler;
|
this.butler = butler;
|
||||||
this.apiDomain = "http://ccse-global.ctapi.ctyun.local:31167";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,7 +48,7 @@ public class TianYiContainerClusterProvider extends TianyiProvider {
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
body.put("pageNow", pageNow);
|
body.put("pageNow", pageNow);
|
||||||
Result result = doGet(url, header, body);
|
Result result = doGet2(url, header, body);
|
||||||
JSONObject returnObj = checkResult(result, "查询容器集群列表");
|
JSONObject returnObj = checkResult(result, "查询容器集群列表");
|
||||||
log.info("checkedResult:{}", JSON.toJSONString(returnObj));
|
log.info("checkedResult:{}", JSON.toJSONString(returnObj));
|
||||||
records.addAll(JSONObject.parseObject(returnObj.getString("records"), List.class));
|
records.addAll(JSONObject.parseObject(returnObj.getString("records"), List.class));
|
||||||
|
|
|
@ -33,7 +33,6 @@ public class TianYiContainerNodeProvider extends TianyiProvider {
|
||||||
public TianYiContainerNodeProvider(Butler butler) {
|
public TianYiContainerNodeProvider(Butler butler) {
|
||||||
super(butler);
|
super(butler);
|
||||||
this.butler = butler;
|
this.butler = butler;
|
||||||
this.apiDomain = "http://ccse-global.ctapi.ctyun.local:31167";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public GeneralResult listNodes(String clusterName) {
|
public GeneralResult listNodes(String clusterName) {
|
||||||
|
|
Loading…
Reference in New Issue