Reads:73534Replies:5
Instance price
Hello!
Is there a way to get instance price from API? I found SpotPriceHistory, but that is not what I need |
|
1st Reply#
Posted time:Jun 9, 2018 8:13 AM
are you referring to API Gateway?
refer to API gateway document here https://www.alibabacloud.com/product/api-gateway Pricing https://www.alibabacloud.com/product/api-gateway#pricing |
|
|
2nd Reply#
Posted time:Jun 11, 2018 9:47 AM
Spot instances pricing is determined by bidding. If your bid wins then you will know the price. There is no API to get the current price as the price changes instant by instant and could be out of date by the time you then created your bid. AWS has the same limitation.
Solution: use spot history, determine your maximum bid, win the bid and display the price. |
|
|
3rd Reply#
Posted time:Jun 15, 2018 17:05 PM
There are two APIs for querying ECS prices: DescribePriceRequest and DescribePriceResponse. But only whitelisted users can use it. Please submit a ticket to request for permissons. Hope it helps. |
|
4Floor#
Posted time:Jun 18, 2018 22:23 PM
I'm now trying to get all prices for all instance types in all zones, I loop through regions, getting its zones and then loop through the zone.AvailableInstanceTypes and trying to get SpotPriceHistory for this instance type, the weird part, that I'm getting a different number of prices, sometimes I'm getting empty SpotPriceHistory for some instance type, but next time I successfully receive a list of SpotPriceHistory.
Any ideas why this happening? |
|
5Floor#
Posted time:Jun 18, 2018 22:26 PM
Faxin:There are two APIs for querying ECS prices: DescribePriceRequest and DescribePriceResponse.as I understand I can get only one price for specified instance, but I have thousands and thousands of instances, so I think it's better for me to get all prices for all instance types in all regions, and periodically refresh that list, what do you think? |
|