Unsubscribes from an instance that is no longer needed.
Operation description
- Refunds are applicable only for the actual paid amount. Vouchers used for the purchase are non-refundable.
- Check the information about unsubscription and confirm the unsubscription terms and refundable amount. The resource that is unsubscribed cannot be restored.
- For more information, see Rules for unsubscribing from resources.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
bss:RefundBatchRemainRefund | Read |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ClientToken | string | No | This parameter is required for scenarios that need idempotence. The UUID that is used to ensure the idempotence of the request. | 793F021C-B589-1225-82A9-99232AEBE494 |
ImmediatelyRelease | string | No | This parameter is required for unsubscription scenarios. Valid values: 1 and 0. A value of 1 specifies that the instance is immediately released. A value of 0 specifies that the instance is shut down based on the shutdown policy. This parameter is supported only for specified services. Default value: 1. | 1 |
ProductCode | string | No | The code of the service. This parameter is required for unsubscription scenarios. | ecs |
InstanceId | string | No | The ID of the instance. This parameter is required for unsubscription scenarios. Do not specify a custom name for this parameter. | i-bp1etb69sqxgl4******* |
ProductType | string | No | The type of the service. This parameter is required for unsubscription scenarios. Unless otherwise specified, set this parameter to an empty string. | ”“ |
Response parameters
Examples
Sample success responses
JSON
format
{
"Message": "success",
"RequestId": "UUID",
"Data": {
"HostId": "cn",
"OrderId": 0
},
"Code": "ResourceNotExists",
"Success": false
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | ResourceNotExists | The specific resource is not exists. |
400 | ResourceStatusError | The resource status error. |
400 | InvalidOwner | The specified owner does not belong to caller. |
400 | InvalidParameter | The specified request contains invalid parameters. |
400 | MissingParameter | The specified request lacks essential parameters. |
400 | NotApplicable | The specified API is not applicable for the user. |
400 | NotAuthorized | The user is not authorized for the specified API. |
400 | BindMirrorInstanceError | Charged images that are related to ECS. |
400 | ExceedRefundQuotaError | The number of unsubscription times has reached the upper limit. |
400 | ExistUnPaidOrderError | The instance has an unsettled order. |
400 | ExistRefundingOrderError | The instance ID is invalid: the instance may have expired, been refunded, or been released. |
400 | NoRestValueError | The refund amount is 0. |
400 | AmbassadorOrderLimitError | The instance has an ambassador order that may raise risks. |
400 | ActivityForbiddenError | Promotional orders do not support refunds. |
400 | ProductCheckError | The cloud service failed SPI preflight verification. |
400 | CommodityNotSupported | The specified commodity is not supported. |
500 | InternalError | An error occurred in the internal server. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|
Error codes that are returned if a request is blocked
- ResourceNotExists: The instance does not exist.
- ResourceStatusError: The instance is not in the expected state.
- BindMirrorInstanceError: The ECS instance is bound to a paid image.
- ExceedRefundQuotaError: The number of times that you unsubscribe from the instance exceeds the quota.
- ExistUnPaidOrderError: An order that is not paid exists in the instance.
- ExistRefundingOrderError: The ID of the instance is invalid because the instance expires, the instance is released, or the instance is refunded.
- NoRestValueError: The refundable amount is 0.
- AmbassadorOrderLimitError: The instance has an ambassador order that may raise risks.
- ActivityForbiddenError: You cannot request a refund for an instance that is purchased during the marketing campaigns.
- ProductCheckError: The instance does not pass the precheck.