Queries the historical prices of preemptible instances within the previous 30 days.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The zone ID of the preemptible instance. | cn-hangzhou |
ZoneId | string | No | The spot price (market price) of the preemptible instance. | cn-hangzhou-g |
NetworkType | string | Yes | The network type of the preemptible instance. Valid values:
| vpc |
InstanceType | string | Yes | The beginning of the time range to query. Specify the time in the ISO 8601 standard in the This parameter is empty by default. If this parameter is empty, the time that is 3 hours earlier than the specified EndTime value is used. | ecs.t1.xsmall |
SpotDuration | integer | No | The protection period of the preemptible instance. Unit: hours. Default value: 1. Valid values:
Alibaba Cloud sends an ECS system event to notify you 5 minutes before the instance is released. Preemptible instances are billed by second. We recommend that you specify a protection period based on your business requirements. Note
This parameter takes effect only if you set SpotStrategy to SpotWithPriceLimit or SpotAsPriceGo.
| 1 |
IoOptimized | string | No | Specifies whether the instance is I/O optimized. Valid values:
For instances of generation I instance families, the default value is none. For instances of other instance families, the default value is optimized. | optimized |
StartTime | string | No | The beginning of the time range to query. The value of this parameter and the value of EndTime can be up to 30 days apart. Specify the time in the ISO 8601 standard in the This parameter is left empty by default. If this parameter is empty, the time that is 3 hours earlier than the value of EndTime is used. | 2017-08-22T08:45:08Z |
EndTime | string | No | The end of the time range to query. Specify the time in the ISO 8601 standard in the This parameter is empty by default. If this parameter is empty, the current time is used. | 2017-08-22T08:45:08Z |
OSType | string | No | The type of the operating system platform. Valid values:
| linux |
Offset | integer | No | The line from which the query starts. Default value: 0 | 0 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"Currency": "CNY",
"NextOffset": 1000,
"SpotPrices": {
"SpotPriceType": [
{
"IoOptimized": "optimized",
"ZoneId": "cn-hangzhou-c",
"SpotPrice": 0.036,
"Timestamp": "2019-11-19T06:00:00Z",
"NetworkType": "vpc",
"InstanceType": "ecs.g5.large",
"OriginPrice": 0.354
}
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | MissingParameter | %s | A parameter is not specified. |
400 | UnsupportedParameter | %s | The parameter is not supported. |
400 | InvalidParameter | %s | The specified parameter is invalid. |
400 | InvalidInstanceID.Malformed | %s | The specified InstanceId parameter is invalid. |
400 | InvalidParams.StartTime | %s | The specified StartTime parameter is invalid. |
400 | InvalidParams.EndTime | %s | The specified EndTime parameter is invalid. |
400 | Abs.Abs.InvalidSpotInstanceUID | %s | The preemptible instance ID is invalid. |
400 | InvalidParams.NetworkType | %s | The specified NetworkType parameter is invalid. |
400 | InvalidParams.IoOptimized | %s | The specified IoOptimized parameter is invalid. |
400 | InvalidParams.OSType | %s | The specified OSType parameter is invalid. |
400 | Abs.IoOptimized.ValueNotSupported | %s | The I/O optimization attribute of the instance is invalid. Check whether the specified IoOptimized parameter is valid. |
400 | InvalidZoneId.NotFound | The specified zone does not exist. | The specified zone ID does not exist. |
400 | InvalidParams.ZoneId | %s | The specified ZoneId parameter is invalid. |
400 | InvalidParams.RegionId | %s | The specified RegionId parameter is invalid. |
400 | InvalidParams.InstanceType | %s | The specified InstanceType parameter is invalid. |
400 | InvalidParams.PageSize | %s | The specified PageSize parameter is invalid. |
400 | InvalidParams.Offset | %s | The specified Offset parameter is invalid. |
400 | InvalidInstanceType.ValueNotSupported | %s | The operation is not supported by the specified instance type. |
400 | DependencyViolation.IoOptimized | The specified instancetype must be IoOptimized instance. | The specified instance type must be I/O optimized. Check your instance type and try again. |
400 | InvalidSpotDuration | The specified SpotDuration is not valid. | The specified SpotDuration parameter is invalid. |
400 | OperationDenied.QueryFail | Query spot price fail, please retry later. | - |
403 | InvalidUserType.NotSupported | %s | Your account does not support this operation. |
403 | Abs.InvalidAccount.NotFound | %s | Your Alibaba Cloud account does not exist or your AccessKey pair has expired. |
403 | Forbedden.NotSupportRAM | %s | RAM users are not authorized to perform this operation. |
403 | Forbbiden.SubUser | %s | You are not authorized to manage this resource. Contact the owner of the Alibaba Cloud account for authorization. |
403 | OperationDenied.RegionIdNotSupported | region not support spot duration instance. | - |
403 | OperationDenied.FlavorNotSupported | flavor not support spot duration instance. | - |
403 | OperationDenied.TimestampNotSupported | timestamp not support spot duration instance. | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|