![](/img/trans.png)
[英]Boto3 get_products pricing returning 0.00 USD for some instance types
[英]Available filter for AWS boto3 Pricing API - get_products
我正在嘗試獲取不同 EC2 實例的定價。 我必須指定不同的過濾器才能獲得最准確的價格。 例如,
import boto3
client = boto3.client('pricing')
response = client.get_products(
ServiceCode='string',
Filters=[
{
'Type': 'TERM_MATCH',
'Field': 'string',
'Value': 'string'
},
],
FormatVersion='string',
NextToken='string',
MaxResults=123
)
我想知道 EC2 實例的所有可用字段和值。 我無法在這方面找到任何東西,因此我們將不勝感激。
謝謝你們!
使用方法describe_services()和服務代碼來獲取所有可用屬性。
使用方法get_attribute_values()獲取屬性值列表
來自描述 get_products() 的同一 API 文檔的更多信息: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/pricing.html#pricing
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.