All Products
Search
Document Center

Enterprise Distributed Application Service:InsertApplication

Last Updated:Jan 08, 2024

Creates an application in an Elastic Compute Service (ECS) cluster.

Operation description

Note To create an application in a Kubernetes cluster, call the InsertK8sApplication operation provided by Enterprise Distributed Application Service (EDAS).

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Debug

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.
OperationAccess levelResource typeCondition keyAssociated operation
edas:CreateApplicationWrite
  • NameSpace
    acs:edas:{#regionId}:{#accountId}:namespace/{#NameSpaceId}
    none
none

Request syntax

POST /pop/v5/changeorder/co_create_app

Request parameters

ParameterTypeRequiredDescriptionExample
ClusterIdstringNo

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
BuildPackIdintegerNo

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
DescriptionstringNo

The description of the application.

create by edas pop api
ApplicationNamestringYes

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
ReservedPortStrstringNo

The reserved port for the application. **This parameter is deprecated.**

8090
EcuInfostringNo

The value of ecu_id of the ECS instance to be added during scale-out. The ECU ID is the unique identity for an ECS instance that is imported to EDAS. Separate multiple values of ecu_id with commas (,). You can call the ListScaleOutEcu operation to query the value of ecu_id. For more information, see ListScaleOutEcu .

07bd417a-b863-477d-****-************
CpuintegerNo

The number of CPU cores that can be used by the application container in a Swarm cluster. **This parameter is deprecated.**

2
MemintegerNo

The memory size that can be used by the application container in a Swarm cluster. **This parameter is deprecated.**

2048
HealthCheckURLstringNo

The health check URL of the application.

http://127.0.0.1:8080/_ehc.html
LogicalRegionIdstringNo

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 .

  • This parameter is required if the cluster you specify is not deployed in the default microservices namespace. Otherwise, the message application regionId is different with cluster regionId! appears.
  • If the cluster you specify is deployed in the default microservices namespace, you do not need to specify this parameter. Set this parameter to the ID of the microservices namespace in which the cluster you specify is deployed.
cn-beijing:prod
JdkstringNo

The version of the Java Development Kit (JDK) used to deploy the application. **This parameter is deprecated.

8
WebContainerstringNo

The version of Apache Tomcat. **This parameter is deprecated.

4
PackageTypestringNo

The type of the application deployment package. Valid values: war and jar.

war
ComponentIdsstringNo

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:

  • 4: Apache Tomcat 7.0.91
  • 7: Apache Tomcat 8.5.42
  • 5: OpenJDK 1.8.x
  • 6: OpenJDK 1.7.x

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
HooksstringNo

The script to mount. Set the value in the JSON format. Example: [{"ignoreFail":false,"name":"postprepareInstanceEnvironmentOnScaleOut","script":"ls"},{"ignoreFail":true,"name":"postdeleteInstanceDataOnScaleIn","script":""},{"ignoreFail":true,"name":"prestartInstance","script":""},{"ignoreFail":true,"name":"poststartInstance","script":""},{"ignoreFail":true,"name":"prestopInstance","script":""},{"ignoreFail":true,"name":"poststopInstance","script":""}]

[{"ignoreFail":false,"name":"postprepareInstanceEnvironmentOnScaleOut","script":"ls"}]
JvmOptionsstringNo

The custom parameters.

-Dproperty=value
MinHeapSizeintegerNo

The initial size of the heap memory. Unit: MB.

500
MaxPermSizeintegerNo

The size of the permanent generation heap memory. Unit: MB.

200
MaxHeapSizeintegerNo

The maximum size of the heap memory. Unit: MB.

1000
EnableUrlCheckbooleanNo

Specifies whether to enable the URL health check. Valid values:

  • true: enables the URL health check.
  • false: does not enable the URL health check.
true
EnablePortCheckbooleanNo

Specifies whether to enable the port health check. Valid values:

  • true: enable the port health check.
  • false: does not enable the port health check.
true
HealthCheckUrlstringNo

The health check URL of the application. This parameter is equivalent to the HealthCheckURL parameter.

http://127.0.0.1:8080/_ehc.html
ResourceGroupIdstringNo

The ID of the resource group.

rg-aek24j4s4b*****

Response parameters

ParameterTypeDescriptionExample
object
Codeinteger

The HTTP status code that is returned.

200
Messagestring

The message that is returned.

The application name test-hsy-C5039-paas-6 had been created successfully.
RequestIdstring

The ID of the request.

4264F69C-686C-4107-B493-0599C8xxxxxx
ApplicationInfoobject

The information about the created application.

ChangeOrderIdstring

The ID of the change process.

d0cf569e-dce3-4efb-****-08b70021****
AppNamestring

The name of the application.

hello-edas-test-1
Ownerstring

The owner of the application. The owner is the user who created the application.

249763358688********
Dockerizeboolean

Indicates whether the application is a Docker application. Valid values:

  • true: The application is a Docker application.
  • false: The application is not a Docker application.
false
RegionNamestring

The name of the region.

cn-hangzhou
AppIdstring

The ID of the application. The ID is the unique identifier of the application in EDAS.

6c733bcd-6efb-47a1-8226-cf722c******
UserIdstring

The ID of the user who created the application.

tdy218@1362469756xxxxxx
Portinteger

The port used by the created application. Default value: 8080. You can call the UpdateContainerConfiguration operation to change the port. For more information, see UpdateContainerConfiguration .

8080

Examples

Sample success responses

JSONformat

{
  "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 timeSummary of changesOperation
No change history

Common application parameters

  1. 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. 
    
  2. 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. 
    
  3. 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.