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

Note To deploy an application in a Container Service for Kubernetes (ACK) cluster that is imported into Enterprise Distributed Application Service (EDAS), call the DeployK8sApplication operation provided by EDAS. For more information, see DeployK8sApplication.

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 common request headers. For more information, see the topic about common request parameters.

Request syntax

POST /pop/v5/changeorder/co_deploy HTTP/1.1

Request parameters

Parameter Type Position Required Example Description
AppId String Query Yes 3616cdca-********************

The ID of the application. You can call the ListApplication operation to query the ID of the application. For more information, see ListApplication.

DeployType String Query Yes URL

The deployment mode of the application. Valid values: url and image. The image value is deprecated. You can deploy an application to a Swarm cluster only by using an image.

GroupId String Query Yes all

The ID of the instance group to which the application is deployed. You can call the ListDeployGroup operation to query the ID of the instance group. For more information, see ListDeployGroup.

Set the parameter to all if you want to deploy the application to all instance groups.

PackageVersion String Query Yes 1.0

The version of the application deployment package. The value can be up to 64 characters in length. We recommend that you use a timestamp.

Desc String Query No Deploy by edas pop api

The description of the application deployment.

WarUrl String Query No https://edas.oss-cn-hangzhou.aliyuncs.com/demo/hello-edas.war

The URL of the application deployment package. The package can be a WAR or JAR package. This parameter is required if you set the DeployType parameter to url. We recommend that you specify the URL of an application deployment package that is stored in an Object Storage Service (OSS) bucket.

ImageUrl String Query No registry.cn-hangzhou.aliyuncs.com/mw/testapp:latest

The URL of the application image that is used to deploy the application in a Swarm cluster. We recommend that you use an image that is stored in Alibaba Cloud Container Registry. This parameter is deprecated.

Batch Integer Query No 1

The number of phases per instance group.

  • If you specify an ID when you set the GroupId parameter, the application is deployed to the specified instance group. The minimum number of phases that can be specified is 1. The maximum number of phases is the maximum number of ECS instances in the Normal state in the instance group. The actual value falls in the range of [1, specified number]. The specified number cannot exceed the number of ECS instances in the specified instance group.
  • If you set the GroupId parameter to all, the application is deployed to all instance groups. The minimum number of phases that can be specified is 1. The maximum number of phases is the number of ECS instances in the instance group that has the largest number of ECS instances in the Normal state.
BatchWaitTime Integer Query No 0

The wait time between deployment phases for the application. Unit: minutes.

  • Default value: 0. If no wait time between deployment phases is needed, set this parameter to 0.
  • Maximum value: 5. If a large number of deployment phases is needed, we recommend that you specify a small value for this parameter. Otherwise, the application deployment is time-consuming.
AppEnv String Query No [{\"name\":\"env_name_1\", \"value\":\"env_value_1\"}, {\"name\":\"env_name_2\",\"value\":\"env_value_2\"}]

The environment variables of the application. Specify each environment variable by using two key-value pairs. Example: {"name":"x","value":"y"},{"name":"x2","value":"y2"}. The keys of the two key-value pairs are name and value.

BuildPackId Long Query No 59

The build package number of EDAS Container.

  • You do not need to set the parameter if you do not need to change the EDAS Container version during the deployment.
  • Set the parameter if you need to update the EDAS Container version of the application during the deployment.

You can query the build package number by using one of the following methods:

ComponentIds String Query No 7

The IDs of the components used by the application. The parameter is not applicable to High-Speed Framework (HSF) applications. You can call the ListComponents operation to query the component IDs. For more information, see ListComponents.

  • If you have specified the component IDs when you create the application, you do not need to set the parameter when you deploy the application.
  • Set the parameter if you need to update the component versions for the application during the deployment.

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

For more information, see the Common application parameters section of the InsertApplication topic.

ReleaseType Long Query No 0

The mode in which the deployment phases are triggered. Valid values:

  • 0: automatic.
  • 1: You must manually trigger the next phase. You can manually click Proceed to Next Batch in the console or call the ContinuePipeline operation to proceed to the next phase. We recommend that you choose the automatic mode when you call an API operation to deploy the application. For more information, see ContinuePipeline.
Gray Boolean Query No true

Specifies whether canary release is selected as the deployment method. Valid values:

  • true: Canary release is selected.
    • To implement a canary release, specify the GroupId parameter, which specifies the ID of the instance group for the canary release.
    • Canary release can be selected as the deployment method for only one phase.
    • After the canary release is complete, the application is released in regular mode. The Batch parameter specifies the number of phases.
  • false: Single-phase release or phased release is selected.
TrafficControlStrategy String Query No null

The canary release policy. For more information about canary release policies, see DeployK8sApplication.

Response parameters

Parameter Type Example Description
ChangeOrderId String adf86823-055b-48a4-a59f-fa5582******

The change process ID of the application deployment.

Code Integer 200

The HTTP status code.

Message String success

The returned message that indicates whether the request is successful.

RequestId String d6834ee9-5045-*************

The ID of the request.

Examples

Sample requests

POST /pop/v5/changeorder/co_deploy HTTP/1.1
Common request headers
{
  "AppId": ""
  "DeployType": ""
  "GroupId": ""
  "PackageVersion": ""
}

Sample success responses

XML format

<Message>success</Message>
<ChangeOrderId>212892bf-7757-4694-b0f0-fdf401xxxxxx</ChangeOrderId>
<Code>200</Code>

JSON format

{
    "Message": "success",
    "ChangeOrderId": "212892bf-7757-4694-b0f0-fdf401xxxxxx",
    "Code": 200
}

Error codes

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