From 1c9cfb6a8553b621f3b6ad1e55211cbbe4437c23 Mon Sep 17 00:00:00 2001 From: tanshaolong Date: Thu, 5 Sep 2024 17:02:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bocloud/ctstack/plugin/provider/TianyiProvider.java | 7 ++++--- .../provider/container/TianYiContainerClusterProvider.java | 2 +- .../provider/container/TianYiContainerNodeProvider.java | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) 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 069051c1..669dbfb1 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 @@ -42,8 +42,8 @@ public class TianyiProvider { private Butler butler; 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 String apiPort = "31167"; public Integer PAGE_SIZE = 50; private final HttpClient client = new HttpClient(60 * 1000, PostDataFormat.RAW); protected ResultBuilder resultBuilder = new CommonResultBuilder(); @@ -61,9 +61,10 @@ public class TianyiProvider { this.ctUserId = butler.getProjectId(); this.regionId = butler.getRegionId() == null ? this.regionId : butler.getRegionId().trim(); if (StringUtils.hasText(butler.getUrl())) { - this.PROTOCOL = butler.getUrl(); + this.apiDomain = butler.getUrl(); + // TODO: 先写死,以后会从url中解析 + this.apiPort = "31167"; } - this.apiDomain = "http://ct-global.ctapi.ctyun.local:31167"; } public boolean accessable() { 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 816aed21..d80bc366 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,7 +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"; + this.apiDomain = "http://ccse-global.ctapi.ctyun.local:" + this.apiPort; } 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 9e5fa9a9..616a6d73 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,7 +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"; + this.apiDomain = "http://ccse-global.ctapi.ctyun.local:" + this.apiPort; } public GeneralResult listNodes(String clusterName) {