Alibaba Cloud SDK for Python
Clone or download
Latest commit c934f19 Dec 14, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
aliyun-python-sdk-aas upgrade setup.py to support python3 Sep 27, 2017
aliyun-python-sdk-actiontrail 由恨少发起的ACTIONTRAIL SDK自动发布, 版本号:2.0.0 Apr 8, 2018
aliyun-python-sdk-aegis 由君石发起的AEGIS SDK自动发布, BUILD_ID=397, 版本号:1.0.1 Feb 7, 2018
aliyun-python-sdk-afs 由婉明发起的AFS SDK自动发布, BUILD_ID=385, 版本号:1.0.0 Feb 2, 2018
aliyun-python-sdk-alidns upgrade setup.py to support python3 Sep 27, 2017
aliyun-python-sdk-alimt ALIMT SDK Auto Released By xulei.xl,Version:1.0.2 Nov 22, 2018
aliyun-python-sdk-arms ARMS SDK Auto Released By qikai.yangqikai,Version:2.2.0 Oct 16, 2018
aliyun-python-sdk-arms4finance bugfix Jan 12, 2018
aliyun-python-sdk-baas BAAS SDK Auto Released By titian.gtt,Version:1.0.0 Dec 4, 2018
aliyun-python-sdk-batchcompute upgrade setup.py to support python3 Sep 27, 2017
aliyun-python-sdk-bsn upgrade setup.py to support python3 Sep 27, 2017
aliyun-python-sdk-bss upgrade setup.py to support python3 Sep 27, 2017
aliyun-python-sdk-bssopenapi BSSOPENAPI SDK Auto Released By derick.zdc,Version:1.0.6 Nov 22, 2018
aliyun-python-sdk-cbn CBN SDK Auto Released By shuguang.wsg,Version:1.0.1 Sep 14, 2018
aliyun-python-sdk-ccc CCC SDK Auto Released By yonghong.lyh,Version:1.0.8 Aug 14, 2018
aliyun-python-sdk-ccs CCS SDK Auto Released By wilson.liuw,Version:1.0.0 Sep 25, 2018
aliyun-python-sdk-cdn CDN SDK Auto Released By xiaoyao,Version:3.0.3 Dec 3, 2018
aliyun-python-sdk-chatbot CHATBOT SDK Auto Released By longda.cld,Version:1.2.0 Nov 15, 2018
aliyun-python-sdk-cloudapi CLOUDAPI SDK Auto Released By yixiong.jxy,Version:4.5.1 Oct 15, 2018
aliyun-python-sdk-cloudauth CLOUDAUTH SDK Auto Released By gongpei.gp,Version:1.1.6 Oct 26, 2018
aliyun-python-sdk-cloudmarketing CLOUDMARKETING SDK Auto Released By ken.hzc,Version:1.0.0 Dec 5, 2018
aliyun-python-sdk-cloudphoto 由廷诚发起的CLOUDPHOTO SDK自动发布, 版本号:1.1.18 Apr 24, 2018
aliyun-python-sdk-cms CMS SDK Auto Released By yixiong.jxy,Version:6.0.13 Aug 2, 2018
aliyun-python-sdk-core-v3 Improve the coverage report Nov 21, 2018
aliyun-python-sdk-core Improve the coverage report Nov 21, 2018
aliyun-python-sdk-cr 由驹中发起的CR SDK自动发布, 版本号:3.0.0 May 23, 2018
aliyun-python-sdk-crm upgrade setup.py to support python3 Sep 27, 2017
aliyun-python-sdk-cs 由治世发起的CS SDK自动发布, BUILD_ID=442, 版本号:2.9.0 Feb 27, 2018
aliyun-python-sdk-csb CSB SDK Auto Released By yaolan.lt,Version:1.1.6 Sep 3, 2018
aliyun-python-sdk-dcdn DCDN SDK Auto Released By xiaoyao,Version:1.2.1 Dec 11, 2018
aliyun-python-sdk-dds DDS SDK Auto Released By junjun.zhang,Version:2.0.3 Dec 11, 2018
aliyun-python-sdk-dms-enterprise DMS-ENTERPRISE SDK Auto Released By yuyang.cjx,Version:1.0.0 Nov 26, 2018
aliyun-python-sdk-domain-intl DOMAIN-INTL SDK Auto Released By lukang.zlh,Version:1.3.0 Nov 13, 2018
aliyun-python-sdk-domain DOMAIN SDK Auto Released By huizeng.zh,Version:3.11.0 Nov 22, 2018
aliyun-python-sdk-drds 由燧木发起的DRDS SDK自动发布, 版本号:2.5.0 May 23, 2018
aliyun-python-sdk-dybaseapi DYBASEAPI SDK Auto Released By pianzuo.zj,Version:1.0.0 Nov 20, 2018
aliyun-python-sdk-dyvmsapi 由峰远发起的DYVMSAPI SDK自动发布, 版本号:1.0.0 May 23, 2018
aliyun-python-sdk-eci ECI SDK Auto Released By lm140765,Version:1.0.1 Dec 11, 2018
aliyun-python-sdk-ecs ECS SDK Auto Released By corey.ql,Version:4.15.0 Dec 6, 2018
aliyun-python-sdk-edas EDAS SDK Auto Released By lukun.cc,Version:2.16.1 Sep 3, 2018
aliyun-python-sdk-ehpc EHPC SDK Auto Released By qianzheng.llc,Version:1.10.0 Dec 13, 2018
aliyun-python-sdk-emr EMR SDK Auto Released By salmon.smm,Version:3.0.0 Nov 7, 2018
aliyun-python-sdk-ess ESS SDK Auto Released By wujin.lhr,Version:2.2.8 Dec 5, 2018
aliyun-python-sdk-faas FAAS SDK Auto Released By yinfeng.lyf,Version:1.1.0 Dec 7, 2018
aliyun-python-sdk-ft Ft SDK Auto Released By AlibabaCloud,Version:null Aug 27, 2018
aliyun-python-sdk-gpdb GPDB SDK Auto Released By zhigang.xzg,Version:1.0.0 Jul 30, 2018
aliyun-python-sdk-green GREEN SDK Auto Released By liuhai.lh,Version:3.4.0 Nov 22, 2018
aliyun-python-sdk-highddos upgrade setup.py to support python3 Sep 27, 2017
aliyun-python-sdk-hpc upgrade setup.py to support python3 Sep 27, 2017
aliyun-python-sdk-hsm 由鸿逸发起的HSM SDK自动发布, 版本号:1.0.0 Apr 27, 2018
aliyun-python-sdk-httpdns upgrade setup.py to support python3 Sep 27, 2017
aliyun-python-sdk-imagesearch 由元狩发起的IMAGESEARCH SDK自动发布, 版本号:1.0.1 May 4, 2018
aliyun-python-sdk-imm IMM SDK Auto Released By zhengrui.lj,Version:1.5.2 Dec 5, 2018
aliyun-python-sdk-iot IOT SDK Auto Released By cheyun.lxf,Version:7.5.0 Dec 9, 2018
aliyun-python-sdk-jaq upgrade setup.py to support python3 Sep 27, 2017
aliyun-python-sdk-jarvis-public JARVIS-PUBLIC SDK Auto Released By mainri.mxy,Version:1.0.0 Jun 20, 2018
aliyun-python-sdk-jarvis JARVIS SDK Auto Released By mainri.mxy,Version:1.2.3 Jun 21, 2018
aliyun-python-sdk-kms 由丰鲁成发起的KMS SDK自动发布, 版本号:2.5.0 Mar 29, 2018
aliyun-python-sdk-linkface LINKFACE SDK Auto Released By jiayao.wjy,Version:1.1.2 Nov 2, 2018
aliyun-python-sdk-live LIVE SDK Auto Released By renrang.yl,Version:3.7.3 Dec 6, 2018
aliyun-python-sdk-lubancloud LUBANCLOUD SDK Auto Released By benxiang.hhq,Version:1.0.0 Nov 2, 2018
aliyun-python-sdk-mopen MOPEN SDK Auto Released By everettli.ll,Version:1.1.0 Jul 31, 2018
aliyun-python-sdk-mts MTS SDK Auto Released By lingkong.mxs,Version:2.6.0 Aug 4, 2018
aliyun-python-sdk-nas 由执少发起的NAS SDK自动发布, BUILD_ID=274, 版本号:3.1.2 Dec 15, 2017
aliyun-python-sdk-nls-cloud-meta NLS-CLOUD-META SDK Auto Released By kyne.wk,Version:1.0.0 Jul 13, 2018
aliyun-python-sdk-ocs upgrade setup.py to support python3 Sep 27, 2017
aliyun-python-sdk-oms upgrade setup.py to support python3 Sep 27, 2017
aliyun-python-sdk-ons 由明锻发起的ONS SDK自动发布, BUILD_ID=185, 版本号:2.0.0 Sep 19, 2017
aliyun-python-sdk-ossadmin upgrade setup.py to support python3 Sep 27, 2017
aliyun-python-sdk-ots OTS SDK Auto Released By wanhong.chenwh,Version:4.0.0 Aug 8, 2018
aliyun-python-sdk-petadata PETADATA SDK Auto Released By zhigang.xzg,Version:1.2.0 Dec 12, 2018
aliyun-python-sdk-polardb POLARDB SDK Auto Released By zhigang.xzg,Version:1.1.2 Nov 19, 2018
aliyun-python-sdk-productcatalog PRODUCTCATALOG SDK Auto Released By yixiong.jxy,Version:1.0.0 Oct 8, 2018
aliyun-python-sdk-push 由释一发起的PUSH SDK自动发布, BUILD_ID=490, 版本号:3.10.0 Mar 23, 2018
aliyun-python-sdk-pvtz 由空木发起的PVTZ SDK自动发布, 版本号:1.0.0 May 17, 2018
aliyun-python-sdk-r-kvstore R-KVSTORE SDK Auto Released By junjun.zhang,Version:2.0.4 Dec 11, 2018
aliyun-python-sdk-ram 由高阳发起的RAM SDK自动发布, BUILD_ID=99, 版本号:3.0.0 Oct 9, 2017
aliyun-python-sdk-rds RDS SDK Auto Released By junjun.zhang,Version:2.2.0 Dec 14, 2018
aliyun-python-sdk-release-test 由青塘发起的RELEASE-TEST SDK自动发布, BUILD_ID=26, 版本号:0.0.2 Jul 21, 2017
aliyun-python-sdk-risk upgrade setup.py to support python3 Sep 27, 2017
aliyun-python-sdk-ros upgrade setup.py to support python3 Sep 27, 2017
aliyun-python-sdk-rtc RTC SDK Auto Released By renrang.yl,Version:1.0.1 Nov 8, 2018
aliyun-python-sdk-saf SAF SDK Auto Released By xinfa.duanxf,Version:1.0.1 Oct 9, 2018
aliyun-python-sdk-sas-api 由顾怀发起的SAS-API SDK自动发布, BUILD_ID=350, 版本号:2.1.0 Jan 15, 2018
aliyun-python-sdk-scdn SCDN SDK Auto Released By xiaoyao,Version:1.2.3 Dec 12, 2018
aliyun-python-sdk-slb SLB SDK Auto Released By laysong.sl,Version:3.2.7 Aug 28, 2018
aliyun-python-sdk-smartag SMARTAG SDK Auto Released By jijun.jj,Version:1.4.1 Dec 12, 2018
aliyun-python-sdk-sts 由高阳发起的STS SDK自动发布, BUILD_ID=100, 版本号:3.0.0 Oct 9, 2017
aliyun-python-sdk-tesladam 由荣旸发起的TESLADAM SDK自动发布, BUILD_ID=310, 版本号:1.0.1 Feb 27, 2018
aliyun-python-sdk-teslamaxcompute 由荣旸发起的TESLAMAXCOMPUTE SDK自动发布, 版本号:1.5.4 May 8, 2018
aliyun-python-sdk-teslastream TESLASTREAM SDK Auto Released By tony.ly,Version:1.0.0 Jul 26, 2018
aliyun-python-sdk-ubsms upgrade setup.py to support python3 Sep 27, 2017
aliyun-python-sdk-uis UIS SDK Auto Released By hejian.hj,Version:1.0.0 Nov 29, 2018
aliyun-python-sdk-vod VOD SDK Auto Released By xiao.xwp,Version:2.11.8 Nov 30, 2018
aliyun-python-sdk-vpc 由温仰发起的VPC SDK自动发布, BUILD_ID=466, 版本号:3.0.2 Mar 15, 2018
aliyun-python-sdk-yundun upgrade setup.py to support python3 Sep 27, 2017
.gitignore remove the fails tests Nov 21, 2018
.travis.yml improve travis config Dec 14, 2018
License first commit aliyun open api sdk to github. Jul 23, 2015
README.md Update README.md Nov 21, 2018
README_zh.md Update README Nov 21, 2018

README.md

Alibaba Cloud Python Software Development Kit

Build Status codecov

中文文档

The Alibaba Cloud Python Software Development Kit (SDK) allows you to access Alibaba Cloud services such as Elastic Compute Service (ECS), Object Storage Service (OSS), and Resource Access Management (RAM). 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 Python SDK.

Prerequisites

  • To use Alibaba Cloud Python SDK, you must have an Alibaba Cloud account as well as an AccessKey.

    The AccessKey is required when initializing AcsClient. You can create an AccessKey in the Alibaba Cloud console. For more information, see Create an AccessKey.

    Note: To increase the security of your account, we recommend that you use the AccessKey of the RAM user to access Alibaba Cloud services.

  • To use Alibaba Cloud Python SDK to access the APIs of a product, you must first activate the product on the Alibaba Cloud console if required.

  • Alibaba Cloud Python SDK requires 2.6.x, 2.7.x, and Python 3.x.

Install Python SDK

Alibaba Cloud Python SDK supports Python 2.6.x, 2.7.x, and Python 3.x. Run python --version to check your version of Python.

You can install the Alibaba Cloud Python SDK using the following two methods. Regardless of which method and cloud service are used, the core library aliyun-python-sdk-core must be installed.

  • Install with pip

    Python SDK uses a common package management tool named pip. If pip is not installed, see the pip user guide to install pip.

    Run the following command to install the individual libraries of Alibaba Cloud services:

     # Install the core library
     pip install aliyun-python-sdk-core
     # Install the ECS management library
     pip install aliyun-python-sdk-ecs
     # Install the RDS management library
     pip install aliyun-python-sdk-rds

    Note: If you are using Python 3.x, run the following command to install the core library:

     pip install aliyun-python-sdk-core-v3
  • Install from GitHub

    You can clone the source code to your local folder and then run setup.py install to install the SDK:

     git clone https://github.com/aliyun/aliyun-openapi-python-sdk.git
     # Install the core library
     cd aliyun-python-sdk-core
     python setup.py install
     # Install the ECS management library
     cd aliyun-python-sdk-ecs
     python setup.py install

Use Python SDK

  1. Import the required modules as follows:

    from aliyunsdkcore.client import AcsClient
    from aliyunsdkcore.acs_exception.exceptions import ClientException
    from aliyunsdkcore.acs_exception.exceptions import ServerException
    from aliyunsdkecs.request.v20140526 import DescribeInstancesRequest
    from aliyunsdkecs.request.v20140526 import StopInstanceRequest
  2. Initialize the AcsClient instance:

    client = AcsClient(
        "<access-key-id>",
        "<access-key-secret>",
        "<region-id>"
    );

    where:

    • access-key-id is the Accesskey ID for your account.
    • access-key-secret is the AccessKey secret for your account.
    • region-id is the ID of the region where the service is called. For a list of region IDs, see Regions and zones.

    Note: The sequence of these parameters cannot be changed.

  3. Initialize a request and print response.

    # Initialize a request and set parameters
    request = DescribeInstancesRequest.DescribeInstancesRequest()
    request.set_PageSize(10)
    # Print response
    response = client.do_action_with_exception(request)
    print response

Code example

The following example shows how to query a list of ECS instances in a specific region using DescribeInstances. Substitute the values for your-access-key-id, your-access-key-secret, and your-region-id.

# -*- coding: utf8 -*-

from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyunsdkecs.request.v20140526 import DescribeInstancesRequest
from aliyunsdkecs.request.v20140526 import StopInstanceRequest

# Initialize AcsClient instance
client = AcsClient(
  "<your-access-key-id>",
  "<your-access-key-secret>",
  "<your-region-id>"
);

# Initialize a request and set parameters
request = DescribeInstancesRequest.DescribeInstancesRequest()
request.set_PageSize(10)

# Print response
response = client.do_action_with_exception(request)
print response