To meet different output format requirements of different users, Alibaba Cloud CLI supports three output formats.
JSON format is the default output format of Alibaba Cloud CLI. Most languages have the internal function or open JSON parser library to parse JSON strings easily. JSON format is mainly used with other scripts or any programming language to facilitate developers’ parsing and use. An example is shown as follows.
Text separated by Tab (text)
In text format, outputs of Alibaba Cloud CLI are arranged into lines separated by Tab. This format is appropriate for traditional UNIX text tools (such as sed, grep, and awk) and Windows PowerShell. The text output format complies with the basic structure shown in the following example. The columns are sorted alphabetically by key names of bottom-layer JSON objects.
ASCII table (table)
In table format, data is arranged in an easy-to-read manner. An example is shown as follows.
The output format can be specified in two ways.
Method 1: Modify the config file.
Use the output option in the config file. The following example shows how to set the output format to text.
Method 2: Use command line.
Use the output option in Alibaba Cloud CLI. The following example shows how to set the output format to table.
$ aliyuncli ecs DescribeInstanceAttribute --InstanceId i-23rjh06vf --output table