Creates an application in an Elastic Compute Service (ECS) cluster.
Operation description
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
edas:CreateApplication |
|
| none |
Request syntax
POST /pop/v5/changeorder/co_create_app HTTP/1.1
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ClusterId | string | No | The ID of the ECS cluster in which you want to create the application. If you specify an ID, the application is created in the specified ECS cluster. If you leave this parameter empty, the application is created in the default cluster. We recommend that you specify this parameter. | 13136119-f384-4f50-b76e-xxxxxxxxxxx |
BuildPackId | integer | No | The build package number of EDAS Container. This parameter is required if you create a High-Speed Service Framework (HSF) application. You can query the build package number by using one of the following methods:
| 59 |
Description | string | No | The description of the application. | create by edas pop api |
ApplicationName | string | Yes | The name of the application. The name can contain only digits, letters, hyphens (-), and underscores (_) and must start with a letter. The name can be up to 36 characters in length. | hello-edas-test-1 |
ReservedPortStr | string | No | The reserved port for the application. This parameter is deprecated. | 8090 |
EcuInfo | string | No | The value of | 07bd417a-b863-477d-****-************ |
Cpu | integer | No | The number of CPU cores that can be used by the application container in a Swarm cluster. **This parameter is deprecated.** | 2 |
Mem | integer | No | The memory size that can be used by the application container in a Swarm cluster. **This parameter is deprecated.** | 2048 |
HealthCheckURL | string | No | The health check URL of the application. | http://127.0.0.1:8080/_ehc.html |
LogicalRegionId | string | No | The ID of the microservices namespace. To query the ID of a microservices namespace, you can choose Resource Management > Microservice Namespaces in the left-side navigation pane of the EDAS console or call the ListUserDefineRegion operation. For more information, see ListUserDefineRegion .
| cn-beijing:prod |
Jdk | string | No | The version of the Java Development Kit (JDK) used to deploy the application. **This parameter is deprecated. | 8 |
WebContainer | string | No | The version of Apache Tomcat. **This parameter is deprecated. | 4 |
PackageType | string | No | The type of the application deployment package. Valid values: war and jar. | war |
ComponentIds | string | No | The ID of the application component. You can call the ListComponents operation to query the component IDs. For more information, see ListComponents . This parameter is required if the application runs in Apache Tomcat or in a standard Java application runtime environment. The Apache Tomcat application runtime environment is applicable to Dubbo applications that are deployed by using WAR packages. A standard Java application runtime environment is applicable to Spring Boot or Spring Cloud applications that are deployed by using JAR packages. Valid values for common application components:
This parameter is available only for Java SDK 2.57.3 or later, or Python SDK 2.57.3 or later. Assume that you use an SDK that is not provided by EDAS, for example, aliyun-python-sdk-core, aliyun-java-sdk-core, and Alibaba Cloud CLI. In this case, you can directly specify this parameter. | 7 |
Hooks | string | No | The script to mount. Set the value in the JSON format. Example: | [{"ignoreFail":false,"name":"postprepareInstanceEnvironmentOnScaleOut","script":"ls"}] |
JvmOptions | string | No | The custom parameters. | -Dproperty=value |
MinHeapSize | integer | No | The initial size of the heap memory. Unit: MB. | 500 |
MaxPermSize | integer | No | The size of the permanent generation heap memory. Unit: MB. | 200 |
MaxHeapSize | integer | No | The maximum size of the heap memory. Unit: MB. | 1000 |
EnableUrlCheck | boolean | No | Specifies whether to enable the URL health check. Valid values:
| true |
EnablePortCheck | boolean | No | Specifies whether to enable the port health check. Valid values:
| true |
HealthCheckUrl | string | No | The health check URL of the application. This parameter is equivalent to the HealthCheckURL parameter. | http://127.0.0.1:8080/_ehc.html |
ResourceGroupId | string | No | The ID of the resource group. | rg-aek24j4s4b***** |
Response parameters
Examples
Sample success responses
JSON
format
{
"Code": 200,
"Message": "The application name test-hsy-C5039-paas-6 had been created successfully.",
"RequestId": "4264F69C-686C-4107-B493-0599C8xxxxxx",
"ApplicationInfo": {
"ChangeOrderId": "d0cf569e-dce3-4efb-****-08b70021****",
"AppName": "hello-edas-test-1",
"Owner": "249763358688********",
"Dockerize": false,
"RegionName": "cn-hangzhou",
"AppId": "6c733bcd-6efb-47a1-8226-cf722c******",
"UserId": "tdy218@1362469756xxxxxx",
"Port": 8080
}
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|
Common application parameters
-
Assume that you use EDAS SDK for Java to create a native Dubbo or Java web application that runs in Apache Tomcat. In this case, you can use the following common parameters:
InsertApplicationRequest request = new InsertApplicationRequest(); request.setApplicationName("hello-edas-test-1"); // The name of the application. request.setPackageType("war"); // The type of the application deployment package. This parameter is optional. request.setComponentIds("7"); // The application component. Set the value to 7 or 4. 7 indicates Apache Tomcat 8.5.42 and 4 indicates Apache Tomcat 7.0.91. request.setLogicalRegionId("cn-hangzhou:prod"); // The ID of the namespace. Take note that this parameter does not specify the name of the namespace. This parameter is required if the cluster you specify is not deployed in the default namespace. request.setClusterId("ebc364ca-1875-4266-ae1f-ad0e7c179417"); // The ID of the ECS cluster in which the application is to be created.
-
Assume that you use EDAS SDK for Java to create a native Spring Boot or Spring Cloud application that runs in a standard Java application runtime environment. A Fat JAR package is used to create the application. In this case, you can use the following common parameters:
InsertApplicationRequest request = new InsertApplicationRequest(); request.setApplicationName("hello-edas-test-2"); // The name of the application. request.setPackageType("jar"); // The type of the application deployment package. This parameter is optional. request.setComponentIds("5"); // The application component. Set the value to 5 or 6. 5 indicates OpenJDK 1.8.0 and 6 indicates OpenJDK 1.8.0. If you leave this parameter empty, OpenJDK 1.8.0 is used. request.setLogicalRegionId("cn-hangzhou:prod"); // The ID of the namespace. Take note that this parameter does not specify the name of the namespace. This parameter is required if the cluster you specify is not deployed in the default namespace. request.setClusterId("ebc364ca-1875-4266-ae1f-ad0e7c179417"); // The ID of the ECS cluster in which the application is to be created.
-
Assume that you use EDAS SDK for Java to create an HSF application that runs in EDAS Container. In this case, you can use the following common parameters:
InsertApplicationRequest request = new InsertApplicationRequest(); request.setBuildPackId(59); // The build package number of EDAS Container. The value 59 indicates that edas-container 3.5.8 is used. request.setApplicationName("hello-edas-test-3"); // The name of the application. request.setPackageType("war"); // The type of the application deployment package. Valid values: war and jar. This parameter is optional. request.setLogicalRegionId("cn-hangzhou:prod"); // The ID of the namespace. Take note that this parameter does not specify the name of the namespace. This parameter is required if the cluster you specify is not deployed in the default namespace. request.setClusterId("ebc364ca-1875-4266-ae1f-ad0e7c179417"); // The ID of the ECS cluster in which the application is to be created.