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.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.BillExpirationException) -> None:
...
Methods#
can_paginate#
Check if an operation can be paginated.
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:
...
close#
Closes underlying endpoint connections.
Type annotations and code completion for boto3.client("ce").close
method.
boto3 documentation
# close method definition
def close(
self,
) -> None:
...
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)
...
# create_anomaly_monitor method usage example with argument unpacking
kwargs: CreateAnomalyMonitorRequestRequestTypeDef = { # (1)
"AnomalyMonitor": ...,
}
parent.create_anomaly_monitor(**kwargs)
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)
...
# create_anomaly_subscription method usage example with argument unpacking
kwargs: CreateAnomalySubscriptionRequestRequestTypeDef = { # (1)
"AnomalySubscription": ...,
}
parent.create_anomaly_subscription(**kwargs)
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[CostCategoryRuleTypeDef], # (2)
EffectiveStart: str = ...,
DefaultValue: str = ...,
SplitChargeRules: Sequence[CostCategorySplitChargeRuleTypeDef] = ..., # (3)
ResourceTags: Sequence[ResourceTagTypeDef] = ..., # (4)
) -> CreateCostCategoryDefinitionResponseTypeDef: # (5)
...
- See CostCategoryRuleVersionType
- See CostCategoryRuleTypeDef
- See CostCategorySplitChargeRuleTypeDef
- See ResourceTagTypeDef
- See CreateCostCategoryDefinitionResponseTypeDef
# create_cost_category_definition method usage example with argument unpacking
kwargs: CreateCostCategoryDefinitionRequestRequestTypeDef = { # (1)
"Name": ...,
"RuleVersion": ...,
"Rules": ...,
}
parent.create_cost_category_definition(**kwargs)
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)
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)
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)
...
# delete_cost_category_definition method usage example with argument unpacking
kwargs: DeleteCostCategoryDefinitionRequestRequestTypeDef = { # (1)
"CostCategoryArn": ...,
}
parent.delete_cost_category_definition(**kwargs)
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)
...
# describe_cost_category_definition method usage example with argument unpacking
kwargs: DescribeCostCategoryDefinitionRequestRequestTypeDef = { # (1)
"CostCategoryArn": ...,
}
parent.describe_cost_category_definition(**kwargs)
generate_presigned_url#
Generate a presigned url given a client, its method, and arguments.
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:
...
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)
...
- See AnomalyDateIntervalTypeDef
- See AnomalyFeedbackTypeType
- See TotalImpactFilterTypeDef
- See GetAnomaliesResponseTypeDef
# get_anomalies method usage example with argument unpacking
kwargs: GetAnomaliesRequestRequestTypeDef = { # (1)
"DateInterval": ...,
}
parent.get_anomalies(**kwargs)
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)
...
# get_anomaly_monitors method usage example with argument unpacking
kwargs: GetAnomalyMonitorsRequestRequestTypeDef = { # (1)
"MonitorArnList": ...,
}
parent.get_anomaly_monitors(**kwargs)
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)
...
# get_anomaly_subscriptions method usage example with argument unpacking
kwargs: GetAnomalySubscriptionsRequestRequestTypeDef = { # (1)
"SubscriptionArnList": ...,
}
parent.get_anomaly_subscriptions(**kwargs)
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)
NextPageToken: str = ...,
) -> GetCostAndUsageResponseTypeDef: # (5)
...
- See DateIntervalTypeDef
- See GranularityType
- See ExpressionTypeDef
- See GroupDefinitionTypeDef
- See GetCostAndUsageResponseTypeDef
# get_cost_and_usage method usage example with argument unpacking
kwargs: GetCostAndUsageRequestRequestTypeDef = { # (1)
"TimePeriod": ...,
"Granularity": ...,
"Metrics": ...,
}
parent.get_cost_and_usage(**kwargs)
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)
NextPageToken: str = ...,
) -> GetCostAndUsageWithResourcesResponseTypeDef: # (5)
...
- See DateIntervalTypeDef
- See GranularityType
- See