aliyun-java-sdk-core-v5

Aliyun Open API SDK for Java Copyright (C) Alibaba Cloud Computing All rights reserved. 版权所有 (C)阿里云计算有限公司 http://www.aliyun.com

License

License

Categories

Categories

Java Languages
GroupId

GroupId

com.aliyun
ArtifactId

ArtifactId

aliyun-java-sdk-core-v5
Last Version

Last Version

5.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

aliyun-java-sdk-core-v5
Aliyun Open API SDK for Java Copyright (C) Alibaba Cloud Computing All rights reserved. 版权所有 (C)阿里云计算有限公司 http://www.aliyun.com
Project URL

Project URL

http://www.aliyun.com
Source Code Management

Source Code Management

https://github.com/aliyun/aliyun-openapi-java-sdk-v5

Download aliyun-java-sdk-core-v5

How to add to project

<!-- https://jarcasting.com/artifacts/com.aliyun/aliyun-java-sdk-core-v5/ -->
<dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>aliyun-java-sdk-core-v5</artifactId>
    <version>5.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.aliyun/aliyun-java-sdk-core-v5/
implementation 'com.aliyun:aliyun-java-sdk-core-v5:5.0.2'
// https://jarcasting.com/artifacts/com.aliyun/aliyun-java-sdk-core-v5/
implementation ("com.aliyun:aliyun-java-sdk-core-v5:5.0.2")
'com.aliyun:aliyun-java-sdk-core-v5:jar:5.0.2'
<dependency org="com.aliyun" name="aliyun-java-sdk-core-v5" rev="5.0.2">
  <artifact name="aliyun-java-sdk-core-v5" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.aliyun', module='aliyun-java-sdk-core-v5', version='5.0.2')
)
libraryDependencies += "com.aliyun" % "aliyun-java-sdk-core-v5" % "5.0.2"
[com.aliyun/aliyun-java-sdk-core-v5 "5.0.2"]

Dependencies

compile (10)

Group / Artifact Type Version
com.google.code.gson : gson jar 2.8.6
org.apache.httpcomponents : httpclient jar 4.5.12
org.apache.httpcomponents : httpcore jar 4.4.13
commons-logging : commons-logging jar 1.2
javax.xml.bind : jaxb-api jar 2.3.1
org.jacoco : org.jacoco.agent jar 0.8.5
org.ini4j : ini4j jar 0.5.4
org.slf4j : slf4j-api jar 1.7.30
io.opentracing : opentracing-api jar 0.33.0
io.opentracing : opentracing-util jar 0.33.0

provided (1)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.18.12

test (7)

Group / Artifact Type Version
junit : junit jar 4.13.1
org.mockito : mockito-core jar 3.3.3
org.powermock : powermock-core jar 2.0.7
org.powermock : powermock-reflect jar 2.0.7
org.powermock : powermock-module-junit4 jar 2.0.7
org.powermock : powermock-api-mockito2 jar 2.0.7
org.slf4j : slf4j-simple jar 1.7.30

Project Modules

There are no modules declared in this project.

English | 简体中文

Alibaba Cloud SDK for Java

Latest Stable Version

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.

This document introduces how to obtain and call Alibaba Cloud SDK for Java.

If you have any problem while using Alibaba Cloud SDK for Java, please submit an issue.

Requirements

  • 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 or contact your system administrator.

  • 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 if required.

  • The Alibaba Cloud Java SDK requires JDK 1.6 or later.

Installation

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.

You must install aliyun-java-sdk-core-v5 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-v5 library and aliyun-java-sdk-ecs-v5 library .

To use the Ecs SDK as an example, you only need to declare the following two dependencies in the pom.xml file.

<dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>aliyun-java-sdk-core-v5</artifactId>
    <version>[5.0.0, 6.0.0)</version>
</dependency>
<dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>aliyun-java-sdk-ecs-v5</artifactId>
    <version>[4.16.0,5.0.0)</version>
</dependency>

If maven is not downloading jar packages from a central repository, you need to add these dependencies in the pom.xml file, or a NoClassDefFoundError exception will be reported

<dependency>
    <groupId>com.google.code.gson</groupId>
    <artifactId>gson</artifactId>
    <version>2.8.5</version>
</dependency>
<dependency>
    <groupId>io.opentracing</groupId>
    <artifactId>opentracing-api</artifactId>
    <version>0.33.0</version>
</dependency>
<dependency>
    <groupId>io.opentracing</groupId>
    <artifactId>opentracing-util</artifactId>
    <version>0.33.0</version>
</dependency>

Quick Examples

The following code example shows the three main steps to use Alibaba Cloud SDK for Java :

  1. Create and initialize a DefaultAcsClient instance.

  2. Create an API request and set parameters.

  3. Initiate the request and handle the response or exceptions.

package com.testprogram;
import com.aliyuncs.v5.profile.DefaultProfile;
import com.aliyuncs.v5.DefaultAcsClient;
import com.aliyuncs.v5.IAcsClient;
import com.aliyuncs.v5.exceptions.ClientException;
import com.aliyuncs.v5.exceptions.ServerException;
import com.aliyuncs.v5.ecs.model.v20140526.*;
public class Main {
    public static void main(String[] args) {
        // Create and initialize a DefaultAcsClient instance
        DefaultProfile profile = DefaultProfile.getProfile(
            "<your-region-id>",          // The region ID
            "<your-access-key-id>",      // The AccessKey ID of the RAM account
            "<your-access-key-secret>"); // The AccessKey Secret of the RAM account
        IAcsClient client = new DefaultAcsClient(profile);
        // Create an API request and set parameters
        DescribeInstancesRequest request = new DescribeInstancesRequest();
        request.setPageSize(10);
        // Initiate the request and handle the response or exceptions
        DescribeInstancesResponse response;
        try {
            response = client.getAcsResponse(request);
            for (DescribeInstancesResponse.Instance instance:response.getInstances()) {
                System.out.println(instance.getPublicIpAddress());
            }
        } catch (ServerException e) {
            e.printStackTrace();
        } catch (ClientException e) {
            e.printStackTrace();
        }
    }
}

Documentation

Issues

Opening an Issue, Issues not conforming to the guidelines may be closed immediately.

Changelog

Detailed changes for each release are documented in the release notes.

Contribution

Please make sure to read the Contributing Guide before making a pull request.

References

License

Apache-2.0

Copyright (c) 2009-present, Alibaba Cloud All rights reserved.

com.aliyun

Alibaba Cloud

More Than Just Cloud

Versions

Version
5.0.2
5.0.1
5.0.0