DescribeServices - AWS Billing and Cost Management

DescribeServices

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.

Request Syntax

{ "FormatVersion": "string", "MaxResults": number, "NextToken": "string", "ServiceCode": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

FormatVersion

The format version that you want the response to be in.

Valid values are: aws_v1

Type: String

Required: No

MaxResults

The maximum number of results that you want returned in the response.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 100.

Required: No

NextToken

The pagination token that indicates the next set of results that you want to retrieve.

Type: String

Required: No

ServiceCode

The code for the service whose information you want to retrieve, such as AmazonEC2. You can use the ServiceCode to filter the results in a GetProducts call. To retrieve a list of all services, leave this blank.

Type: String

Required: No

Response Syntax

{ "FormatVersion": "string", "NextToken": "string", "Services": [ { "AttributeNames": [ "string" ], "ServiceCode": "string" } ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

FormatVersion

The format version of the response. For example, aws_v1.

Type: String

NextToken

The pagination token for the next set of retrievable results.

Type: String

Services

The service metadata for the service or services in the response.

Type: Array of Service objects

Errors

For information about the errors that are common to all actions, see Common Errors.

ExpiredNextTokenException

The pagination token expired. Try again without a pagination token.

HTTP Status Code: 400

InternalErrorException

An error on the server occurred during the processing of your request. Try again later.

HTTP Status Code: 500

InvalidNextTokenException

The pagination token is invalid. Try again without a pagination token.

HTTP Status Code: 400

InvalidParameterException

One or more parameters had an invalid value.

HTTP Status Code: 400

NotFoundException

The requested resource can't be found.

HTTP Status Code: 400

ThrottlingException

You've made too many requests exceeding service quotas.

HTTP Status Code: 400

Examples

The following is a sample request and response of the GetService operation.

This example illustrates one usage of DescribeServices.

Sample Request

POST / HTTP/1.1 Host: api.pricing.<region>.<domain> x-amz-Date: <Date> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=contenttype;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid,Signature=<Signature> User-Agent: <UserAgentString> Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes> Connection: Keep-Alive X-Amz-Target: AWSPriceListService.DescribeServices { "ServiceCode": "AmazonEC2", "FormatVersion": "aws_v1", "NextToken": null, "MaxResults": 1 }

Sample Response

HTTP/1.1 200 OK x-amzn-RequestId: <RequestId> Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes> Date: <Date> { "FormatVersion": "aws_v1", "NextToken": "abcdefg123", "Services": [ { "AttributeNames": [ "volumeType", "maxIopsvolume", "instanceCapacity10xlarge", "locationType", "operation" ], "ServiceCode": "AmazonEC2" } ] }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: