Copyright | (c) 2013-2018 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Retrieves cost and usage metrics for your account. You can specify which cost and usage-related metric, such as BlendedCosts
or UsageQuantity
, that you want the request to return. You can also filter and group your data by various dimensions, such as SERVICE
or AZ
, in a specific time range. For a complete list of valid dimensions, see the GetDimensionValues
operation. Master accounts in an organization in AWS Organizations have access to all member accounts.
- getCostAndUsage :: GetCostAndUsage
- data GetCostAndUsage
- gcauGroupBy :: Lens' GetCostAndUsage [GroupDefinition]
- gcauNextPageToken :: Lens' GetCostAndUsage (Maybe Text)
- gcauMetrics :: Lens' GetCostAndUsage [Text]
- gcauTimePeriod :: Lens' GetCostAndUsage (Maybe DateInterval)
- gcauGranularity :: Lens' GetCostAndUsage (Maybe Granularity)
- gcauFilter :: Lens' GetCostAndUsage (Maybe Expression)
- getCostAndUsageResponse :: Int -> GetCostAndUsageResponse
- data GetCostAndUsageResponse
- gcaursResultsByTime :: Lens' GetCostAndUsageResponse [ResultByTime]
- gcaursNextPageToken :: Lens' GetCostAndUsageResponse (Maybe Text)
- gcaursGroupDefinitions :: Lens' GetCostAndUsageResponse [GroupDefinition]
- gcaursResponseStatus :: Lens' GetCostAndUsageResponse Int
Creating a Request
getCostAndUsage :: GetCostAndUsage Source #
Creates a value of GetCostAndUsage
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
gcauGroupBy
- You can group AWS costs using up to two different groups, either dimensions, tag keys, or both. When you group by tag key, you get all tag values, including empty strings. Valid values areAZ
,INSTANCE_TYPE
,LEGAL_ENTITY_NAME
,LINKED_ACCOUNT
,OPERATION
,PLATFORM
,PURCHASE_TYPE
,SERVICE
,TAGS
,TENANCY
, andUSAGE_TYPE
.gcauNextPageToken
- The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.gcauMetrics
- Which metrics are returned in the query. For more information about blended and unblended rates, see Why does the "blended" annotation appear on some line items in my bill? . Valid values areBlendedCost
,UnblendedCost
, andUsageQuantity
.Metrics
is required forGetCostAndUsage
requests.gcauTimePeriod
- Sets the start and end dates for retrieving AWS costs. The start date is inclusive, but the end date is exclusive. For example, ifstart
is2017-01-01
andend
is2017-05-01
, then the cost and usage data is retrieved from2017-01-01
up to and including2017-04-30
but not including2017-05-01
.gcauGranularity
- Sets the AWS cost granularity toMONTHLY
orDAILY
. IfGranularity
isn't set, the response object doesn't include theGranularity
, eitherMONTHLY
orDAILY
.gcauFilter
- Filters AWS costs by different dimensions. For example, you can specifySERVICE
andLINKED_ACCOUNT
and get the costs that are associated with that account's usage of that service. You can nestExpression
objects to define any combination of dimension filters. For more information, see Expression .
data GetCostAndUsage Source #
See: getCostAndUsage
smart constructor.
Request Lenses
gcauGroupBy :: Lens' GetCostAndUsage [GroupDefinition] Source #
You can group AWS costs using up to two different groups, either dimensions, tag keys, or both. When you group by tag key, you get all tag values, including empty strings. Valid values are AZ
, INSTANCE_TYPE
, LEGAL_ENTITY_NAME
, LINKED_ACCOUNT
, OPERATION
, PLATFORM
, PURCHASE_TYPE
, SERVICE
, TAGS
, TENANCY
, and USAGE_TYPE
.
gcauNextPageToken :: Lens' GetCostAndUsage (Maybe Text) Source #
The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.
gcauMetrics :: Lens' GetCostAndUsage [Text] Source #
Which metrics are returned in the query. For more information about blended and unblended rates, see Why does the "blended" annotation appear on some line items in my bill? . Valid values are BlendedCost
, UnblendedCost
, and UsageQuantity
. Metrics
is required for GetCostAndUsage
requests.
gcauTimePeriod :: Lens' GetCostAndUsage (Maybe DateInterval) Source #
Sets the start and end dates for retrieving AWS costs. The start date is inclusive, but the end date is exclusive. For example, if start
is 2017-01-01
and end
is 2017-05-01
, then the cost and usage data is retrieved from 2017-01-01
up to and including 2017-04-30
but not including 2017-05-01
.
gcauGranularity :: Lens' GetCostAndUsage (Maybe Granularity) Source #
Sets the AWS cost granularity to MONTHLY
or DAILY
. If Granularity
isn't set, the response object doesn't include the Granularity
, either MONTHLY
or DAILY
.
gcauFilter :: Lens' GetCostAndUsage (Maybe Expression) Source #
Filters AWS costs by different dimensions. For example, you can specify SERVICE
and LINKED_ACCOUNT
and get the costs that are associated with that account's usage of that service. You can nest Expression
objects to define any combination of dimension filters. For more information, see Expression .
Destructuring the Response
getCostAndUsageResponse Source #
Creates a value of GetCostAndUsageResponse
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
gcaursResultsByTime
- The time period that is covered by the results in the response.gcaursNextPageToken
- The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.gcaursGroupDefinitions
- The groups that are specified by theFilter
orGroupBy
parameters in the request.gcaursResponseStatus
- -- | The response status code.
data GetCostAndUsageResponse Source #
See: getCostAndUsageResponse
smart constructor.
Response Lenses
gcaursResultsByTime :: Lens' GetCostAndUsageResponse [ResultByTime] Source #
The time period that is covered by the results in the response.
gcaursNextPageToken :: Lens' GetCostAndUsageResponse (Maybe Text) Source #
The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.
gcaursGroupDefinitions :: Lens' GetCostAndUsageResponse [GroupDefinition] Source #
The groups that are specified by the Filter
or GroupBy
parameters in the request.
gcaursResponseStatus :: Lens' GetCostAndUsageResponse Int Source #
- - | The response status code.