请求参数
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见
公共请求参数。
Action
|
String
|
是
| 公共参数,本接口取值:DescribeSpotPriceHistory。 |
Version
|
String
|
是
| 公共参数,本接口取值:2016-03-04。 |
InstanceType
|
String
|
是
| 示例值:N3.2B |
AvailabilityZone
|
String
|
是
| 示例值:cn-beijing-6a |
StartTime
|
String
|
否
| 查询竞价实例历史价格的起始时间。按照ISO8601标准表示,并使用UTC +8时间,格式为yyyy-MM-ddTHH:mm:ssZ。默认值:空,空代表结束时间前3小时,最大值不得超过指定的结束时间3天。 示例值:—— |
EndTime
|
String
|
否
| 查询抢占式实例历史价格的结束时间。按照ISO8601标准表示,并使用UTC +8时间,格式为yyyy-MM-ddTHH:mm:ssZ。默认值:空,空表示当前时间。(endtime不进行强校验)。 示例值:—— |
返回参数
RequestId
|
String
| 示例值:KEC-7ceaed40-66d9-4287-bf23-79fa60b47cf9002 |
InstanceType
|
String
| 示例值:N3.1A |
AvailabilityZone
|
String
| 示例值:cn-beijing-6a |
SpotPrices
|
Object[]
| |
SpotPrice
|
Double
| 示例值:0.0393 |
OriginPrice
|
Double
| 示例值:0.1965 |
Timestamp
|
String
| 示例值:2023-09-17 16:00:00 |
请求示例
curl -X GET|POST
'http://kec.api.ksyun.com/?Action=DescribeSpotPriceHistory&Version=2016-03-04'
-H 'authorization: xxx, SignedHeaders=content-type;host;x-amz-date, Signature=xxx'
-H 'cache-control: no-cache'
-H 'content-type: application/x-www-form-urlencoded'
-H 'host: kec.api.ksyun.com'
-H 'x-amz-date: 20170720T022802Z'
-d 'InstanceType=xxx&AvailabilityZone=xxx&StartTime=xxx&EndTime=xxx'

返回示例
JSON格式
{
"RequestId":"KEC-7ceaed40-66d9-4287-bf23-79fa60b47cf9002", "AvailabilityZone":"cn-beijing-6a", "Timestamp":"2023-09-17 16:00:00" "Timestamp":"2023-09-17 17:00:00" "Timestamp":"2023-09-17 18:00:00" "Timestamp":"2023-09-17 19:00:00" "Timestamp":"2023-09-17 20:00:00" "Timestamp":"2023-09-17 21:00:00" "Timestamp":"2023-09-17 22:00:00" "Timestamp":"2023-09-17 23:00:00" "Timestamp":"2023-09-18 00:00:00" "Timestamp":"2023-09-18 01:00:00" "Timestamp":"2023-09-18 02:00:00" "Timestamp":"2023-09-18 03:00:00" "Timestamp":"2023-09-18 04:00:00" "Timestamp":"2023-09-18 05:00:00" "Timestamp":"2023-09-18 06:00:00" "Timestamp":"2023-09-18 07:00:00" "Timestamp":"2023-09-18 08:00:00" "Timestamp":"2023-09-18 09:00:00" "Timestamp":"2023-09-18 10:00:00" "Timestamp":"2023-09-18 11:00:00" "Timestamp":"2023-09-18 12:00:00" "Timestamp":"2023-09-18 13:00:00" "Timestamp":"2023-09-18 14:00:00" "Timestamp":"2023-09-18 15:00:00" "Timestamp":"2023-09-18 16:00:00" "Timestamp":"2023-09-18 17:00:00" "Timestamp":"2023-09-18 18:00:00" "Timestamp":"2023-09-18 19:00:00" "Timestamp":"2023-09-18 20:00:00" "Timestamp":"2023-09-18 21:00:00" "Timestamp":"2023-09-18 22:00:00" "Timestamp":"2023-09-18 23:00:00" "Timestamp":"2023-09-19 00:00:00" "Timestamp":"2023-09-19 01:00:00" "Timestamp":"2023-09-19 02:00:00" "Timestamp":"2023-09-19 03:00:00" "Timestamp":"2023-09-19 04:00:00" "Timestamp":"2023-09-19 05:00:00" "Timestamp":"2023-09-19 06:00:00" "Timestamp":"2023-09-19 07:00:00" "Timestamp":"2023-09-19 08:00:00" "Timestamp":"2023-09-19 09:00:00" "Timestamp":"2023-09-19 10:00:00" "Timestamp":"2023-09-19 11:00:00" "Timestamp":"2023-09-19 12:00:00" "Timestamp":"2023-09-19 13:00:00" "Timestamp":"2023-09-19 14:00:00" "Timestamp":"2023-09-19 15:00:00" "Timestamp":"2023-09-19 16:00:00" "Timestamp":"2023-09-19 17:00:00" "Timestamp":"2023-09-19 18:00:00" "Timestamp":"2023-09-19 19:00:00" "Timestamp":"2023-09-19 20:00:00" "Timestamp":"2023-09-19 21:00:00" "Timestamp":"2023-09-19 22:00:00" "Timestamp":"2023-09-19 23:00:00" "Timestamp":"2023-09-20 00:00:00" "Timestamp":"2023-09-20 01:00:00" "Timestamp":"2023-09-20 02:00:00" "Timestamp":"2023-09-20 03:00:00" "Timestamp":"2023-09-20 04:00:00" "Timestamp":"2023-09-20 05:00:00" "Timestamp":"2023-09-20 06:00:00" "Timestamp":"2023-09-20 07:00:00" "Timestamp":"2023-09-20 08:00:00" "Timestamp":"2023-09-20 09:00:00" "Timestamp":"2023-09-20 10:00:00" "Timestamp":"2023-09-20 11:00:00" "Timestamp":"2023-09-20 12:00:00" "Timestamp":"2023-09-20 13:00:00" "Timestamp":"2023-09-20 14:00:00" "Timestamp":"2023-09-20 15:00:00" }

错误码
以下仅列出了接口业务逻辑相关的错误码,其他错误码详见公共错误码
EndTimeNotAllowedBeforeStartTime | The start time should be earlier than end time. | 400 | 结束时间不允许在开始时间之前 |
EndTimeIsMoreThanThreeDaysThanStartTime | The time-span between the start and end time should be less than three days. | 400 | 开始时间不得超过结束时间三天 |
EndTimeOutOfRange | The start time should be earlier than now and within recent three months. | 400 | 结束时间必须早于现在时间并且在三个月以内。 |
StartTimeOutOfRange | The start time should be earlier than now and within recent three months. | 400 | 开始时间必须早于现在时间并且在三个月以内。 |
SpotInstanceTypeOrAzNotExistOrSale | The historical price of this instance type cannot be found. This instance type does not exist or is not sold spot in this availability zone. | 400 | 查不到此机型的竞价实例历史价格,因此机型不存在或者不在指定可用区售卖竞价实例。 |