調用ModifyInstanceAutoRenewAttribute設置一臺或多臺包年包月實例的自動續(xù)費狀態(tài)。為了減少您的資源到期維護成本,包年包月ECS實例可以設置自動續(xù)費。
接口說明
請確保在使用該接口前,您已充分了解云服務器 ECS的計費方式和產品定價。
-
自動續(xù)費扣款日為實例到期前第 9 天,扣費在北京時間(UTC +8)08:00:00 開始執(zhí)行。
-
如果新建實例的購買時長為一周,則會在創(chuàng)建成功的第一天自動扣款續(xù)費。
-
如果前一日執(zhí)行自動扣費失敗,將會繼續(xù)下一日定時繼續(xù)執(zhí)行,直到扣費成功或者 9 天之后實例到期鎖定。您只需要保證自己的賬號的余額或者信用額度充足即可。
調試
您可以在OpenAPI Explorer中直接運行該接口,免去您計算簽名的困擾。運行成功后,OpenAPI Explorer可以自動生成SDK代碼示例。
授權信息
請求參數(shù)
名稱 | 類型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
InstanceId | string | 是 | 實例 ID。支持批量設置最多 100 個包年包月實例,多個實例 ID 以英文逗號分隔。 | i-bp67acfmxazb4ph****,i-bp67acfmxazb4pi**** |
RegionId | string | 是 | 實例所屬的地域 ID。您可以調用 DescribeRegions 查看最新的阿里云地域列表。 | cn-hangzhou |
Duration | integer | 否 | 設置實例自動續(xù)費時長。
| 1 |
AutoRenew | boolean | 否 | 實例到期前是否自動續(xù)費。 默認值:false | true |
RenewalStatus | string | 否 | 實例的自動續(xù)費狀態(tài)。取值范圍:
說明
參數(shù) RenewalStatus 的優(yōu)先級高于參數(shù)AutoRenew 。如果不傳入?yún)?shù)RenewalStatus ,則默認以參數(shù)AutoRenew 為準。
| AutoRenewal |
PeriodUnit | string | 否 | 續(xù)費時長的時間單位,即參數(shù)
| Month |
返回參數(shù)
示例
正常返回示例
JSON
格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
錯誤碼
HTTP status code | 錯誤碼 | 錯誤信息 | 描述 |
---|---|---|---|
400 | OperationDenied.StarterPackage | Instance created with a Starter Package plan can not set auto renew. | - |
403 | MissingParameter.InstanceId | InstanceId should not be null. | 參數(shù) InstanceId 不能為空。 |
403 | InvalidParameter.ToManyInstanceIds | InstanceId should be less than 100. | 實例數(shù)應小于100。 |
403 | InvalidParameter.InvalidInstanceId | %s | 指定的參數(shù) InstanceId 無效。 |
403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | 該資源目前的狀態(tài)不支持此操作。 |
403 | ChargeTypeViolation | Pay-As-You-Go instances do not support this operation. | 按量付費實例不支持該操作,檢查實例的付費類型是否與該操作沖突。 |
403 | InvalidParameter.Duration | %s | 參數(shù) Duration 無效。 |
403 | InvalidParameter.RenewalStatus | %s | 指定的參數(shù) RenewalStatus 無效。 |
403 | InvalidPeriodUnit.ValueNotSupported | The specified parameter PeriodUnit is not valid. | 參數(shù) PeriodUnit 無效。 |
403 | InvalidPeriod.StarterPackage | This instance was created by using a Starter Package plan and can only be renewed monthly, not yearly. | 參加了入門級套餐活動的實例,只能設置成每月自動續(xù)費。 |
500 | InternalError | The request processing has failed due to some unknown error. | 內部錯誤,請重試。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
變更時間 | 變更內容概要 | 操作 |
---|