RenewInstance

更新时间:
复制 MD 格式

Renews a subscription Elastic Compute Service (ECS) instance. You can specify a renewal period or renew the instance to a unified expiration date.

Operation description

Before you call this operation, make sure that you are familiar with the billing methods and pricing of ECS.

  • Make sure that your account balance or credit balance is sufficient.

  • Only subscription instances are supported. If you call this operation for a pay-as-you-go instance, an error is returned.

  • You must specify the renewal period-related parameter pair (Period and PeriodUnit) or ExpectedRenewDay, but not both.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecs:RenewInstance

update

*Instance

acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

ClientToken

string

No

The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

0c593ea1-3bea-11e9-b96b-88e9fe637760

InstanceId

string

Yes

The ID of the instance that you want to renew.

i-bp67acfmxazb4p****

Period

integer

No

The renewal period of the subscription instance. If DedicatedHostId is specified, the value of Period cannot exceed the subscription period of the specified dedicated host.

Valid values when PeriodUnit is set to Month: 1, 2, 3, 4, 5, 6, 7, 8, 9, and 12.

Note

The renewal period-related parameter pair (Period and PeriodUnit) and ExpectedRenewDay are mutually exclusive.

1

PeriodUnit

string

No

The unit of the renewal period. Valid values:

Month

Default value: Month.

Month

ExpectedRenewDay

integer

No

Specifies the unified expiration date. Valid values: 1 to 28.

To use this parameter, you must specify a unified expiration date for the ECS instance. The value of this parameter must be the same as the specified unified expiration date. Otherwise, the call fails.

Note

You must specify the renewal period-related parameter pair (Period and PeriodUnit) or ExpectedRenewDay, but not both.

5

Response elements

Element

Type

Description

Example

object

OrderId

string

The order ID.

1234567890

RequestId

string

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

Examples

Success response

JSON format

{
  "OrderId": "1234567890",
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidInternetChargeType.ValueNotSupported The specified InternetChargeType is not valid. The specified InternetChargeType parameter is invalid.
400 InvalidInstanceType.NotSupported The specified InstanceType is not Supported.
400 InvalidParameter The specified parameter "InternetMaxBandwidthOut" is not valid.
400 InvalidInstanceChargeType.NotFound The InstanceChargeType does not exist in our records. The specified instance billing method does not exist.
400 InvalidRebootTime.Malformed The specified RebootTime is not valid.
400 InvalidRebootTime.ValueNotSupported The specified RebootTime is out of the permitted range. The specified restart time is invalid.
400 IdempotenceParamNotMatch Request uses a client token in a previous request but is not identical to that request. This request and the previous request contain the same client token but different other parameters.
400 InvalidClientToken.ValueNotSupported The ClientToken provided is invalid. The specified ClientToken parameter is invalid.
400 InvalidInstanceType.ValueNotSupported The specified InstanceType does not exist or beyond the permitted range. The specified instance type does not exist or you are not authorized to manage instances of this instance type.
400 InvalidInstanceType.codeUnauthorized The specified InstanceType is not authorized. The specified InstanceType parameter is invalid.
400 InvalidInternetChargeType.InstanceNotSupported The specified instance which is in vpc is not support the parameter InternetChargeType. The specified billing method for network usage is not supported by the specified instance of the VPC type.
400 InvalidPeriod The specified period is not valid. The specified period is invalid.
400 MissingParamter The specified parameter "Period" is not null.
400 Upgrade.NotSupported Upgrade operation is not supported. The upgrade operation is invalid.
400 OperationDenied Specified instance is in VPC. The instance resides in a VPC.
400 InvalidInstanceType.ValueUnauthorized The specified InstanceType is not authorized.
400 DependencyViolation.InstanceType Current instancetype cannot be changed to the specified one. The current instance type cannot be changed to the specified one.
400 InvalidPeriodUnit.ValueNotSupported The specified parameter PeriodUnit is not valid. The specified PeriodUnit parameter is invalid.
400 InvalidDedicatedHostId.NotFound The specified DedicatedHostId does not exist.
400 InvalidDedicatedHostStatus.NotSupport Operation denied due to dedicated host status.
400 IncorrectDedicatedHostStatus The current status of the resource does not support this operation. The resource is in a state that does not support the current operation.
400 InvalidPeriod.ExceededDedicatedHost Instance expired date can't exceed dedicated host expired date.
400 InvalidStatus.Upgrading The instance is upgrading; please try again later. The instance is being upgraded. Try again later.
400 InvalidPeriod.ExceededMaximumExpirationDate The specified renewal period cannot exceed the maximum expiration date. We recommend you try shortening the renewal period at next attempt. The specified renewal period exceeds the maximum allowed value. We recommend that you shorten the renewal period at your next attempt.
400 LastOrderProcessing The previous order is still processing, please try again later. The order is being processed. Try again later.
400 Idempotence.Processing The previous request is still processing, please try again later. The request is being processed. Try again later.
400 InvalidLoanOrderStatus.Uncompleted Any unpaid order must be cancelled before you try this action again. The scheduled unpaid order is a loan order that cannot be auto cancelled. For more information, visit the loan management center.
400 OperationDenied.UnfinishedOrder The current instance has unfinished refundOrder, this operation is denied.
400 InvalidPeriod.NotFound The specified period and expectedRenewDay cannot both be empty.
400 InvalidExpectedRenewDay.StarterPackageNotSupported The specified starterPackage cannot support renew with expectedRenewDay.
400 InvalidParam.ExpectedRenewDay The specified param ExpectedRenewDay is not valid.
400 QuotaExceed.AlignInstance The maximum number of align operations is exceeded.
400 InvalidExpectedRenewDay.Conflict The specified expectedRenewDay is in conflict with period.
400 InvalidExpectedRenewDay.ValueNotSupported The specified parameter ExpectedRenewDay is not valid.
400 OperationDenied.AbnormalInstanceInfo The current renewable operation is not supported due to abnormal information of the instance, please submit ticket to process.
400 NoPermission.Price The operation requires price permission. Please either apply for permission from your main account, or set the parameter AutoPay as true. This operation requires price permission. Please apply for permission to your master account, or set the parameter AutoPay to true for automatic payment.
400 InvalidOperation.ClassicNetworkTypeNotSupported The classic network instance does not support this operation. Sorry, the instance you renewed based on the classic network architecture cannot be renewed. You need to migrate to a VPC for normal renewal.
500 InternalError The request processing has failed due to some unknown error.
403 ChargeTypeViolation The operation is not permitted due to charge type of the instance.
403 Diskcategory.Mismatch The disk specified to convert to portable is not allowed due to the disk category does not support. The specified disk cannot be converted to a removable disk due to disk category constraints.
403 IncorrectInstanceStatus The current status of the resource does not support this operation.
403 InstanceSpecModification.NotEffective The specified instance has been reserved for making a spec modification and not taken effective in the current contract period. The specified instance is retained due to the instance type change. The instance type change cannot take effect during the current contract period.
403 LastTokenProcessing The last token request is processing.
403 Instance.UnPaidOrder The specified instance has unpaid order.
403 InstanceLockedForSecurity The specified operation is denied as your instance is locked for security reasons.
403 InvalidDisk.NotAllowed The specified disk is not allowed to be converted to portable.
403 InstanceTypeNotSupported The specified zone does not offer the specified instancetype.
403 InvalidChargeType.NotSupported The chargeType of the instance does not support this operation. The operation is not supported while the instance is using the current billing method.
403 OperationDenied.NoStock The requested resource is sold out in the specified zone, try other types of resources or other regions and zones. The requested resources are sold out in the specified zone. Try another instance type or zone.
403 OperationDenied.ImageNotValid The specified image is not authorized.
403 InvalidPeriod.StarterPackage This instance was created by using a Starter Package plan and can only be renewed monthly, not yearly. The instance was created in a Starter Package plan and can only be automatically renewed on a monthly basis.
403 RenewDateNotSupported.StarterPackage This instance was created by using a Starter Package plan and can only be renewed three days before it expires.
403 PrePaidInstance.Expired The prePaid instance has expired.
404 InvalidDiskId.NotFound The specified disk does not exist. The specified disk does not exist. Check whether the disk ID is correct.
404 InvalidInstanceId.NotFound The specified InstanceId does not exist. The specified instanceId is invalid.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.