Skip to content

CostExplorerClient#

Index > CostExplorer > CostExplorerClient

Auto-generated documentation for CostExplorer type annotations stubs module mypy-boto3-ce.

CostExplorerClient#

Type annotations and code completion for boto3.client("ce"). boto3 documentation

# CostExplorerClient usage example

from boto3.session import Session
from mypy_boto3_ce.client import CostExplorerClient

def get_ce_client() -> CostExplorerClient:
    return Session().client("ce")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("ce").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("ce")

try:
    do_something(client)
except (
    client.exceptions.AnalysisNotFoundException,
    client.exceptions.BackfillLimitExceededException,
    client.exceptions.BillExpirationException,
    client.exceptions.ClientError,
    client.exceptions.DataUnavailableException,
    client.exceptions.GenerationExistsException,
    client.exceptions.InvalidNextTokenException,
    client.exceptions.LimitExceededException,
    client.exceptions.RequestChangedException,
    client.exceptions.ResourceNotFoundException,
    client.exceptions.ServiceQuotaExceededException,
    client.exceptions.TooManyTagsException,
    client.exceptions.UnknownMonitorException,
    client.exceptions.UnknownSubscriptionException,
    client.exceptions.UnresolvableUsageUnitException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_ce.client import Exceptions

def handle_error(exc: Exceptions.AnalysisNotFoundException) -> None:
    ...

Methods#

can_paginate#

Type annotations and code completion for boto3.client("ce").can_paginate method. boto3 documentation

# can_paginate method definition

def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

generate_presigned_url#

Type annotations and code completion for boto3.client("ce").generate_presigned_url method. boto3 documentation

# generate_presigned_url method definition

def generate_presigned_url(
    self,
    ClientMethod: str,
    Params: Mapping[str, Any] = ...,
    ExpiresIn: int = 3600,
    HttpMethod: str = ...,
) -> str:
    ...

create_anomaly_monitor#

Creates a new cost anomaly detection monitor with the requested type and monitor specification.

Type annotations and code completion for boto3.client("ce").create_anomaly_monitor method. boto3 documentation

# create_anomaly_monitor method definition

def create_anomaly_monitor(
    self,
    *,
    AnomalyMonitor: AnomalyMonitorTypeDef,  # (1)
    ResourceTags: Sequence[ResourceTagTypeDef] = ...,  # (2)
) -> CreateAnomalyMonitorResponseTypeDef:  # (3)
    ...
  1. See AnomalyMonitorTypeDef
  2. See ResourceTagTypeDef
  3. See CreateAnomalyMonitorResponseTypeDef
# create_anomaly_monitor method usage example with argument unpacking

kwargs: CreateAnomalyMonitorRequestRequestTypeDef = {  # (1)
    "AnomalyMonitor": ...,
}

parent.create_anomaly_monitor(**kwargs)
  1. See CreateAnomalyMonitorRequestRequestTypeDef

create_anomaly_subscription#

Adds an alert subscription to a cost anomaly detection monitor.

Type annotations and code completion for boto3.client("ce").create_anomaly_subscription method. boto3 documentation

# create_anomaly_subscription method definition

def create_anomaly_subscription(
    self,
    *,
    AnomalySubscription: AnomalySubscriptionTypeDef,  # (1)
    ResourceTags: Sequence[ResourceTagTypeDef] = ...,  # (2)
) -> CreateAnomalySubscriptionResponseTypeDef:  # (3)
    ...
  1. See AnomalySubscriptionTypeDef
  2. See ResourceTagTypeDef
  3. See CreateAnomalySubscriptionResponseTypeDef
# create_anomaly_subscription method usage example with argument unpacking

kwargs: CreateAnomalySubscriptionRequestRequestTypeDef = {  # (1)
    "AnomalySubscription": ...,
}

parent.create_anomaly_subscription(**kwargs)
  1. See CreateAnomalySubscriptionRequestRequestTypeDef

create_cost_category_definition#

Creates a new Cost Category with the requested name and rules.

Type annotations and code completion for boto3.client("ce").create_cost_category_definition method. boto3 documentation

# create_cost_category_definition method definition

def create_cost_category_definition(
    self,
    *,
    Name: str,
    RuleVersion: CostCategoryRuleVersionType,  # (1)
    Rules: Sequence[CostCategoryRuleUnionTypeDef],  # (2)
    EffectiveStart: str = ...,
    DefaultValue: str = ...,
    SplitChargeRules: Sequence[CostCategorySplitChargeRuleUnionTypeDef] = ...,  # (3)
    ResourceTags: Sequence[ResourceTagTypeDef] = ...,  # (4)
) -> CreateCostCategoryDefinitionResponseTypeDef:  # (5)
    ...
  1. See CostCategoryRuleVersionType
  2. See CostCategoryRuleTypeDef CostCategoryRuleOutputTypeDef
  3. See CostCategorySplitChargeRuleTypeDef CostCategorySplitChargeRuleOutputTypeDef
  4. See ResourceTagTypeDef
  5. See CreateCostCategoryDefinitionResponseTypeDef
# create_cost_category_definition method usage example with argument unpacking

kwargs: CreateCostCategoryDefinitionRequestRequestTypeDef = {  # (1)
    "Name": ...,
    "RuleVersion": ...,
    "Rules": ...,
}

parent.create_cost_category_definition(**kwargs)
  1. See CreateCostCategoryDefinitionRequestRequestTypeDef

delete_anomaly_monitor#

Deletes a cost anomaly monitor.

Type annotations and code completion for boto3.client("ce").delete_anomaly_monitor method. boto3 documentation

# delete_anomaly_monitor method definition

def delete_anomaly_monitor(
    self,
    *,
    MonitorArn: str,
) -> dict[str, Any]:
    ...
# delete_anomaly_monitor method usage example with argument unpacking

kwargs: DeleteAnomalyMonitorRequestRequestTypeDef = {  # (1)
    "MonitorArn": ...,
}

parent.delete_anomaly_monitor(**kwargs)
  1. See DeleteAnomalyMonitorRequestRequestTypeDef

delete_anomaly_subscription#

Deletes a cost anomaly subscription.

Type annotations and code completion for boto3.client("ce").delete_anomaly_subscription method. boto3 documentation

# delete_anomaly_subscription method definition

def delete_anomaly_subscription(
    self,
    *,
    SubscriptionArn: str,
) -> dict[str, Any]:
    ...
# delete_anomaly_subscription method usage example with argument unpacking

kwargs: DeleteAnomalySubscriptionRequestRequestTypeDef = {  # (1)
    "SubscriptionArn": ...,
}

parent.delete_anomaly_subscription(**kwargs)
  1. See DeleteAnomalySubscriptionRequestRequestTypeDef

delete_cost_category_definition#

Deletes a Cost Category.

Type annotations and code completion for boto3.client("ce").delete_cost_category_definition method. boto3 documentation

# delete_cost_category_definition method definition

def delete_cost_category_definition(
    self,
    *,
    CostCategoryArn: str,
) -> DeleteCostCategoryDefinitionResponseTypeDef:  # (1)
    ...
  1. See DeleteCostCategoryDefinitionResponseTypeDef
# delete_cost_category_definition method usage example with argument unpacking

kwargs: DeleteCostCategoryDefinitionRequestRequestTypeDef = {  # (1)
    "CostCategoryArn": ...,
}

parent.delete_cost_category_definition(**kwargs)
  1. See DeleteCostCategoryDefinitionRequestRequestTypeDef

describe_cost_category_definition#

Returns the name, Amazon Resource Name (ARN), rules, definition, and effective dates of a Cost Category that's defined in the account.

Type annotations and code completion for boto3.client("ce").describe_cost_category_definition method. boto3 documentation

# describe_cost_category_definition method definition

def describe_cost_category_definition(
    self,
    *,
    CostCategoryArn: str,
    EffectiveOn: str = ...,
) -> DescribeCostCategoryDefinitionResponseTypeDef:  # (1)
    ...
  1. See DescribeCostCategoryDefinitionResponseTypeDef
# describe_cost_category_definition method usage example with argument unpacking

kwargs: DescribeCostCategoryDefinitionRequestRequestTypeDef = {  # (1)
    "CostCategoryArn": ...,
}

parent.describe_cost_category_definition(**kwargs)
  1. See DescribeCostCategoryDefinitionRequestRequestTypeDef

get_anomalies#

Retrieves all of the cost anomalies detected on your account during the time period that's specified by the DateInterval object.

Type annotations and code completion for boto3.client("ce").get_anomalies method. boto3 documentation

# get_anomalies method definition

def get_anomalies(
    self,
    *,
    DateInterval: AnomalyDateIntervalTypeDef,  # (1)
    MonitorArn: str = ...,
    Feedback: AnomalyFeedbackTypeType = ...,  # (2)
    TotalImpact: TotalImpactFilterTypeDef = ...,  # (3)
    NextPageToken: str = ...,
    MaxResults: int = ...,
) -> GetAnomaliesResponseTypeDef:  # (4)
    ...
  1. See AnomalyDateIntervalTypeDef
  2. See AnomalyFeedbackTypeType
  3. See TotalImpactFilterTypeDef
  4. See GetAnomaliesResponseTypeDef
# get_anomalies method usage example with argument unpacking

kwargs: GetAnomaliesRequestRequestTypeDef = {  # (1)
    "DateInterval": ...,
}

parent.get_anomalies(**kwargs)
  1. See GetAnomaliesRequestRequestTypeDef

get_anomaly_monitors#

Retrieves the cost anomaly monitor definitions for your account.

Type annotations and code completion for boto3.client("ce").get_anomaly_monitors method. boto3 documentation

# get_anomaly_monitors method definition

def get_anomaly_monitors(
    self,
    *,
    MonitorArnList: Sequence[str] = ...,
    NextPageToken: str = ...,
    MaxResults: int = ...,
) -> GetAnomalyMonitorsResponseTypeDef:  # (1)
    ...
  1. See GetAnomalyMonitorsResponseTypeDef
# get_anomaly_monitors method usage example with argument unpacking

kwargs: GetAnomalyMonitorsRequestRequestTypeDef = {  # (1)
    "MonitorArnList": ...,
}

parent.get_anomaly_monitors(**kwargs)
  1. See GetAnomalyMonitorsRequestRequestTypeDef

get_anomaly_subscriptions#

Retrieves the cost anomaly subscription objects for your account.

Type annotations and code completion for boto3.client("ce").get_anomaly_subscriptions method. boto3 documentation

# get_anomaly_subscriptions method definition

def get_anomaly_subscriptions(
    self,
    *,
    SubscriptionArnList: Sequence[str] = ...,
    MonitorArn: str = ...,
    NextPageToken: str = ...,
    MaxResults: int = ...,
) -> GetAnomalySubscriptionsResponseTypeDef:  # (1)
    ...
  1. See GetAnomalySubscriptionsResponseTypeDef
# get_anomaly_subscriptions method usage example with argument unpacking

kwargs: GetAnomalySubscriptionsRequestRequestTypeDef = {  # (1)
    "SubscriptionArnList": ...,
}

parent.get_anomaly_subscriptions(**kwargs)
  1. See GetAnomalySubscriptionsRequestRequestTypeDef

get_approximate_usage_records#

Retrieves estimated usage records for hourly granularity or resource-level data at daily granularity.

Type annotations and code completion for boto3.client("ce").get_approximate_usage_records method. boto3 documentation

# get_approximate_usage_records method definition

def get_approximate_usage_records(
    self,
    *,
    Granularity: GranularityType,  # (1)
    ApproximationDimension: ApproximationDimensionType,  # (2)
    Services: Sequence[str] = ...,
) -> GetApproximateUsageRecordsResponseTypeDef:  # (3)
    ...
  1. See GranularityType
  2. See ApproximationDimensionType
  3. See GetApproximateUsageRecordsResponseTypeDef
# get_approximate_usage_records method usage example with argument unpacking

kwargs: GetApproximateUsageRecordsRequestRequestTypeDef = {  # (1)
    "Granularity": ...,
    "ApproximationDimension": ...,
}

parent.get_approximate_usage_records(**kwargs)
  1. See GetApproximateUsageRecordsRequestRequestTypeDef

get_commitment_purchase_analysis#

Retrieves a commitment purchase analysis result based on the AnalysisId.

Type annotations and code completion for boto3.client("ce").get_commitment_purchase_analysis method. boto3 documentation

# get_commitment_purchase_analysis method definition

def get_commitment_purchase_analysis(
    self,
    *,
    AnalysisId: str,
) -> GetCommitmentPurchaseAnalysisResponseTypeDef:  # (1)
    ...
  1. See GetCommitmentPurchaseAnalysisResponseTypeDef
# get_commitment_purchase_analysis method usage example with argument unpacking

kwargs: GetCommitmentPurchaseAnalysisRequestRequestTypeDef = {  # (1)
    "AnalysisId": ...,
}

parent.get_commitment_purchase_analysis(**kwargs)
  1. See GetCommitmentPurchaseAnalysisRequestRequestTypeDef

get_cost_and_usage#

Retrieves cost and usage metrics for your account.

Type annotations and code completion for boto3.client("ce").get_cost_and_usage method. boto3 documentation

# get_cost_and_usage method definition

def get_cost_and_usage(
    self,
    *,
    TimePeriod: DateIntervalTypeDef,  # (1)
    Granularity: GranularityType,  # (2)
    Metrics: Sequence[str],
    Filter: ExpressionTypeDef = ...,  # (3)
    GroupBy: Sequence[GroupDefinitionTypeDef] = ...,  # (4)
    BillingViewArn: str = ...,
    NextPageToken: str = ...,
) -> GetCostAndUsageResponseTypeDef:  # (5)
    ...
  1. See DateIntervalTypeDef
  2. See GranularityType
  3. See ExpressionTypeDef
  4. See GroupDefinitionTypeDef
  5. See GetCostAndUsageResponseTypeDef
# get_cost_and_usage method usage example with argument unpacking

kwargs: GetCostAndUsageRequestRequestTypeDef = {  # (1)
    "TimePeriod": ...,
    "Granularity": ...,
    "Metrics": ...,
}

parent.get_cost_and_usage(**kwargs)
  1. See GetCostAndUsageRequestRequestTypeDef

get_cost_and_usage_with_resources#

Retrieves cost and usage metrics with resources for your account.

Type annotations and code completion for boto3.client("ce").get_cost_and_usage_with_resources method. boto3 documentation

# get_cost_and_usage_with_resources method definition

def get_cost_and_usage_with_resources(
    self,
    *,
    TimePeriod: DateIntervalTypeDef,  # (1)
    Granularity: GranularityType,  # (2)
    Filter: ExpressionTypeDef,  # (3)
    Metrics: Sequence[str] = ...,
    GroupBy: Sequence[GroupDefinitionTypeDef] = ...,  # (4)
    BillingViewArn: str = ...,
    NextPageToken: str = ...,
) -> GetCostAndUsageWithResourcesResponseTypeDef:  # (5)
    ...
  1. See DateIntervalTypeDef
  2. See GranularityType
  3. See ExpressionTypeDef
  4. See GroupDefinitionTypeDef
  5. See GetCostAndUsageWithResourcesResponseTypeDef
# get_cost_and_usage_with_resources method usage example with argument unpacking

kwargs: GetCostAndUsageWithResourcesRequestRequestTypeDef = {  # (1)
    "TimePeriod": ...,
    "Granularity": ...,
    "Filter": ...,
}

parent.get_cost_and_usage_with_resources(**kwargs)
  1. See GetCostAndUsageWithResourcesRequestRequestTypeDef

get_cost_categories#

Retrieves an array of Cost Category names and values incurred cost.

Type annotations and code completion for boto3.client("ce").get_cost_categories method. boto3 documentation

# get_cost_categories method definition

def get_cost_categories(
    self,
    *,
    TimePeriod: DateIntervalTypeDef,  # (1)
    SearchString: str = ...,
    CostCategoryName: str = ...,
    Filter: ExpressionTypeDef = ...,  # (2)
    SortBy: Sequence[SortDefinitionTypeDef] = ...,  # (3)
    BillingViewArn: str = ...,
    MaxResults: int = ...,
    NextPageToken: str = ...,
) -> GetCostCategoriesResponseTypeDef:  # (4)
    ...
  1. See DateIntervalTypeDef
  2. See ExpressionTypeDef
  3. See SortDefinitionTypeDef
  4. See GetCostCategoriesResponseTypeDef
# get_cost_categories method usage example with argument unpacking

kwargs: GetCostCategoriesRequestRequestTypeDef = {  # (1)
    "TimePeriod": ...,
}

parent.get_cost_categories(**kwargs)
  1. See GetCostCategoriesRequestRequestTypeDef

get_cost_forecast#

Retrieves a forecast for how much Amazon Web Services predicts that you will spend over the forecast time period that you select, based on your past costs.

Type annotations and code completion for boto3.client("ce").get_cost_forecast method. boto3 documentation

# get_cost_forecast method definition

def get_cost_forecast(
    self,
    *,
    TimePeriod: DateIntervalTypeDef,  # (1)
    Metric: MetricType,  # (2)
    Granularity: GranularityType,  # (3)
    Filter: ExpressionTypeDef = ...,  # (4)
    BillingViewArn: str = ...,
    PredictionIntervalLevel: int = ...,
) -> GetCostForecastResponseTypeDef:  # (5)
    ...
  1. See DateIntervalTypeDef
  2. See MetricType
  3. See GranularityType
  4. See ExpressionTypeDef
  5. See GetCostForecastResponseTypeDef
# get_cost_forecast method usage example with argument unpacking

kwargs: GetCostForecastRequestRequestTypeDef = {  # (1)
    "TimePeriod": ...,
    "Metric": ...,
    "Granularity": ...,
}

parent.get_cost_forecast(**kwargs)
  1. See GetCostForecastRequestRequestTypeDef

get_dimension_values#

Retrieves all available filter values for a specified filter over a period of time.

Type annotations and code completion for boto3.client("ce").get_dimension_values method. boto3 documentation

# get_dimension_values method definition

def get_dimension_values(
    self,
    *,
    TimePeriod: DateIntervalTypeDef,  # (1)
    Dimension: DimensionType,  # (2)
    SearchString: str = ...,
    Context: ContextType = ...,  # (3)
    Filter: ExpressionTypeDef = ...,  # (4)
    SortBy: Sequence[SortDefinitionTypeDef] = ...,  # (5)
    BillingViewArn: str = ...,
    MaxResults: int = ...,
    NextPageToken: str = ...,
) -> GetDimensionValuesResponseTypeDef:  # (6)
    ...
  1. See DateIntervalTypeDef
  2. See DimensionType
  3. See ContextType
  4. See ExpressionTypeDef
  5. See SortDefinitionTypeDef
  6. See GetDimensionValuesResponseTypeDef
# get_dimension_values method usage example with argument unpacking

kwargs: GetDimensionValuesRequestRequestTypeDef = {  # (1)
    "TimePeriod": ...,
    "Dimension": ...,
}

parent.get_dimension_values(**kwargs)
  1. See GetDimensionValuesRequestRequestTypeDef

get_reservation_coverage#

Retrieves the reservation coverage for your account, which you can use to see how much of your Amazon Elastic Compute Cloud, Amazon ElastiCache, Amazon Relational Database Service, or Amazon Redshift usage is covered by a reservation.

Type annotations and code completion for boto3.client("ce").get_reservation_coverage method. boto3 documentation

# get_reservation_coverage method definition

def get_reservation_coverage(
    self,
    *,
    TimePeriod: DateIntervalTypeDef,  # (1)
    GroupBy: Sequence[GroupDefinitionTypeDef] = ...,  # (2)
    Granularity: GranularityType = ...,  # (3)
    Filter: ExpressionTypeDef = ...,  # (4)
    Metrics: Sequence[str] = ...,
    NextPageToken: str = ...,
    SortBy: SortDefinitionTypeDef = ...,  # (5)
    MaxResults: int = ...,
) -> GetReservationCoverageResponseTypeDef:  # (6)
    ...
  1. See DateIntervalTypeDef
  2. See GroupDefinitionTypeDef
  3. See GranularityType
  4. See ExpressionTypeDef
  5. See SortDefinitionTypeDef
  6. See GetReservationCoverageResponseTypeDef
# get_reservation_coverage method usage example with argument unpacking

kwargs: GetReservationCoverageRequestRequestTypeDef = {  # (1)
    "TimePeriod": ...,
}

parent.get_reservation_coverage(**kwargs)
  1. See GetReservationCoverageRequestRequestTypeDef

get_reservation_purchase_recommendation#

Gets recommendations for reservation purchases.

Type annotations and code completion for boto3.client("ce").get_reservation_purchase_recommendation method. boto3 documentation

# get_reservation_purchase_recommendation method definition

def get_reservation_purchase_recommendation(
    self,
    *,
    Service: str,
    AccountId: str = ...,
    Filter: ExpressionTypeDef = ...,  # (1)
    AccountScope: AccountScopeType = ...,  # (2)
    LookbackPeriodInDays: LookbackPeriodInDaysType = ...,  # (3)
    TermInYears: TermInYearsType = ...,  # (4)
    PaymentOption: PaymentOptionType = ...,  # (5)
    ServiceSpecification: ServiceSpecificationTypeDef = ...,  # (6)
    PageSize: int = ...,
    NextPageToken: str = ...,
) -> GetReservationPurchaseRecommendationResponseTypeDef:  # (7)
    ...
  1. See ExpressionTypeDef
  2. See AccountScopeType
  3. See LookbackPeriodInDaysType
  4. See TermInYearsType
  5. See PaymentOptionType
  6. See ServiceSpecificationTypeDef
  7. See GetReservationPurchaseRecommendationResponseTypeDef
# get_reservation_purchase_recommendation method usage example with argument unpacking

kwargs: GetReservationPurchaseRecommendationRequestRequestTypeDef = {  # (1)
    "Service": ...,
}

parent.get_reservation_purchase_recommendation(**kwargs)
  1. See GetReservationPurchaseRecommendationRequestRequestTypeDef

get_reservation_utilization#

Retrieves the reservation utilization for your account.

Type annotations and code completion for boto3.client("ce").get_reservation_utilization method. boto3 documentation

# get_reservation_utilization method definition

def get_reservation_utilization(
    self,
    *,
    TimePeriod: DateIntervalTypeDef,  # (1)
    GroupBy: Sequence[GroupDefinitionTypeDef] = ...,  # (2)
    Granularity: GranularityType = ...,  # (3)
    Filter: ExpressionTypeDef = ...,  # (4)
    SortBy: SortDefinitionTypeDef = ...,  # (5)
    NextPageToken: str = ...,
    MaxResults: int = ...,
) -> GetReservationUtilizationResponseTypeDef:  # (6)
    ...
  1. See DateIntervalTypeDef
  2. See GroupDefinitionTypeDef
  3. See GranularityType
  4. See ExpressionTypeDef
  5. See SortDefinitionTypeDef
  6. See GetReservationUtilizationResponseTypeDef
# get_reservation_utilization method usage example with argument unpacking

kwargs: GetReservationUtilizationRequestRequestTypeDef = {  # (1)
    "TimePeriod": ...,
}

parent.get_reservation_utilization(**kwargs)
  1. See GetReservationUtilizationRequestRequestTypeDef

get_rightsizing_recommendation#

Creates recommendations that help you save cost by identifying idle and underutilized Amazon EC2 instances.

Type annotations and code completion for boto3.client("ce").get_rightsizing_recommendation method. boto3 documentation

# get_rightsizing_recommendation method definition

def get_rightsizing_recommendation(
    self,
    *,
    Service: str,
    Filter: ExpressionTypeDef = ...,  # (1)
    Configuration: RightsizingRecommendationConfigurationTypeDef = ...,  # (2)
    PageSize: int = ...,
    NextPageToken: str = ...,
) -> GetRightsizingRecommendationResponseTypeDef:  # (3)
    ...
  1. See ExpressionTypeDef
  2. See RightsizingRecommendationConfigurationTypeDef
  3. See GetRightsizingRecommendationResponseTypeDef
# get_rightsizing_recommendation method usage example with argument unpacking

kwargs: GetRightsizingRecommendationRequestRequestTypeDef = {  # (1)
    "Service": ...,
}

parent.get_rightsizing_recommendation(**kwargs)
  1. See GetRightsizingRecommendationRequestRequestTypeDef

get_savings_plan_purchase_recommendation_details#

Retrieves the details for a Savings Plan recommendation.

Type annotations and code completion for boto3.client("ce").get_savings_plan_purchase_recommendation_details method. boto3 documentation

# get_savings_plan_purchase_recommendation_details method definition

def get_savings_plan_purchase_recommendation_details(
    self,
    *,
    RecommendationDetailId: str,
) -> GetSavingsPlanPurchaseRecommendationDetailsResponseTypeDef:  # (1)
    ...
  1. See GetSavingsPlanPurchaseRecommendationDetailsResponseTypeDef
# get_savings_plan_purchase_recommendation_details method usage example with argument unpacking

kwargs: GetSavingsPlanPurchaseRecommendationDetailsRequestRequestTypeDef = {  # (1)
    "RecommendationDetailId": ...,
}

parent.get_savings_plan_purchase_recommendation_details(**kwargs)
  1. See GetSavingsPlanPurchaseRecommendationDetailsRequestRequestTypeDef

get_savings_plans_coverage#

Retrieves the Savings Plans covered for your account.

Type annotations and code completion for boto3.client("ce").get_savings_plans_coverage method. boto3 documentation

# get_savings_plans_coverage method definition

def get_savings_plans_coverage(
    self,
    *,
    TimePeriod: DateIntervalTypeDef,  # (1)
    GroupBy: Sequence[GroupDefinitionTypeDef] = ...,  # (2)
    Granularity: GranularityType = ...,  # (3)
    Filter: ExpressionTypeDef = ...,  # (4)
    Metrics: Sequence[str] = ...,
    NextToken: str = ...,
    MaxResults: int = ...,
    SortBy: SortDefinitionTypeDef = ...,  # (5)
) -> GetSavingsPlansCoverageResponseTypeDef:  # (6)
    ...
  1. See DateIntervalTypeDef
  2. See GroupDefinitionTypeDef
  3. See GranularityType
  4. See ExpressionTypeDef
  5. See SortDefinitionTypeDef
  6. See GetSavingsPlansCoverageResponseTypeDef
# get_savings_plans_coverage method usage example with argument unpacking

kwargs: GetSavingsPlansCoverageRequestRequestTypeDef = {  # (1)
    "TimePeriod": ...,
}

parent.get_savings_plans_coverage(**kwargs)
  1. See GetSavingsPlansCoverageRequestRequestTypeDef

get_savings_plans_purchase_recommendation#

Retrieves the Savings Plans recommendations for your account.

Type annotations and code completion for boto3.client("ce").get_savings_plans_purchase_recommendation method. boto3 documentation

# get_savings_plans_purchase_recommendation method definition

def get_savings_plans_purchase_recommendation(
    self,
    *,
    SavingsPlansType: SupportedSavingsPlansTypeType,  # (1)
    TermInYears: TermInYearsType,  # (2)
    PaymentOption: PaymentOptionType,  # (3)
    LookbackPeriodInDays: LookbackPeriodInDaysType,  # (4)
    AccountScope: AccountScopeType = ...,  # (5)
    NextPageToken: str = ...,
    PageSize: int = ...,
    Filter: ExpressionTypeDef = ...,  # (6)
) -> GetSavingsPlansPurchaseRecommendationResponseTypeDef:  # (7)
    ...
  1. See SupportedSavingsPlansTypeType
  2. See TermInYearsType
  3. See PaymentOptionType
  4. See LookbackPeriodInDaysType
  5. See AccountScopeType
  6. See ExpressionTypeDef
  7. See GetSavingsPlansPurchaseRecommendationResponseTypeDef
# get_savings_plans_purchase_recommendation method usage example with argument unpacking

kwargs: GetSavingsPlansPurchaseRecommendationRequestRequestTypeDef = {  # (1)
    "SavingsPlansType": ...,
    "TermInYears": ...,
    "PaymentOption": ...,
    "LookbackPeriodInDays": ...,
}

parent.get_savings_plans_purchase_recommendation(**kwargs)
  1. See GetSavingsPlansPurchaseRecommendationRequestRequestTypeDef

get_savings_plans_utilization#

Retrieves the Savings Plans utilization for your account across date ranges with daily or monthly granularity.

Type annotations and code completion for boto3.client("ce").get_savings_plans_utilization method. boto3 documentation

# get_savings_plans_utilization method definition

def get_savings_plans_utilization(
    self,
    *,
    TimePeriod: DateIntervalTypeDef,  # (1)
    Granularity: GranularityType = ...,  # (2)
    Filter: ExpressionTypeDef = ...,  # (3)
    SortBy: SortDefinitionTypeDef = ...,  # (4)
) -> GetSavingsPlansUtilizationResponseTypeDef:  # (5)
    ...
  1. See DateIntervalTypeDef
  2. See GranularityType
  3. See ExpressionTypeDef
  4. See SortDefinitionTypeDef
  5. See GetSavingsPlansUtilizationResponseTypeDef
# get_savings_plans_utilization method usage example with argument unpacking

kwargs: GetSavingsPlansUtilizationRequestRequestTypeDef = {  # (1)
    "TimePeriod": ...,
}

parent.get_savings_plans_utilization(**kwargs)
  1. See GetSavingsPlansUtilizationRequestRequestTypeDef

get_savings_plans_utilization_details#

Retrieves attribute data along with aggregate utilization and savings data for a given time period.

Type annotations and code completion for boto3.client("ce").get_savings_plans_utilization_details method. boto3 documentation

# get_savings_plans_utilization_details method definition

def get_savings_plans_utilization_details(
    self,
    *,
    TimePeriod: DateIntervalTypeDef,  # (1)
    Filter: ExpressionTypeDef = ...,  # (2)
    DataType: Sequence[SavingsPlansDataTypeType] = ...,  # (3)
    NextToken: str = ...,
    MaxResults: int = ...,
    SortBy: SortDefinitionTypeDef = ...,  # (4)
) -> GetSavingsPlansUtilizationDetailsResponseTypeDef:  # (5)
    ...
  1. See DateIntervalTypeDef
  2. See ExpressionTypeDef
  3. See SavingsPlansDataTypeType
  4. See SortDefinitionTypeDef
  5. See GetSavingsPlansUtilizationDetailsResponseTypeDef
# get_savings_plans_utilization_details method usage example with argument unpacking

kwargs: GetSavingsPlansUtilizationDetailsRequestRequestTypeDef = {  # (1)
    "TimePeriod": ...,
}

parent.get_savings_plans_utilization_details(**kwargs)
  1. See GetSavingsPlansUtilizationDetailsRequestRequestTypeDef

get_tags#

Queries for available tag keys and tag values for a specified period.

Type annotations and code completion for boto3.client("ce").get_tags method. boto3 documentation

# get_tags method definition

def get_tags(
    self,
    *,
    TimePeriod: DateIntervalTypeDef,  # (1)
    SearchString: str = ...,
    TagKey: str = ...,
    Filter: ExpressionTypeDef = ...,  # (2)
    SortBy: Sequence[SortDefinitionTypeDef] = ...,  # (3)
    BillingViewArn: str = ...,
    MaxResults: int = ...,
    NextPageToken: str = ...,
) -> GetTagsResponseTypeDef:  # (4)
    ...
  1. See DateIntervalTypeDef
  2. See ExpressionTypeDef
  3. See SortDefinitionTypeDef
  4. See GetTagsResponseTypeDef
# get_tags method usage example with argument unpacking

kwargs: GetTagsRequestRequestTypeDef = {  # (1)
    "TimePeriod": ...,
}

parent.get_tags(**kwargs)
  1. See GetTagsRequestRequestTypeDef

get_usage_forecast#

Retrieves a forecast for how much Amazon Web Services predicts that you will use over the forecast time period that you select, based on your past usage.

Type annotations and code completion for boto3.client("ce").get_usage_forecast method. boto3 documentation

# get_usage_forecast method definition

def get_usage_forecast(
    self,
    *,
    TimePeriod: DateIntervalTypeDef,  # (1)
    Metric: MetricType,  # (2)
    Granularity: GranularityType,  # (3)
    Filter: ExpressionTypeDef = ...,  # (4)
    BillingViewArn: str = ...,
    PredictionIntervalLevel: int = ...,
) -> GetUsageForecastResponseTypeDef:  # (5)
    ...
  1. See DateIntervalTypeDef
  2. See MetricType
  3. See GranularityType
  4. See ExpressionTypeDef
  5. See GetUsageForecastResponseTypeDef
# get_usage_forecast method usage example with argument unpacking

kwargs: GetUsageForecastRequestRequestTypeDef = {  # (1)
    "TimePeriod": ...,
    "Metric": ...,
    "Granularity": ...,
}

parent.get_usage_forecast(**kwargs)
  1. See GetUsageForecastRequestRequestTypeDef

list_commitment_purchase_analyses#

Lists the commitment purchase analyses for your account.

Type annotations and code completion for boto3.client("ce").list_commitment_purchase_analyses method. boto3 documentation

# list_commitment_purchase_analyses method definition

def list_commitment_purchase_analyses(
    self,
    *,
    AnalysisStatus: AnalysisStatusType = ...,  # (1)
    NextPageToken: str = ...,
    PageSize: int = ...,
    AnalysisIds: Sequence[str] = ...,
) -> ListCommitmentPurchaseAnalysesResponseTypeDef:  # (2)
    ...
  1. See AnalysisStatusType
  2. See ListCommitmentPurchaseAnalysesResponseTypeDef
# list_commitment_purchase_analyses method usage example with argument unpacking

kwargs: ListCommitmentPurchaseAnalysesRequestRequestTypeDef = {  # (1)
    "AnalysisStatus": ...,
}

parent.list_commitment_purchase_analyses(**kwargs)
  1. See ListCommitmentPurchaseAnalysesRequestRequestTypeDef

list_cost_allocation_tag_backfill_history#

Retrieves a list of your historical cost allocation tag backfill requests.

Type annotations and code completion for boto3.client("ce").list_cost_allocation_tag_backfill_history method. boto3 documentation

# list_cost_allocation_tag_backfill_history method definition

def list_cost_allocation_tag_backfill_history(
    self,
    *,
    NextToken: str = ...,
    MaxResults: int = ...,
) -> ListCostAllocationTagBackfillHistoryResponseTypeDef:  # (1)
    ...
  1. See ListCostAllocationTagBackfillHistoryResponseTypeDef
# list_cost_allocation_tag_backfill_history method usage example with argument unpacking

kwargs: ListCostAllocationTagBackfillHistoryRequestRequestTypeDef = {  # (1)
    "NextToken": ...,
}

parent.list_cost_allocation_tag_backfill_history(**kwargs)
  1. See ListCostAllocationTagBackfillHistoryRequestRequestTypeDef

list_cost_allocation_tags#

Get a list of cost allocation tags.

Type annotations and code completion for boto3.client("ce").list_cost_allocation_tags method. boto3 documentation

# list_cost_allocation_tags method definition

def list_cost_allocation_tags(
    self,
    *,
    Status: CostAllocationTagStatusType = ...,  # (1)
    TagKeys: Sequence[str] = ...,
    Type: CostAllocationTagTypeType = ...,  # (2)
    NextToken: str = ...,
    MaxResults: int = ...,
) -> ListCostAllocationTagsResponseTypeDef:  # (3)
    ...
  1. See CostAllocationTagStatusType
  2. See CostAllocationTagTypeType
  3. See ListCostAllocationTagsResponseTypeDef
# list_cost_allocation_tags method usage example with argument unpacking

kwargs: ListCostAllocationTagsRequestRequestTypeDef = {  # (1)
    "Status": ...,
}

parent.list_cost_allocation_tags(**kwargs)
  1. See ListCostAllocationTagsRequestRequestTypeDef

list_cost_category_definitions#

Returns the name, Amazon Resource Name (ARN), NumberOfRules and effective dates of all Cost Categories defined in the account.

Type annotations and code completion for boto3.client("ce").list_cost_category_definitions method. boto3 documentation

# list_cost_category_definitions method definition

def list_cost_category_definitions(
    self,
    *,
    EffectiveOn: str = ...,
    NextToken: str = ...,
    MaxResults: int = ...,
) -> ListCostCategoryDefinitionsResponseTypeDef:  # (1)
    ...
  1. See ListCostCategoryDefinitionsResponseTypeDef
# list_cost_category_definitions method usage example with argument unpacking

kwargs: ListCostCategoryDefinitionsRequestRequestTypeDef = {  # (1)
    "EffectiveOn": ...,
}

parent.list_cost_category_definitions(**kwargs)
  1. See ListCostCategoryDefinitionsRequestRequestTypeDef

list_savings_plans_purchase_recommendation_generation#

Retrieves a list of your historical recommendation generations within the past 30 days.

Type annotations and code completion for boto3.client("ce").list_savings_plans_purchase_recommendation_generation method. boto3 documentation

# list_savings_plans_purchase_recommendation_generation method definition

def list_savings_plans_purchase_recommendation_generation(
    self,
    *,
    GenerationStatus: GenerationStatusType = ...,  # (1)
    RecommendationIds: Sequence[str] = ...,
    PageSize: int = ...,
    NextPageToken: str = ...,
) -> ListSavingsPlansPurchaseRecommendationGenerationResponseTypeDef:  # (2)
    ...
  1. See GenerationStatusType
  2. See ListSavingsPlansPurchaseRecommendationGenerationResponseTypeDef
# list_savings_plans_purchase_recommendation_generation method usage example with argument unpacking

kwargs: ListSavingsPlansPurchaseRecommendationGenerationRequestRequestTypeDef = {  # (1)
    "GenerationStatus": ...,
}

parent.list_savings_plans_purchase_recommendation_generation(**kwargs)
  1. See ListSavingsPlansPurchaseRecommendationGenerationRequestRequestTypeDef

list_tags_for_resource#

Returns a list of resource tags associated with the resource specified by the Amazon Resource Name (ARN).

Type annotations and code completion for boto3.client("ce").list_tags_for_resource method. boto3 documentation

# list_tags_for_resource method definition

def list_tags_for_resource(
    self,
    *,
    ResourceArn: str,
) -> ListTagsForResourceResponseTypeDef:  # (1)
    ...
  1. See ListTagsForResourceResponseTypeDef
# list_tags_for_resource method usage example with argument unpacking

kwargs: ListTagsForResourceRequestRequestTypeDef = {  # (1)
    "ResourceArn": ...,
}

parent.list_tags_for_resource(**kwargs)
  1. See ListTagsForResourceRequestRequestTypeDef

provide_anomaly_feedback#

Modifies the feedback property of a given cost anomaly.

Type annotations and code completion for boto3.client("ce").provide_anomaly_feedback method. boto3 documentation

# provide_anomaly_feedback method definition

def provide_anomaly_feedback(
    self,
    *,
    AnomalyId: str,
    Feedback: AnomalyFeedbackTypeType,  # (1)
) -> ProvideAnomalyFeedbackResponseTypeDef:  # (2)
    ...
  1. See AnomalyFeedbackTypeType
  2. See ProvideAnomalyFeedbackResponseTypeDef
# provide_anomaly_feedback method usage example with argument unpacking

kwargs: ProvideAnomalyFeedbackRequestRequestTypeDef = {  # (1)
    "AnomalyId": ...,
    "Feedback": ...,
}

parent.provide_anomaly_feedback(**kwargs)
  1. See ProvideAnomalyFeedbackRequestRequestTypeDef

start_commitment_purchase_analysis#

Specifies the parameters of a planned commitment purchase and starts the generation of the analysis.

Type annotations and code completion for boto3.client("ce").start_commitment_purchase_analysis method. boto3 documentation

# start_commitment_purchase_analysis method definition

def start_commitment_purchase_analysis(
    self,
    *,
    CommitmentPurchaseAnalysisConfiguration: CommitmentPurchaseAnalysisConfigurationTypeDef,  # (1)
) -> StartCommitmentPurchaseAnalysisResponseTypeDef:  # (2)
    ...
  1. See CommitmentPurchaseAnalysisConfigurationTypeDef
  2. See StartCommitmentPurchaseAnalysisResponseTypeDef
# start_commitment_purchase_analysis method usage example with argument unpacking

kwargs: StartCommitmentPurchaseAnalysisRequestRequestTypeDef = {  # (1)
    "CommitmentPurchaseAnalysisConfiguration": ...,
}

parent.start_commitment_purchase_analysis(**kwargs)
  1. See StartCommitmentPurchaseAnalysisRequestRequestTypeDef

start_cost_allocation_tag_backfill#

Request a cost allocation tag backfill.

Type annotations and code completion for boto3.client("ce").start_cost_allocation_tag_backfill method. boto3 documentation

# start_cost_allocation_tag_backfill method definition

def start_cost_allocation_tag_backfill(
    self,
    *,
    BackfillFrom: str,
) -> StartCostAllocationTagBackfillResponseTypeDef:  # (1)
    ...
  1. See StartCostAllocationTagBackfillResponseTypeDef
# start_cost_allocation_tag_backfill method usage example with argument unpacking

kwargs: StartCostAllocationTagBackfillRequestRequestTypeDef = {  # (1)
    "BackfillFrom": ...,
}

parent.start_cost_allocation_tag_backfill(**kwargs)
  1. See StartCostAllocationTagBackfillRequestRequestTypeDef

start_savings_plans_purchase_recommendation_generation#

Requests a Savings Plans recommendation generation.

Type annotations and code completion for boto3.client("ce").start_savings_plans_purchase_recommendation_generation method. boto3 documentation

# start_savings_plans_purchase_recommendation_generation method definition

def start_savings_plans_purchase_recommendation_generation(
    self,
) -> StartSavingsPlansPurchaseRecommendationGenerationResponseTypeDef:  # (1)
    ...
  1. See StartSavingsPlansPurchaseRecommendationGenerationResponseTypeDef

tag_resource#

An API operation for adding one or more tags (key-value pairs) to a resource.

Type annotations and code completion for boto3.client("ce").tag_resource method. boto3 documentation

# tag_resource method definition

def tag_resource(
    self,
    *,
    ResourceArn: str,
    ResourceTags: Sequence[ResourceTagTypeDef],  # (1)
) -> dict[str, Any]:
    ...
  1. See ResourceTagTypeDef
# tag_resource method usage example with argument unpacking

kwargs: TagResourceRequestRequestTypeDef = {  # (1)
    "ResourceArn": ...,
    "ResourceTags": ...,
}

parent.tag_resource(**kwargs)
  1. See TagResourceRequestRequestTypeDef

untag_resource#

Removes one or more tags from a resource.

Type annotations and code completion for boto3.client("ce").untag_resource method. boto3 documentation

# untag_resource method definition

def untag_resource(
    self,
    *,
    ResourceArn: str,
    ResourceTagKeys: Sequence[str],
) -> dict[str, Any]:
    ...
# untag_resource method usage example with argument unpacking

kwargs: UntagResourceRequestRequestTypeDef = {  # (1)
    "ResourceArn": ...,
    "ResourceTagKeys": ...,
}

parent.untag_resource(**kwargs)
  1. See UntagResourceRequestRequestTypeDef

update_anomaly_monitor#

Updates an existing cost anomaly monitor.

Type annotations and code completion for boto3.client("ce").update_anomaly_monitor method. boto3 documentation

# update_anomaly_monitor method definition

def update_anomaly_monitor(
    self,
    *,
    MonitorArn: str,
    MonitorName: str = ...,
) -> UpdateAnomalyMonitorResponseTypeDef:  # (1)
    ...
  1. See UpdateAnomalyMonitorResponseTypeDef
# update_anomaly_monitor method usage example with argument unpacking

kwargs: UpdateAnomalyMonitorRequestRequestTypeDef = {  # (1)
    "MonitorArn": ...,
}

parent.update_anomaly_monitor(**kwargs)
  1. See UpdateAnomalyMonitorRequestRequestTypeDef

update_anomaly_subscription#

Updates an existing cost anomaly subscription.

Type annotations and code completion for boto3.client("ce").update_anomaly_subscription method. boto3 documentation

# update_anomaly_subscription method definition

def update_anomaly_subscription(
    self,
    *,
    SubscriptionArn: str,
    Threshold: float = ...,
    Frequency: AnomalySubscriptionFrequencyType = ...,  # (1)
    MonitorArnList: Sequence[str] = ...,
    Subscribers: Sequence[SubscriberTypeDef] = ...,  # (2)
    SubscriptionName: str = ...,
    ThresholdExpression: ExpressionTypeDef = ...,  # (3)
) -> UpdateAnomalySubscriptionResponseTypeDef:  # (4)
    ...
  1. See AnomalySubscriptionFrequencyType
  2. See SubscriberTypeDef
  3. See ExpressionTypeDef
  4. See UpdateAnomalySubscriptionResponseTypeDef
# update_anomaly_subscription method usage example with argument unpacking

kwargs: UpdateAnomalySubscriptionRequestRequestTypeDef = {  # (1)
    "SubscriptionArn": ...,
}

parent.update_anomaly_subscription(**kwargs)
  1. See UpdateAnomalySubscriptionRequestRequestTypeDef

update_cost_allocation_tags_status#

Updates status for cost allocation tags in bulk, with maximum batch size of 20.

Type annotations and code completion for boto3.client("ce").update_cost_allocation_tags_status method. boto3 documentation

# update_cost_allocation_tags_status method definition

def update_cost_allocation_tags_status(
    self,
    *,
    CostAllocationTagsStatus: Sequence[CostAllocationTagStatusEntryTypeDef],  # (1)
) -> UpdateCostAllocationTagsStatusResponseTypeDef:  # (2)
    ...
  1. See CostAllocationTagStatusEntryTypeDef
  2. See UpdateCostAllocationTagsStatusResponseTypeDef
# update_cost_allocation_tags_status method usage example with argument unpacking

kwargs: UpdateCostAllocationTagsStatusRequestRequestTypeDef = {  # (1)
    "CostAllocationTagsStatus": ...,
}

parent.update_cost_allocation_tags_status(**kwargs)
  1. See UpdateCostAllocationTagsStatusRequestRequestTypeDef

update_cost_category_definition#

Updates an existing Cost Category.

Type annotations and code completion for boto3.client("ce").update_cost_category_definition method. boto3 documentation

# update_cost_category_definition method definition

def update_cost_category_definition(
    self,
    *,
    CostCategoryArn: str,
    RuleVersion: CostCategoryRuleVersionType,  # (1)
    Rules: Sequence[CostCategoryRuleTypeDef],  # (2)
    EffectiveStart: str = ...,
    DefaultValue: str = ...,
    SplitChargeRules: Sequence[CostCategorySplitChargeRuleTypeDef] = ...,  # (3)
) -> UpdateCostCategoryDefinitionResponseTypeDef:  # (4)
    ...
  1. See CostCategoryRuleVersionType
  2. See CostCategoryRuleTypeDef
  3. See CostCategorySplitChargeRuleTypeDef
  4. See UpdateCostCategoryDefinitionResponseTypeDef
# update_cost_category_definition method usage example with argument unpacking

kwargs: UpdateCostCategoryDefinitionRequestRequestTypeDef = {  # (1)
    "CostCategoryArn": ...,
    "RuleVersion": ...,
    "Rules": ...,
}

parent.update_cost_category_definition(**kwargs)
  1. See UpdateCostCategoryDefinitionRequestRequestTypeDef