Updated on 2026-09-01 GMT+08:00

Using KooCLI

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

Installing KooCLI

Before you begin, you will need to install KooCLI. KooCLI supports three operating systems: Windows, Linux, and macOS. Install the corresponding version of the tool based on the operating system of your host.

Initializing KooCLI Configuration

When KooCLI is used to call APIs, the caller's identity information needs to be obtained for authentication. By configuring KooCLI initialization, you can store permanent AK/SK information in the configuration file. In this way, you do not need to frequently enter this information when calling APIs.

Skip this step if you intend to pass authentication information 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 will anonymize the input.
    Secret Access Key (again):      // Mandatory. Enter the SK again. The system will anonymize the input.
    Region:      // Optional. Enter a region.

    The message "Initialization successful" is then displayed.

Generating and Executing a CLI Command

KooCLI supports two methods for generating commands:

  • Use API Explorer to quickly generate and obtain the CLI command for calling an API. This method is recommended as it is more convenient.
  • 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 UCS API for activating a cluster as an example to describe how to generate a CLI command from API Explorer and then run the CLI command to call the API.

  1. On the API Explorer page of the UCS service, select the API for which you want to generate a CLI command.
  2. On the parameter configuration page in the middle, configure the parameters required for calling the API.
  3. In the right pane, click the CLI Example tab and view the generated CLI command.

    The following is an example of the CLI command for calling the API that is used to activate a cluster:

    hcloud UCS RetryClusterActivation --cli-region="******"
  4. Copy the generated CLI command and paste it into the CLI for execution.

    The following shows the execution output of the CLI command for calling the API that is used to activate a cluster:

    {
      "clusterId" : "58e4dc3f-2117-11f1-885a-0255ac1001bd",
      "message" : "The cluster is being reactivated."
    }