我正在嘗試獲取不同 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 實體的所有可用欄位和值。我一直無法找到任何關于此的任何幫助,因此將不勝感激。
謝謝你們!
uj5u.com熱心網友回復:
使用帶有服務代碼的方法describe_services()來獲取所有可用的屬性。
使用方法get_attribute_values()獲取某個屬性的所有屬性值的串列。
來自描述 get_products() 的相同 API 檔案的更多資訊:https ://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/pricing.html#pricing
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/402873.html
標籤:
上一篇:無法創建檔案彈性beantalk
