接口说明
查询指定可用区下,抢占式实例的历史价格,最多支持获取近30天内的数据,通过历史价格数据可以帮助您合理地设置单台实例价格上限。
URL
GET https://ecloud.10086.cn/api/openapi-instance/v4/describe-history-price
请求参数
Query
|
参数名称
|
类型
|
必填
|
描述
|
|
zoneId
|
string
|
否
|
可用区ID,可通过查询属地地域可用区信息接口获取。 |
|
flavorName
|
string
|
是
|
规格名称,可通过查询实例可用规格列表获取。 |
|
duration
|
integer(int32)
|
是
|
查询时长,取值范围[1,30],单位:天。 |
请求示例
GET https://ecloud.10086.cn/api/openapi-instance/v4/describe-history-price
返回参数
返回码:200
OK
|
参数名称
|
类型
|
描述
|
|
body
|
<HistoryPriceInfo> array
|
请求成功时返回的数据。 |
|
historyPrices
|
<HistoryPriceResp> array
|
抢占式实例历史价格。 |
|
beginTime
|
string(date-time)
|
开始时间。 |
|
discount
|
number
|
折扣。 |
|
endTime
|
string(date-time)
|
结束时间。 |
|
price
|
number
|
价格。 |
|
zoneId
|
string
|
可用区ID。 |
|
errorCode
|
string
|
统一错误码。 |
|
errorMessage
|
string
|
页面国际化错误提示。 |
|
errorParams
|
<string> array
|
统一错误码的自定义参数。 |
|
requestId
|
string
|
每个请求的序列号。 |
|
state
|
enum(OK,ERROR,EXCEPTION,ALARM,FORBIDDEN)
|
返回状态码。返回正常:OK,返回错误:ERROR,返回异常:EXCEPTION,需要告警实现的:ALARM,禁止访问:FORBIDDEN。 |
返回示例
返回码:200
OK
{
"requestId":"reqId-ddce55b85eed4f30bada3eadb6ed99f9",
"state":"OK",
"body":[
{
"zoneId":"cn-jiangsu-1a",
"historyPrices":[
{
"beginTime":"2026-05-13 15:00:00",
"endTime":"9999-12-31 00:00:00",
"price":0.05,
"discount":0.15
},
{
"beginTime":"2026-05-14 15:00:00",
"endTime":null,
"price":0.05,
"discount":0.15
}
]
}
]
}