amazonka-cost-explorer-1.6.1: Amazon Cost Explorer Service SDK.

Copyright(c) 2013-2018 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.CostExplorer.GetCostAndUsage

Contents

Description

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.

Synopsis

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 are AZ , INSTANCE_TYPE , LEGAL_ENTITY_NAME , LINKED_ACCOUNT , OPERATION , PLATFORM , PURCHASE_TYPE , SERVICE , TAGS , TENANCY , and USAGE_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 are BlendedCost , UnblendedCost , and UsageQuantity . Metrics is required for GetCostAndUsage 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, 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 - 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 - 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 .

data GetCostAndUsage Source #

See: getCostAndUsage smart constructor.

Instances
Eq GetCostAndUsage Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

Data GetCostAndUsage Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> GetCostAndUsage -> c GetCostAndUsage #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c GetCostAndUsage #

toConstr :: GetCostAndUsage -> Constr #

dataTypeOf :: GetCostAndUsage -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c GetCostAndUsage) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GetCostAndUsage) #

gmapT :: (forall b. Data b => b -> b) -> GetCostAndUsage -> GetCostAndUsage #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GetCostAndUsage -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GetCostAndUsage -> r #

gmapQ :: (forall d. Data d => d -> u) -> GetCostAndUsage -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> GetCostAndUsage -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> GetCostAndUsage -> m GetCostAndUsage #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GetCostAndUsage -> m GetCostAndUsage #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GetCostAndUsage -> m GetCostAndUsage #

Read GetCostAndUsage Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

Show GetCostAndUsage Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

Generic GetCostAndUsage Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

Associated Types

type Rep GetCostAndUsage :: Type -> Type #

Hashable GetCostAndUsage Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

ToJSON GetCostAndUsage Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

AWSRequest GetCostAndUsage Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

Associated Types

type Rs GetCostAndUsage :: Type #

ToHeaders GetCostAndUsage Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

ToPath GetCostAndUsage Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

ToQuery GetCostAndUsage Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

NFData GetCostAndUsage Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

Methods

rnf :: GetCostAndUsage -> () #

type Rep GetCostAndUsage Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

type Rep GetCostAndUsage = D1 (MetaData "GetCostAndUsage" "Network.AWS.CostExplorer.GetCostAndUsage" "amazonka-cost-explorer-1.6.1-7sTfcQv11bzDg3vrG851Fd" False) (C1 (MetaCons "GetCostAndUsage'" PrefixI True) ((S1 (MetaSel (Just "_gcauGroupBy") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe [GroupDefinition])) :*: (S1 (MetaSel (Just "_gcauNextPageToken") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_gcauMetrics") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe [Text])))) :*: (S1 (MetaSel (Just "_gcauTimePeriod") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe DateInterval)) :*: (S1 (MetaSel (Just "_gcauGranularity") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Granularity)) :*: S1 (MetaSel (Just "_gcauFilter") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Expression))))))
type Rs GetCostAndUsage Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

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 the Filter or GroupBy parameters in the request.
  • gcaursResponseStatus - -- | The response status code.

data GetCostAndUsageResponse Source #

See: getCostAndUsageResponse smart constructor.

Instances
Eq GetCostAndUsageResponse Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

Data GetCostAndUsageResponse Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> GetCostAndUsageResponse -> c GetCostAndUsageResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c GetCostAndUsageResponse #

toConstr :: GetCostAndUsageResponse -> Constr #

dataTypeOf :: GetCostAndUsageResponse -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c GetCostAndUsageResponse) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GetCostAndUsageResponse) #

gmapT :: (forall b. Data b => b -> b) -> GetCostAndUsageResponse -> GetCostAndUsageResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GetCostAndUsageResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GetCostAndUsageResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> GetCostAndUsageResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> GetCostAndUsageResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> GetCostAndUsageResponse -> m GetCostAndUsageResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GetCostAndUsageResponse -> m GetCostAndUsageResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GetCostAndUsageResponse -> m GetCostAndUsageResponse #

Read GetCostAndUsageResponse Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

Show GetCostAndUsageResponse Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

Generic GetCostAndUsageResponse Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

Associated Types

type Rep GetCostAndUsageResponse :: Type -> Type #

NFData GetCostAndUsageResponse Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

Methods

rnf :: GetCostAndUsageResponse -> () #

type Rep GetCostAndUsageResponse Source # 
Instance details

Defined in Network.AWS.CostExplorer.GetCostAndUsage

type Rep GetCostAndUsageResponse = D1 (MetaData "GetCostAndUsageResponse" "Network.AWS.CostExplorer.GetCostAndUsage" "amazonka-cost-explorer-1.6.1-7sTfcQv11bzDg3vrG851Fd" False) (C1 (MetaCons "GetCostAndUsageResponse'" PrefixI True) ((S1 (MetaSel (Just "_gcaursResultsByTime") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe [ResultByTime])) :*: S1 (MetaSel (Just "_gcaursNextPageToken") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 (MetaSel (Just "_gcaursGroupDefinitions") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe [GroupDefinition])) :*: S1 (MetaSel (Just "_gcaursResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int))))

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.