AWS Price List Service 2017-10-15
- Client: Aws\Pricing\PricingClient
- Service ID: pricing
- Version: 2017-10-15
This page describes the parameters and results for the operations of the AWS Price List Service (2017-10-15), and shows how to use the Aws\Pricing\PricingClient object to call the described operations. This documentation is specific to the 2017-10-15 API version of the service.
Operation Summary
Each of the following operations can be created from a client using
$client->getCommand('CommandName')
, where "CommandName" is the
name of one of the following operations. Note: a command is a value that
encapsulates an operation and the parameters used to create an HTTP request.
You can also create and send a command immediately using the magic methods
available on a client object: $client->commandName(/* parameters */)
.
You can send the command asynchronously (returning a promise) by appending the
word "Async" to the operation name: $client->commandNameAsync(/* parameters */)
.
- DescribeServices ( array $params = [] )
Returns the metadata for one service or a list of the metadata for all services.
- GetAttributeValues ( array $params = [] )
Returns a list of attribute values.
- GetProducts ( array $params = [] )
Returns a list of all products that match the filter criteria.
Paginators
Paginators handle automatically iterating over paginated API results. Paginators are associated with specific API operations, and they accept the parameters that the corresponding API operation accepts. You can get a paginator from a client class using getPaginator($paginatorName, $operationParameters). This client supports the following paginators:
Operations
DescribeServices
$result = $client->describeServices
([/* ... */]); $promise = $client->describeServicesAsync
([/* ... */]);
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
.
Parameter Syntax
$result = $client->describeServices([ 'FormatVersion' => '<string>', 'MaxResults' => <integer>, 'NextToken' => '<string>', 'ServiceCode' => '<string>', ]);
Parameter Details
Members
- FormatVersion
-
- Type: string
The format version that you want the response to be in.
Valid values are:
aws_v1
- MaxResults
-
- Type: int
The maximum number of results that you want returned in the response.
- NextToken
-
- Type: string
The pagination token that indicates the next set of results that you want to retrieve.
- ServiceCode
-
- Type: string
The code for the service whose information you want to retrieve, such as
AmazonEC2
. You can use theServiceCode
to filter the results in aGetProducts
call. To retrieve a list of all services, leave this blank.
Result Syntax
[ 'FormatVersion' => '<string>', 'NextToken' => '<string>', 'Services' => [ [ 'AttributeNames' => ['<string>', ...], 'ServiceCode' => '<string>', ], // ... ], ]
Result Details
Members
- FormatVersion
-
- Type: string
The format version of the response. For example,
aws_v1
. - NextToken
-
- Type: string
The pagination token for the next set of retreivable results.
- Services
-
- Type: Array of Service structures
The service metadata for the service or services in the response.
Errors
-
An error on the server occurred during the processing of your request. Try again later.
-
One or more parameters had an invalid value.
-
The requested resource can't be found.
-
The pagination token is invalid. Try again without a pagination token.
-
The pagination token expired. Try again without a pagination token.
Examples
Example 1: To retrieve a list of services and service codes
Retrieves the service for the given Service Code.
$result = $client->describeServices([ 'FormatVersion' => 'aws_v1', 'MaxResults' => 1, 'ServiceCode' => 'AmazonEC2', ]);
Result syntax:
[ 'FormatVersion' => 'aws_v1', 'NextToken' => 'abcdefg123', 'Services' => [ [ 'AttributeNames' => [ 'volumeType', 'maxIopsvolume', 'instanceCapacity10xlarge', 'locationType', 'operation', ], 'ServiceCode' => 'AmazonEC2', ], ], ]
GetAttributeValues
$result = $client->getAttributeValues
([/* ... */]); $promise = $client->getAttributeValuesAsync
([/* ... */]);
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.
Parameter Syntax
$result = $client->getAttributeValues([ 'AttributeName' => '<string>', // REQUIRED 'MaxResults' => <integer>, 'NextToken' => '<string>', 'ServiceCode' => '<string>', // REQUIRED ]);
Parameter Details
Members
- AttributeName
-
- Required: Yes
- Type: string
The name of the attribute that you want to retrieve the values for, such as
volumeType
. - MaxResults
-
- Type: int
The maximum number of results to return in response.
- NextToken
-
- Type: string
The pagination token that indicates the next set of results that you want to retrieve.
- ServiceCode
-
- Required: Yes
- Type: string
The service code for the service whose attributes you want to retrieve. For example, if you want the retrieve an EC2 attribute, use
AmazonEC2
.
Result Syntax
[ 'AttributeValues' => [ [ 'Value' => '<string>', ], // ... ], 'NextToken' => '<string>', ]
Result Details
Members
- AttributeValues
-
- Type: Array of AttributeValue structures
The list of values for an attribute. For example,
Throughput Optimized HDD
andProvisioned IOPS
are two available values for theAmazonEC2
volumeType
. - NextToken
-
- Type: string
The pagination token that indicates the next set of results to retrieve.
Errors
-
An error on the server occurred during the processing of your request. Try again later.
-
One or more parameters had an invalid value.
-
The requested resource can't be found.
-
The pagination token is invalid. Try again without a pagination token.
-
The pagination token expired. Try again without a pagination token.
Examples
Example 1: To retrieve a list of attribute values
This operation returns a list of values available for the given attribute.
$result = $client->getAttributeValues([ 'AttributeName' => 'volumeType', 'MaxResults' => 2, 'ServiceCode' => 'AmazonEC2', ]);
Result syntax:
[ 'AttributeValues' => [ [ 'Value' => 'Throughput Optimized HDD', ], [ 'Value' => 'Provisioned IOPS', ], ], 'NextToken' => 'GpgauEXAMPLEezucl5LV0w==:7GzYJ0nw0DBTJ2J66EoTIIynE6O1uXwQtTRqioJzQadBnDVgHPzI1en4BUQnPCLpzeBk9RQQAWaFieA4+DapFAGLgk+Z/9/cTw9GldnPOHN98+FdmJP7wKU3QQpQ8MQr5KOeBkIsAqvAQYdL0DkL7tHwPtE5iCEByAmg9gcC/yBU1vAOsf7R3VaNN4M5jMDv3woSWqASSIlBVB6tgW78YL22KhssoItM/jWW+aP6Jqtq4mldxp/ct6DWAl+xLFwHU/CbketimPPXyqHF3/UXDw==', ]
GetProducts
$result = $client->getProducts
([/* ... */]); $promise = $client->getProductsAsync
([/* ... */]);
Returns a list of all products that match the filter criteria.
Parameter Syntax
$result = $client->getProducts([ 'Filters' => [ [ 'Field' => '<string>', // REQUIRED 'Type' => 'TERM_MATCH', // REQUIRED 'Value' => '<string>', // REQUIRED ], // ... ], 'FormatVersion' => '<string>', 'MaxResults' => <integer>, 'NextToken' => '<string>', 'ServiceCode' => '<string>', ]);
Parameter Details
Members
- Filters
-
- Type: Array of Filter structures
The list of filters that limit the returned products. only products that match all filters are returned.
- FormatVersion
-
- Type: string
The format version that you want the response to be in.
Valid values are:
aws_v1
- MaxResults
-
- Type: int
The maximum number of results to return in the response.
- NextToken
-
- Type: string
The pagination token that indicates the next set of results that you want to retrieve.
- ServiceCode
-
- Type: string
The code for the service whose products you want to retrieve.
Result Syntax
[ 'FormatVersion' => '<string>', 'NextToken' => '<string>', 'PriceList' => ['<string>', ...], ]
Result Details
Members
- FormatVersion
-
- Type: string
The format version of the response. For example, aws_v1.
- NextToken
-
- Type: string
The pagination token that indicates the next set of results to retrieve.
- PriceList
-
- Type: Array of string (string|number|array|map or anything parsable by json_encode)s
The list of products that match your filters. The list contains both the product metadata and the price information.
Errors
-
An error on the server occurred during the processing of your request. Try again later.
-
One or more parameters had an invalid value.
-
The requested resource can't be found.
-
The pagination token is invalid. Try again without a pagination token.
-
The pagination token expired. Try again without a pagination token.
Examples
Example 1: To retrieve a list of products
This operation returns a list of products that match the given criteria.
$result = $client->getProducts([ 'Filters' => [ [ 'Field' => 'ServiceCode', 'Type' => 'TERM_MATCH', 'Value' => 'AmazonEC2', ], [ 'Field' => 'volumeType', 'Type' => 'TERM_MATCH', 'Value' => 'Provisioned IOPS', ], ], 'FormatVersion' => 'aws_v1', 'MaxResults' => 1, ]);
Result syntax:
[ 'FormatVersion' => 'aws_v1', 'NextToken' => '57r3EXAMPLEujbzWfHF7Ciw==:ywSmZsD3mtpQmQLQ5XfOsIMkYybSj+vAT+kGmwMFq+K9DGmIoJkz7lunVeamiOPgthdWSO2a7YKojCO+zY4dJmuNl2QvbNhXs+AJ2Ufn7xGmJncNI2TsEuAsVCUfTAvAQNcwwamtk6XuZ4YdNnooV62FjkV3ZAn40d9+wAxV7+FImvhUHi/+f8afgZdGh2zPUlH8jlV9uUtj0oHp8+DhPUuHXh+WBII1E/aoKpPSm3c=', 'PriceList' => [ '{"product":{"productFamily":"Storage","attributes":{"storageMedia":"SSD-backed","maxThroughputvolume":"320 MB/sec","volumeType":"Provisioned IOPS","maxIopsvolume":"20000","servicecode":"AmazonEC2","usagetype":"CAN1-EBS:VolumeUsage.piops","locationType":"AWS Region","location":"Canada (Central)","servicename":"Amazon Elastic Compute Cloud","maxVolumeSize":"16 TiB","operation":""},"sku":"WQGC34PB2AWS8R4U"},"serviceCode":"AmazonEC2","terms":{"OnDemand":{"WQGC34PB2AWS8R4U.JRTCKXETXF":{"priceDimensions":{"WQGC34PB2AWS8R4U.JRTCKXETXF.6YS6EN2CT7":{"unit":"GB-Mo","endRange":"Inf","description":"$0.138 per GB-month of Provisioned IOPS SSD (io1) provisioned storage - Canada (Central)","appliesTo":[],"rateCode":"WQGC34PB2AWS8R4U.JRTCKXETXF.6YS6EN2CT7","beginRange":"0","pricePerUnit":{"USD":"0.1380000000"}}},"sku":"WQGC34PB2AWS8R4U","effectiveDate":"2017-08-01T00:00:00Z","offerTermCode":"JRTCKXETXF","termAttributes":{}}}},"version":"20170901182201","publicationDate":"2017-09-01T18:22:01Z"}', ], ]
Shapes
AttributeValue
Description
The values of a given attribute, such as Throughput Optimized HDD
or Provisioned IOPS
for the Amazon EC2
volumeType
attribute.
Members
ExpiredNextTokenException
Description
The pagination token expired. Try again without a pagination token.
Members
Filter
Description
The constraints that you want all returned products to match.
Members
- Field
-
- Required: Yes
- Type: string
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 namesFor example, you can filter by the
AmazonEC2
service code and thevolumeType
attribute name to get the prices for only Amazon EC2 volumes. - Type
-
- Required: Yes
- Type: string
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. - Value
-
- Required: Yes
- Type: string
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 aProvisioned IOPS
volume.
InternalErrorException
Description
An error on the server occurred during the processing of your request. Try again later.
Members
InvalidNextTokenException
Description
The pagination token is invalid. Try again without a pagination token.