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 HTTPS|HTTP

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 digits, letters, hyphens (-), and underscores (_). It can be up to 36 characters in length.

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

The ID of the 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 value by calling the ListBuildPack operation or from the release notes of EDAS Container. For more information, see Build package number in EDAS-Container release notes.

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 ID of the Elastic Compute Unit (ECU) that corresponds to the ECS instance. After an ECS instance is imported to an ECS cluster in EDAS, the ECS instance runs as an ECU that is uniquely identified by an ECU ID. Separate ECU IDs with commas (,). To query ECU IDs, call the ListScaleOutEcu operation.

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. You can obtain the namespace ID in the EDAS console. In the left-side navigation pane, choose Resource Management > Microservice Namespaces to obtain the ID of the namespace where the cluster you specify is deployed. You can also call the ListUserDefineRegion operation to query namespace IDs.

Note
  • 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 application components. 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
Note 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.
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

A list of 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, which 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. This indicates 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.

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 response message.

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 parameters
{
"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 Java SDK provided by EDAS 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 ID of the application component. Valid values: 7 and 4. The value 7 specifies Apache Tomcat 8.5.42. The value 4 specifies Apache Tomcat 7.0.91.
    request.setLogicalRegionId("cn-hangzhou:prod"); //The ID of the namespace. Take note of this point: This parameter does not indicate 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 Java SDK provided by EDAS to create a native Spring Boot or Spring Cloud application that runs in a standard Java application runtime environment. A Fat JAR 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 ID of the application component. Valid values: 5 and 6. The value 5 specifies OpenJDK 1.8.0. The value 6 specifies OpenJDK 1.8.0. If you leave this parameter empty, OpenJDK 1.8.0 is used by default.
    request.setLogicalRegionId("cn-hangzhou:prod"); //The ID of the namespace. Take note of this point: This parameter does not indicate 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 Java SDK provided by EDAS 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 specifies 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 of this point: This parameter does not indicate 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.