Rolls back an application.

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 does not have operation-specific request headers and uses only common request headers. For more information, see Common request and response headers.

Request syntax

PUT /pop/v1/sam/app/rollbackApplication HTTP/1.1

Request parameters

ParameterTypePositionRequiredExampleDescription
AppIdStringQueryYes017f39b8-dfa4-4e16-a84b-1dcee4b1****

The application ID.

VersionIdStringQueryYes0026ff7f-2b57-4127-bdd0-9bf202bb9****

The ID of the application version. Call the ListAppVersions operation to obtain the version ID.

BatchWaitTimeIntegerQueryNo10

The interval between two consecutive batches. Unit: seconds.

MinReadyInstancesIntegerQueryNo1

The minimum number of available instances. Valid values:

  • If you set the value to 0, business interruptions occur when the application is upgraded.
  • If you set the value to -1, the minimum number of available instances is automatically set to a system-recommended value. The value is the nearest integer to which the calculated result of the following formula is rounded up: Current number of instances × 25%. For example, if five instances are available, the minimum number of available instances is calculated by using the following formula: 5 × 25% = 1.25. In this case, the minimum number of available instances is 2.
Note To ensure business continuity, make sure that at least one instance is available during application deployment and rollback.
MinReadyInstanceRatioIntegerQueryNo-1

The ratio of the minimum number of available instances to the current number of instances. Valid values:

  • If you set the value to -1, the minimum number of available instances is not determined based on this parameter. This is the default value.
  • If you set the value to a number from 0 to 100, the minimum number of available instances is calculated by using the following formula: Current number of instances × (Value of MinReadyInstanceRatio × 100%). If the calculated result is not an integer, the result is rounded up to the nearest integer. For example, if five instances are available and the MinReadyInstanceRatio parameter is set to 50, the minimum number of available instances is 3.
Note If the MinReadyInstance and MinReadyInstanceRatio parameters are configured and the MinReadyInstanceRatio parameter is set to a number from 0 to 100, the value of the MinReadyInstanceRatio parameter takes precedence. For example, if the MinReadyInstances parameter is set to 5, and the MinReadyInstanceRatio parameter is set to 50, the minimum number of available instances is set to the nearest integer rounded up from the calculated result of the following formula: Current number of instances × 50%.
UpdateStrategyStringQueryNo{"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":1},"grayUpdate":{"gray":1}}

The release policy. If the minimum number of available instances is 1, the value of the UpdateStrategy parameter is an empty string (""). If the minimum number of available instances is greater than 1, the following policies can be configured:

  • Perform canary release for one instance and release the remaining instances in two batches automatically with a one-minute interval between the deployment of each batch: {"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":1},"grayUpdate":{"gray":1}}
  • Perform canary release for one instance and release the remaining instances in two batches manually: {"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"manual"},"grayUpdate":{"gray":1}}
  • Release the instances in two batches automatically with no interval between the deployment of each batch: {"type":"BatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":0}}

The following parameters are involved:

  • type: the type of the release policy. Valid values: GrayBatchUpdate and BatchUpdate.
  • batchUpdate: the phased release policy.
    • batch: the number of batches in which you want to release the instances.
    • releaseType: the processing method for the batches. Valid values: auto and manual.
    • batchWaitTime: the interval between two consecutive batches. Unit: seconds.
  • grayUpdate: the number of batches in which you want to release the remaining instances after the canary release. This parameter is required only if the type parameter is set to GrayBatchUpdate.
AutoEnableApplicationScalingRuleStringQueryNotrue

Specifies whether to automatically enable an auto scaling policy for the application Valid values:

  • true
  • false

Response parameters

ParameterTypeExampleDescription
RequestIdString91F93257-7A4A-4BD3-9A7E-2F6EAE6D****

The request ID.

MessageStringsuccess

The returned message.

TraceIdString0a98a02315955564772843261e****

The trace ID that is used to query the details of the request.

DataObject

The returned result.

ChangeOrderIdString01db03d3-3ee9-48b3-b3d0-dfce2d88****

The ID of the change order.

IsNeedApprovalBooleantrue

Indicates whether approval is required when you release a change order as a RAM user. Valid values:

  • true
  • false
ErrorCodeStringNull

The error code. Valid values:

  • If the call is successful, the ErrorCode parameter is not returned.
  • If the call fails, the ErrorCode parameter is returned. For more information, see the "Error codes" section in this topic.
CodeString200

The HTTP status code. Valid values:

  • 2xx: The call was successful.
  • 3xx: The call was redirected.
  • 4xx: The call failed.
  • 5xx: A server error occurred.
SuccessBooleantrue

Indicates whether the application was rolled back. Valid values:

  • true: The application was rolled back.
  • false: The application failed to be rolled back.

Examples

Sample requests

PUT /pop/v1/sam/app/rollbackApplication?AppId=017f39b8-dfa4-4e16-a84b-1dcee4b1****&VersionId=0026ff7f-2b57-4127-bdd0-9bf202bb9****&BatchWaitTime=10&MinReadyInstances=1&MinReadyInstanceRatio=-1&UpdateStrategy={"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":1},"grayUpdate":{"gray":1}}&AutoEnableApplicationScalingRule=true HTTP/1.1
Host:sae.aliyuncs.com
Content-Type:application/json

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<RollbackApplicationResponse>
    <RequestId>91F93257-7A4A-4BD3-9A7E-2F6EAE6D****</RequestId>
    <Message>success</Message>
    <TraceId>0a98a02315955564772843261e****</TraceId>
    <Data>
        <ChangeOrderId>01db03d3-3ee9-48b3-b3d0-dfce2d88****</ChangeOrderId>
        <IsNeedApproval>true</IsNeedApproval>
    </Data>
    <Code>200</Code>
    <Success>true</Success>
</RollbackApplicationResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "91F93257-7A4A-4BD3-9A7E-2F6EAE6D****",
  "Message" : "success",
  "TraceId" : "0a98a02315955564772843261e****",
  "Data" : {
    "ChangeOrderId" : "01db03d3-3ee9-48b3-b3d0-dfce2d88****",
    "IsNeedApproval" : true
  },
  "Code" : "200",
  "Success" : true
}

Error codes

HttpCodeError codeError messageDescription
400InvalidApplication.NotFoundThe current application does not exist.The specified application is not found.
400InvalidParameter.NotEmptyYou must specify the parameter %s.The value of the %s parameter is invalid. This parameter cannot be left empty.
400InvalidParameter.ObviouslyThe specified parameter is invalid {%s}.The value of the {%s} parameter is invalid.
400InvalidParameter.WithMessageThe parameter is invalid {%s}: %sThe value %s of the {%s} parameter is invalid.
400user.indebtThe user has an outstanding payment.The current user has overdue payments.
400NoComputeResourceQuota.App.ExceedYou can create %s instances for each application. Please submit a ticket to raise the quota.A maximum of %s instances can be created for each application. Join the DingTalk group 32874633 for technical support.
400NoComputeResourceQuota.User.ExceedYour account is limited to create %s instances. Please submit a ticket to raise the quota.A maximum of %s instances can be created within your account. Join the DingTalk group 32874633 for technical support.
400System.UpgradingThe system is being upgraded. Please try again later.The system is being upgraded. Try again later.
400Application.ChangerOrderRunningAn application change process is in progress. Please try again later.An application change is in progress. Try again later.
400Application.InvalidStatusThe application status is abnormal. Please try again later.The application is in an abnormal state. Try again later.
400Application.NotDeployYetThe application has not been deployed. Please deploy it and try again.The application is not deployed. Deploy the application and try again.
400rollback.errorFailed to roll back.An error occurred during the rollback.
400Application.MissingJdkYour application must at least contain a JDK component.No JDK component is specified.
400JarApplication.MissingJdkA FatJar application must contain JDK.No JDK is specified for the application whose package type is FatJar.
400PandoraApplication.MissingJdkThe Pandora application is missing a JDK component.No JDK is found for the Pandora application.
400WarApplication.MissingJdkWebcontainerA War application must contain JDK and Tomcat.No JDK or Tomcat is specified for the WAR application. You must specify both JDK and Tomcat.
400InvalidComponent.NotFoundThe current component (such as JDK, Tomcat, or EDASWebContainer) does not exist.The specified component (JDK, Tomcat, or EDASWebContainer) is not found.
400InvalidHostnameIp.InvalidThe hostname and/or IP is invalid: Hostname [%s], IP [%s].The hostname [%s] or the IP address [%s] is invalid.
400InvalidInstanceSpecification.UnsupportedThe instance specification is not supported: CPU [%s], memory [%s].The following instance type is not supported: CPU[%s], Memory[%s].
400InvalidPackageType.NotFoundThe package type must be War, FatJar, or Image.The PackageType parameter is not set to War, FatJar, or Image.
400LogService.ConfigQuotaExceedThe maximum number of Log Service configs is exceeded.The number of logging configurations of Log Service exceeds the limit. Join the DingTalk group 32874633 for technical support.
400LogService.InternalErrorAn exception occurred while calling Log Service. Please submit a ticket to solve the problem.Log Service failed to be called. Join the DingTalk group 32874633 for technical support.
400LogService.LogDirInvalidThe log collection path is invalid.The path for log collection is invalid.
400LogService.NotAvailableLog Service is unavailable. Please activate Log Service first.Log Service is unavailable. Active Log Service.
400LogService.ProjectNumQuotaExceedThe maximum number of Log Service projects is exceeded.The number of Log Service projects exceeds the limit. Join the DingTalk group 32874633 for technical support.
400VolumnPath.ConflictConflict between log collection directory and persistent storage directory.The log collection directory conflicts with the persistent storage directory.
400MountConflict.ConfigMapConflict detected for ConfigMap path %s.The %s path on which you want to mount the ConfigMap is occupied.
400NotFound.ConfigMapThe ConfigMap object (ID: %s) does not exist.The specified ConfigMap whose ID is %s does not exist.
400NotFound.ConfigMapKeyThe key %s of ConfigMap object (ID: %s) does not exist.The %s key of the ConfigMap whose ID is %s does not exist.
400MinReadyInstances.Not.Smaller.ReplicasThe minimum number of available instances must be less than the number of application instances.The minimum number of available instances is larger than or equal to the total number of instances.
400MinReadyInstanceRatio.InvalidThe ratio of minimum available instances must be between 0 and 100.The value of the MinReadyInstanceRatio parameter is invalid. The parameter value must be an integer from 0 to 100.
400Package.Version.Too.LongThe maximum length of package version is exceeded.The length of the version number of the deployment package exceeds the limit.
400App.Package.Version.ExistsThe package version of application already exists.The version number of the deployment package already exists.
400Slb.OccupiedThe SLB instance is occupied.The SLB instance is occupied.
400Slb.Tag.Not.QualifiedThe current SLB instance cannot be reused because it may have been occupied by %s.The SLB instance is being used by %s. We recommend that you choose another SLB instance.
400InvalidParameter.FileNameThe application deployment package name is invalid. This name can contain only alphanumeric characters, hyphens (-), and underscores (_). For deploying java package, you can upload JAR files only if the selected deployment version supports JAR file. Otherwise, upload WAR files only. For deploying php package, you can upload ZIP files only if the selected deployment version supports ZIP file.The name of the application package is invalid. The name can contain only letters, digits, hyphens (-), and underscores (_). To use JAR packages, make sure that the specified version supports JAR packages. Otherwise, you can only use WAR packages to deploy Java applications. To use zip files to deploy PHP packages, make sure that the specified version supports using zip files.
400vswitch.not.existThe specified vSwitch does not exist.The specified vSwitch does not exist.
404InvalidNamespaceId.NotFoundThe specified NamespaceId does not exist.The specified namespace ID does not exist.

For a list of error codes, see Service error codes.