You can call this operation to rebuild a deployment environment.

  • Only the deployment environments in the terminated or abnormal state can be rebuilt.
  • If you are calling this operation to perform a change rather than a dry run, the change ID will be returned. You can use this change ID to query the change information.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. You can use OpenAPI Explorer to search for APIs, call APIs, and dynamically generate SDK example code.

Request headers

This operation uses common request headers, instead of special request headers. For more information, see the "Common request headers" section in "Common request and response headers."

Request syntax

POST /pop/v1/wam/appEnv/rebuild HTTP/1.1

Request parameters

Parameter Type Required? Example Description
EnvId String Yes we-5d39b8ba6786bd4b149*****

The ID of the deployment environment.

DryRun Boolean No true

Specifies whether to perform a dry run.

  • If this parameter is set to true, no change is created, but the steps for creating the deployment environment are returned. If this parameter is set to false, the deployment environment is created and the change ID is returned.
    • The default value is false.

Response parameters

Parameter Type Example Description
Code String OK

The response code. The value is OK if the request is successful.

EnvChangeDetail

The change information about the deployment environment.

ChangeId String wc-5d3e71642977ca5251e*****

The ID of the change.

EnvId String we-5d39b8ba6786bd4b149*****

The ID of the deployment environment.

Operations

The list of change operations.

OperationDescription String Change application on the instance(s)

The description of the change operation.

OperationType String update

The type of the change operation.

StartTime String 1562666697684

The start time of the change.

Message String success

The response message. The value is success if the request is successful.

RequestId String 8D69F3C4-EA43-49D5-875A-0893BF5*****

The ID of the request.

Examples

Sample request


http://webplus.cn-hangzhou.aliyuncs.com/pop/v1/wam/appEnv/rebuild?Id=we-5d22bc1a6f48e5478fd*****&<Common request parameters>
{
  "EnvId":"we-5d39b8ba6786bd4b149*****",
  "DryRun":true,
}

Sample success response

XML format

<RebuildAppEnvResponse>
    <Message>success</Message>
    <RequestId>3E85CF06-071C-4A90-B7A1-2ACBA56*****</RequestId>
    <EnvChangeDetail>
        <Operations>
            <Operation>
                <OperationType>create</OperationType>
                <OperationDescription>Bind to VPC vpc-wz9e6y22o3o91nuy*****</OperationDescription>
            </Operation>
            <Operation>
                <OperationType>create</OperationType>
                <OperationDescription>Bind to VSwitch vsw-wz9gfawx1vxkimtj*****</OperationDescription>
            </Operation>
            <Operation>
                <OperationType>create</OperationType>
                <OperationDescription>Create security group</OperationDescription>
            </Operation>
            <Operation>
                <OperationType>update</OperationType>
                <OperationDescription>Update ESS scaling group</OperationDescription>
            </Operation>
            <Operation>
                <OperationType>create</OperationType>
                <OperationDescription>Create 1 ECS instances and create instances with priority using the following instance specifications: ecs.t5-****.small,ecs. ***.small,ecs.***,ecs.g5.large Creating resources may incur charges, please see //www.aliyun.com/price/product ? #/ecs/detail ECS Pricing</OperationDescription>
            </Operation>
            <Operation>
                <OperationType>create</OperationType>
                <OperationDescription>Setup platform services on ECS instance(s)</OperationDescription>
            </Operation>
            <Operation>
                <OperationType>create</OperationType>
                <OperationDescription>Create monitor group</OperationDescription>
            </Operation>
            <Operation>
                <OperationType>update</OperationType>
                <OperationDescription>Synchronous ECS instance(s) to monitor group</OperationDescription>
            </Operation>
            <Operation>
                <OperationType>update</OperationType>
                <OperationDescription>Change application on the instance(s)</OperationDescription>
            </Operation>
        </Operations>
    </EnvChangeDetail>
    <Code>OK</Code>
</RebuildAppEnvResponse>

JSON format

{
	"Message":"success",
	"RequestId":"607E6D37-6037-48FD-A89E-A57C584*****",
	"EnvChangeDetail":{
		"Operations":{
			"Operation":[
				{
					"OperationType":"create",
					"OperationDescription":"Bind to VPC vpc-wz9e6y22o3o91nuy*****"
				},
				{
					"OperationType":"create",
					"OperationDescription":"Bind to VSwitch vsw-wz9gfawx1vxkimtj*****"
				},
				{
					"OperationType":"create",
					"OperationDescription":"Create security group"
				},
				{
					"OperationType":"update",
					"OperationDescription":"Update ESS scaling group"
				},
				{
					"OperationType":"create",
					"OperationDescription":"Create 1 ECS instances and create instances with priority using the following instance specifications: ecs.t5-lc1*1.*****,ecs. ***.small,ecs. ****.tiny,ecs. ***.large (<b>Creating resources may incur charges, please see <a href=\"//www.aliyun.com/price/product ? #/ecs/detail\" target=\"_blank\">ECS Pricing</a></b>)"
				},
				{
					"OperationType":"create",
					"OperationDescription":"Setup platform services on ECS instance(s)"
				},
				{
					"OperationType":"create",
					"OperationDescription":"Create monitor group"
				},
				{
					"OperationType":"update",
					"OperationDescription":"Synchronous ECS instance(s) to monitor group"
				},
				{
					"OperationType":"update",
					"OperationDescription":"Change application on the instance(s)"
				}
			]
		}
	},
	"Code":"OK"
}

Error codes

HTTP status code Error code Error message Description
403 StatusNotAllowedRebuild You can only rebuild a terminated environment or an environment that failed to be rebuilt. The error message returned because the deployment environment to be rebuilt is not in the correct state. You can only rebuild a terminated deployment environment or a deployment environment that failed to be rebuilt.
400 EnvOnChanging An error occurred while starting the change. Wait until the ongoing change is complete. The error message returned because an error occurred while starting the change. Wait until the ongoing change is complete.
403 ResourceAuthFailed The specified resource does not exist or it does not belong to this Alibaba Cloud account. The error message returned because the specified resource does not exist or it does not belong to your Alibaba Cloud account.
400 OSSDisabled You have not activated the OSS service and cannot use the WebPlus service. Please go to the OSS console (https://oss.console.aliyun.com) to activate OSS and try again. The error message returned because you have not activated OSS. Log on to the OSS console (https://oss.console.aliyun.com) and activate OSS before using Web+.
400 OSSApiCallFailed When initializing applications, updating configurations, or destroying applications, WebPlus attempts to communicate with OSS through API communication. An OSS service throw error occurred. The bucket or the file does not exist. The error message returned because an exception (such as the non-existence of a bucket or file) was thrown by OSS when Web+ attempted to communicate with OSS through the API to initialize an application, update the configuration, or destroy the application.

For more information about error codes, see API Error Center.