You can call this operation to update a deployment environment.

  • You cannot change the technology stack type of the deployment environment by changing the technology stack ID.
  • The version of the deployment package used to update the deployment environment must belong to the same application as the deployment environment.
  • 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

PUT /pop/v1/wam/appEnv HTTP/1.1

Request parameters

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

The ID of the deployment environment to be updated.

DryRun Boolean No false

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.
EnvDescription String No This is an env.

The description of the deployment environment.

OptionSettings String No [{"path":"resources.slb.internet", "name":"enable","value":"true"}]

The custom configuration item data, in the format of a JSON array. The array contains the following fields:

  • path: the path to the configuration item.
  • name: the name of the configuration item.
  • value: the value of the configuration item.
PkgVersionId String No wp-5d1c0a5d913567334af*****

The ID of the deployment package version.

StackId String No ws-6c937c98a9c0296d0c48*****

The ID of the technology stack used by the deployment environment.

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-5d3bb06a970b3f2e2a8*****

The ID of the change.

EnvId String we-5d39b8ba6786bd4b149*****

The ID of the deployment environment.

Operations

The list of change operations.

OperationDescription String Unbind VSwitch(es) vsw-wz9gfawx1vxkimtj*****

The description of the change operation.

OperationType String destroy

The type of the change operation.

StartTime String 1562666600768

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&<Common request parameters>
{
  "EnvId":"we-5d22bc1a6f48e5478fd*****"
}

Sample success response

XML format

<UpdateAppEnvResponse>
    <Message>success</Message>
    <RequestId>1DCDA97A-5F5E-4DEC-85C7-9F2EE02*****</RequestId>
    <EnvChangeDetail>
        <Operations>
            <Operation>
                <OperationType>destroy</OperationType>
                <OperationDescription>Delete monitor group *****03</OperationDescription>
            </Operation>
            <Operation>
                <OperationType>destroy</OperationType>
                <OperationDescription>Delete security group sg-wz97khuqdfkclpr*****</OperationDescription>
            </Operation>
            <Operation>
                <OperationType>destroy</OperationType>
                <OperationDescription>Delete scaling group on ESS</OperationDescription>
            </Operation>
            <Operation>
                <OperationType>destroy</OperationType>
                <OperationDescription>Unbind VSwitch(es) vsw-wz9gfawx1vxkimtj*****</OperationDescription>
            </Operation>
            <Operation>
                <OperationType>destroy</OperationType>
                <OperationDescription>Unbind VPC vpc-wz9e6y22o3o91nuy*****</OperationDescription>
            </Operation>
        </Operations>
    </EnvChangeDetail>
    <Code>OK</Code>
</UpdateAppEnvResponse>

JSON format

{
	"Message":"success",
	"RequestId":"393D5428-E693-4063-9C59-1D5393E*****",
	"EnvChangeDetail":{
		"Operations":{
			"Operation":[
				{
					"OperationType":"destroy",
					"OperationDescription":"Delete monitor group 78*****"
				},
				{
					"OperationType":"destroy",
					"OperationDescription":"Delete security group sg-wz97khuqdfkclpr*****"
				},
				{
					"OperationType":"destroy",
					"OperationDescription":"Delete scaling group on ESS"
				},
				{
					"OperationType":"destroy",
					"OperationDescription":"Unbind VSwitch(es) vsw-wz9gfawx1vxkimtj*****"
				},
				{
					"OperationType":"destroy",
					"OperationDescription":"Unbind VPC vpc-wz9e6y22o3o91nuy*****"
				}
			]
		}
	},
	"Code":"OK"
}

Error codes

HTTP status code Error code Error message Description
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.
404 ConfigOptionNotExists An error occurred while updating the configuration. The system did not locate the configuration item declared by the key. The error message returned because an error occurred while updating the configuration. The system did not locate the configuration item declared by the key.
400 ChangingAReadonlyConfig An error occurred while modifying the configuration. You cannot modify a read-only configuration. The error message returned because an error occurred while updating the configuration. You cannot modify a read-only configuration item.
403 VpcNotAllowedUpdate You are not allowed to modify the VPC ID against an unterminated environment. Please terminate it before continuing this operation. The error message returned because you are not allowed to change the VPC ID in a deployment environment that is not terminated. Terminate the deployment environment and try again.
400 ConfigValueInvalid An error occurred while resolving the configuration values. Please make sure the value type and constraints is consistent with the declared type. Types currently supported by WebPlus are: String, Integer, List, Boolean, Float, Json. The error message returned because an error occurred while resolving the values of configuration items. Ensure that the value types of configuration items are the same as the declared value types. Currently, Web+ supports the following value types: String, Integer, List, Boolean, Float, and JSON.
400 AppPackageOwnedByOthers The version of the application package used must be consistent with the application to which the environment belongs. The error message returned because the deployment package version used to create or update a deployment environment for an application does not belong to the application.
400 AppCategoryNotMatchWithStacks The application type declared in the application does not match the type of the software stack. Please make sure that the types are consistent and then try again. The error message returned because the platform type specified for the application is different from that in the technology stack. Use a consistent platform type and try again.
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.

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