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 APIs of TaurusDB in API Explorer to manage and use your TaurusDB resources. For details about KooCLI, see What Is KooCLI?
Installing KooCLI
Before you begin, you will need to install KooCLI. KooCLI is compatible with Windows, Linux, and macOS. Install the tool of the corresponding version based on the OS used by your machine.
Initializing KooCLI
When KooCLI is used to call APIs, you need to obtain the caller's identity information for authentication. If you initialize KooCLI, your permanent AK/SK is stored in the configuration file, so you do not need to enter the credentials each time you call an API.
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. The steps on Linux and macOS are similar. Before the initialization, obtain the AK/SK information. For details, see Access Keys.
- Open the CLI.
- Run the following command to initialize the configuration:
hcloud configure init
- 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 command generation methods:
- 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 API operations and related parameters, and then manually combine CLI commands to call APIs. For details, see Step 4: View and Run Cloud Service Operation Commands.
The following uses the TaurusDB API for querying version information about a DB engine as an example to describe how to generate a CLI command in API Explorer and then run the CLI command to call the API.
- On the API Explorer page of TaurusDB, select the API for which you want to generate a CLI command.
- In the parameter configuration interface in the middle, enter the parameters required to call the API.
- In the pane on the right, click the CLI Example tab and view the generated CLI command.
The following is an example of the CLI command for calling the API for querying version information about a DB engine.
hcloud GaussDB ShowGaussMySqlEngineVersion --cli-region="af-north-1" --database_name="gaussdb-mysql"
- Copy the generated CLI command and paste it into the CLI for execution.
The following is an example of the CLI command output for calling the API for querying version information about a DB engine.
{ "datastores": [ { "id": "64fce5ee-f59a-3c01-b99a-38c634a1ef45", "name": "8.0", "kernel_version": "2.0.72.251200", "version": "8.0.22" } ] }
What is your overall rating for this page?
Thank 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