Skip to content

Commit c6dca9b

Browse files
committed
CORE SDK Auto Released By sunzhiqiang,Version:4.4.1
发布日志: 1, teswt
1 parent 4851f9d commit c6dca9b

File tree

5 files changed

+8
-424
lines changed

5 files changed

+8
-424
lines changed

README-CN.md

Lines changed: 1 addition & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,125 +1 @@
1-
[English](./README.md) | 简体中文
2-
3-
<p align="center">
4-
<a href=" https://www.alibabacloud.com"><img src="https://aliyunsdk-pages.alicdn.com/icons/Aliyun.svg"></a>
5-
</p>
6-
7-
<h1 align="center">Alibaba Cloud SDK for Java</h1>
8-
9-
<p align="center">
10-
<a href="https://search.maven.org/search?q=g:%22com.aliyun%22%20AND%20a:%22aliyun-java-sdk-core%22"><img src="https://img.shields.io/maven-central/v/com.aliyun/aliyun-java-sdk-core.svg?label=Maven%20Central" alt="Latest Stable Version"/></a>
11-
<a href="https://travis-ci.org/aliyun/aliyun-openapi-java-sdk"><img src="https://travis-ci.org/aliyun/aliyun-openapi-java-sdk.svg?branch=master"/></a>
12-
<a href="https://codecov.io/gh/aliyun/aliyun-openapi-java-sdk"><img src="https://codecov.io/gh/aliyun/aliyun-openapi-java-sdk/branch/master/graph/badge.svg"/></a>
13-
<a href="https://www.codacy.com/app/aliyun/aliyun-openapi-java-sdk?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=aliyun/aliyun-openapi-java-sdk&amp;utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/aef3826e57ca444fb217bab8edaed195"/></a>
14-
<a href="https://ci.appveyor.com/project/aliyun/aliyun-openapi-java-sdk"><img src="https://ci.appveyor.com/api/projects/status/bymi868y6443gwdp?svg=true"/></a>
15-
</p>
16-
17-
欢迎使用 Alibaba Cloud SDK for Java 。Alibaba Cloud SDK for Java 让您不用复杂编程即可访问云服务器、云监控等多个阿里云服务。
18-
这里向您介绍如何获取 Alibaba Cloud SDK for Java 并开始调用。
19-
如果您在使用 Alibaba Cloud SDK for Java 的过程中遇到任何问题,欢迎在当前 GitHub [提交 Issues](https://github.com/aliyun/aliyun-openapi-java-sdk/issues/new)
20-
21-
## 环境要求
22-
1. 要使用 Alibaba Cloud SDK for Java ,您需要一个云账号以及一对`Access Key ID``Access Key Secret`。 请在阿里云控制台中的[AccessKey管理页面](https://usercenter.console.aliyun.com/?spm=5176.doc52740.2.3.QKZk8w#/manage/ak)上创建和查看您的Access Key,或者联系您的系统管理员。
23-
2. 要使用 Alibaba Cloud SDK for Java 访问某个产品的API,您需要事先在[阿里云控制台](https://home.console.aliyun.com/?spm=5176.doc52740.2.4.QKZk8w)中开通这个产品。
24-
3. Alibaba Cloud SDK for Java 需要1.6以上的JDK。
25-
26-
## 安装依赖
27-
无论您要使用哪个产品的开发工具包,都必须安装`aliyun-java-sdk-core`。比如,对云服务器SDK的调用,您需要安装`aliyun-java-sdk-core``aliyun-java-sdk-ecs`
28-
#### 通过Maven来管理项目依赖(推荐)
29-
如果您使用Apache Maven来管理Java项目,只需在项目的`pom.xml`文件加入相应的依赖项即可。您可以在[阿里云开发者资源](https://help.aliyun.com/learn/developer.html)中下载各云产品的Maven依赖。
30-
以使用Ecs SDK为例,您只需在`pom.xml`中声明以下两个依赖:
31-
```xml
32-
<dependency>
33-
<groupId>com.aliyun</groupId>
34-
<artifactId>aliyun-java-sdk-core</artifactId>
35-
<version>[4.3.2,5.0.0)</version>
36-
</dependency>
37-
<dependency>
38-
<groupId>com.aliyun</groupId>
39-
<artifactId>aliyun-java-sdk-ecs</artifactId>
40-
<version>[4.16.0,5.0.0)</version>
41-
</dependency>
42-
```
43-
44-
如果 maven 没有从中央存储库下载 jar 包,则需要将此依赖项添加到`pom.xml`文件中,否则将报告 NoClassDefFoundError 异常
45-
```xml
46-
<dependency>
47-
<groupId>com.google.code.gson</groupId>
48-
<artifactId>gson</artifactId>
49-
<version>2.8.5</version>
50-
</dependency>
51-
```
52-
## 快速使用
53-
54-
以下这个代码示例向您展示了调用 Alibaba Cloud SDK for Java 的3个主要步骤:
55-
1. 创建DefaultAcsClient实例并初始化。
56-
2. 创建API请求并设置参数。
57-
3. 发起请求并处理应答或异常。
58-
59-
```java
60-
package com.testprogram;
61-
import com.aliyuncs.profile.DefaultProfile;
62-
import com.aliyuncs.DefaultAcsClient;
63-
import com.aliyuncs.IAcsClient;
64-
import com.aliyuncs.exceptions.ClientException;
65-
import com.aliyuncs.exceptions.ServerException;
66-
import com.aliyuncs.ecs.model.v20140526.*;
67-
public class Main {
68-
public static void main(String[] args) {
69-
// 创建DefaultAcsClient实例并初始化
70-
DefaultProfile profile = DefaultProfile.getProfile(
71-
"<your-region-id>", // 地域ID
72-
"<your-access-key-id>", // RAM账号的AccessKey ID
73-
"<your-access-key-secret>"); // RAM账号Access Key Secret
74-
IAcsClient client = new DefaultAcsClient(profile);
75-
// 创建API请求并设置参数
76-
DescribeInstancesRequest request = new DescribeInstancesRequest();
77-
request.setPageSize(10);
78-
// 发起请求并处理应答或异常
79-
DescribeInstancesResponse response;
80-
try {
81-
response = client.getAcsResponse(request);
82-
for (DescribeInstancesResponse.Instance instance:response.getInstances()) {
83-
System.out.println(instance.getPublicIpAddress());
84-
}
85-
} catch (ServerException e) {
86-
e.printStackTrace();
87-
} catch (ClientException e) {
88-
e.printStackTrace();
89-
}
90-
}
91-
}
92-
```
93-
94-
95-
## 文档
96-
* [环境要求](./docs/0-Requirements-CN.md)
97-
* [安装](./docs/1-Installation-CN.md)
98-
* [客户端](./docs/2-Client-CN.md)
99-
* [连接池](./docs/3-Pool-CN.md)
100-
* [超时机制](./docs/4-Timeout-CN.md)
101-
* [HTTPS配置](./docs/5-HTTPS-CN.md)
102-
* [代理配置](./docs/6-Proxy-CN.md)
103-
* [调试](./docs/7-Debug-CN.md)
104-
* [日志](./docs/8-Log-CN.md)
105-
* [异常](./docs/9-Exception-CN.md)
106-
107-
## 问题
108-
[提交 Issue](https://github.com/aliyun/aliyun-openapi-java-sdk/issues/new),不符合指南的问题可能会立即关闭。
109-
110-
## 发行说明
111-
每个版本的详细更改记录在[发行说明](./aliyun-java-sdk-core/ChangeLog.txt)中。
112-
113-
## 贡献
114-
提交 Pull Request 之前请阅读[贡献指南](CONTRIBUTING.md)
115-
116-
## 相关
117-
* [阿里云服务 Regions & Endpoints](https://developer.aliyun.com/endpoints)
118-
* [OpenAPI Explorer](https://api.aliyun.com/)
119-
* [最新源码](https://github.com/aliyun/aliyun-openapi-java-sdk)
120-
121-
## 许可证
122-
[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
123-
124-
版权所有 1999-2019 阿里巴巴集团
125-
1+
test

README.md

Lines changed: 1 addition & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -1,137 +1 @@
1-
English | [简体中文](./README-CN.md)
2-
3-
<p align="center">
4-
<a href=" https://www.alibabacloud.com"><img src="https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg"></a>
5-
</p>
6-
7-
<h1 align="center">Alibaba Cloud SDK for Java</h1>
8-
9-
<p align="center">
10-
<a href="https://search.maven.org/search?q=g:%22com.aliyun%22%20AND%20a:%22aliyun-java-sdk-core%22"><img src="https://img.shields.io/maven-central/v/com.aliyun/aliyun-java-sdk-core.svg?label=Maven%20Central" alt="Latest Stable Version"/></a>
11-
<a href="https://travis-ci.org/aliyun/aliyun-openapi-java-sdk"><img src="https://travis-ci.org/aliyun/aliyun-openapi-java-sdk.svg?branch=master"/></a>
12-
<a href="https://codecov.io/gh/aliyun/aliyun-openapi-java-sdk"><img src="https://codecov.io/gh/aliyun/aliyun-openapi-java-sdk/branch/master/graph/badge.svg"/></a>
13-
<a href="https://www.codacy.com/app/aliyun/aliyun-openapi-java-sdk?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=aliyun/aliyun-openapi-java-sdk&amp;utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/aef3826e57ca444fb217bab8edaed195"/></a>
14-
<a href="https://ci.appveyor.com/project/aliyun/aliyun-openapi-java-sdk"><img src="https://ci.appveyor.com/api/projects/status/bymi868y6443gwdp?svg=true"/></a>
15-
</p>
16-
17-
The Alibaba Cloud SDK for Java allows you to access Alibaba Cloud services such as Elastic Compute Service (ECS), Server Load Balancer (SLB), and CloudMonitor. You can access Alibaba Cloud services without the need to handle API related tasks, such as signing and constructing your requests.
18-
19-
This document introduces how to obtain and call Alibaba Cloud SDK for Java.
20-
21-
If you have any problem while using Alibaba Cloud SDK for Java, please [submit an issue](https://github.com/aliyun/aliyun-openapi-java-sdk/issues/new).
22-
23-
## Requirements
24-
25-
- To use Alibaba Cloud SDK for Java, you must have an Alibaba Cloud account as well as an `AccessKey ID` and an `AccessKey Secret`. Create and view your AccessKey on the [RAM console](https://ram.console.aliyun.com "RAM console") or contact your system administrator.
26-
27-
- To use the Alibaba Cloud SDK for Java to access the APIs of a product, you must first activate the product on the [Alibaba Cloud console](https://home.console.aliyun.com/?spm=5176.doc52740.2.4.QKZk8w) if required.
28-
29-
- The Alibaba Cloud Java SDK requires JDK 1.6 or later.
30-
31-
## Installation
32-
33-
If you use Apache Maven to manage Java projects, you only need to add corresponding dependencies to the pom.xml files of the projects. You can download the Maven dependencies of different cloud products in [Alibaba Cloud developer resources](https://help.aliyun.com/learn/developer.html).
34-
35-
You must install `aliyun-java-sdk-core` library no matter which product development kit you want to use. For example, to call the ECS SDK, you need to install `aliyun-java-sdk-core` library and `aliyun-java-sdk-ecs` library .
36-
37-
To use the Ecs SDK as an example, you only need to declare the following two dependencies in the `pom.xml` file.
38-
39-
```xml
40-
<dependency>
41-
<groupId>com.aliyun</groupId>
42-
<artifactId>aliyun-java-sdk-core</artifactId>
43-
<version>[4.3.2,5.0.0)</version>
44-
</dependency>
45-
<dependency>
46-
<groupId>com.aliyun</groupId>
47-
<artifactId>aliyun-java-sdk-ecs</artifactId>
48-
<version>[4.16.0,5.0.0)</version>
49-
</dependency>
50-
```
51-
52-
If maven is not downloading jar packages from a central repository, you need to add this dependency in the pom.xml file, or a NoClassDefFoundError exception will be reported
53-
```xml
54-
<dependency>
55-
<groupId>com.google.code.gson</groupId>
56-
<artifactId>gson</artifactId>
57-
<version>2.8.5</version>
58-
</dependency>
59-
```
60-
61-
## Quick Examples
62-
63-
The following code example shows the three main steps to use Alibaba Cloud SDK for Java :
64-
65-
1. Create and initialize a `DefaultAcsClient` instance.
66-
67-
2. Create an API request and set parameters.
68-
69-
3. Initiate the request and handle the response or exceptions.
70-
71-
```java
72-
package com.testprogram;
73-
import com.aliyuncs.profile.DefaultProfile;
74-
import com.aliyuncs.DefaultAcsClient;
75-
import com.aliyuncs.IAcsClient;
76-
import com.aliyuncs.exceptions.ClientException;
77-
import com.aliyuncs.exceptions.ServerException;
78-
import com.aliyuncs.ecs.model.v20140526.*;
79-
public class Main {
80-
public static void main(String[] args) {
81-
// Create and initialize a DefaultAcsClient instance
82-
DefaultProfile profile = DefaultProfile.getProfile(
83-
"<your-region-id>", // The region ID
84-
"<your-access-key-id>", // The AccessKey ID of the RAM account
85-
"<your-access-key-secret>"); // The AccessKey Secret of the RAM account
86-
IAcsClient client = new DefaultAcsClient(profile);
87-
// Create an API request and set parameters
88-
DescribeInstancesRequest request = new DescribeInstancesRequest();
89-
request.setPageSize(10);
90-
// Initiate the request and handle the response or exceptions
91-
DescribeInstancesResponse response;
92-
try {
93-
response = client.getAcsResponse(request);
94-
for (DescribeInstancesResponse.Instance instance:response.getInstances()) {
95-
System.out.println(instance.getPublicIpAddress());
96-
}
97-
} catch (ServerException e) {
98-
e.printStackTrace();
99-
} catch (ClientException e) {
100-
e.printStackTrace();
101-
}
102-
}
103-
}
104-
```
105-
106-
107-
## Documentation
108-
* [Requirements](./docs/0-Requirements-EN.md)
109-
* [Installation](./docs/1-Installation-EN.md)
110-
* [Client](./docs/2-Client-EN.md)
111-
* [Connection Pool](./docs/3-Pool-EN.md)
112-
* [Timeout](./docs/4-Timeout-EN.md)
113-
* [HTTPS Configurations](./docs/5-HTTPS-EN.md)
114-
* [Proxy Configurations](./docs/6-Proxy-EN.md)
115-
* [Debug](./docs/7-Debug-EN.md)
116-
* [Log](./docs/8-Log-EN.md)
117-
* [Exception](./docs/9-Exception-EN.md)
118-
119-
120-
## Issues
121-
[Opening an Issue](https://github.com/aliyun/aliyun-openapi-java-sdk/issues/new), Issues not conforming to the guidelines may be closed immediately.
122-
123-
## Changelog
124-
Detailed changes for each release are documented in the [release notes](./aliyun-java-sdk-core/ChangeLog.txt).
125-
126-
## Contribution
127-
Please make sure to read the [Contributing Guide](CONTRIBUTING.md) before making a pull request.
128-
129-
## References
130-
* [Alibaba Cloud Regions & Endpoints](https://developer.aliyun.com/endpoints)
131-
* [OpenAPI Explorer](https://api.aliyun.com/)
132-
* [Latest Release](https://github.com/aliyun/aliyun-openapi-java-sdk)
133-
134-
## License
135-
[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
136-
137-
Copyright 1999-2019 Alibaba Group Holding Ltd.
1+
test

0 commit comments

Comments
 (0)