Table of Contents
A low-level client representing AWS Price List Service (Pricing):
import boto3
client = boto3.client('pricing')
These are the available methods:
Check if an operation can be paginated.
Returns the metadata for one service or a list of the metadata for all services. Use this without a service code to get the service codes for all services. Use it with a service code, such as AmazonEC2 , to get information specific to that service, such as the attribute names available for that service. For example, some of the attribute names available for EC2 are volumeType , maxIopsVolume , operation , locationType , and instanceCapacity10xlarge .
See also: AWS API Documentation
Request Syntax
response = client.describe_services(
ServiceCode='string',
FormatVersion='string',
NextToken='string',
MaxResults=123
)
The format version that you want the response to be in.
Valid values are: aws_v1
dict
Response Syntax
{
'Services': [
{
'ServiceCode': 'string',
'AttributeNames': [
'string',
]
},
],
'FormatVersion': 'string',
'NextToken': 'string'
}
Response Structure
(dict) --
Services (list) --
The service metadata for the service or services in the response.
(dict) --
The metadata for a service, such as the service code and available attribute names.
ServiceCode (string) --
The code for the AWS service.
AttributeNames (list) --
The attributes that are available for this service.
FormatVersion (string) --
The format version of the response. For example, aws_v1 .
NextToken (string) --
The pagination token for the next set of retreivable results.
Generate a presigned url given a client, its method, and arguments
The presigned url
Returns a list of attribute values. Attibutes are similar to the details in a Price List API offer file. For a list of available attributes, see Offer File Definitions in the AWS Billing and Cost Management User Guide .
See also: AWS API Documentation
Request Syntax
response = client.get_attribute_values(
ServiceCode='string',
AttributeName='string',
NextToken='string',
MaxResults=123
)
[REQUIRED]
The service code for the service whose attributes you want to retrieve. For example, if you want the retrieve an EC2 attribute, use AmazonEC2 .
[REQUIRED]
The name of the attribute that you want to retrieve the values for, such as volumeType .
dict
Response Syntax
{
'AttributeValues': [
{
'Value': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
AttributeValues (list) --
The list of values for an attribute. For example, Throughput Optimized HDD and Provisioned IOPS are two available values for the AmazonEC2 volumeType .
(dict) --
The values of a given attribute, such as Throughput Optimized HDD or Provisioned IOPS for the Amazon EC2 volumeType attribute.
Value (string) --
The specific value of an attributeName .
NextToken (string) --
The pagination token that indicates the next set of results to retrieve.
Create a paginator for an operation.
Returns a list of all products that match the filter criteria.
See also: AWS API Documentation
Request Syntax
response = client.get_products(
ServiceCode='string',
Filters=[
{
'Type': 'TERM_MATCH',
'Field': 'string',
'Value': 'string'
},
],
FormatVersion='string',
NextToken='string',
MaxResults=123
)
The list of filters that limit the returned products. only products that match all filters are returned.
The constraints that you want all returned products to match.
The type of filter that you want to use.
Valid values are: TERM_MATCH . TERM_MATCH returns only products that match both the given filter field and the given value.
The product metadata field that you want to filter on. You can filter by just the service code to see all products for a specific service, filter by just the attribute name to see a specific attribute for multiple services, or use both a service code and an attribute name to retrieve only products that match both fields.
Valid values include: ServiceCode , and all attribute names
For example, you can filter by the AmazonEC2 service code and the volumeType attribute name to get the prices for only Amazon EC2 volumes.
The service code or attribute value that you want to filter by. If you are filtering by service code this is the actual service code, such as AmazonEC2 . If you are filtering by attribute name, this is the attribute value that you want the returned products to match, such as a Provisioned IOPS volume.
The format version that you want the response to be in.
Valid values are: aws_v1
dict
Response Syntax
{
'FormatVersion': 'string',
'PriceList': [
'string',
],
'NextToken': 'string'
}
Response Structure
(dict) --
FormatVersion (string) --
The format version of the response. For example, aws_v1.
PriceList (list) --
The list of products that match your filters. The list contains both the product metadata and the price information.
NextToken (string) --
The pagination token that indicates the next set of results to retrieve.
Returns an object that can wait for some condition.
The available paginators are:
paginator = client.get_paginator('describe_services')
Creates an iterator that will paginate through responses from Pricing.Client.describe_services().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ServiceCode='string',
FormatVersion='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The format version that you want the response to be in.
Valid values are: aws_v1
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Services': [
{
'ServiceCode': 'string',
'AttributeNames': [
'string',
]
},
],
'FormatVersion': 'string',
}
Response Structure
(dict) --
Services (list) --
The service metadata for the service or services in the response.
(dict) --
The metadata for a service, such as the service code and available attribute names.
ServiceCode (string) --
The code for the AWS service.
AttributeNames (list) --
The attributes that are available for this service.
FormatVersion (string) --
The format version of the response. For example, aws_v1 .
paginator = client.get_paginator('get_attribute_values')
Creates an iterator that will paginate through responses from Pricing.Client.get_attribute_values().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ServiceCode='string',
AttributeName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The service code for the service whose attributes you want to retrieve. For example, if you want the retrieve an EC2 attribute, use AmazonEC2 .
[REQUIRED]
The name of the attribute that you want to retrieve the values for, such as volumeType .
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'AttributeValues': [
{
'Value': 'string'
},
],
}
Response Structure
(dict) --
AttributeValues (list) --
The list of values for an attribute. For example, Throughput Optimized HDD and Provisioned IOPS are two available values for the AmazonEC2 volumeType .
(dict) --
The values of a given attribute, such as Throughput Optimized HDD or Provisioned IOPS for the Amazon EC2 volumeType attribute.
Value (string) --
The specific value of an attributeName .
paginator = client.get_paginator('get_products')
Creates an iterator that will paginate through responses from Pricing.Client.get_products().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ServiceCode='string',
Filters=[
{
'Type': 'TERM_MATCH',
'Field': 'string',
'Value': 'string'
},
],
FormatVersion='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
The list of filters that limit the returned products. only products that match all filters are returned.
The constraints that you want all returned products to match.
The type of filter that you want to use.
Valid values are: TERM_MATCH . TERM_MATCH returns only products that match both the given filter field and the given value.
The product metadata field that you want to filter on. You can filter by just the service code to see all products for a specific service, filter by just the attribute name to see a specific attribute for multiple services, or use both a service code and an attribute name to retrieve only products that match both fields.
Valid values include: ServiceCode , and all attribute names
For example, you can filter by the AmazonEC2 service code and the volumeType attribute name to get the prices for only Amazon EC2 volumes.
The service code or attribute value that you want to filter by. If you are filtering by service code this is the actual service code, such as AmazonEC2 . If you are filtering by attribute name, this is the attribute value that you want the returned products to match, such as a Provisioned IOPS volume.
The format version that you want the response to be in.
Valid values are: aws_v1
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'FormatVersion': 'string',
'PriceList': [
'string',
],
}
Response Structure
(dict) --
FormatVersion (string) --
The format version of the response. For example, aws_v1.
PriceList (list) --
The list of products that match your filters. The list contains both the product metadata and the price information.