All Products
Search
Document Center

Serverless App Engine:CLI reference

Last Updated:Sep 03, 2024

You can use Alibaba Cloud CLI to call the API operations of Serverless App Engine (SAE) to perform routine management operations.

Install Alibaba Cloud CLI

For more information about how to install Alibaba Cloud CLI, see the following topics:

Configure Alibaba Cloud CLI

For more information about how to configure Alibaba Cloud CLI, see Overview.

Generate a sample CLI command

  1. Go to the SAE API debugging page.

  2. In the left-side search box of the page that appears, search for the operation that you want to call. On the Parameters tab, configure the parameters based on API documentation. You can click the CLI Example tab on the right to view the generated sample CLI command that contains the specified parameters.

    image

    • Click the image icon to start Cloud Shell and debug the command in Cloud Shell.

    • Click the image icon to copy the sample command to the clipboard. You can paste the sample command into your shell tool to run the sample command.

      • Pay attention to the parameter formats when you copy and paste the CLI command to your local shell tool. For more information about the parameter formats of Alibaba Cloud CLI, see Parameter formats.

      • By default, the --region option is added to the sample command that is generated in OpenAPI Explorer. When you copy the command to your local shell tool, Alibaba Cloud CLI ignores the region information in the default credential configurations and environment variable settings, and preferentially runs the command in the specified region. You can delete or retain this option based on your business requirements.

Use Alibaba Cloud CLI to call API operations

For more information about how to use Alibaba Cloud CLI, see Call RPC API and RESTful API. Before you use SAE, you must learn about List of operations by function and the request parameters and response parameters of each SAE API operation.

Note

The parameters of different data types in the API operations must comply with the parameter format requirements of Alibaba Cloud CLI. For more information, see Parameter formats.

The following examples show how to use Alibaba Cloud CLI to call SAE API operations:

  • Create an application

    aliyun sae CreateApplication --AppName test --NamespaceId cn-shenzhen --PackageType=Image --Replicas=2 --ImageUrl=registry-vpc.cn-shenzhen.aliyuncs.com/sae-demo-image/consumer:1.0 --Cpu 1000 --Memory 2048 --Deploy=true
  • Query a list of applications

    aliyun sae ListApplications --region cn-beijing

Usage notes

If you want to perform a complex task by calling API operations in Alibaba Cloud CLI, we recommend that you compile the commands into a shell script and then run the shell script to improve efficiency.

References

OpenAPI