edit-icon download-icon

Parameter value input requirements

Last Updated: Dec 20, 2017

When you are calling Alibaba Cloud CLI, you must input the required values according to the following instructions to avoid errors.

  • In most cases, you are required to input a string or numeric value to Alibaba Cloud CLI.

    Example:

    1. $ aliyuncli ecs DescribeInstanceAttribute --InstanceId myInstanceId
  • If your inputs contain spaces, use single quotation mark (‘) to include the value. This manner is applicable to Windows PowerShell, Mac OS, and Linux.

    Example:

    1. $ aliyuncli ecs DescribeInstanceAttribute --InstanceId 'my instance id'

    For Windows Command Processer, use double quotation marks (“) to include the value.

    Example:

    1. > aliyuncli ecs DescribeInstanceAttribute --InstanceId "my instance id"
  • Use JSON format to input parameters. JSON format is allowed in Alibaba Cloud CLI. Especially, when you query information of multiple instances or multiple disks, you can input multiple ID values in JsonArray format. It requires that you strictly edit data in JSON format and perform special processing on double quotation marks (“) in JSON format.

    To query information of multiple instances, you can input values with double quotation marks (“), like [“my-intances-id1”, “my-instances-id2”]. However, in Python, the double quotation marks (“) are filtered out by default, so special processing is required.

    • On Linux and Mac OS systems, use single quotation mark (‘) to include the entire JSON value.

      Example:

      1. $ aliyuncli ecs DescribeInstances --InstanceIds '["my-intances-id1", "my-instances-id2"]'
    • In Windows Command Processer, use a backslash ( \ ) to represent the double quotation mark (“), and use double quotation marks (“) to include the entire JSON value.

      Example:

      1. > aliyuncli ecs DescribeInstances --InstanceIds "[\"my-intances-id1\", \"my-instances-id2\"]"
    • In Windows PowerShell, use a backslash ( \ ) to represent the double quotation mark (“), and then use single quotation mark (‘) to include the entire JSON value.

      Example:

      1. > aliyuncli ecs DescribeInstances --InstanceIds '[\"my-intances-id1\", \"my-instances-id2\"]'
Thank you! We've received your feedback.