Esta página aún no está disponible en su idioma local. Estamos trabajando arduamente para agregar más versiones de idiomas. Gracias por tu apoyo.
- 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
- Checking Command
- Specifying Region
- Calling APIs with an Account in Non-configuration Mode
- Calling APIs with AK/SK in Non-configuration Mode
- Calling APIs with a Token in Non-configuration Mode
- Calling APIs Using an Agency 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
- Obtaining CLI Examples on API Explorer
- Using KooCLI in Non-configuration Mode
- 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
Show all
How Do I Use cli-output-rows, cli-output-cols, and cli-output-num?
By default, results are returned in JSON format when you call cloud service APIs using KooCLI. KooCLI supports the --cli-output-rows, --cli-output-cols, and --cli-output-num parameters to output data in table format. These parameters facilitate the extraction of key information in the calling result.
hcloud ECS NovaListServers --cli-region="eu-west-101" --project_id="0dd8cb****************19b5a84546" { "servers": [ { "name": "ecs-a6b4", "links": [ { "rel": "self", "href": "https://ecs.eu-west-101.myhuaweicloud.eu/v2.1/0dd8cb****************19b5a84546/servers/4f06****-****-****-****-****04dd856a" }, { "rel": "bookmark", "href": "https://ecs.eu-west-101.myhuaweicloud.eu/0dd8cb****************19b5a84546/servers/4f06****-****-****-****-****04dd856a" } ], "id": "4f06****-****-****-****-****04dd856a" }, { "name": "hdn-docker", "links": [ { "rel": "self", "href": "https://ecs.eu-west-101.myhuaweicloud.eu/v2.1/0dd8cb****************19b5a84546/servers/6731****-****-****-****-****0bc463f0" }, { "rel": "bookmark", "href": "https://ecs.eu-west-101.myhuaweicloud.eu/0dd8cb****************19b5a84546/servers/6731****-****-****-****-****0bc463f0" } ], "id": "6731****-****-****-****-****0bc463f0" }, { "name": "ecs-8f88", "links": [ { "rel": "self", "href": "https://ecs.eu-west-101.myhuaweicloud.eu/v2.1/0dd8cb****************19b5a84546/servers/06a2****-****-****-****-****c79a1a26" }, { "rel": "bookmark", "href": "https://ecs.eu-west-101.myhuaweicloud.eu/0dd8cb****************19b5a84546/servers/06a2****-****-****-****-****c79a1a26" } ], "id": "06a2****-****-****-****-****c79a1a26" } ] }
During table output, --cli-output-rows specifies a JSON structure level, that is, the data source of the table, --cli-output-cols specifies the column names of the table, which must correspond to the fields in the JSON structure, and --cli-output-num specifies whether to print the row numbers of the table (the default value is true).
hcloud ECS NovaListServers --cli-region="eu-west-101" --project_id="0dd8cb******************b5a84546" --cli-output-rows="servers" --cli-output-cols="name,id"
The --cli-output-rows, --cli-output-cols, and --cli-output-num parameters can also be used in system commands. For example:
hcloud configure list --cli-output-rows="profiles[]"
hcloud configure list --cli-output-rows="profiles[0]" --cli-output-cols="name,accessKeyId,secretAccessKey,projectId,region"
For details about how to use --cli-output-rows, --cli-output-cols, and --cli-output-num, see What Are the Precautions for Using cli-output-rows, cli-output-cols, and cli-output-num?
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.