edit-icon download-icon

Install ROS CLI

Last Updated: May 18, 2018

Overview

Resource Orchestration Service (ROS) supports Python 2.7–based command line tool, which allows users to create, update, delete, and view resource stacks.

Scenarios

  • API-level development and debugging for resource stack management, such as creating, viewing, and deleting resource stacks.

  • Circumstances where your access to a console is limited.

Restrictions

Resource Orchestration Service command line tool run in Python 2.7 environment. Python 3.x is not supported.

Environment requirements

If you have not installed Python, get an installation package from the Python website. You can also find instructions for installing and using Python on the website.

If you have not installed the Python Core SDK and the Python ROS SDK, click aliyun-python-sdk-core to download the Python Core SDK and aliyun-python-sdk-ros to download the Python ROS SDK.

Check the version number of your Python

In Linux shell, enter “python” and press Enter to view the version number of your Python.

The result is shown as follows.

  1. Python 2.5.4 (r254:67916, Mar 10 2010, 22:43:17)
  2. [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
  3. Type "help", "copyright", "credits" or "license" for more information.
  4. >>>

In Windows cmd, enter “python” and press the Enter button to view the version number of your Python.

The result is shown as the following example:

  1. C:\Documents and Settings\Administrator>python
  2. Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win
  3. 32
  4. Type "help", "copyright", "credits" or "license" for more information.
  5. >>>

Now Python is properly installed.

Exception

After entering “python” in Windows cmd and pressing Enter, the system prompts “Not an internal or external command”. In this case, check the environment variable, configure it to Path, and add the Python installation path.

Install the ROS CLI

Click aliyun-ros-cli to download the installation package. Extract the command line tool zip, and run python ros set-userdata directly under the directory where bin/ros is located to configure the Alibaba Cloud AccessKey and the default region.

If you have installed pip, the Python package management tool, use the following command to install Resource Orchestration Service command line tool. Installing the command lines also installs all the dependencies.

  1. pip install aliyun-ros-cli

Configure the ROS CLI

You must configure the following basic items before you can use the Resource Orchestration Service command line tool:

  • Alibaba Cloud AccessKey.

  • Default region for running commands.

  • Output format of command lines.

Run python ros set-userdata to configure the following parameters.

  1. $ python ros set-userdata -h
  2. usage: ros set-userdata [-h] --key-id KEY_ID --key-secret KEY_SECRET
  3. --region-id REGION_ID [--json-ident JSON_IDENT]
  4. optional arguments:
  5. -h, --help show this help message and exit
  6. --key-id KEY_ID The default Aliyun access key id
  7. --key-secret KEY_SECRET
  8. The default Aliyun access key region
  9. --region-id REGION_ID
  10. The default region
  11. --json-ident JSON_IDENT
  12. The default json indent when output in json format

Example:

  1. python ros set-userdata --key-id access-key --key-secret access-secret --region cn-beijing

Resource Orchestration Service comes with the command line tool completion script ros_completion for the bash environment. Click here to download the completion script. Place ros-cli/resources/ros_completion under the /etc/bash_completion.d/ directory. The path is source /etc/bash_completion.d/ros_completion.

Thank you! We've received your feedback.