You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
Instances
DescribeSpotAdvice - Queries the average release rate of spot instances over the past 30 days
Copy page
Download PDF
DescribeSpotAdvice - Queries the average release rate of spot instances over the past 30 days
Call the DescribeSpotAdvice operation to query information such as the average release rate and average discount rate of spot instances over the past 30 days.​
Usage notes​
  • For data on instance type, vCPU count, memory, and other metrics, see Instance types.​
Debugging​
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
​
Request parameters​
The table below lists only the request parameters specific to this operation and some common parameters. For more information, please refer to Common parameters.​
Action string required Sample value: DescribeSpotAdvice​
The operation that you want to perform. Valid value: DescribeSpotAdvice.​
​
Version string required Sample value: 2020-04-01​
The version of the API. Valid value: 2020-04-01.​
​
Cpus integer Optional Sample value: 2​
The number of vCPUs for the instance type.​
If you configure both Cpus and MinCpus, Cpus takes effect.​
​
Gpu.Count integer Optional Sample value: 2​
The number of GPUs for each GPU instance. For valid values, see GPU instance types.​
​
Gpu.ProductName string Optional Sample value: Tesla A100​
The type of the GPU computing card.​
  • Valid values: For detailed information on GPU computing cards of each instance, see GPU instance types.​
  • Default value: None (that is, all types will be queried).​
  • When a non-existent GPU computing card type is passed in, the return value is empty.​
​
InstanceTypeFamily string Optional Sample value: ecs.g2i​
The instance type family.​
​
InstanceTypeIds.N string[] Optional Sample value: InstanceTypeIds.1=ecs.r2a.xlarge&InstanceTypeIds.2=ecs.g2a.xlarge​
Instance type.​
  • Parameter - N: This specifies the serial number of the instance type. Valid value: 1–10.​
  • Multiple instance types are separated by &.​
tip​
If you configure both InstanceTypeFamily and InstanceTypeIds.N, InstanceTypeIds.N takes effect.​
​
MaxResults integer Optional Sample value: 100​
The number of entries returned on each page in a pagination query.​
  • Maximum value: 1000​
  • Minimum value: 1​
  • Default value: 100​
​
MemorySize integer Optional Sample value: 32768​
The memory size of the instance type. Unit: MiB.​
If you configure both MemorySize and MinMemorySize, MemorySize takes effect.​
​
MinCpus integer Optional Sample value: 2​
The minimum number of vCPUs for the instance type.​
  • You can configure this parameter to perform a fuzzy query. For example, if you set MinCpus to 2, spot instances with two or more vCPUs in this availability zone are queried.​
  • If you configure both Cpus and MinCpus, Cpus takes effect.​
​
MinMemorySize integer Optional Sample value: 32768​
The minimum memory size of the instance type. Unit: MiB.​
  • You can configure this parameter to perform a fuzzy query. For example, if you set MinMemorySize to 8, spot instances with memory capacity greater than or equal to 8 MiB in this availability zone are queried.​
  • If you configure both MemorySize and MinMemorySize, MemorySize takes effect.​
​
NextToken string Optional Sample value: --​
Pagination token marking the query position. Omit this parameter for initial API requests. In the next query, set the NextToken parameter to the value returned by the previous API call.​
​
ZoneId string Optional Sample value: cn-beijing-a​
The availability zone ID of the instance type.​
You can call the DescribeZones operation to query the availability zones in the same region.​
​
​
​
Response parameters​
The table below lists only the response parameters specific to this operation. For more information, refer to Response structure.​
AvailableSpotResources object[] Sample value: --​
The array consisting of information such as the release rate and discount rate of spot instances over the past 30 days.​
AverageSpotDiscount integer Sample value: 20​
The discount rate of the average price of spot instances in the past 30 days compared to the price of pay-as-you-go instances. Unit: %​
  • Possible values: 1–100​
  • You can calculate the average price of spot instances based on this value. For example, if the price of a pay-as-you-go instance is 1 and the return value is 40 (that is, 40%), then the average price of spot instances over the past 30 days is 0.4.​
​
InstanceType string Sample value: ecs.g2i.large​
Instance type​
​
InterruptionRate integer Sample value: 0​
The average release rate of spot instances over the past 30 days. Unit: %​
​
InterruptionRateRange string Sample value: 0-3%​
The range of the average release rate of spot instances over the past 30 days, corresponding to the return value of InterruptionRate. Possible values:​
  • 0-3%​
  • 3-5%​
  • 5-10%​
  • 10-100%​
​
ZoneId string Sample value: cn-beijing-a​
The ID of the availability zone where the instance is located.​
​
​
NextToken string Sample value: bHpwdXJja2RxemU1eG5sb3NzdGcW1-RCEq******​
The query credentials value returned by this call. If null is returned, this page is the last page.​
​
​
​
Sample request​
​
GET /?Action=DescribeSpotAdvice&Version=2020-04-01&ZoneId=cn-beijing-a&InstanceTypeIds.1=ecs.r2a.xlarge HTTP/1.1​
Host: ecs.cn-beijing.volcengineapi.com​
Region: cn-beijing​
ServiceName: ecs​
​
Sample response​
​
{​
"ResponseMetadata": {​
"RequestId": "20230426113431A57961174C490267****",​
"Action": "DescribeSpotAdvice",​
"Version": "2020-04-01",​
"Service": "ecs",​
"Region": "cn-beijing-a"​
},​
"Result": {​
"AvailableSpotResources": [​
{​
"AverageSpotDiscount": 40,​
"InstanceType": "ecs.r2a.xlarge",​
"InterruptionRateRange": "0-3%",​
"InterruptionRate": 0,​
"ZoneId": "cn-beijing-a"​
}​
],​
"NextToken": "bHpwdXJja2RxemU1eG5sb3NzdGcW1-RCEq******"​
}​
}​
​
Error codes​
The table below lists the business-related error codes of the operation. For more information, refer to Common error codes.​
​
Status code​
Error codes​
Error message​
Description​
400​
InvalidArgument​
The specified argument is invalid.​
The specified parameter is invalid.​
400​
LimitExceeded.MaximumInstanceTypeIds​
You've reached the limit on the number of InstanceTypeIds that you can set.​
The specified number of InstanceTypeIds exceeds the maximum limit.​
500​
InternalError​
An internal error has occurred.​
An internal error occurred. Try again. If multiple attempts fail, submit a ticket.​
​
​
Last updated: 2026.06.18 17:48:26