Skip to main content

Software Development Kit for QingCloud.

Project description

This repository allows you to access QingCloud and control your resources from your applications.

This SDK is licensed under Apache Licence, Version 2.0.


Requires Python 2.6 or higher, compatible with Python 3, for more information please see QingCloud SDK Documentation


Install via pip

$ pip install qingcloud-sdk

Upgrade to the latest version

$ pip install --upgrade qingcloud-sdk

Install from source

git clone
cd qingcloud-sdk-python
python install

Getting Started

In order to operate QingCloud IaaS or QingStor (QingCloud Object Storage), you need apply access key on qingcloud console first.

QingCloud IaaS API

  1. Pass access key id and secret key into method connect_to_zone to create connection

    >>> import qingcloud.iaas
    >>> conn = qingcloud.iaas.connect_to_zone(
            'zone id',
            'access key id',
            'secret access key'
  2. Call API by using IAM role

If you would like to call our APIs without access key and secret key (bad things would happen if they were lost or leaked) or if you want a finer access control over your instances, there is a easy way to do it :P

  • Go to our IAM service, create an instance role and attach it to your instance.

  • Create connection without access key and secret key.

    >>> import qingcloud.iaas
    >>> conn = qingcloud.iaas.connect_to_zone(
          'zone id',

The variable conn is the instance of qingcloud.iaas.connection.APIConnection, we can use it to call resource related methods. Example:

# launch instances
>>> ret = conn.run_instances(

# stop instances
>>> ret = conn.stop_instances(

# describe instances
>>> ret = conn.describe_instances(
        status=['running', 'stopped']

QingCloud QingStor API

Pass access key id and secret key into method connect to create connection

>>> import qingcloud.qingstor
>>> conn = qingcloud.qingstor.connect(
        'access key id',
        'secret access key'

The variable conn is the instance of qingcloud.qingstor.connection.QSConnection, we can use it to create Bucket which is used for generating Key and MultiPartUpload.


# Create a bucket
>>> bucket = conn.create_bucket('mybucket')

# Create a key
>>> key = bucket.new_key('myobject')
>>> with open('/tmp/myfile') as f:
>>>     key.send_file(f)

# Delete the key
>>> bucket.delete_key('myobject')

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qingcloud-sdk-1.2.14.tar.gz (62.2 kB view hashes)

Uploaded source

Built Distribution

qingcloud_sdk-1.2.14-py2-none-any.whl (100.3 kB view hashes)

Uploaded py2

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page