Help Center> Koo Command Line Interface> FAQs> Parameters> Why Are Old and New KooCLI System Parameters (Such as region and cli-region) Available? Which Parameters Are Recommended?
Updated on 2023-10-16 GMT+08:00

Why Are Old and New KooCLI System Parameters (Such as region and cli-region) Available? Which Parameters Are Recommended?

Background

Among the KooCLI system parameters, some have two forms, for example, --region and --cli-region. The parameters without the prefix cli- are old system parameters. Those with the prefix cli- are new system parameters. This happens because some parameters of cloud service APIs may have the same names as old system parameters. Two parameters with the same name in a command may be used for different purposes. That is, one is used as a parameter of the target API, and the other is used as a system parameter. When checking the validity of parameters, the following error message may be displayed:

[USE_ERROR] Duplicate *. Change the key of the KooCLI system parameter to cli-*.

In addition, if the cloud service API contains a parameter (or a custom one) with the same name as an old system parameter, KooCLI cannot determine the function if the API parameter appears in a command. Therefore, when parsing the command, the CLI confirms the actual function of the parameter with you through interactive information to prevent errors. Example:

  • The target API contains a parameter with the same name as the KooCLI system parameter %s (unknown location %s). Confirm whether this parameter is a KooCLI system parameter (a), a target API parameter (b), or both (c):
  • You can define a parameter for the target API using the same name as the KooCLI system parameter %s (unknown location %s). Confirm whether this parameter is a KooCLI system parameter (a), a target API parameter (b), or both (c):

When you construct KooCLI commands, use the new system parameters to prevent errors or interactions caused by parameter conflicts.

The new system parameters have been added to the new parameter list. The old system parameters can still be used but will not be upgraded.

Old System Parameters

The following table describes KooCLI's old system parameters and the corresponding new system parameters.

Table 1 KooCLI's old system parameters

Old Parameter

Description

New Parameter

region

Region.

cli-region

access-key

Access key ID required in AK/SK mode.

cli-access-key

secret-key

Secret access key required in AK/SK mode.

cli-secret-key

domain-id

Account ID

cli-domain-id

project-id

Project ID.

cli-project-id

profile

Profile.

cli-profile

mode

Authentication mode (AKSK or ecsAgency).

cli-mode

jsonInput

Passes API parameters using a JSON file.

cli-jsonInput

output-cols

Specifies the fields to print during table output.

cli-output-cols

output-rows

Specifies the levels to print during table output.

cli-output-rows

output-num

Whether to print the row numbers during table output. The value can be true (default) or false.

cli-output-num

json-filter

Performs a JMESPath query on the output JSON result.

cli-json-filter

connect-timeout

Request connection timeout, in seconds. The default value is 5s, and the minimum value is 1s.

cli-connect-timeout

read-timeout

I/O timeout, in seconds. The default value is 10s, and the minimum value is 1s.

cli-read-timeout

retry-count

Specifies the number of connection attempts. The value ranges from 0 to 5. The default value is 0.

cli-retry-count

security-token

Specifies a temporary token, which must be used together with a temporary AK/SK.

cli-security-token

lang

Language, which can be cn or en.

cli-lang

Parameters FAQs

more