我正在使用boto3定價客戶端來獲取按需定價,因?yàn)閎oto3 ec2客戶端沒有按需定價,而是現(xiàn)貨定價。這給了我錯誤的說法Could not connect to the endpoint URL: "https://api.pricing.us-west-2.amazonaws.com/。以下是我們西2的正確區(qū)域名稱或位置值是多少。我檢查了這些區(qū)域,這是正確的區(qū)域。定價API是否不在俄勒岡州地區(qū)? 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)
添加回答
舉報
0/150
提交
取消