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

Note You can call the DeployK8sApplication operation provided by Enterprise Distributed Application Service (EDAS) to deploy an application to a Container Service Kubernetes cluster that is imported to 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 only uses the common request header. For more information, see Common request parameters.

Request syntax

POST /pop/v5/changeorder/co_deploy HTTPS|HTTP

Request parameters

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

The ID of the application that you want to deploy. You can call the ListApplication operation to query the application ID.

DeployType String Query Yes url

The deployment type of the application. Valid values: url and image. The image value is obsolete. Set this parameter to image only when you deploy the application to a Swarm cluster by using an image.

GroupId String Query Yes all

The ID of the instance group where you want to deploy the application. You can call the ListDeployGroup operation to query the group ID. Set this parameter to all if you want to deploy the application to all instance groups.

PackageVersion String Query Yes 1.0

The deployment package version of the application. This parameter 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 to store the WAR or JAR package that is uploaded for deploying the application. This parameter is required if the DeployType parameter is set to url. We recommend that you set this parameter to the URL of an Object Storage Service (OSS) bucket.

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

The URL of the application image. This parameter can be specified only when you deploy the application to the Swarm cluster. We recommend that you use an image repository in Alibaba Cloud Container Registry. This parameter is obsolete.

Batch Integer Query No 1

The number of batches for each instance group where you want to deploy the application.

  • If the GroupId parameter is set to the ID of an instance group, the application is deployed to the specified instance group. The minimum number of deployment batches can be set to 1. The maximum number of deployment batches is the maximum number of running ECS instances in the specified instance group. Therefore, the actual number of deployment batches ranges from one to the maximum number of running ECS instances in the specified instance group.
  • If the GroupId parameter is set to all, the application is deployed to all instance groups. The minimum number of deployment batches can be set to 1. The maximum number of deployment batches is the total number of the ECS instances in the instance group that has the largest number of running ECS instances.
BatchWaitTime Integer Query No 0

The waiting time between deployment batches for the application. Unit: minutes.

  • Default value: 0. If no waiting time between deployment batches is needed, set this parameter to 0.
  • Maximum value: 5. If a large number of deployment batches are 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 the value for this parameter in the following format: {"name":"x","value":"y"},{"name":"x2","value":"y2"}. The key must be name or value.

BuildPackId Long Query No 59

The build package number of EDAS Container. To query the build package number, call the ListBuildPack operation or check the values in the Build package number column of the table that lists EDAS Container versions. If you set this parameter to 59, EDAS Container V.3.5.8 is used. This parameter is required when you create a High-Speed Service Framework (HSF) application. In other scenarios, this parameter is optional. If you do not want to change the version of EDAS Container, you can ignore this parameter. If you want to change the version of EDAS Container for the application that you want to deploy, specify this parameter.

ComponentIds String Query No 7

The ID of the component that is used for the application runtime environment. You can call the ListComponents operation to query the component ID. If the component ID is specified when the application is created, you can ignore this parameter. If you want to change the component ID, specify this parameter. The following values are commonly used: 4, 7, 5, and 6. The value of 4 represents Apache Tomcat V7.0.91. The value of 7 represents Apache Tomcat V8.5.42. The value of 5 represents OpenJDK V1.8.x. The value of 6 represents OpenJDK V1.7.x. For more information, see the description of the InsertApplication operation. This parameter is not applicable to HSF applications.

ReleaseType Long Query No 0

The way in which the application instances are assigned to each deployment batch. Valid values:

  • 0: automatic.
  • 1: You must manually assign the application instances to each batch. You can manually click Proceed to Next Batch in the EDAS console or call the ContinuePipeline operation to proceed to the next batch. If you want to call the API operation for automatic deployment, set this parameter to 0.
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 represents the ID of the instance group for the canary release.
    • Canary release can be selected as the deployment method for only one batch.
    • After the canary release is complete, the application is released in regular mode. The number of batches is specified by the Batch parameter.
  • false: The single-batch release or the phased release is selected.
TrafficControlStrategy String Query No {"http":{"rules":[{"conditionType":"percent","percent":10}]}}

For more information about canary release policies, see DeployK8sApplication.

Response parameters

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

The ID of the change order that is created for the application deployment.

Code Integer 200

The returned status code.

Message String success

The returned message.

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

The ID of the request.

Examples

Sample requests

POST /pop/v5/changeorder/co_deploy HTTP/1.1
Common request parameters
{
  "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.