Skip to content

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)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_alarms method usage example with argument unpacking

kwargs: DeleteAlarmsInputRequestTypeDef = {  # (1)
    "AlarmNames": ...,
}

parent.delete_alarms(**kwargs)
  1. See DeleteAlarmsInputRequestTypeDef

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]:
    ...
  1. See DimensionTypeDef
  2. See SingleMetricAnomalyDetectorTypeDef
  3. See MetricMathAnomalyDetectorTypeDef
# delete_anomaly_detector method usage example with argument unpacking

kwargs: DeleteAnomalyDetectorInputRequestTypeDef = {  # (1)
    "Namespace": ...,
}

parent.delete_anomaly_detector(**kwargs)
  1. See DeleteAnomalyDetectorInputRequestTypeDef

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)
  1. See DeleteDashboardsInputRequestTypeDef

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)
    ...
  1. See DeleteInsightRulesOutputTypeDef
# delete_insight_rules method usage example with argument unpacking

kwargs: DeleteInsightRulesInputRequestTypeDef = {  # (1)
    "RuleNames": ...,
}

parent.delete_insight_rules(**kwargs)
  1. See DeleteInsightRulesInputRequestTypeDef

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)
  1. See DeleteMetricStreamInputRequestTypeDef

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)
    ...
  1. See AlarmTypeType
  2. See HistoryItemTypeType
  3. See ScanByType
  4. See DescribeAlarmHistoryOutputTypeDef
# describe_alarm_history method usage example with argument unpacking

kwargs: DescribeAlarmHistoryInputRequestTypeDef = {  # (1)
    "AlarmName": ...,
}

parent.describe_alarm_history(**kwargs)
  1. See DescribeAlarmHistoryInputRequestTypeDef

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)
    ...
  1. See AlarmTypeType
  2. See StateValueType
  3. See DescribeAlarmsOutputTypeDef
# describe_alarms method usage example with argument unpacking

kwargs: DescribeAlarmsInputRequestTypeDef = {  # (1)
    "AlarmNames": ...,
}

parent.describe_alarms(**kwargs)
  1. See DescribeAlarmsInputRequestTypeDef

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)
    ...
  1. See StatisticType
  2. See DimensionTypeDef
  3. See StandardUnitType
  4. See DescribeAlarmsForMetricOutputTypeDef
# describe_alarms_for_metric method usage example with argument unpacking

kwargs: DescribeAlarmsForMetricInputRequestTypeDef = {  # (1)
    "MetricName": ...,
    "Namespace": ...,
}

parent.describe_alarms_for_metric(**kwargs)
  1. See DescribeAlarmsForMetricInputRequestTypeDef

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)
    ...
  1. See DimensionTypeDef
  2. See AnomalyDetectorTypeType
  3. See DescribeAnomalyDetectorsOutputTypeDef
# describe_anomaly_detectors method usage example with argument unpacking

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

parent.describe_anomaly_detectors(**kwargs)
  1. See DescribeAnomalyDetectorsInputRequestTypeDef

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)
    ...
  1. See DescribeInsightRulesOutputTypeDef
# describe_insight_rules method usage example with argument unpacking

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

parent.describe_insight_rules(**kwargs)
  1. See DescribeInsightRulesInputRequestTypeDef

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)
    ...
  1. See EmptyResponseMetadataTypeDef
# disable_alarm_actions method usage example with argument unpacking

kwargs: DisableAlarmActionsInputRequestTypeDef = {  # (1)
    "AlarmNames": ...,
}

parent.disable_alarm_actions(**kwargs)
  1. See DisableAlarmActionsInputRequestTypeDef

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)
    ...
  1. See DisableInsightRulesOutputTypeDef
# disable_insight_rules method usage example with argument unpacking

kwargs: DisableInsightRulesInputRequestTypeDef = {  # (1)
    "RuleNames": ...,
}

parent.disable_insight_rules(**kwargs)
  1. See DisableInsightRulesInputRequestTypeDef

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)
    ...
  1. See EmptyResponseMetadataTypeDef
# enable_alarm_actions method usage example with argument unpacking

kwargs: EnableAlarmActionsInputRequestTypeDef = {  # (1)
    "AlarmNames": ...,
}

parent.enable_alarm_actions(**kwargs)
  1. See EnableAlarmActionsInputRequestTypeDef

enable_insight_rules#

Enables the specified Contributor Insights rules.

Type annotations and code completion for boto3.client("cloudwatch").enable_insight_rules method.