Skip to main content

Command Line Interface for QingCloud.

Project description

qingcloud-cli is the command line interface for managing QingCloud resources, with it you can check, create, delete and operate all your resources, it supports Linux, Mac and Windows for now.

This CLI is licensed under Apache Licence, Version 2.0.

Installation

Install via pip

$ pip install qingcloud-cli

If not installed in virtualenv, maybe sudo is needed

$ sudo pip install qingcloud-cli

Upgrade to the latest version

$ pip install --upgrade qingcloud-cli

Command Completion

qingcloud-cli has auto-completion (only support Linux and Mac).

If auto-completion doesn’t take effect, please activate it manually.:

$ source ~/.bash_profile

If still doesn’t work, please input:

$ complete -C qingcloud_completer qingcloud

and add this command into your login shell (such as ~/.bash_profile).

Getting Started

To use qingcloud-cli, there must be a configuration file to configure your own qy_access_key_id , qy_secret_access_key and zone , such as:

qy_access_key_id: 'QINGCLOUDACCESSKEYID'
qy_secret_access_key: 'QINGCLOUDSECRETACCESSKEYEXAMPLE'
zone: 'pek1'

access key can be applied for in Qingcloud Console. zone is the Node ID where your resources are, and it can be checked in the switching node on the console, such as pek1, pek2, gd1, ap1 .

The configuration file is saved in ~/.qingcloud/config.yaml by default, it also can be assigned by the parameter -f /path/to/config when executing the command.

Input Parameters

For iaas service, the parameters of qingcloud-cli only include int and string type. If the parameters support the list passing, the values shall be separated by English comma . For example:

qingcloud iaas describe-keypairs -k 'kp-bn2n77ow, kp-b2ivaf15' -L 2

Sometimes, the parameter needs to be string in JSON format, such as:

qingcloud iaas add-router-statics -r rtr-ba2nbge6 -s '[{"static_type":1,"val1":"80","val2":"192.168.99.2","val3":"8000"}]'

For qs service, the parameters include int, string and list type. If the parameters support the list passing, the values shall be separated by spaces. For example:

qingcloud qs set-bucket-acl -b mybucket -A QS_ACL_EVERYONE,READ usr-wmTc0avW,FULL_CONTROL

Command Output

The returned result of Command is in JSON format. For example, the returned result of describe-keypair of ‘iaas’ service.:

{
  "action":"DescribeKeyPairsResponse",
  "total_count":2,
  "keypair_set":[
    {
      "description":null,
      "encrypt_method":"ssh-rsa",
      "keypair_name":"kp 1",
      "instance_ids":[
        "i-ogbndull"
      ],
      "create_time":"2013-08-30T05:13:50Z",
      "keypair_id":"kp-bn2n77ow",
      "pub_key":"AAAAB3..."
    },
    {
      "description":null,
      "encrypt_method":"ssh-rsa",
      "keypair_name":"kp 2",
      "create_time":"2013-08-31T05:13:50Z",
      "keypair_id":"kp-b2ivaf15",
      "pub_key":"AAAAB3..."
    }
  ],
  "ret_code":0
}

The returned result of list-objects of ‘qs’ service.:

{
  "name": "mybucket",
  "keys": [
    {
      "key": "myphoto.jpg",
      "size": 67540,
      "modified": 1456226022,
      "mime_type": "image/jpeg",
      "created": "2016-02-23T11:13:42.000Z"
    },
    {
      "key": "mynote.txt",
      "size": 11,
      "modified": 1456298679,
      "mime_type": "text/plain",
      "created": "2016-02-24T06:49:23.000Z"
    }
  ],
  "prefix": "",
  "owner": "qingcloud",
  "delimiter": "",
  "limit": 20,
  "marker": "mynote.txt",
  "common_prefixes": []
}

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-cli-1.3.1.tar.gz (144.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qingcloud_cli-1.3.1-py2-none-any.whl (545.8 kB view details)

Uploaded Python 2

File details

Details for the file qingcloud-cli-1.3.1.tar.gz.

File metadata

  • Download URL: qingcloud-cli-1.3.1.tar.gz
  • Upload date:
  • Size: 144.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/2.7

File hashes

Hashes for qingcloud-cli-1.3.1.tar.gz
Algorithm Hash digest
SHA256 cef8e8032caa0caf88853b132ab59b48472b7766db8ce57f898969639ecf9ea3
MD5 6cd7c7b361d3c63d36c97a840dd1c74a
BLAKE2b-256 cad8929f003c8da2a4e770f5adb049641f3879fdfa6e65bfbcde1e1016a0461a

See more details on using hashes here.

File details

Details for the file qingcloud_cli-1.3.1-py2-none-any.whl.

File metadata

  • Download URL: qingcloud_cli-1.3.1-py2-none-any.whl
  • Upload date:
  • Size: 545.8 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/2.7.15

File hashes

Hashes for qingcloud_cli-1.3.1-py2-none-any.whl
Algorithm Hash digest
SHA256 f7ac8afb49a6e168323a0040bf8ed23dff56dcb648751700a8027b1243a7f234
MD5 f1d7ec9480852940b294e20b1cc147a8
BLAKE2b-256 7a691eae03a2fa4aafba9bab6f48134578c71d488e16bbe45236cbe8527557f6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page