简体   繁体   English

AWS boto3 定价 API - get_products 的可用过滤器

[英]Available filter for AWS boto3 Pricing API - get_products

I'm trying to get the pricing for different EC2 instances.我正在尝试获取不同 EC2 实例的定价。 I have to specify different filters to get the most accurate price.我必须指定不同的过滤器才能获得最准确的价格。 For example,例如,

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
)

I would like to know all the available fields and values for EC2 instances.我想知道 EC2 实例的所有可用字段和值。 I've not been able to find anything on this so any help will be appreciated.我无法在这方面找到任何东西,因此我们将不胜感激。

Thank you all!谢谢你们!

Use method describe_services() with service code to get all available attributes.使用方法describe_services()和服务代码来获取所有可用属性。

Use method get_attribute_values() to get list of attribute values使用方法get_attribute_values()获取属性值列表

More information from the same API documentation where get_products() was described: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/pricing.html#pricing来自描述 get_products() 的同一 API 文档的更多信息: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/pricing.html#pricing

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM