Pricing / Client / get_attribute_values

get_attribute_values#

Pricing.Client.get_attribute_values(**kwargs)#

Returns a list of attribute values. Attributes are similar to the details in a Price List API offer file. For a list of available attributes, see Offer File Definitions in the 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
)
Parameters:
  • ServiceCode (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.

  • AttributeName (string) –

    [REQUIRED]

    The name of the attribute that you want to retrieve the values for, such as volumeType.

  • NextToken (string) – The pagination token that indicates the next set of results that you want to retrieve.

  • MaxResults (integer) – The maximum number of results to return in response.

Return type:

dict

Returns:

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.

Exceptions

  • Pricing.Client.exceptions.InternalErrorException

  • Pricing.Client.exceptions.InvalidParameterException

  • Pricing.Client.exceptions.NotFoundException

  • Pricing.Client.exceptions.InvalidNextTokenException

  • Pricing.Client.exceptions.ExpiredNextTokenException

Examples

This operation returns a list of values available for the given attribute.

response = client.get_attribute_values(
    AttributeName='volumeType',
    MaxResults=2,
    ServiceCode='AmazonEC2',
)

print(response)

Expected Output:

{
    'AttributeValues': [
        {
            'Value': 'Throughput Optimized HDD',
        },
        {
            'Value': 'Provisioned IOPS',
        },
    ],
    'NextToken': 'GpgauEXAMPLEezucl5LV0w==:7GzYJ0nw0DBTJ2J66EoTIIynE6O1uXwQtTRqioJzQadBnDVgHPzI1en4BUQnPCLpzeBk9RQQAWaFieA4+DapFAGLgk+Z/9/cTw9GldnPOHN98+FdmJP7wKU3QQpQ8MQr5KOeBkIsAqvAQYdL0DkL7tHwPtE5iCEByAmg9gcC/yBU1vAOsf7R3VaNN4M5jMDv3woSWqASSIlBVB6tgW78YL22KhssoItM/jWW+aP6Jqtq4mldxp/ct6DWAl+xLFwHU/CbketimPPXyqHF3/UXDw==',
    'ResponseMetadata': {
        '...': '...',
    },
}