Need help with aliyun-openapi-java-sdk?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

aliyun
1.2K Stars 1.0K Forks Other 4.0K Commits 7 Opened issues

Description

Alibaba Cloud SDK for Java

Services available

!
?

Need anything else?

Contributors list

# 12,011
PHP
aliyun
alibaba...
Maven
2468 commits
# 26,128
alibaba...
Maven
PHP
C#
646 commits
# 45,214
alibaba...
Maven
aliyun
PHP
242 commits
# 104,011
alibaba...
Java
alibaba
Maven
110 commits
# 149,656
alibaba...
Maven
PHP
C#
40 commits
# 180,656
alibaba...
Java
alibaba
Maven
31 commits
# 190,671
alibaba...
Java
alibaba
Maven
27 commits
# 2,147
egg
node
cnode
Linux
21 commits
# 247,945
alibaba...
Java
alibaba
Maven
13 commits
# 1,599
GraphQL
MongoDB
render-...
formik
10 commits
# 257,022
Shell
PHP
alibaba...
Java
10 commits
# 274,919
Python
Shell
alibaba...
Java
8 commits
# 115,127
Compose...
alibaba...
cpp11
fortran
7 commits
# 303,310
HTML
alibaba
alibaba...
Maven
5 commits
# 353,066
alibaba...
Java
alibaba
Maven
4 commits
# 260,313
alibaba...
Maven
C++
C#
4 commits
# 370,419
alibaba...
PHP
Maven
C#
2 commits
# 2,957
query-l...
python-...
mvvm-fr...
wechat-...
2 commits
# 278,181
skywalk...
Applica...
alibaba...
Maven
2 commits
# 298,016
aliyun
openapi
Go
alibaba...
1 commit

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
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 .

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

pom.xml
file.
    com.aliyun
    aliyun-java-sdk-core
    [4.4.9,5.0.0)


    com.aliyun
    aliyun-java-sdk-ecs
    [4.16.0,5.0.0)

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

xml

    com.google.code.gson
    gson
    2.8.5


    io.opentracing
    opentracing-api
    0.33.0


    io.opentracing
    opentracing-util
    0.33.0

Troubleshoot

Troubleshoot Provide OpenAPI diagnosis service to help developers locate quickly and provide solutions for developers through

RequestID
or
error message
.

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.profile.DefaultProfile;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.ecs.model.v20140526.*;
public class Main {
    public static void main(String[] args) {
        // Create and initialize a DefaultAcsClient instance
        DefaultProfile profile = DefaultProfile.getProfile(
            "",          // The region ID
            "",      // The AccessKey ID of the RAM account
            ""); // 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.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.