CloudWatchClient#
Index > CloudWatch > CloudWatchClient
Auto-generated documentation for CloudWatch type annotations stubs module mypy-boto3-cloudwatch.
CloudWatchClient#
Type annotations and code completion for boto3.client("cloudwatch")
.
boto3 documentation
# CloudWatchClient usage example
from boto3.session import Session
from mypy_boto3_cloudwatch.client import CloudWatchClient
def get_cloudwatch_client() -> CloudWatchClient:
return Session().client("cloudwatch")
Exceptions#
boto3
client exceptions are generated in runtime.
This class provides code completion for boto3.client("cloudwatch").exceptions
structure.
# Exceptions.exceptions usage example
client = boto3.client("cloudwatch")
try:
do_something(client)
except (
client.exceptions.ClientError,
client.exceptions.ConcurrentModificationException,
client.exceptions.DashboardInvalidInputError,
client.exceptions.DashboardNotFoundError,
client.exceptions.InternalServiceFault,
client.exceptions.InvalidFormatFault,
client.exceptions.InvalidNextToken,
client.exceptions.InvalidParameterCombinationException,
client.exceptions.InvalidParameterValueException,
client.exceptions.LimitExceededException,
client.exceptions.LimitExceededFault,
client.exceptions.MissingRequiredParameterException,
client.exceptions.ResourceNotFound,
client.exceptions.ResourceNotFoundException,
) as e:
print(e)
# Exceptions.exceptions type checking example
from mypy_boto3_cloudwatch.client import Exceptions
def handle_error(exc: Exceptions.ClientError) -> None:
...
Methods#
can_paginate#
Check if an operation can be paginated.
Type annotations and code completion for boto3.client("cloudwatch").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("cloudwatch").close
method.
boto3 documentation
# close method definition
def close(
self,
) -> None:
...
delete_alarms#
Deletes the specified alarms.
Type annotations and code completion for boto3.client("cloudwatch").delete_alarms
method.
boto3 documentation
# delete_alarms method definition
def delete_alarms(
self,
*,
AlarmNames: Sequence[str],
) -> EmptyResponseMetadataTypeDef: # (1)
...
# delete_alarms method usage example with argument unpacking
kwargs: DeleteAlarmsInputRequestTypeDef = { # (1)
"AlarmNames": ...,
}
parent.delete_alarms(**kwargs)
delete_anomaly_detector#
Deletes the specified anomaly detection model from your account.
Type annotations and code completion for boto3.client("cloudwatch").delete_anomaly_detector
method.
boto3 documentation
# delete_anomaly_detector method definition
def delete_anomaly_detector(
self,
*,
Namespace: str = ...,
MetricName: str = ...,
Dimensions: Sequence[DimensionTypeDef] = ..., # (1)
Stat: str = ...,
SingleMetricAnomalyDetector: SingleMetricAnomalyDetectorTypeDef = ..., # (2)
MetricMathAnomalyDetector: MetricMathAnomalyDetectorTypeDef = ..., # (3)
) -> Dict[str, Any]:
...
# delete_anomaly_detector method usage example with argument unpacking
kwargs: DeleteAnomalyDetectorInputRequestTypeDef = { # (1)
"Namespace": ...,
}
parent.delete_anomaly_detector(**kwargs)
delete_dashboards#
Deletes all dashboards that you specify.
Type annotations and code completion for boto3.client("cloudwatch").delete_dashboards
method.
boto3 documentation
# delete_dashboards method definition
def delete_dashboards(
self,
*,
DashboardNames: Sequence[str],
) -> Dict[str, Any]:
...
# delete_dashboards method usage example with argument unpacking
kwargs: DeleteDashboardsInputRequestTypeDef = { # (1)
"DashboardNames": ...,
}
parent.delete_dashboards(**kwargs)
delete_insight_rules#
Permanently deletes the specified Contributor Insights rules.
Type annotations and code completion for boto3.client("cloudwatch").delete_insight_rules
method.
boto3 documentation
# delete_insight_rules method definition
def delete_insight_rules(
self,
*,
RuleNames: Sequence[str],
) -> DeleteInsightRulesOutputTypeDef: # (1)
...
# delete_insight_rules method usage example with argument unpacking
kwargs: DeleteInsightRulesInputRequestTypeDef = { # (1)
"RuleNames": ...,
}
parent.delete_insight_rules(**kwargs)
delete_metric_stream#
Permanently deletes the metric stream that you specify.
Type annotations and code completion for boto3.client("cloudwatch").delete_metric_stream
method.
boto3 documentation
# delete_metric_stream method definition
def delete_metric_stream(
self,
*,
Name: str,
) -> Dict[str, Any]:
...
# delete_metric_stream method usage example with argument unpacking
kwargs: DeleteMetricStreamInputRequestTypeDef = { # (1)
"Name": ...,
}
parent.delete_metric_stream(**kwargs)
describe_alarm_history#
Retrieves the history for the specified alarm.
Type annotations and code completion for boto3.client("cloudwatch").describe_alarm_history
method.
boto3 documentation
# describe_alarm_history method definition
def describe_alarm_history(
self,
*,
AlarmName: str = ...,
AlarmTypes: Sequence[AlarmTypeType] = ..., # (1)
HistoryItemType: HistoryItemTypeType = ..., # (2)
StartDate: Union[datetime, str] = ...,
EndDate: Union[datetime, str] = ...,
MaxRecords: int = ...,
NextToken: str = ...,
ScanBy: ScanByType = ..., # (3)
) -> DescribeAlarmHistoryOutputTypeDef: # (4)
...
- See AlarmTypeType
- See HistoryItemTypeType
- See ScanByType
- See DescribeAlarmHistoryOutputTypeDef
# describe_alarm_history method usage example with argument unpacking
kwargs: DescribeAlarmHistoryInputRequestTypeDef = { # (1)
"AlarmName": ...,
}
parent.describe_alarm_history(**kwargs)
describe_alarms#
Retrieves the specified alarms.
Type annotations and code completion for boto3.client("cloudwatch").describe_alarms
method.
boto3 documentation
# describe_alarms method definition
def describe_alarms(
self,
*,
AlarmNames: Sequence[str] = ...,
AlarmNamePrefix: str = ...,
AlarmTypes: Sequence[AlarmTypeType] = ..., # (1)
ChildrenOfAlarmName: str = ...,
ParentsOfAlarmName: str = ...,
StateValue: StateValueType = ..., # (2)
ActionPrefix: str = ...,
MaxRecords: int = ...,
NextToken: str = ...,
) -> DescribeAlarmsOutputTypeDef: # (3)
...
- See AlarmTypeType
- See StateValueType
- See DescribeAlarmsOutputTypeDef
# describe_alarms method usage example with argument unpacking
kwargs: DescribeAlarmsInputRequestTypeDef = { # (1)
"AlarmNames": ...,
}
parent.describe_alarms(**kwargs)
describe_alarms_for_metric#
Retrieves the alarms for the specified metric.
Type annotations and code completion for boto3.client("cloudwatch").describe_alarms_for_metric
method.
boto3 documentation
# describe_alarms_for_metric method definition
def describe_alarms_for_metric(
self,
*,
MetricName: str,
Namespace: str,
Statistic: StatisticType = ..., # (1)
ExtendedStatistic: str = ...,
Dimensions: Sequence[DimensionTypeDef] = ..., # (2)
Period: int = ...,
Unit: StandardUnitType = ..., # (3)
) -> DescribeAlarmsForMetricOutputTypeDef: # (4)
...
- See StatisticType
- See DimensionTypeDef
- See StandardUnitType
- See DescribeAlarmsForMetricOutputTypeDef
# describe_alarms_for_metric method usage example with argument unpacking
kwargs: DescribeAlarmsForMetricInputRequestTypeDef = { # (1)
"MetricName": ...,
"Namespace": ...,
}
parent.describe_alarms_for_metric(**kwargs)
describe_anomaly_detectors#
Lists the anomaly detection models that you have created in your account.
Type annotations and code completion for boto3.client("cloudwatch").describe_anomaly_detectors
method.
boto3 documentation
# describe_anomaly_detectors method definition
def describe_anomaly_detectors(
self,
*,
NextToken: str = ...,
MaxResults: int = ...,
Namespace: str = ...,
MetricName: str = ...,
Dimensions: Sequence[DimensionTypeDef] = ..., # (1)
AnomalyDetectorTypes: Sequence[AnomalyDetectorTypeType] = ..., # (2)
) -> DescribeAnomalyDetectorsOutputTypeDef: # (3)
...
# describe_anomaly_detectors method usage example with argument unpacking
kwargs: DescribeAnomalyDetectorsInputRequestTypeDef = { # (1)
"NextToken": ...,
}
parent.describe_anomaly_detectors(**kwargs)
describe_insight_rules#
Returns a list of all the Contributor Insights rules in your account.
Type annotations and code completion for boto3.client("cloudwatch").describe_insight_rules
method.
boto3 documentation
# describe_insight_rules method definition
def describe_insight_rules(
self,
*,
NextToken: str = ...,
MaxResults: int = ...,
) -> DescribeInsightRulesOutputTypeDef: # (1)
...
# describe_insight_rules method usage example with argument unpacking
kwargs: DescribeInsightRulesInputRequestTypeDef = { # (1)
"NextToken": ...,
}
parent.describe_insight_rules(**kwargs)
disable_alarm_actions#
Disables the actions for the specified alarms.
Type annotations and code completion for boto3.client("cloudwatch").disable_alarm_actions
method.
boto3 documentation
# disable_alarm_actions method definition
def disable_alarm_actions(
self,
*,
AlarmNames: Sequence[str],
) -> EmptyResponseMetadataTypeDef: # (1)
...
# disable_alarm_actions method usage example with argument unpacking
kwargs: DisableAlarmActionsInputRequestTypeDef = { # (1)
"AlarmNames": ...,
}
parent.disable_alarm_actions(**kwargs)
disable_insight_rules#
Disables the specified Contributor Insights rules.
Type annotations and code completion for boto3.client("cloudwatch").disable_insight_rules
method.
boto3 documentation
# disable_insight_rules method definition
def disable_insight_rules(
self,
*,
RuleNames: Sequence[str],
) -> DisableInsightRulesOutputTypeDef: # (1)
...
# disable_insight_rules method usage example with argument unpacking
kwargs: DisableInsightRulesInputRequestTypeDef = { # (1)
"RuleNames": ...,
}
parent.disable_insight_rules(**kwargs)
enable_alarm_actions#
Enables the actions for the specified alarms.
Type annotations and code completion for boto3.client("cloudwatch").enable_alarm_actions
method.
boto3 documentation
# enable_alarm_actions method definition
def enable_alarm_actions(
self,
*,
AlarmNames: Sequence[str],
) -> EmptyResponseMetadataTypeDef: # (1)
...
# enable_alarm_actions method usage example with argument unpacking
kwargs: EnableAlarmActionsInputRequestTypeDef = { # (1)
"AlarmNames": ...,
}
parent.enable_alarm_actions(**kwargs)
enable_insight_rules#
Enables the specified Contributor Insights rules.
Type annotations and code completion for boto3.client("cloudwatch").enable_insight_rules
method.