Queries the historical prices of preemptible instances. For more information about preemptible instances, see Create and use preemptible instances.
Try it now
Test
RAM authorization
Request syntax
GET /api/v2/public/spot_discount HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceType |
string |
Yes |
The type of the Elastic Algorithm Service (EAS) instance. |
ecs.c6.4xlarge |
| IsProtect |
boolean |
No |
Specifies whether the preemptible instance has a protection period. During the 1-hour protection period of the preemptible instance, the preemptible instance will not be released. |
false |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
40325405-579C-4D82*** |
| SpotDiscounts |
array<object> |
The discount for the preemptible instance. |
|
|
object |
|||
| ZoneId |
string |
The zone ID. |
cn-hangzhou-i |
| SpotDiscount |
string |
The discount for the preemptible instance. For example, 0.1 represents a 90% discount. |
0.1 |
| Timestamp |
string |
The time when the discount is available. The time must be in UTC. |
2024-04-10T10:00:00Z |
| InstanceType |
string |
The type of the ECS instance. |
ecs.c7.large |
Examples
Success response
JSON format
{
"RequestId": "40325405-579C-4D82***",
"SpotDiscounts": [
{
"ZoneId": "cn-hangzhou-i",
"SpotDiscount": "0.1",
"Timestamp": "2024-04-10T10:00:00Z",
"InstanceType": "ecs.c7.large"
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.