Use Alibaba Cloud CLI to call Enterprise Distributed Application Service (EDAS) API operations and manage resources such as namespaces, regions, and clusters from the command line, without writing SDK code.
Before you begin
Install Alibaba Cloud CLI on your operating system:
Configure credentials, region, and language settings. For details, see Configure Alibaba Cloud CLI.
Command structure
All EDAS CLI commands follow this pattern:
aliyun edas <ApiAction> [--<ParamName> <value>]Component | Description |
| The base CLI program |
| The target product (EDAS) |
| The API operation to call, such as |
| One or more request parameters required by the operation |
Some operations also require the --region and --endpoint parameters to specify the target region and service endpoint.
Find available operations
List all EDAS API operations available through the CLI:
aliyun edas --helpView the parameters and usage of a specific operation:
aliyun edas <ApiAction> --helpFor example:
aliyun edas InsertOrUpdateRegion --helpTo explore and test operations interactively, use OpenAPI Explorer.
Examples
Before you use Alibaba Cloud CLI to call the EDAS API, you must know the EDAS API operations and the information about each API operation, such as request parameters and response parameters. For details on calling RPC and RESTful API operations, see Call RPC API and RESTful API.
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 format overview.
Create a namespace
aliyun edas InsertOrUpdateRegion \
--RegionTag cn-beijing:testheng \
--RegionName testheng \
--region cn-beijing \
--endpoint "edas.cn-beijing.aliyuncs.com"Parameter | Description |
| The unique identifier for the namespace, in the format |
| The display name of the namespace |
| The Alibaba Cloud region where the namespace is created |
| The EDAS service endpoint for the region |
Query regions
This operation takes no parameters and returns all available regions for EDAS.
Delete a cluster from a namespace
aliyun edas DeleteCluster \
--ClusterId f8b3014e-0f61-493a-a602-6f9b63ba**** \
--logicalRegionId cn-beijing:docNamespace3Parameter | Description |
| The ID of the cluster to delete |
| The namespace identifier that contains the cluster |
Replace f8b3014e-0f61-493a-a602-6f9b63ba**** with your actual cluster ID.
Automate with shell scripts
When you use Alibaba Cloud CLI to call an API operation to perform a complex task, we recommend that you compile the command text into a shell script and then run the shell script to improve efficiency. For example:
#!/bin/bash
# Create a namespace and verify the result
# Step 1: Create the namespace
aliyun edas InsertOrUpdateRegion \
--RegionTag cn-beijing:<your-namespace-id> \
--RegionName <your-namespace-name> \
--region cn-beijing \
--endpoint "edas.cn-beijing.aliyuncs.com"
# Step 2: Verify that the namespace was created
aliyun edas ListAliyunRegionReplace the following placeholders with your actual values:
Placeholder | Description | Example |
| The namespace identifier | mynamespace |
| The display name for the namespace | mynamespace |
The examples in this topic use Bash syntax. If you use PowerShell or Command Prompt on Windows, adjust the line continuation characters accordingly (\ in Bash, ` `` in PowerShell).