All Products
Search
Document Center

:Alibaba cloud CLI parameter input format

Last Updated:May 07, 2022

Overview

This topic describes the format in which parameters are entered in Alibaba Cloud CLI.

Detailed information

Alibaba Cloud reminds you that:

  • If you have any risky operations on an instance or data, pay attention to the disaster tolerance and fault tolerance capabilities of the instance to ensure data security.
  • If you modify the configuration and data of an instance (including but not limited to ECS and RDS), we recommend that you create snapshots or enable RDS log backup.
  • If you have granted permissions on the Alibaba Cloud platform or submitted security information such as the logon account and password, we recommend that you modify the information as soon as possible.

For different types of fields in the API, Alibaba Cloud CLI follows different input format requirements, the main description is as follows.

  • Parameter case: API parameters are case-sensitive. The parameters entered in alibaba cloud CLI must also be case-sensitive.
  • Entering String-type parameter values: for parameters marked as String in API documentation, the parameter value can be passed in directly if it does not contain any special characters. Otherwise, you need to enclose the rule in single or double quotation marks ('), as shown in the following code:
    aliyun ecs DescribeImages --ImageName "custom image_1-10. X.X.1"
    aliyun ecs DescribeImages --ImageName 'windows-DB screen business -10.X.X.26'
    aliyun ecs DescribeImages --ImageName WindowsTest
  • Passing of Integer type parameter value: The parameters marked as Integer in the API documentation can be passed in directly.
    aliyun ecs DescribeImages --ImageName WindowsTest --Pagesize 10
    In this example, "-- Pagesize 10" indicates the default value instead of the maximum value.
  • Input of String type String list value: for parameters marked as String in API documentation, if a list of multiple values is supported, such as ImageId list, separate each value with a comma (,). Use single quotation marks or double quotation marks before entering, as shown below.
    aliyun ecs DescribeImages --ImageId "m-23e0oxmbv,m-23waejuy9"
    aliyun ecs DescribeImages --ImageId 'm-23e0oxmbv,m-23waejuy9
  • Input of a String-type JSON Array parameter value: for parameters marked as String in API documentation, if the parameter value must be a formatted JSON Array, enclose each value in single quotes (''). Enclosed by square brackets ([]), quoted with double quotation marks ("), and separated with commas (,). Single and double quotes in the above usage can also be interchanged, as shown below.
    aliyun ecs DescribeDisks --DiskIds '["d-23rssg24f","d-23vsih26x","d-23sfqfbfa"]'
    aliyun ecs DescribeDisks --DiskIds "['d-23rssg24f, 'd-23vsih26x, 'd-23sfqfbfa]"
  • Input of String-type JSON Array list parameter value: Parameters marked as String in API documentation. If the parameter values must be a JSON Array, enclose each value in single quotes ('') and square brackets ([]). Separate JSON Array values with commas (,). Separate keys and values in the JSON Array with colon (:). Single and double quotes in the above usage can also be interchanged, as shown below.
    aliyun slb AddBackendServers --LoadBalancerId 15157b19f18-cn-hangzhou-dg-a01 --BackendServers "[{'ServerId':'i-23g8aact0 ',{'ServerId':'i-23bb03yh9}]"
    aliyun slb AddBackendServers --LoadBalancerId 15157b19f18-cn-hangzhou-dg-a01 --BackendServers '[{"ServerId":"i-23g8aact0"},{"ServerId":"i-23bb03yh9"}]'
  • Input of String type date format parameter value: for parameters marked as String in API documentation, if the parameter value must be a UTC time expressed according to the "ISO8601" standard, the time must be passed in the YYYY-MM-DDThh:mm:ssZ format.
    aliyun ecs DescribeInstanceMonitorData --InstanceId i-94ola4btx --StartTime 2015-11-28T15:00:00Z --EndTime 2015-11-28T18:00:00Z

Applicable to

  • Elastic Compute Service