Renews a subscription instance.

Description

When you call this interface, consider the following:

  • This interface supports only Subscription ECS instances.

  • By default, coupons available under your account will be preferentially used during payment if you are not using a free account.

  • Your account must support credit payment. Otherwise, your request will be denied.

Request parameters

Name Type Required Description
Action String Yes Name of this interface. Value: RenewInstance.
InstanceId String Yes ID of the instance to be renewed.
Period Integer Yes Renewal period of a Subscription instance. This parameter is valid and mandatory only when InstanceChargeType is set to PrePaid. Once DedicatedHostId is specified, the value range of the Period parameter must be within the subscription period of the dedicated host. Value range:
  • {“1”, “2”, “3”, “4”} when PeriodUnit is set to week.
  • { “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “12”, “24”, “36”,”48”,”60”} when PeriodUnit is set to month
PeriodUnit String No Unit of Period. Value range:
  • Week
  • Month (Default value)
ClientToken String No

Guarantees the idempotence of the request.  The value is generated by a client and must be globally unique. Only ASCII characters are allowed. It can contain a maximum of 64 ASCII characters. For more information, see How to ensure idempotence.

Response parameters

All are common response parameters. See Common response parameters.

Examples

Request example
https://ecs.aliyuncs.com/?Action=RenewInstance
&InstanceId=i-instance1
&Period=1
&<Common Request Parameters>
Response example

XML format

<ModifyInstanceSpecResponse>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
</ModifyInstanceSpecResponse>
JSON format
{
    "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Error codes

Error codes specific to this interface are as follows. For more information, see API Error Center.

Error code Error message HTTP status code Meaning
IdempotenceParamNotMatch Request uses a client token in a previous request but is not identical to that request. 400 The parameter does not match the request parameter using the same ClientToken.
InvalidClientToken.ValueNotSupported The ClientToken provided is invalid. 400 The ClientToken value is invalid. Only ASCII characters are allowed.
InvalidPeriod The specified period is not valid. 400 The specified Period is invalid (not a digit or beyond the value range).
ChargeTypeViolation The operation is not permitted due to charge type of the instance. 403 The payment method does not support this operation.
IncorrectInstanceStatus The current status of the resource does not support this operation. 403 The current state of the resource does not support this operation.
Instance.UnPaidOrder The specified instance has unpaid order. 403 There are still unpaid orders under this instance.
InstanceLockedForSecurity The specified operation is denied as your instance is locked for security reasons. 403 This operation is denied because the instance is locked for security reasons.
LastTokenProcessing The last token request is processing. 403 The last request is still in progress.
InvalidInstanceId.NotFound The specified InstanceId does not exist. 404 The specified InstanceId does not exist.