Advanced
Тема интерфейса

Option Overview

Cloud CLI options are system parameters that can be added to commands for calling APIs. The following table describes the options supported by Cloud CLI. Any option except help, debug, dryrun, cli-username, cli-password, cli-domain, cli-output, cli-query, cli-output-num, cli-jsonInput, and cli-endpoint can be set in profiles. When a command is executed, the value of a parameter in the command takes precedence over that in the profile.

Table 1 Cloud CLI options

Option

Description

Example

Prints help information.

cloud RDS ListCollations --cli-region="ru-moscow-1" --help

Prints debugging information during command invocation. For example, the steps of API calling and the complete request URL.

cloud VPC ShowVpc/v3 --cli-region="ru-moscow-1" --project_id="0dd8cb****************19b5a84546" --vpc_id="0bbe****-****-****-****-****235be6e7" --debug

Checks a command. The system prints the request message after verification. It does not call the target API.

cloud RDS CreateConfiguration --cli-region="ru-moscow-1" --project_id="4ff018c******************df31948" --datastore.type="MySQL" --datastore.version="5.7" --values.max_connections="10" --name="test-001" --description="test create configuration" --dryrun

Region where the cloud service resources to be managed are located.

cloud EVS DeleteVolume --cli-region="ru-moscow-1" --volume_id="aed9****-****-****-****-****0e3219cf" --project_id="0dd8cb****************19b5a84546"
  • cli-username: IAM user name
  • cli-password: IAM user password
  • cli-domain: the name of the account to which the IAM user belongs

These options are used to call cloud service APIs using an account in non-configuration mode.

cloud EVS UpdateVolume --cli-region="ru-moscow-1" --volume_id="aed9****-****-****-****-****0e3219cf" --project_id="0dd8cb****************19b5a84546" --volume.name="ecs-abcd" --volume.description="volume test" --cli-username=s******1 --cli-password=****** --cli-domain=s******1
  • cli-access-key: access key ID (AK). This parameter must be used together with SK.
  • cli-secret-key: secret access key (SK). This parameter must be used together with AK.
  • cli-security-token: temporary security credential. This parameter is required when you use a temporary AK/SK for identity authentication.

These options are used to call cloud service APIs using an AK/SK in non-configuration mode.

Call cloud service APIs using an AK/SK in non-configuration mode.

  • Use an access key (permanent AK/SK):
    cloud RDS ListApiVersion --cli-region="ru-moscow-1" --cli-access-key=8NVT************KIOV --cli-secret-key=VHMQjoC**************************lsk3cGf
  • Use temporary security credentials (temporary AK/SK and SecurityToken):
    cloud RDS ListApiVersion --cli-region="ru-moscow-1" --cli-access-key=5FSU************607T --cli-secret-key=VoyjgLh**************************qRc8pSq --cli-security-token=******

The access token issued to an IAM user. This option is used to call cloud service APIs using a token in non-configuration mode.

cloud ECS ListServersDetails --cli-region="ru-moscow-1" --project_id="2cc60f5****************efa5019ef" --enterprise_project_id="441d5677-****-****-****-ef7fd6336666" --cli-x-auth-token=******
  • cli-agency-domain-name: Account name of a delegating party. This parameter must be used together with cli-agency-name.

    cli-agency-domain-id: Account ID of the delegating party. This parameter must be used together with cli-agency-name.

  • cli-agency-name: Agency name. It must be used together with cli-agency-domain-id or cli-agency-domain-name.
  • cli-source-profile: The profile that stores the authentication information of the delegated party. The value of this option cannot be the current profile.

These options are used to call cloud service APIs using an agency in non-configuration mode.

cloud VPC ListAddressGroup/v3 --cli-region="ru-moscow-1" --project_id="2cc60****************caefa5019ef" --cli-agency-domain-id=13534326******************5cf67b --cli-agency-name=****** --cli-source-profile=test

ID of the account to which the IAM user belongs. This option is required when global service APIs are called in AK/SK authentication mode. In this case, Cloud CLI automatically obtains this parameter from your authentication information.

cloud CDN ListDomains --cli-region="ru-moscow-1" --cli-domain-id="08e09a6e******************1bb800"

Name of a Cloud CLI profile. A profile stores a group of common information (such as the AK/SK, region, and project ID) required for calling cloud service APIs.

cloud EVS ListSnapshots --cli-profile=test

Authentication mode of a profile. Options:

  • AKSK
  • token
  • ecsAgency
  • agency

If a profile contains different authentication parameters (such as AK/SK and token), the mode specified by cli-mode is used. Use --cli-mode in a command to specify the authentication mode for a profile.

  • Set cli-mode to AKSK.
    cloud CCE ListNodes --cluster_id="f288****-****-****-****-****ac101534" --project_id="0dd8cb****************19b5a84546" --cli-profile=test --cli-mode=AKSK
  • Set cli-mode to token.
    cloud CCE ListNodes --cluster_id="f288****-****-****-****-****ac101534" --project_id="0dd8cb****************19b5a84546" --cli-profile=test --cli-mode=token
  • Set cli-mode to ecsAgency.
    cloud CCE ListNodes --cluster_id="f288****-****-****-****-****ac101534" --project_id="0dd8cb****************19b5a84546" --cli-profile=test --cli-mode=ecsAgency

Output format.

  • cli-output

    Output format of the response data. The options include:

    • json
    • table
    • tsv

  • cli-query

    JMESPath for filtering response data.

  • cli-output-num

    Indicates whether to print the row numbers during table output. The value can be true or false.

  • When the value of cli-output is json:
    • Call a cloud service API
      cloud CCE ListClusters --cli-region="ru-moscow-1" --type="VirtualMachine" --project_id="0dd8cb****************19b5a84546" --cli-query="items[0]"
    • Call a CLI system command
      cloud configure list --cli-output=json --cli-query="profiles[].{Name:name,Mode:mode,Ak:accessKeyId,SK:secretAccessKey}"
  • When the value of cli-output is table:
    cloud configure list --cli-output=table --cli-query="profiles[].{Name:name,Mode:mode,Ak:accessKeyId,SK:secretAccessKey}"
  • When the value of cli-output is tsv:
    cloud configure list --cli-output=tsv --cli-query="profiles[].{Name:name,Mode:mode,Ak:accessKeyId,SK:secretAccessKey}"

Specifies a JSON file to pass API parameters. If a cloud service API has too many parameters, you can define the parameters in a JSON file. Cloud CLI then parses the parameters in the file.

cloud ECS CreateServers --cli-region="ru-moscow-1" --cli-read-timeout=60 --cli-jsonInput=C:\cli\Ecs_CreateServers.json

Request timeouts.

  • cli-connect-timeout: request connection timeout, in seconds. The default value is 5, and the minimum value is 1.
  • cli-read-timeout: I/O timeout, in seconds. The default value is 10, and the minimum value is 1.
cloud ECS DeleteServerPassword --cli-region="ru-moscow-1" --project_id="2cc60f5****************efa5019ef" --server_id="e6b99563-****-****-****-1820d4fd2a67" --cli-connect-timeout=10 --cli-read-timeout=15

Number of connection attempts. The system retries automatically if the connection times out. The value ranges from 0 to 5, and the default value is 0.

cloud RDS ListInstances --cli-region="ru-moscow-1" --Content-Type="application/json" --project_id="2cc60****************caefa5019ef" --cli-retry-count=3

Specifies whether to skip HTTPS certificate verification (not recommended). The value can be true or false. The default value is false. Skipping certificate verification has security risks. If you set this parameter to true, Cloud CLI will display a message asking for your confirmation.

cloud ECS NovaListServers --cli-region="ru-moscow-1" --project_id="2cc6****************6caefa5019ef" --cli-skip-secure-verify=true

Custom domain name.

By default, requests are sent to the target cloud service in the relevant region. You can also specify an endpoint of this cloud service.

cloud IoTDA UpdateDevice --cli-region="ru-moscow-1" --description="test update device" --device_id="testz*********************0802" --cli-endpoint="iot-mqtts.ru-moscow-1.hc.sbercloud.ru"