qingcloud-sdk


Nameqingcloud-sdk JSON
Version 1.2.16 PyPI version JSON
download
home_pagehttps://docs.qingcloud.com/sdk/
SummarySoftware Development Kit for QingCloud.
upload_time2024-11-05 03:33:50
maintainerNone
docs_urlNone
authorYunify Team
requires_pythonNone
licenseNone
keywords qingcloud iaas qingstor sdk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =====================
QingCloud Python SDK
=====================

This repository allows you to access `QingCloud <https://www.qingcloud.com>`_
and control your resources from your applications.

This SDK is licensed under
`Apache Licence, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0.html>`_.

.. note::
  Requires Python 2.6 or higher, compatible with Python 3,
  for more information please see
  `QingCloud SDK Documentation <https://docs.qingcloud.com/sdk/>`_


------------
Installation
------------

Install via `pip <http://www.pip-installer.org>`_ ::

    $ pip install qingcloud-sdk

Upgrade to the latest version ::

    $ pip install --upgrade qingcloud-sdk

Install from source ::

    git clone https://github.com/yunify/qingcloud-sdk-python.git
    cd qingcloud-sdk-python
    python setup.py install


---------------
Getting Started
---------------

In order to operate QingCloud IaaS or QingStor (QingCloud Object Storage),
you need apply **access key** on `qingcloud console <https://console.qingcloud.com>`_ 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',
             None,
             None
          )


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(
          image_id='img-xxxxxxxx',
          cpu=1,
          memory=1024,
          vxnets=['vxnet-0'],
          login_mode='passwd',
          login_passwd='Passw0rd@()'
      )

  # stop instances
  >>> ret = conn.stop_instances(
          instances=['i-xxxxxxxx'],
          force=True
        )

  # 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(
          'pek3a.qingstor.com',
          '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.

Example::

  # 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')


Coreshub AICP API
'''''''''''''''''''''''
Pass access key id and secret key into method ``connect`` to create connection ::

  >>> import qingcloud.qai
  >>> conn = qingcloud.qai.connect(
          'access key id',
          'secret access key',
          'zone_id'
      )

The variable ``conn`` is the instance of ``qingcloud.qai.connection.QAIConnection``,
we can use it to connect to aicp server.

Example::

  # Get user information.
  >>> user_info = conn.get_user_info()

  # Get trains.
  >>> trains = conn.get_trains()

  # Get the metrics of trains.
  >>> conn.trains_metrics(['tn-xxx', 'tn-xxx'])





            

Raw data

            {
    "_id": null,
    "home_page": "https://docs.qingcloud.com/sdk/",
    "name": "qingcloud-sdk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "qingcloud iaas qingstor sdk",
    "author": "Yunify Team",
    "author_email": "simon@yunify.com",
    "download_url": "https://files.pythonhosted.org/packages/f8/55/f96af56402640641550a12aa39e681c8e6fd1f9eb492d9dca1a0f2d1d46c/qingcloud-sdk-1.2.16.tar.gz",
    "platform": null,
    "description": "=====================\nQingCloud Python SDK\n=====================\n\nThis repository allows you to access `QingCloud <https://www.qingcloud.com>`_\nand control your resources from your applications.\n\nThis SDK is licensed under\n`Apache Licence, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0.html>`_.\n\n.. note::\n  Requires Python 2.6 or higher, compatible with Python 3,\n  for more information please see\n  `QingCloud SDK Documentation <https://docs.qingcloud.com/sdk/>`_\n\n\n------------\nInstallation\n------------\n\nInstall via `pip <http://www.pip-installer.org>`_ ::\n\n    $ pip install qingcloud-sdk\n\nUpgrade to the latest version ::\n\n    $ pip install --upgrade qingcloud-sdk\n\nInstall from source ::\n\n    git clone https://github.com/yunify/qingcloud-sdk-python.git\n    cd qingcloud-sdk-python\n    python setup.py install\n\n\n---------------\nGetting Started\n---------------\n\nIn order to operate QingCloud IaaS or QingStor (QingCloud Object Storage),\nyou need apply **access key** on `qingcloud console <https://console.qingcloud.com>`_ first.\n\n\nQingCloud IaaS API\n'''''''''''''''''''\n1. Pass access key id and secret key into method ``connect_to_zone`` to create connection ::\n\n      >>> import qingcloud.iaas\n      >>> conn = qingcloud.iaas.connect_to_zone(\n              'zone id',\n              'access key id',\n              'secret access key'\n          )\n\n\n2. Call API by using IAM role\n\nIf you would like to call our APIs without access key and secret key (bad things would happen if they were lost or leaked)\nor if you want a finer access control over your instances, there is a easy way to do it :P\n\n- Go to our IAM service, create an instance role and attach it to your instance.\n- Create connection without access key and secret key. ::\n\n      >>> import qingcloud.iaas\n      >>> conn = qingcloud.iaas.connect_to_zone(\n            'zone id',\n             None,\n             None\n          )\n\n\nThe variable ``conn`` is the instance of ``qingcloud.iaas.connection.APIConnection``,\nwe can use it to call resource related methods. Example::\n\n  # launch instances\n  >>> ret = conn.run_instances(\n          image_id='img-xxxxxxxx',\n          cpu=1,\n          memory=1024,\n          vxnets=['vxnet-0'],\n          login_mode='passwd',\n          login_passwd='Passw0rd@()'\n      )\n\n  # stop instances\n  >>> ret = conn.stop_instances(\n          instances=['i-xxxxxxxx'],\n          force=True\n        )\n\n  # describe instances\n  >>> ret = conn.describe_instances(\n          status=['running', 'stopped']\n        )\n\nQingCloud QingStor API\n'''''''''''''''''''''''\nPass access key id and secret key into method ``connect`` to create connection ::\n\n  >>> import qingcloud.qingstor\n  >>> conn = qingcloud.qingstor.connect(\n          'pek3a.qingstor.com',\n          'access key id',\n          'secret access key'\n      )\n\nThe variable ``conn`` is the instance of ``qingcloud.qingstor.connection.QSConnection``,\nwe can use it to create Bucket which is used for generating Key and MultiPartUpload.\n\nExample::\n\n  # Create a bucket\n  >>> bucket = conn.create_bucket('mybucket')\n\n  # Create a key\n  >>> key = bucket.new_key('myobject')\n  >>> with open('/tmp/myfile') as f:\n  >>>     key.send_file(f)\n\n  # Delete the key\n  >>> bucket.delete_key('myobject')\n\n\nCoreshub AICP API\n'''''''''''''''''''''''\nPass access key id and secret key into method ``connect`` to create connection ::\n\n  >>> import qingcloud.qai\n  >>> conn = qingcloud.qai.connect(\n          'access key id',\n          'secret access key',\n          'zone_id'\n      )\n\nThe variable ``conn`` is the instance of ``qingcloud.qai.connection.QAIConnection``,\nwe can use it to connect to aicp server.\n\nExample::\n\n  # Get user information.\n  >>> user_info = conn.get_user_info()\n\n  # Get trains.\n  >>> trains = conn.get_trains()\n\n  # Get the metrics of trains.\n  >>> conn.trains_metrics(['tn-xxx', 'tn-xxx'])\n\n\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Software Development Kit for QingCloud.",
    "version": "1.2.16",
    "project_urls": {
        "Homepage": "https://docs.qingcloud.com/sdk/"
    },
    "split_keywords": [
        "qingcloud",
        "iaas",
        "qingstor",
        "sdk"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bb180f17377a592581b096c244004f40977bacef25de007bb695a45b5b3dcfea",
                "md5": "f76037c3c95ddd79ac9f7b1c072c18ef",
                "sha256": "61240e4e56995a428438941a878c962a776bef0c916a4727f600aa8134d62081"
            },
            "downloads": -1,
            "filename": "qingcloud_sdk-1.2.16-py2-none-any.whl",
            "has_sig": false,
            "md5_digest": "f76037c3c95ddd79ac9f7b1c072c18ef",
            "packagetype": "bdist_wheel",
            "python_version": "py2",
            "requires_python": null,
            "size": 103786,
            "upload_time": "2024-11-05T03:33:48",
            "upload_time_iso_8601": "2024-11-05T03:33:48.528402Z",
            "url": "https://files.pythonhosted.org/packages/bb/18/0f17377a592581b096c244004f40977bacef25de007bb695a45b5b3dcfea/qingcloud_sdk-1.2.16-py2-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f855f96af56402640641550a12aa39e681c8e6fd1f9eb492d9dca1a0f2d1d46c",
                "md5": "3ece3d9724251ae9ea5fd9efbb9baf67",
                "sha256": "6fa6a28d1512b48855eb6b04b4e025fd701d21ae474d40b9ff34846ae0a369d9"
            },
            "downloads": -1,
            "filename": "qingcloud-sdk-1.2.16.tar.gz",
            "has_sig": false,
            "md5_digest": "3ece3d9724251ae9ea5fd9efbb9baf67",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 64760,
            "upload_time": "2024-11-05T03:33:50",
            "upload_time_iso_8601": "2024-11-05T03:33:50.403247Z",
            "url": "https://files.pythonhosted.org/packages/f8/55/f96af56402640641550a12aa39e681c8e6fd1f9eb492d9dca1a0f2d1d46c/qingcloud-sdk-1.2.16.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-05 03:33:50",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "qingcloud-sdk"
}
        
Elapsed time: 0.40797s