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

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. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses only the common request header. For more information, see Common request parameters.

Request syntax

POST /pop/v5/changeorder/co_create_app HTTP/1.1

Request parameters

Parameter Type Position Required Example Description
ApplicationName String Query Yes hello-edas-test-1

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.

ClusterId String Query No 13136119-f384-4f50-b76e-xxxxxxxxxxx

The ID of the ECS cluster in which you want to create the application. If you leave this parameter empty, the application is created in the default cluster. We recommend that you specify this parameter.

BuildPackId Integer Query No 59

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:

Description String Query No create by edas pop api

The description of the application.

ReservedPortStr String Query No 8090

The reserved port for the application. This parameter is obsolete.

EcuInfo String Query No 07bd417a-b863-477d-****-************

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.

Cpu Integer Query No 2

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

Mem Integer Query No 2048

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

HealthCheckURL String Query No http://127.0.0.1:8080/_ehc.html

The health check URL of the application.

LogicalRegionId String Query No cn-beijing:prod

The ID of the namespace. To query the ID of a namespace, you can choose Application Management > 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 namespace. Otherwise, the message "application regionId is different with cluster regionId!" appears.
  • You can leave this parameter empty if the cluster you specify is deployed in the default namespace. Set the value to the ID of the namespace where the cluster you specify is deployed.
Jdk String Query No 8

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

WebContainer String Query No 4

The version of Apache Tomcat. This parameter is obsolete.

PackageType String Query No war

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

ComponentIds String Query No 7

The ID of the application component. You can call the ListComponents operation to query the component ID. 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 SDK for Java 2.57.3 or later, or SDK for Python 2.57.3 or later. Assume that you use an SDK that is not provided by EDAS, such as aliyun-python-sdk-core, aliyun-java-sdk-core, or Alibaba Cloud CLI. In this case, you can directly specify this parameter. </note>

Hooks String Query No [{"ignoreFail":false,"name":"postprepareInstanceEnvironmentOnScaleOut","script":"ls"}]

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":""}]
JvmOptions String Query No -Dproperty=value

The custom parameters.

MinHeapSize Integer Query No 500

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

MaxPermSize Integer Query No 200

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

MaxHeapSize Integer Query No 1000

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

EnableUrlCheck Boolean Query No true

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

  • true: enables the URL health check.
  • false: disables the URL health check.
EnablePortCheck Boolean Query No true

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

  • true: enables the port health check.
  • false: disables the port health check.
HealthCheckUrl String Query No http://127.0.0.1:8080/_ehc.html

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

Response parameters

Parameter Type Example Description
ApplicationInfo Struct

The returned data about the created application.

AppId String 6c733bcd-6efb-47a1-8226-cf722c******

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

AppName String hello-edas-test-1

The name of the application.

ChangeOrderId String d0cf569e-dce3-4efb-****-08b70021****

The ID of the change process.

Dockerize Boolean false

Indicates whether the application runs in a Docker container. Valid values:

  • true: The application runs in a Docker container.
  • false: The application does not run in a Docker container.
Owner String 249763358688********

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

Port Integer 8080

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.

RegionName String cn-hangzhou

The name of the region.

UserId String tdy218@1362469756xxxxxx

The ID of the user who created the application.

Code Integer 200

The HTTP status code.

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

The returned message that indicates whether the request is successful.

RequestId String 4264F69C-686C-4107-B493-0599C8xxxxxx

The ID of the request.

Examples

Sample requests

POST /pop/v5/changeorder/co_create_app HTTP/1.1
Common request header
{
"ApplicationName": "hello-edas-test-1"
}

Sample success responses

XML format

<RequestId>4264F69C-686C-4107-B493-0599C8xxxxxx</RequestId>
<Message>The application name test-hsy-C5039-paas-6 had been created successfully.</Message>
<ApplicationInfo>
    <Dockerize>false</Dockerize>
    <Owner>249763358688********</Owner>
    <AppId>6c733bcd-6efb-47a1-8226-cf722c******</AppId>
    <RegionName>cn-hangzhou</RegionName>
    <UserId>tdy218@1362469756xxxxxx</UserId>
    <Port>8080</Port>
    <ChangeOrderId>d0cf569e-dce3-4efb-****-08b70021****</ChangeOrderId>
    <AppName>hello-edas-test-1</AppName>
</ApplicationInfo>
<Code>200</Code>

JSON format

{
    "RequestId": "4264F69C-686C-4107-B493-0599C8xxxxxx",
    "Message": "The application name test-hsy-C5039-paas-6 had been created successfully.",
    "ApplicationInfo": {
        "Dockerize": false,
        "Owner": "249763358688********",
        "AppId": "6c733bcd-6efb-47a1-8226-cf722c******",
        "RegionName": "cn-hangzhou",
        "UserId": "tdy218@1362469756xxxxxx",
        "Port": 8080,
        "ChangeOrderId": "d0cf569e-dce3-4efb-****-08b70021****",
        "AppName": "hello-edas-test-1"
    },
    "Code": 200
}

Error codes

For a list of error codes, visit the API Error Center.

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.