Skip to content

Commit a226c08

Browse files
committed
update
1 parent b3752ee commit a226c08

3 files changed

Lines changed: 45 additions & 1 deletion

File tree

.idea/misc.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@
2323
<!-- https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper-spring-boot-starter -->
2424

2525
<!-- https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper-spring-boot-starter -->
26+
<dependency>
27+
<groupId>com.aliyun</groupId>
28+
<artifactId>tea-console</artifactId>
29+
<version>0.0.1</version>
30+
</dependency>
31+
<dependency>
32+
<groupId>com.aliyun</groupId>
33+
<artifactId>cs20151215</artifactId>
34+
<version>4.3.1</version>
35+
</dependency>
2636
<dependency>
2737
<groupId>com.github.pagehelper</groupId>
2838
<artifactId>pagehelper-spring-boot-starter</artifactId>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.common.aliyun.product;
2+
3+
import com.aliyun.cs20151215.Client;
4+
import com.aliyun.cs20151215.models.DescribeClustersV1Response;
5+
import com.common.aliyun.Base;
6+
import com.domain.Key;
7+
8+
public class ACK {
9+
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
10+
11+
public static com.aliyun.cs20151215.Client createClient(Key key) throws Exception {
12+
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
13+
.setAccessKeyId(key.getSecretId())
14+
.setAccessKeySecret(key.getSecretKey());
15+
// Endpoint 请参考 https://api.aliyun.com/product/CS
16+
config.endpoint = "cs.cn-beijing.aliyuncs.com";
17+
return new com.aliyun.cs20151215.Client(config);
18+
}
19+
20+
public void getClustgerLists(Key key){
21+
try {
22+
Client client = createClient(key);
23+
com.aliyun.cs20151215.models.DescribeClustersV1Request describeClustersV1Request = new com.aliyun.cs20151215.models.DescribeClustersV1Request();
24+
java.util.Map<String, String> headers = new java.util.HashMap<>();
25+
DescribeClustersV1Response describeClustersV1Response = client.describeClustersV1WithOptions(describeClustersV1Request, headers, runtime);
26+
describeClustersV1Response.body.getClusters().forEach(cluster -> {
27+
28+
});
29+
} catch (Exception e) {
30+
throw new RuntimeException(e);
31+
}
32+
33+
34+
}
35+
}

0 commit comments

Comments
 (0)