全部產品
Search
文件中心

Elastic Compute Service:DescribeRenewalPrice

更新時間:Aug 26, 2026

查詢雲端伺服器 ECS 資源的續費價格。僅支援查詢包年包月資源的續費價格。

介面說明

  • 僅支援查詢包年包月 ECS 執行個體續費時長的價格或者續費至統一到期日的價格。

  • 參數設定的注意事項如下:
    • 只設定必選參數時,預設查詢執行個體續費時長 1 個月的價格資訊。

    • 不支援同時查詢續費時長價格和續費至統一到期日的價格,即續費時長參數(PeriodPeriodUnit)與續費至統一到期日參數(ExpectedRenewDay)不能同時設定。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

ecs:DescribeRenewalPrice

get

DedicatedHost

acs:ecs:{#regionId}:{#accountId}:ddh/{#ddhId}

Instance

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

請求參數

名稱

類型

必填

描述

樣本值

RegionId

string

執行個體所屬的地域 ID。您可以呼叫 DescribeRegions 查看最新的阿里雲地域列表。

cn-hangzhou

ResourceType

string

查詢續費價格的資源類型。取值:instance。

預設值:instance。

instance

ResourceId

string

查詢續費價格的資源 ID。參數 ResourceType 取值為 instance 時,ResourceId 可以理解為 InstanceId

i-bp1f2o4ldh8l29zv****

Period

integer

指定續費時長。取值範圍:

  • 當參數 PriceUnit 取值為 Month 時:1~9。

  • 當參數 PriceUnit 取值為 Year 時:1~3。

預設值:1。

說明

續費時長參數(PeriodPeriodUnit)與統一到期日參數(ExpectedRenewDay)不能同時設定。

1

PriceUnit

string

指定續費週期。取值範圍:

  • Month:續費週期為一個月。

  • Year:續費週期為一年。

預設值:Month。

Month

ExpectedRenewDay

integer

統一到期日。指定該參數後,將查詢執行個體續費至統一到期日的價格資訊。取值範圍:1~28。

關於統一到期日功能的更多資訊,請參見統一執行個體到期日

說明

續費時長參數(PeriodPeriodUnit)與統一到期日參數(ExpectedRenewDay)不能同時設定。

5

返回參數

名稱

類型

描述

樣本值

object

RequestId

string

請求 ID。

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

PriceInfo

object

價格資訊類型(PriceInfo)組成的資料類型,包括價格和優惠規則資訊。

Rules

object

Rule

array<object>

活動規則。

object

Description

string

活動規則描述。

買滿1年,立享官網價格8.5折優惠

RuleId

integer

活動 ID。

1234567890

Price

object

價格。

OriginalPrice

number

原價。

4368

DiscountPrice

number

折扣。

655.2

Currency

string

貨幣單位。

中國站:CNY。

國際站:USD。

CNY

TradePrice

number

最終價,為原價減去折扣。

3712.8

DetailInfos

object

DetailInfo

array<object>

資源定價詳情。

array<object>

Resource

string

價格對應的資源名稱。

instance

OriginalPrice

number

原價。

4368

DiscountPrice

number

折扣價。

655.2

TradePrice

number

成交價。

3712.8

SubRules

object

Rule

array<object>

定價規則子集。

object

Description

string

定價規則描述。

買滿1年,立享官網價格8.5折優惠

RuleId

integer

定價規則 ID。

1234567890

RelatedPrice

object

關聯價格。

MarketplaceImagePrice

object

市場映像價格。

Currency

string

貨幣單位。

中國站:CNY。

國際站:USD。

CNY

OriginalPrice

number

原價。

200

DiscountPrice

number

優惠折扣。

0

TradePrice

number

最終價,為原價減去優惠折扣。

200

樣本

正常返回樣本

JSON格式

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "PriceInfo": {
    "Rules": {
      "Rule": [
        {
          "Description": "買滿1年,立享官網價格8.5折優惠",
          "RuleId": 1234567890
        }
      ]
    },
    "Price": {
      "OriginalPrice": 4368,
      "DiscountPrice": 655.2,
      "Currency": "CNY",
      "TradePrice": 3712.8,
      "DetailInfos": {
        "DetailInfo": [
          {
            "Resource": "instance",
            "OriginalPrice": 4368,
            "DiscountPrice": 655.2,
            "TradePrice": 3712.8,
            "SubRules": {
              "Rule": [
                {
                  "Description": "買滿1年,立享官網價格8.5折優惠",
                  "RuleId": 1234567890
                }
              ]
            }
          }
        ]
      }
    },
    "RelatedPrice": {
      "MarketplaceImagePrice": {
        "Currency": "CNY",
        "OriginalPrice": 200,
        "DiscountPrice": 0,
        "TradePrice": 200
      }
    }
  }
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 InvalidResourceType.ValueNotSupported The specified parameter ResourceType is not valid. 指定的資源類型不合法。
400 InvalidPeriod The specified period is not valid. 指定的時段不合法。
400 InvalidPriceUnit.ValueNotSupported The specified parameter PriceUnit is not valid. 指定的 PriceUnit 參數無效。
400 Throttling Request was denied due to request throttling. 請求被流量控制。
400 Throttling.User Request was denied due to user flow control.
400 InternalError The request processing has failed due to some unknown error. 內部錯誤,請重試。
400 InvalidPeriod.ExceededMaximumExpirationDate The specified renewal period cannot exceed the maximum expiration date. We recommend you try shortening the renewal period at next attempt. 指定的續訂期限不能超過最大有效期限。我們建議您嘗試在下次嘗試時縮短續訂時間。
400 InvalidExpectedRenewDay.Conflict The specified expectedRenewDay is in conflict with period.
400 InvalidExpectedRenewDay.ValueNotSupported The specified parameter ExpectedRenewDay is not valid.
400 InvalidPeriod.ExceededDedicatedHost Instance expired date can not exceed dedicated host expired date. 執行個體到期日不能超過專用宿主機的到期日。
400 OperationRestricted.Renewal The renewal operation has been restricted because the zone is closed. %s
400 InvalidOperation.ClassicNetworkTypeNotSupported The classic network instance does not support this operation. 抱歉,您續約的基於傳統網路架構的執行個體已無法續約,需要遷移至專有網路進行正常續約操作。
400 LastOrderProcessing The previous order is still processing, please try again later. 訂單正在處理中,請稍後重試。
400 InvalidParam.ExpectedRenewDay The specified parameter ExpectedRenewDay is not valid. 續約時間參數錯誤,請參考開發文件重新設定。
500 InternalError The request processing has failed due to some unknown error, exception or failure. 內部錯誤,請重試。
403 ChargeTypeViolation The operation is not permitted due to charge type of the instance.
403 InvalidAction.Unauthorized The specified action is not valid. 指定的操作無效。
403 InvalidStatus.DiskNotReady This specified disk is not ready, status needs to be either In_use or Available. 指定磁碟的狀態必須是 In_use 或 Available。
404 InvalidInstanceId.NotFound The specified InstanceId does not exist. 指定的執行個體不存在,請您檢查執行個體 ID 是否正確。

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情