簡體   English   中英

AWS產品API:什么是我們West 2的正確區域位置和URL

[英]aws product api: what is the correct regional location and url for us west 2

我正在使用boto3定價客戶端來獲得按需定價,因為boto3 ec2客戶端沒有按需定價,而是現貨定價。

這給了我一個錯誤,提示Could not connect to the endpoint URL: "https://api.pricing.us-west-2.amazonaws.com/

以下是我們西2的正確區域名稱或位置值是多少。我檢查了這些區域,這是正確的區域。 定價API是否不在俄勒岡州地區?

        pricing = boto3.client('pricing', region_name='us-west-2')
        response = pricing.get_products(
        ServiceCode='AmazonEC2',
        Filters=[
            {'Type': 'TERM_MATCH', 'Field': 'operatingSystem', 'Value': 'Linux'},
            {'Type':'TERM_MATCH', 'Field': 'location', 'Value': 'US West (Oregon)'}

        ],
        MaxResults=20
    )

    for price in response['PriceList']:
        resp = json.loads(price)
        on_demand = resp['terms']['OnDemand']
        print len(on_demand)
        print(on_demand)

AWS Price List Service API僅支持兩個服務終端節點:

您將需要從其中之一中進行選擇。 不支持us-west-2。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM