Skip to main content

Wraps the Alibaba Cloud SDK to make complicated tasks a lot simpler.

Project description

Ali CLI

PyPI version

Wraps the Alibaba Cloud SDK to make complicated tasks a lot simpler.

Installation

Installation is easy, run the following command to install the CLI through Pip:

pip install ali-cli

Then run the CLI using the command ali. You should see the default help output with the supported commands.

Configuration

To connect the CLI to your Alibaba Cloud account, you will either need to use the official Aliyun CLI to configure your credentials or create the configuration manually. To use the CLI, run aliyun configure and follow the prompts. If you don't want to install the official CLI, you can manually create the file ~/.aliyun/config.json with the following contents:

{
  "current": "",
  "profiles": [
    {
      "name": "",
      "mode": "AK",
      "access_key_id": "<ACCESS_KEY_ID>",
      "access_key_secret": "<ACCESS_KEY_SECRET>",
      "sts_token": "",
      "ram_role_name": "",
      "ram_role_arn": "",
      "ram_session_name": "",
      "private_key": "",
      "key_pair_name": "",
      "expired_seconds": 0,
      "verified": "",
      "region_id": "eu-central-1",
      "output_format": "json",
      "language": "zh",
      "site": "",
      "retry_timeout": 0,
      "retry_count": 0
    }
  ]
}

Replace <ACCESS_KEY_ID> with your access key ID and <ACCESS_KEY_SECRET> with your access key secret. Optionally, you can change the region to the region you like (eu-central-1 is Frankfurt).

Usage

Currently, Ali CLI only supports commands related to the Resource Orchestration Service (ROS). This allows you to deploy JSON templates as stacks, so you can use code to define your whole infrastructure.

To deploy an example bucket, run the following command:

ali ros create-stack --name ali-ros-test --template examples/ros/bucket.json --parameters BucketName=my-fancy-bucket

This will create the stack ali-ros-test, using the template in the examples/ros/bucket.json file and specifies the values to use for the template parameters. You can specify multiple parameters if necessary by repeating the --parameters <key>=<val> option as many times as you need. Feel free to modify the stack name and templates if you like. You can also specify - for the template, which means that it will be read from stdin. Type or paste the template in the prompt and press Ctrl-D to send it into the CLI.

To list stacks, run ali ros describe-stacks. This will output all the stacks in the current region.

To delete a stack, run ali ros delete-stack --name ali-ros-test. This will remove the stack you created above, including the provisioned resources.

Although the Alibaba ROS API's only support JSON templates, Ali CLI can also deploy YAML templates. We do this by converting your YAML into JSON before creating the stack. Examples of both JSON and YAML templates can be found in the examples/ros directory.

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

ali-cli-0.2.1.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

ali_cli-0.2.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file ali-cli-0.2.1.tar.gz.

File metadata

  • Download URL: ali-cli-0.2.1.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for ali-cli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 90df88348ac982ba3873a5241a4d0dcd7ec747428d395d53a96f88faecdfdcf7
MD5 8cb9702cbd9a1431a77b8f6e227ddc74
BLAKE2b-256 f826096391def20d12b770921b9a08e79604c6f0b42e01625235ecf8102c8859

See more details on using hashes here.

File details

Details for the file ali_cli-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: ali_cli-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for ali_cli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6dd621a112aa15abb99989116ec1e518201ec1e93c53260bbb8111ce64afff12
MD5 14a9984d5719174429e4b1c222b3b2f4
BLAKE2b-256 001d886c281670fb801635a1269c840791f1d2076f8ef2663278741293712558

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