Updated on 2026-08-21 GMT+08:00

How to Use KooCLI

Huawei Cloud Koo Command Line Interface (KooCLI), previously named "HCloud CLI", is designed to manage Huawei Cloud service APIs released on API Explorer. With KooCLI, you can call the open APIs of DWS to manage and use your DWS resources. For details about KooCLI, see What Is KooCLI?

Installing KooCLI

Before using KooCLI, install it. KooCLI is compatible with Windows, Linux, and macOS. Install the required version.

Initializing KooCLI Configuration

Your identity information is obtained for authentication when you use KooCLI to call APIs. By configuring KooCLI initialization, you can store your permanent AK/SK information in the configuration file. In this way, you do not need to frequently enter the fixed information when calling APIs.

Skip this step if you intend to pass authentication parameters directly in commands instead of using the configuration file. For details, see Using KooCLI in Non-configuration Mode.

The following uses Windows as an example to describe how to initialize KooCLI configuration. The operations on Linux and macOS are similar. Before the initialization, obtain the AK/SK information. For details, see Access Keys.

  1. Open the CLI.
  2. Run the following commands to initialize the configuration:
    hcloud configure init
  3. Enter the parameter values as prompted.
    Access Key ID [required]: //Mandatory. Enter the AK.
     Secret Access Key [required]: //Mandatory. Enter the SK. The system anonymizes the entered content.
     Secret Access Key (again): //Mandatory. Enter the SK again. The system anonymizes the entered content.
     Region: //Optional. Enter a region.

    After the configuration is complete, the system displays a message indicating that the initial configuration is successful.

Generating and Executing CLI Commands

KooCLI supports two methods for generating commands:

  • (Recommended) For quick and easy generation of CLI commands to call APIs, use API Explorer.
  • Use CLI commands to query the operation commands and related parameters of APIs, and then manually combine the CLI commands to call the APIs. For details, see Step 4: View and Run Cloud Service Operation Commands.

    The following uses the API for creating a DWS cluster as an example to describe how to generate CLI commands from API Explorer and run the CLI commands to call the API.

    1. In API Explorer, select Data Warehouse Service and choose Cluster Management APIs > CreateCluster in the API list.
    2. On the parameter configuration page in the middle, set the parameters required for calling the API.
    3. In the right pane, click the CLI Example tab to view the generated CLI commands.

      The following is an example of the CLI commands for the API for creating a cluster:

      hcloud DWS CreateCluster --cli-region="cn-north-4" --project_id="0f4bca096d80f3212f31c002eab9931d" --cluster.node_type="dwsx2.xlarge.m7" --cluster.number_of_node=3 --cluster.vpc_id="1f785f19-4dad-4995-b6bf-799f3f0e2580" --cluster.port=8000 --cluster.user_name="dbadmin" --cluster.name="dws-demo" --cluster.subnet_id="c6386f44-0ea8-41ec-a569-ba96d807fc9a" --cluster.user_pwd="xxxxxxxx" --cluster.tags.value="value01" --cluster.tags.key="key01"
    4. Copy the generated CLI commands and paste them to the CLI for execution.

      The following is an example of the CLI command output for the API for creating a cluster:

      {
        "cluster" : {
          "id" : "7d85f602-a948-4a30-afd4-e84f47471c15"
        }
      }