GenerateCLICommand

Updated at:

Dynamically generates an Alibaba Cloud CLI command.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST /api/cli/makeCode HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

product

string

Yes

The product code.

  • Call the GetRequestLog operation to obtain the product code from the response.

  • Find the product code from the URL of the OpenAPI portal. For example, the OpenAPI portal URL for Short Message Service is https://api.aliyun.com/product/Dysmsapi. Based on this URL, the product code for Short Message Service is Dysmsapi.

Ecs

apiVersion

string

Yes

The API version.

2014-05-26

api

string

Yes

The API name.

DescribeRegions

regionId

string

No

The region ID.

cn-hangzhou

apiParams deprecated

object

No

The request parameters.

any

No

The request parameters.

{ "InstanceChargeType": "PostPaid", "ResourceType": "instance", "AcceptLanguage": "en-US" }

jsonApiParams

string

No

The API input parameters in JSON format. This parameter has a lower priority than apiParams. If apiParams is specified, this parameter does not take effect.

{ "InstanceChargeType": "PostPaid", "ResourceType": "instance", "AcceptLanguage": "en-US" }

aggregatePagination

boolean

No

Specifies whether to enable the aggregation feature. If enabled, the CLI automatically reads full data in a paged manner and aggregates the results.

Warning This option can be used only for List-type operations that support pagination.
  • true: enabled.

  • false: disabled.

true

Response elements

Element

Type

Description

Example

object

The request result.

cli

string

The CLI command.

aliyun ecs DescribeRegions --ResourceType instance

requestId

string

The request ID.

A707AFA8-1A4C-5B2A-A165-8436C1EA38DB

unifiedCli

string

The command in unified CLI format.

aliyun ecs describe-regions --region cn-hangzhou

Examples

Success response

JSON format

{
  "cli": "aliyun ecs DescribeRegions --ResourceType instance",
  "requestId": "A707AFA8-1A4C-5B2A-A165-8436C1EA38DB",
  "unifiedCli": "aliyun ecs describe-regions --region cn-hangzhou"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParam.Product Product name is required and cannot be null or empty.
400 InvalidParam.ApiVersion API version is required and cannot be null or empty.
400 InvalidParam.ApiName API name is required and cannot be null or empty.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.