Skip to main content

No project description provided

Project description

Command Line Interface for QingCloud

qingcloud-cli 是 QingCloud 青云 的命令行接口, 可以通过它对青云的资源进行查看、创建和操作。

Installation

可使用 pip 安装:

$ pip install qingcloud-cli

如果不是在 virtualenv 上安装,则需要 sudo

$ sudo pip install qingcloud-cli

如果你已安装 qingcloud-cli 并需要更新到最新版本,则可以:

$ pip install --upgrade qingcloud-cli

Command Completion

qingcloud-cli 包含命令自动补全功能,不过需要手动配置一下,而且目前只支持 linux 系统。

开启 tab 补全功能需要利用 complete 命令:

$ complete -C qingcloud_completer qingcloud

可以将这条命令加到你的启动脚本中。

Getting Started

使用 qingcloud-cli 必需一个配置文件,配置你自己的 qy_access_key_idqy_secret_access_key 以及 zone 。比如:

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

access key 可在 青云控制台 申请, zone 目前只有一个: pek1 。

配置文件默认放在 ~/.qingcloud/config.yaml ,也可在每次执行命令时以参数 -f /path/to/config 方式来指定。

Parameter Input

qingcloud-cli 的参数只有 int 和 string 类型。如果参数支持传递列表,则多个值之间以 英文逗号 , 分隔。如:

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

有时参数需要是 JSON 格式的字符串,如:

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

Command Output

Command 的返回结果为 JSON 结构。例如 describe-keypair 的返回结果:

{
  "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
}

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-0.6.tar.gz (83.6 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: qingcloud-cli-0.6.tar.gz
  • Upload date:
  • Size: 83.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for qingcloud-cli-0.6.tar.gz
Algorithm Hash digest
SHA256 107cc2c44af244c7f00f580a32a2287bd77e725bac43b8843d6215dbe627a1ab
MD5 97302968c66ed99d97ef961c698b67ec
BLAKE2b-256 8759a724bb33685901ee1e4c1d802e3f79f79d27769e25e18089fb43e42b6147

See more details on using hashes here.

Supported by

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