Tous les produits
Search
Centre de documentation

Elastic Compute Service:RenewInstance

Dernière mise à jour :Aug 18, 2026

Renouvelle une instance Elastic Compute Service (ECS) à abonnement. Vous pouvez spécifier une période de renouvellement ou renouveler l'instance jusqu'à une date d'expiration unifiée.

Description de l'opération

Avant d'appeler cette opération, assurez-vous de bien connaître les modes de facturation et les tarifs d'ECS.

  • Assurez-vous que le solde de votre compte ou votre solde de crédit est suffisant.

  • Seules les instances à abonnement sont prises en charge. Si vous appelez cette opération pour une instance à l'usage, une erreur est renvoyée.

  • Vous devez spécifier la paire de paramètres liée à la période de renouvellement (Period et PeriodUnit) ou ExpectedRenewDay, mais pas les deux.

Testez maintenant

Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale. Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale.

Test

Autorisation RAM

Le tableau ci-dessous décrit les autorisations nécessaires pour appeler cette API. Vous pouvez les définir dans une politique Resource Access Management (RAM). Les colonnes du tableau sont détaillées ci-dessous :

  • Action : les actions peuvent être utilisées dans l'élément Action des instructions de politique de permissions RAM pour accorder les autorisations nécessaires à l'exécution de l'opération.

  • API : l'API que vous pouvez appeler pour exécuter l'action.

  • Niveau d'accès : le niveau d'accès prédéfini accordé pour chaque API. Valeurs valides : create, list, get, update et delete.

  • Type de ressource : le type de ressource qui prend en charge l'autorisation pour exécuter l'action. Il indique si l'action prend en charge les permissions au niveau de la ressource. La ressource spécifiée doit être compatible avec l'action. Sinon, la politique sera inefficace.

    • Pour les API avec permissions au niveau de la ressource, les types de ressource requis sont marqués d'un astérisque (*). Spécifiez l'Alibaba Cloud Resource Name (ARN) correspondant dans l'élément Resource de la politique.

    • Pour les API sans permissions au niveau de la ressource, la valeur All Resources est affichée. Utilisez un astérisque (*) dans l'élément Resource de la politique.

  • Clé de condition : les clés de condition définies par le service. La clé permet un contrôle granulaire, applicable aux actions seules ou aux actions associées à des ressources spécifiques. En plus des clés de condition propres au service, Alibaba Cloud fournit un ensemble de clés de condition communes applicables à tous les services pris en charge par RAM.

  • Action dépendante : les actions dépendantes requises pour exécuter l'action. Pour mener à bien l'opération, l'utilisateur RAM ou le rôle RAM doit disposer des permissions pour toutes les actions dépendantes.

ecs:RenewInstance

update

*Instance

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

Aucune Aucune

Paramètres de requête

Paramètre

Type

Requis

Description

Exemple

ClientToken

string

Non

Le jeton client utilisé pour garantir l'idempotence de la requête. Vous pouvez utiliser le client pour générer le jeton, mais vous devez vous assurer qu'il est unique pour chaque requête. Le jeton ne peut contenir que des caractères ASCII et sa longueur ne peut pas dépasser 64 caractères. Pour plus d'informations, consultez Comment garantir l'idempotence.

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

InstanceId

string

Oui

L'identifiant de l'instance que vous souhaitez renouveler.

i-bp67acfmxazb4p****

Period

integer

Non

La période de renouvellement de l'instance à abonnement. Si DedicatedHostId est spécifié, la valeur de Period ne peut pas dépasser la période d'abonnement de l'hôte dédié spécifié.

Valeurs valides lorsque PeriodUnit est défini sur Month : 1, 2, 3, 4, 5, 6, 7, 8, 9 et 12.

Remarque

La paire de paramètres liée à la période de renouvellement (Period et PeriodUnit) et ExpectedRenewDay sont mutuellement exclusifs.

1

PeriodUnit

string

Non

L'unité de la période de renouvellement. Valeurs valides :

Month

Valeur par défaut : Month.

Month

ExpectedRenewDay

integer

Non

Spécifie la date d'expiration unifiée. Valeurs valides : 1 à 28.

Pour utiliser ce paramètre, vous devez spécifier une date d'expiration unifiée pour l'instance ECS. La valeur de ce paramètre doit être identique à la date d'expiration unifiée spécifiée. Sinon, l'appel échoue.

Remarque

Vous devez spécifier la paire de paramètres liée à la période de renouvellement (Period et PeriodUnit) ou ExpectedRenewDay, mais pas les deux.

5

Éléments de réponse

Élément

Type

Description

Exemple

object

OrderId

string

L'identifiant de la commande.

1234567890

RequestId

string

L'identifiant de la requête.

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

Exemples

JSON format

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

Codes d'erreur

Code de statut HTTP

Code d'erreur

Message d'erreur

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. The required parameter "Period" is missing from the operation.
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. The specified dedicated host does not exist.
400 InvalidDedicatedHostStatus.NotSupport Operation denied due to dedicated host status. The current status of the dedicated host does not support this operation.
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. The instance has an incomplete refund order. Wait and try again later.
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. The instance is locked for security reasons. Contact security technical support.
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. The subscription 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.

Consultez Codes d'erreur pour la liste complète.

Notes de version

Consultez Notes de version pour la liste complète.