简体   繁体   English

AWS产品API:什么是我们West 2的正确区域位置和URL

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

I am using boto3 pricing client to get on-demand pricing as boto3 ec2 client doesn't have on-demand but spot pricing. 我正在使用boto3定价客户端来获得按需定价,因为boto3 ec2客户端没有按需定价,而是现货定价。

This gives me error saying Could not connect to the endpoint URL: "https://api.pricing.us-west-2.amazonaws.com/ . 这给了我一个错误,提示Could not connect to the endpoint URL: "https://api.pricing.us-west-2.amazonaws.com/

What is the correct region name or location value below for us west 2. I check ed the regions and this is the correct one. 以下是我们西2的正确区域名称或位置值是多少。我检查了这些区域,这是正确的区域。 Does pricing api isn't in Oregon region? 定价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)

There are only two services endpoints supported by the AWS Price List Service API: AWS Price List Service API仅支持两个服务终端节点:

You will need to pick from one of those. 您将需要从其中之一中进行选择。 us-west-2 is not supported. 不支持us-west-2。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 HTTPSConnectionPool(host ='s3-us-west-1b.amazonaws.com',port = 443):网址超出最大重试次数 - HTTPSConnectionPool(host='s3-us-west-1b.amazonaws.com', port=443): Max retries exceeded with url boto us-gov-west-1地区 - boto us-gov-west-1 region 在不提供密钥的情况下在API中公开AWS的正确方法是什么? - What is the correct way to expose an AWS in an API without giving out your keys? Python Boto3 在 us-east-1 和 us-east-2 中存储桶的 AWS S3 预签名 url 响应存在差异 - Python Boto3 there is a difference in AWS S3 presign url response for bucket in us-east-1 and us-east-2 此Amazon Product Advertising API查询有什么问题 - What is wrong with this Amazon Product Advertising API query Django:网址路由到错误的文件,但位置正确:TemplateDoesNotExist错误 - Django: Url routing to the wrong file, but correct location: TemplateDoesNotExist Error 在python中调用URL的正确方法是什么 - What is the correct way to call URL in python 获取错误区域名称[us-west-1]无效[Kinesis流与spark整合] - Getting error Region name [us-west-1] is not valid [Kinesis streaming integration with spark] FTX 问题 US API - Issue with FTX US API Python:PIP安装路径,这个和其他插件的正确位置是什么? - Python: PIP install path, what is the correct location for this and other addons?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM