Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Help Center/ Koo Command Line Interface/ FAQs/ Output Formats/ How Do I Use cli-output-rows, cli-output-cols, and cli-output-num? What Are the Precautions?/ What Are the Precautions for Using cli-output-rows, cli-output-cols, and cli-output-num?

What Are the Precautions for Using cli-output-rows, cli-output-cols, and cli-output-num?

Updated on 2022-07-07 GMT+08:00

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.
  • 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.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback