- Requirements
- Usage
- API Dosc
- Note
运行 SDK需要jdk Java 1.6+. 你可以下载最新的版本: http://developers.sun.com/downloads/. 如果 SDK版本 高于或者等于 Java 9 请使用 0.3.17+版本的 SDK 由于在高于或者等于 Java 9 中 javax.xml.bind 被移除
请在使用中引用
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.0</version>
</dependency>
- Getting Started
- Example
在 GitHub 获取SDK : [KSC SDK for Java (GitHub)][ksc-sdk-java-github].
在工程根目录下执行:
mvn clean install
建议使用Maven构建自己的项目,导入[ksc-sdk-java][ksc-sdk-java-github],添加需要的相应模块的依赖,示例如下:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.ksyun</groupId>
<artifactId>ksc-sdk-java-bom</artifactId>
<version>0.3.31</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.ksyun</groupId>
<artifactId>ksc-sdk-java-kec</artifactId>
</dependency>
</dependencies>
本地文件配置:
~/.aws/credentials on Linux, OS X or unix
C:\Users\USERNAME\.aws\credentials on Windows
该文件包含下述内容:
[default]
aws_access_key_id = your_access_key_id
aws_secret_access_key = your_secret_access_key
如不通过本地文件读入ak和sk信息,则需要在执行的类文件中增加以下代码:
AWSCredentials credentials = new BasicAWSCredentials(aws_access_key_id, aws_secret_access_key);
可以在[user guide][example]查看更多详细信息
- [KEC OpenAPI][KECOpenAPI]
- [VPC OpenAPI][VPCOpenAPI]
- [EIP OpenAPI][EIPOpenAPI]
- [SLB OpenAPI][SLBOpenAPI]
- [TAG OpenAPI][TAGOpenAPI]
-
Provides easy-to-use HTTP clients for all supported KSC services, regions, and authentication protocols.
-
And more! [KECOpenAPI]: https://docs.ksyun.com/read/latest/52/_book/index.html [VPCOpenAPI]: https://docs.ksyun.com/read/latest/56/_book/index.html [EIPOpenAPI]: https://docs.ksyun.com/read/latest/21/_book/index.html [SLBOpenAPI]: https://docs.ksyun.com/read/latest/19/_book/index.html [TAGOpenAPI]: https://docs.ksyun.com/read/latest/90/_book/index.html [ksc-sdk-java-github]: https://github.com/KscSDK/ksc-sdk-java [example]: https://github.com/KscSDK/ksc-sdk-java/blob/master/README_SAMPLE.md
- httpclient 建议不要手动指定httpclient版本,依赖ksc-sdk-java工程管理的httpclient版本即可, 确实需要指定的话, 版本至少是4.4