You can call this operation to deploy an application to an Elastic Compute Service (ECS) or a Swarm cluster.

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

Request syntax

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

Request parameters

Parameter Type Required Example Description
AppId String 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 Yes url

The deployment type of the application. Valid values: url and image. You can deploy only Docker applications by using images.

GroupId String 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 groups.

PackageVersion String Yes 1.0

The version of the application that you want to deploy. It must be unique for each application and is up to 64 characters in length. We recommend that you use a timestamp.

Desc String No ""

The description about the deployment of the application.

WarUrl String No ""

The address to store the uploaded web application archive (WAR) package for deploying the application. This parameter is required when the deployType parameter is set to url. We recommend that you set this parameter to the address of an Object Storage Service (OSS) system.

ImageUrl String No ""

The address of the image used to deploy the application. This parameter is required when the deployType parameter is set to image.

Batch Integer No 1

The number of deployment batches for the application. Valid values: 1 to 5. Default value: 1.

BatchWaitTime Integer No 5

The waiting time between deployment batches for the application. Valid values: 0 to 5. Default value: 0. Unit: minutes. If no waiting time between deployment batches is required, set this parameter to 0.

AppEnv String No ""

The one or more environment variables of the application. The values must be in the format of

{"name":"x","value":"y"},{"name":"x2","value":"y2"}

The keys are fixed to name and value.

BuildPackId Long No 1382974398

The ID of the container where the application is to be deployed. If no runtime environment is specified when the application is created and the application is not deployed, you can set this parameter as follows:

When deploying a native Dubbo or Spring Cloud application for the first time, you can leave this parameter empty.

When deploying a non-native Dubbo or Spring Cloud application for the first time, you must specify this parameter. To query container versions, you can call the ListBuildPack operation or see the values in the Build package number column in the Container versions table.

ComponentIds String No 5

The ID of the component in the container where the application is to be deployed. If no runtime environment is specified when the application is created and the application is not deployed, you can set this parameter as follows:

When deploying a native Dubbo or Spring Cloud application by using a WAR package for the first time, you must specify the version of the Apache Tomcat component based on which the application is deployed. You can call the ListComponents operation to query the components.

When deploying a non-native Dubbo or Spring Cloud application by using a WAR package for the first time, you can leave this parameter empty.

ReleaseType Long No 1

The manner in which deployment batches of the application are transitioned. Valid values:

0: automatic.

1: requires manual confirmation between batches. You can manually click Proceed to Next Batch in the console or call the ContinuePipeline operation to proceed to the next batch.

Response parameters

Parameter Type Example Description
Code Integer 200

The returned code.

Message String success

The returned message.

ChangeOrderId String d6834ee9-5045-*************

The details about the deployment progress of the application. You can call the GetChangeOrderInfo operation to query the progress of this deployment.

RequestId String F8DFGEDK98*************** Request ID

Examples

Sample requests

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

Sample success responses

JSON format

{
    "Message": "success",
    "ChangeOrderId": "d6834ee9-5045-*************",
    "Code": 200
}

XML format

<Message>success</Message>
<ChangeOrderId>d6834ee9-5045-*************</ChangeOrderId>
<Code>200</Code>

Error codes

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