- Function Overview
- What's New
- Service Overview
- Getting Started
-
User Guide
- Configuration Management
- HTTP Proxy
- Commonly Used Commands
-
Options
- Option Overview
- Printing Help Information
- Printing Debugging Information
- Generating API Input Parameter Skeleton in JSON Format
- Checking Command
- Specifying Region
- Calling APIs with AK/SK in Non-configuration Mode
- Specifying Account ID
- Specifying Profile
- Specifying Authentication Mode
- Specifying Output Format
- Passing API Parameters with JSON File
- Specifying Request Timeouts
- Specifying Retry Count
- Skipping HTTPS Request Certificate Verification
- Specifying a Domain Name
- Polling Results
- Obtaining CLI Examples on API Explorer
- Using KooCLI in Non-configuration Mode
- Online Experience
- Obtaining Authentication Information
-
FAQs
- Overview
- Authentication
- Profiles
- Metadata Cache
- Logs
- Network Connections
- Cloud Services
- Cloud Service APIs
- Regions
-
Parameters
- What Are KooCLI System Parameters?
- Why Am I Seeing a Message Indicating an Invalid Parameter?
- Why Are Old and New KooCLI System Parameters (Such as region and cli-region) Available? Which Parameters Are Recommended?
- Why Am I Seeing a Message Indicating a Duplicate Parameter?
- How Do I Use cli-jsonInput?
- When Can I Use cli-jsonInput?
- Why Am I Seeing a Message Indicating an Unsupported Parameter Position or Type?
- How Do I Leave a Body Parameter Empty for Cloud Service APIs?
- Interactive Mode and Autocomplete
-
Output Formats
- What Output Formats Are Supported by KooCLI?
- How Do I Define a JMESPath Expression?
- Which KooCLI System Parameters Are Related to Data Output? Which Ones Are Recommended?
- How Do I Use cli-output, cli-query, and cli-output-num?
- How Do I Use cli-output-rows, cli-output-cols, and cli-output-num? What Are the Precautions?
- How Do I Use cli-json-filter? What Are the Precautions?
- Other
- Videos
- General Reference
Show all
Copied.
What Are the Precautions for Using cli-output-rows, cli-output-cols, and cli-output-num?
If --cli-output-rows, --cli-output-cols, and --cli-output-num are used in a command, the command output is in table format. Table output helps you extract key information from return values. The parameters are described as follows:
- --cli-output-cols: the fields to print during table output.
- --cli-output-rows: the levels to print during table output. For example, if you want to convert a JSON structure to a table, set this parameter to the name of the structure.
- --cli-output-num: whether to print the row numbers during table output. The value can be true (default) or false.
For details, see How Do I Use cli-output-rows, cli-output-cols, and cli-output-num?
Note the following when using the preceding parameters for table output:
- --cli-output-cols and --cli-output-rows can be used separately or together.
- Use only --cli-output-rows.
The --cli-output-rows option is separately used in a command to pass the name of a JSON structure in the calling result. The levels must be separated by periods (.). The content of the target JSON structure must be an array. KooCLI will display the structure content in a table. For example, if you run the hcloud configure list --cli-output-rows=profiles command, all profile information will be displayed in a table. If the JSON structure specified in --cli-output-rows is not an array, the following error message is displayed:
[CLI_ERROR] Table output error. The cli-output-cols parameter is required.
- Use only --cli-output-cols.
The --cli-output-cols option is used to pass the root element fields of the JSON structure of the calling result. The fields must be separated by commas (,). For example, if you run the hcloud configure show --cli-profile=${profileName} --cli-output-cols=accessKeyId command, the access key ID in the specified profile will be displayed in a table. When --cli-output-cols is used separately, only the root element fields of the JSON structure can be specified. Otherwise, the following error message is displayed:
[USE_ERROR] In parameter cli-output-cols, * is null.
- Use both --cli-output-cols and --cli-output-rows.
The --cli-output-rows option is used to specify the levels to print, and the --cli-output-cols option is used to specify the fields to print at the levels. For example, if you run the hcloud configure list --cli-output-rows=profiles --cli-output-cols=accessKeyId command, the access key IDs of all profiles will be displayed in a table.
You can set --cli-output-rows to [n] or [m:n] to specify the index of the array element to be printed. Specify [n] to print the value of index n, and specify [m:n] to print the values of indexes m to (n – 1). For example, if you run the hcloud configure list --cli-output-rows=profiles[0:2] --cli-output-cols=accessKeyId command, the access key IDs of the profiles whose indexes are 0 and 1 in the profile array are displayed in a table. Pay attention to the following:
- If the index value of the array in --cli-output-rows is [m:n] and the value of n exceeds the array length limit, data within the maximum index will be printed.
- If the index value of the array in --cli-output-rows is [n] and the value of n exceeds the array length limit, an error message is displayed indicating that the array index is out of range:
[USE_ERROR] The cli-output-rows parameter contains an incorrect field (*). The array index is out of range and the array length is *. Current index: *.
- When both --cli-output-cols and --cli-output-rows are used, the parameters in --cli-output-rows do not need to be of the array type. You only need to specify the level.
- Use only --cli-output-rows.
- When --cli-output-num is used separately, the output will not be displayed in a table.
- In the same command, --cli-output-rows, --cli-output-cols, and --cli-output-num cannot be used together with --cli-json-filter. Otherwise, an error occurs because the output format cannot be determined.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot