选择您的 Cookie 首选项

我们使用必要 Cookie 和类似工具提供我们的网站和服务。我们使用性能 Cookie 收集匿名统计数据,以便我们可以了解客户如何使用我们的网站并进行改进。必要 Cookie 无法停用,但您可以单击“自定义”或“拒绝”来拒绝性能 Cookie。

如果您同意,AWS 和经批准的第三方还将使用 Cookie 提供有用的网站功能、记住您的首选项并显示相关内容,包括相关广告。要接受或拒绝所有非必要 Cookie,请单击“接受”或“拒绝”。要做出更详细的选择,请单击“自定义”。

GetSavingsPlansCoverage

聚焦模式
GetSavingsPlansCoverage - AWS Billing and Cost Management
此页面尚未翻译为您的语言。 请求翻译

Retrieves the Savings Plans covered for your account. This enables you to see how much of your cost is covered by a Savings Plan. An organization’s management account can see the coverage of the associated member accounts. This supports dimensions, Cost Categories, and nested expressions. For any time period, you can filter data for Savings Plans usage with the following dimensions:

  • LINKED_ACCOUNT

  • REGION

  • SERVICE

  • INSTANCE_FAMILY

To determine valid values for a dimension, use the GetDimensionValues operation.

Request Syntax

{ "Filter": { "And": [ "Expression" ], "CostCategories": { "Key": "string", "MatchOptions": [ "string" ], "Values": [ "string" ] }, "Dimensions": { "Key": "string", "MatchOptions": [ "string" ], "Values": [ "string" ] }, "Not": "Expression", "Or": [ "Expression" ], "Tags": { "Key": "string", "MatchOptions": [ "string" ], "Values": [ "string" ] } }, "Granularity": "string", "GroupBy": [ { "Key": "string", "Type": "string" } ], "MaxResults": number, "Metrics": [ "string" ], "NextToken": "string", "SortBy": { "Key": "string", "SortOrder": "string" }, "TimePeriod": { "End": "string", "Start": "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.

Filter

Filters Savings Plans coverage data by dimensions. You can filter data for Savings Plans usage with the following dimensions:

  • LINKED_ACCOUNT

  • REGION

  • SERVICE

  • INSTANCE_FAMILY

GetSavingsPlansCoverage uses the same Expression object as the other operations, but only AND is supported among each dimension. If there are multiple values for a dimension, they are OR'd together.

Cost category is also supported.

Type: Expression object

Required: No

Granularity

The granularity of the Amazon Web Services cost data for your Savings Plans. Granularity can't be set if GroupBy is set.

The GetSavingsPlansCoverage operation supports only DAILY and MONTHLY granularities.

Type: String

Valid Values: DAILY | MONTHLY | HOURLY

Required: No

GroupBy

You can group the data using the attributes INSTANCE_FAMILY, REGION, or SERVICE.

Type: Array of GroupDefinition objects

Required: No

MaxResults

The number of items to be returned in a response. The default is 20, with a minimum value of 1.

Type: Integer

Valid Range: Minimum value of 1.

Required: No

Metrics

The measurement that you want your Savings Plans coverage reported in. The only valid value is SpendCoveredBySavingsPlans.

Type: Array of strings

Length Constraints: Minimum length of 0. Maximum length of 1024.

Pattern: [\S\s]*

Required: No

NextToken

The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 8192.

Pattern: [\S\s]*

Required: No

SortBy

The value that you want to sort the data by.

The following values are supported for Key:

  • SpendCoveredBySavingsPlan

  • OnDemandCost

  • CoveragePercentage

  • TotalCost

  • InstanceFamily

  • Region

  • Service

The supported values for SortOrder are ASCENDING and DESCENDING.

Type: SortDefinition object

Required: No

TimePeriod

The time period that you want the usage and costs for. The Start date must be within 13 months. The End date must be after the Start date, and before the current date. Future dates can't be used as an End date.

Type: DateInterval object

Required: Yes

Response Syntax

{ "NextToken": "string", "SavingsPlansCoverages": [ { "Attributes": { "string" : "string" }, "Coverage": { "CoveragePercentage": "string", "OnDemandCost": "string", "SpendCoveredBySavingsPlans": "string", "TotalCost": "string" }, "TimePeriod": { "End": "string", "Start": "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.

NextToken

The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 8192.

Pattern: [\S\s]*

SavingsPlansCoverages

The amount of spend that your Savings Plans covered.

Type: Array of SavingsPlansCoverage objects

Errors

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

DataUnavailableException

The requested data is unavailable.

HTTP Status Code: 400

InvalidNextTokenException

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

HTTP Status Code: 400

LimitExceededException

You made too many calls in a short period of time. Try again later.

HTTP Status Code: 400

See Also

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

隐私网站条款Cookie 首选项
© 2025, Amazon Web Services, Inc. 或其附属公司。保留所有权利。