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.ConflictException,
    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#

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:
    ...

generate_presigned_url#

Type annotations and code completion for boto3.client("cloudwatch").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:
    ...

delete_alarm_mute_rule#

Deletes a specific alarm mute rule.

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

# delete_alarm_mute_rule method definition

def delete_alarm_mute_rule(
    self,
    *,
    AlarmMuteRuleName: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_alarm_mute_rule method usage example with argument unpacking

kwargs: DeleteAlarmMuteRuleInputTypeDef = {  # (1)
    "AlarmMuteRuleName": ...,
}

parent.delete_alarm_mute_rule(**kwargs)
  1. See DeleteAlarmMuteRuleInputTypeDef

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: DeleteAlarmsInputTypeDef = {  # (1)
    "AlarmNames": ...,
}

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

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: SingleMetricAnomalyDetectorUnionTypeDef = ...,  # (2)
    MetricMathAnomalyDetector: MetricMathAnomalyDetectorUnionTypeDef = ...,  # (3)
) -> dict[str, Any]:
    ...
  1. See Sequence[DimensionTypeDef]
  2. See SingleMetricAnomalyDetectorUnionTypeDef
  3. See MetricMathAnomalyDetectorUnionTypeDef
# delete_anomaly_detector method usage example with argument unpacking

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

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

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: DeleteDashboardsInputTypeDef = {  # (1)
    "DashboardNames": ...,
}

parent.delete_dashboards(**kwargs)
  1. See DeleteDashboardsInputTypeDef

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: DeleteInsightRulesInputTypeDef = {  # (1)
    "RuleNames": ...,
}

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

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: DeleteMetricStreamInputTypeDef = {  # (1)
    "Name": ...,
}

parent.delete_metric_stream(**kwargs)
  1. See DeleteMetricStreamInputTypeDef

describe_alarm_contributors#

Returns the information of the current alarm contributors that are in ALARM state.

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

# describe_alarm_contributors method definition

def describe_alarm_contributors(
    self,
    *,
    AlarmName: str,
    NextToken: str = ...,
) -> DescribeAlarmContributorsOutputTypeDef:  # (1)
    ...
  1. See DescribeAlarmContributorsOutputTypeDef
# describe_alarm_contributors method usage example with argument unpacking

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

parent.describe_alarm_contributors(**kwargs)
  1. See DescribeAlarmContributorsInputTypeDef

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 = ...,
    AlarmContributorId: str = ...,
    AlarmTypes: Sequence[AlarmTypeType] = ...,  # (1)
    HistoryItemType: HistoryItemTypeType = ...,  # (2)
    StartDate: TimestampTypeDef = ...,
    EndDate: TimestampTypeDef = ...,
    MaxRecords: int = ...,
    NextToken: str = ...,
    ScanBy: ScanByType = ...,  # (3)
) -> DescribeAlarmHistoryOutputTypeDef:  # (4)
    ...
  1. See Sequence[AlarmTypeType]
  2. See HistoryItemTypeType
  3. See ScanByType
  4. See DescribeAlarmHistoryOutputTypeDef
# describe_alarm_history method usage example with argument unpacking

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

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

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

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

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

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 Sequence[DimensionTypeDef]
  3. See StandardUnitType
  4. See DescribeAlarmsForMetricOutputTypeDef
# describe_alarms_for_metric method usage example with argument unpacking

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

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

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

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

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

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: DescribeInsightRulesInputTypeDef = {  # (1)
    "NextToken": ...,
}

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

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: DisableAlarmActionsInputTypeDef = {  # (1)
    "AlarmNames": ...,
}

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

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: DisableInsightRulesInputTypeDef = {  # (1)
    "RuleNames": ...,
}

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

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: EnableAlarmActionsInputTypeDef = {  # (1)
    "AlarmNames": ...,
}

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

enable_insight_rules#

Enables the specified Contributor Insights rules.

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

# enable_insight_rules method definition

def enable_insight_rules(
    self,
    *,
    RuleNames: Sequence[str],
) -> EnableInsightRulesOutputTypeDef:  # (1)
    ...
  1. See EnableInsightRulesOutputTypeDef
# enable_insight_rules method usage example with argument unpacking

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

parent.enable_insight_rules(**kwargs)
  1. See EnableInsightRulesInputTypeDef

get_alarm_mute_rule#

Retrieves details for a specific alarm mute rule.

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

# get_alarm_mute_rule method definition

def get_alarm_mute_rule(
    self,
    *,
    AlarmMuteRuleName: str,
) -> GetAlarmMuteRuleOutputTypeDef:  # (1)
    ...
  1. See GetAlarmMuteRuleOutputTypeDef
# get_alarm_mute_rule method usage example with argument unpacking

kwargs: GetAlarmMuteRuleInputTypeDef = {  # (1)
    "AlarmMuteRuleName": ...,
}

parent.get_alarm_mute_rule(**kwargs)
  1. See GetAlarmMuteRuleInputTypeDef

get_dashboard#

Displays the details of the dashboard that you specify.

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

# get_dashboard method definition

def get_dashboard(
    self,
    *,
    DashboardName: str,
) -> GetDashboardOutputTypeDef:  # (1)
    ...
  1. See GetDashboardOutputTypeDef
# get_dashboard method usage example with argument unpacking

kwargs: GetDashboardInputTypeDef = {  # (1)
    "DashboardName": ...,
}

parent.get_dashboard(**kwargs)
  1. See GetDashboardInputTypeDef

get_insight_rule_report#

This operation returns the time series data collected by a Contributor Insights rule.

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

# get_insight_rule_report method definition

def get_insight_rule_report(
    self,
    *,
    RuleName: str,
    StartTime: TimestampTypeDef,
    EndTime: TimestampTypeDef,
    Period: int,
    MaxContributorCount: int = ...,
    Metrics: Sequence[str] = ...,
    OrderBy: str = ...,
) -> GetInsightRuleReportOutputTypeDef:  # (1)
    ...
  1. See GetInsightRuleReportOutputTypeDef
# get_insight_rule_report method usage example with argument unpacking

kwargs: GetInsightRuleReportInputTypeDef = {  # (1)
    "RuleName": ...,
    "StartTime": ...,
    "EndTime": ...,
    "Period": ...,
}

parent.get_insight_rule_report(**kwargs)
  1. See GetInsightRuleReportInputTypeDef

get_metric_data#

You can use the GetMetricData API to retrieve CloudWatch metric values.

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

# get_metric_data method definition

def get_metric_data(
    self,
    *,
    MetricDataQueries: Sequence[MetricDataQueryUnionTypeDef],  # (1)
    StartTime: TimestampTypeDef,
    EndTime: TimestampTypeDef,
    NextToken: str = ...,
    ScanBy: ScanByType = ...,  # (2)
    MaxDatapoints: int = ...,
    LabelOptions: LabelOptionsTypeDef = ...,  # (3)
) -> GetMetricDataOutputTypeDef:  # (4)
    ...
  1. See Sequence[MetricDataQueryUnionTypeDef]
  2. See ScanByType
  3. See LabelOptionsTypeDef
  4. See GetMetricDataOutputTypeDef
# get_metric_data method usage example with argument unpacking

kwargs: GetMetricDataInputTypeDef = {  # (1)
    "MetricDataQueries": ...,
    "StartTime": ...,
    "EndTime": ...,
}

parent.get_metric_data(**kwargs)
  1. See GetMetricDataInputTypeDef

get_metric_statistics#

Gets statistics for the specified metric.

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

# get_metric_statistics method definition

def get_metric_statistics(
    self,
    *,
    Namespace: str,
    MetricName: str,
    StartTime: TimestampTypeDef,
    EndTime: TimestampTypeDef,
    Period: int,
    Dimensions: Sequence[DimensionTypeDef] = ...,  # (1)
    Statistics: Sequence[StatisticType] = ...,  # (2)
    ExtendedStatistics: Sequence[str] = ...,
    Unit: StandardUnitType = ...,  # (3)
) -> GetMetricStatisticsOutputTypeDef:  # (4)
    ...
  1. See Sequence[DimensionTypeDef]
  2. See Sequence[StatisticType]
  3. See StandardUnitType
  4. See GetMetricStatisticsOutputTypeDef
# get_metric_statistics method usage example with argument unpacking

kwargs: GetMetricStatisticsInputTypeDef = {  # (1)
    "Namespace": ...,
    "MetricName": ...,
    "StartTime": ...,
    "EndTime": ...,
    "Period": ...,
}

parent.get_metric_statistics(**kwargs)
  1. See GetMetricStatisticsInputTypeDef

get_metric_stream#

Returns information about the metric stream that you specify.

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

# get_metric_stream method definition

def get_metric_stream(
    self,
    *,
    Name: str,
) -> GetMetricStreamOutputTypeDef:  # (1)
    ...
  1. See GetMetricStreamOutputTypeDef
# get_metric_stream method usage example with argument unpacking

kwargs: GetMetricStreamInputTypeDef = {  # (1)
    "Name": ...,
}

parent.get_metric_stream(**kwargs)
  1. See GetMetricStreamInputTypeDef

get_metric_widget_image#

You can use the GetMetricWidgetImage API to retrieve a snapshot graph of one or more Amazon CloudWatch metrics as a bitmap image.

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

# get_metric_widget_image method definition

def get_metric_widget_image(
    self,
    *,
    MetricWidget: str,
    OutputFormat: str = ...,
) -> GetMetricWidgetImageOutputTypeDef:  # (1)
    ...
  1. See GetMetricWidgetImageOutputTypeDef
# get_metric_widget_image method usage example with argument unpacking

kwargs: GetMetricWidgetImageInputTypeDef = {  # (1)
    "MetricWidget": ...,
}

parent.get_metric_widget_image(**kwargs)
  1. See GetMetricWidgetImageInputTypeDef

get_o_tel_enrichment#

Returns the current status of vended metric enrichment for the account, including whether CloudWatch vended metrics are enriched with resource ARN and resource tag labels and queryable using PromQL.

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

# get_o_tel_enrichment method definition

def get_o_tel_enrichment(
    self,
) -> GetOTelEnrichmentOutputTypeDef:  # (1)
    ...
  1. See GetOTelEnrichmentOutputTypeDef

list_alarm_mute_rules#

Lists alarm mute rules in your Amazon Web Services account and region.

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

# list_alarm_mute_rules method definition

def list_alarm_mute_rules(
    self,
    *,
    AlarmName: str = ...,
    Statuses: Sequence[AlarmMuteRuleStatusType] = ...,  # (1)
    MaxRecords: int = ...,
    NextToken: str = ...,
) -> ListAlarmMuteRulesOutputTypeDef:  # (2)
    ...
  1. See Sequence[AlarmMuteRuleStatusType]
  2. See ListAlarmMuteRulesOutputTypeDef
# list_alarm_mute_rules method usage example with argument unpacking

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

parent.list_alarm_mute_rules(**kwargs)
  1. See ListAlarmMuteRulesInputTypeDef

list_dashboards#

Returns a list of the dashboards for your account.

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

# list_dashboards method definition

def list_dashboards(
    self,
    *,
    DashboardNamePrefix: str = ...,
    NextToken: str = ...,
) -> ListDashboardsOutputTypeDef:  # (1)
    ...
  1. See ListDashboardsOutputTypeDef
# list_dashboards method usage example with argument unpacking

kwargs: ListDashboardsInputTypeDef = {  # (1)
    "DashboardNamePrefix": ...,
}

parent.list_dashboards(**kwargs)
  1. See ListDashboardsInputTypeDef

list_managed_insight_rules#

Returns a list that contains the number of managed Contributor Insights rules in your account.

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

# list_managed_insight_rules method definition

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

kwargs: ListManagedInsightRulesInputTypeDef = {  # (1)
    "ResourceARN": ...,
}

parent.list_managed_insight_rules(**kwargs)
  1. See ListManagedInsightRulesInputTypeDef

list_metric_streams#

Returns a list of metric streams in this account.

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

# list_metric_streams method definition

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

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

parent.list_metric_streams(**kwargs)
  1. See ListMetricStreamsInputTypeDef

list_metrics#

List the specified metrics.

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

# list_metrics method definition

def list_metrics(
    self,
    *,
    Namespace: str = ...,
    MetricName: str = ...,
    Dimensions: Sequence[DimensionFilterTypeDef] = ...,  # (1)
    NextToken: str = ...,
    RecentlyActive: RecentlyActiveType = ...,  # (2)
    IncludeLinkedAccounts: bool = ...,
    OwningAccount: str = ...,
) -> ListMetricsOutputTypeDef:  # (3)
    ...
  1. See Sequence[DimensionFilterTypeDef]
  2. See RecentlyActiveType
  3. See ListMetricsOutputTypeDef
# list_metrics method usage example with argument unpacking

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

parent.list_metrics(**kwargs)
  1. See ListMetricsInputTypeDef

list_tags_for_resource#

Displays the tags associated with a CloudWatch resource.

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

# list_tags_for_resource method definition

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

kwargs: ListTagsForResourceInputTypeDef = {  # (1)
    "ResourceARN": ...,
}

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

put_alarm_mute_rule#

Creates or updates an alarm mute rule.

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

# put_alarm_mute_rule method definition

def put_alarm_mute_rule(
    self,
    *,
    Name: str,
    Rule: RuleTypeDef,  # (1)
    Description: str = ...,
    MuteTargets: MuteTargetsUnionTypeDef = ...,  # (2)
    Tags: Sequence[TagTypeDef] = ...,  # (3)
    StartDate: TimestampTypeDef = ...,
    ExpireDate: TimestampTypeDef = ...,
) -> EmptyResponseMetadataTypeDef:  # (4)
    ...
  1. See RuleTypeDef
  2. See MuteTargetsUnionTypeDef
  3. See Sequence[TagTypeDef]
  4. See EmptyResponseMetadataTypeDef
# put_alarm_mute_rule method usage example with argument unpacking

kwargs: PutAlarmMuteRuleInputTypeDef = {  # (1)
    "Name": ...,
    "Rule": ...,
}

parent.put_alarm_mute_rule(**kwargs)
  1. See PutAlarmMuteRuleInputTypeDef

put_anomaly_detector#

Creates an anomaly detection model for a CloudWatch metric.

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

# put_anomaly_detector method definition

def put_anomaly_detector(
    self,
    *,
    Namespace: str = ...,
    MetricName: str = ...,
    Dimensions: Sequence[DimensionTypeDef] = ...,  # (1)
    Stat: str = ...,
    Configuration: AnomalyDetectorConfigurationUnionTypeDef = ...,  # (2)
    MetricCharacteristics: MetricCharacteristicsTypeDef = ...,  # (3)
    SingleMetricAnomalyDetector: SingleMetricAnomalyDetectorUnionTypeDef = ...,  # (4)
    MetricMathAnomalyDetector: MetricMathAnomalyDetectorUnionTypeDef = ...,  # (5)
) -> dict[str, Any]:
    ...
  1. See Sequence[DimensionTypeDef]
  2. See AnomalyDetectorConfigurationUnionTypeDef
  3. See MetricCharacteristicsTypeDef
  4. See SingleMetricAnomalyDetectorUnionTypeDef
  5. See MetricMathAnomalyDetectorUnionTypeDef
# put_anomaly_detector method usage example with argument unpacking

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

parent.put_anomaly_detector(**kwargs)
  1. See PutAnomalyDetectorInputTypeDef

put_composite_alarm#

Creates or updates a composite alarm.

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

# put_composite_alarm method definition

def put_composite_alarm(
    self,
    *,
    AlarmName: str,
    AlarmRule: str,
    ActionsEnabled: bool = ...,
    AlarmActions: Sequence[str] = ...,
    AlarmDescription: str = ...,
    InsufficientDataActions: Sequence[str] = ...,
    OKActions: Sequence[str] = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
    ActionsSuppressor: str = ...,
    ActionsSuppressorWaitPeriod: int = ...,
    ActionsSuppressorExtensionPeriod: int = ...,
) -> EmptyResponseMetadataTypeDef:  # (2)
    ...
  1. See Sequence[TagTypeDef]
  2. See EmptyResponseMetadataTypeDef
# put_composite_alarm method usage example with argument unpacking

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

parent.put_composite_alarm(**kwargs)
  1. See PutCompositeAlarmInputTypeDef

put_dashboard#

Creates a dashboard if it does not already exist, or updates an existing dashboard.

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

# put_dashboard method definition

def put_dashboard(
    self,
    *,
    DashboardName: str,
    DashboardBody: str,
) -> PutDashboardOutputTypeDef:  # (1)
    ...
  1. See PutDashboardOutputTypeDef
# put_dashboard method usage example with argument unpacking

kwargs: PutDashboardInputTypeDef = {  # (1)
    "DashboardName": ...,
    "DashboardBody": ...,
}

parent.put_dashboard(**kwargs)
  1. See PutDashboardInputTypeDef

put_insight_rule#

Creates a Contributor Insights rule.

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

# put_insight_rule method definition

def put_insight_rule(
    self,
    *,
    RuleName: str,
    RuleDefinition: str,
    RuleState: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
    ApplyOnTransformedLogs: bool = ...,
) -> dict[str, Any]:
    ...
  1. See Sequence[TagTypeDef]
# put_insight_rule method usage example with argument unpacking

kwargs: PutInsightRuleInputTypeDef = {  # (1)
    "RuleName": ...,
    "RuleDefinition": ...,
}

parent.put_insight_rule(**kwargs)
  1. See PutInsightRuleInputTypeDef

put_managed_insight_rules#

Creates a managed Contributor Insights rule for a specified Amazon Web Services resource.

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

# put_managed_insight_rules method definition

def put_managed_insight_rules(
    self,
    *,
    ManagedRules: Sequence[ManagedRuleTypeDef],  # (1)
) -> PutManagedInsightRulesOutputTypeDef:  # (2)
    ...
  1. See Sequence[ManagedRuleTypeDef]
  2. See PutManagedInsightRulesOutputTypeDef
# put_managed_insight_rules method usage example with argument unpacking

kwargs: PutManagedInsightRulesInputTypeDef = {  # (1)
    "ManagedRules": ...,
}

parent.put_managed_insight_rules(**kwargs)
  1. See PutManagedInsightRulesInputTypeDef

put_metric_alarm#

Creates or updates an alarm and associates it with the specified metric, metric math expression, anomaly detection model, Metrics Insights query, or PromQL query.

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

# put_metric_alarm method definition

def put_metric_alarm(
    self,
    *,
    AlarmName: str,
    AlarmDescription: str = ...,
    ActionsEnabled: bool = ...,
    OKActions: Sequence[str] = ...,
    AlarmActions: Sequence[str] = ...,
    InsufficientDataActions: Sequence[str] = ...,
    MetricName: str = ...,
    Namespace: str = ...,
    Statistic: StatisticType = ...,  # (1)
    ExtendedStatistic: str = ...,
    Dimensions: Sequence[DimensionTypeDef] = ...,  # (2)
    Period: int = ...,
    Unit: StandardUnitType = ...,  # (3)
    EvaluationPeriods: int = ...,
    DatapointsToAlarm: int = ...,
    Threshold: float = ...,
    ComparisonOperator: ComparisonOperatorType = ...,  # (4)
    TreatMissingData: str = ...,
    EvaluateLowSampleCountPercentile: str = ...,
    Metrics: Sequence[MetricDataQueryUnionTypeDef] = ...,  # (5)
    Tags: Sequence[TagTypeDef] = ...,  # (6)
    ThresholdMetricId: str = ...,
    EvaluationCriteria: EvaluationCriteriaTypeDef = ...,  # (7)
    EvaluationInterval: int = ...,
) -> EmptyResponseMetadataTypeDef:  # (8)
    ...
  1. See StatisticType
  2. See Sequence[DimensionTypeDef]
  3. See StandardUnitType
  4. See ComparisonOperatorType
  5. See Sequence[MetricDataQueryUnionTypeDef]
  6. See Sequence[TagTypeDef]
  7. See EvaluationCriteriaTypeDef
  8. See EmptyResponseMetadataTypeDef
# put_metric_alarm method usage example with argument unpacking

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

parent.put_metric_alarm(**kwargs)
  1. See PutMetricAlarmInputTypeDef

put_metric_data#

Publishes metric data to Amazon CloudWatch.

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

# put_metric_data method definition

def put_metric_data(
    self,
    *,
    Namespace: str,
    MetricData: Sequence[MetricDatumTypeDef] = ...,  # (1)
    EntityMetricData: Sequence[EntityMetricDataTypeDef] = ...,  # (2)
    StrictEntityValidation: bool = ...,
) -> EmptyResponseMetadataTypeDef:  # (3)
    ...
  1. See Sequence[MetricDatumTypeDef]
  2. See Sequence[EntityMetricDataTypeDef]
  3. See EmptyResponseMetadataTypeDef
# put_metric_data method usage example with argument unpacking

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

parent.put_metric_data(**kwargs)
  1. See PutMetricDataInputTypeDef

put_metric_stream#

Creates or updates a metric stream.

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

# put_metric_stream method definition

def put_metric_stream(
    self,
    *,
    Name: str,
    FirehoseArn: str,
    RoleArn: str,
    OutputFormat: MetricStreamOutputFormatType,  # (1)
    IncludeFilters: Sequence[MetricStreamFilterUnionTypeDef] = ...,  # (2)
    ExcludeFilters: Sequence[MetricStreamFilterUnionTypeDef] = ...,  # (2)
    Tags: Sequence[TagTypeDef] = ...,  # (4)
    StatisticsConfigurations: Sequence[MetricStreamStatisticsConfigurationUnionTypeDef] = ...,  # (5)
    IncludeLinkedAccountsMetrics: bool = ...,
) -> PutMetricStreamOutputTypeDef:  # (6)
    ...
  1. See MetricStreamOutputFormatType
  2. See Sequence[MetricStreamFilterUnionTypeDef]
  3. See Sequence[MetricStreamFilterUnionTypeDef]
  4. See Sequence[TagTypeDef]
  5. See Sequence[MetricStreamStatisticsConfigurationUnionTypeDef]
  6. See PutMetricStreamOutputTypeDef
# put_metric_stream method usage example with argument unpacking

kwargs: PutMetricStreamInputTypeDef = {  # (1)
    "Name": ...,
    "FirehoseArn": ...,
    "RoleArn": ...,
    "OutputFormat": ...,
}

parent.put_metric_stream(**kwargs)
  1. See PutMetricStreamInputTypeDef

set_alarm_state#

Temporarily sets the state of an alarm for testing purposes.

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

# set_alarm_state method definition

def set_alarm_state(
    self,
    *,
    AlarmName: str,
    StateValue: StateValueType,  # (1)
    StateReason: str,
    StateReasonData: str = ...,
) -> EmptyResponseMetadataTypeDef:  # (2)
    ...
  1. See StateValueType
  2. See EmptyResponseMetadataTypeDef
# set_alarm_state method usage example with argument unpacking

kwargs: SetAlarmStateInputTypeDef = {  # (1)
    "AlarmName": ...,
    "StateValue": ...,
    "StateReason": ...,
}

parent.set_alarm_state(**kwargs)
  1. See SetAlarmStateInputTypeDef

start_metric_streams#

Starts the streaming of metrics for one or more of your metric streams.

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

# start_metric_streams method definition

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

kwargs: StartMetricStreamsInputTypeDef = {  # (1)
    "Names": ...,
}

parent.start_metric_streams(**kwargs)
  1. See StartMetricStreamsInputTypeDef

start_o_tel_enrichment#

Enables enrichment and PromQL access for CloudWatch vended metrics for supported AWS resources in the account.

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

# start_o_tel_enrichment method definition

def start_o_tel_enrichment(
    self,
) -> dict[str, Any]:
    ...

stop_metric_streams#

Stops the streaming of metrics for one or more of your metric streams.

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

# stop_metric_streams method definition

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

kwargs: StopMetricStreamsInputTypeDef = {  # (1)
    "Names": ...,
}

parent.stop_metric_streams(**kwargs)
  1. See StopMetricStreamsInputTypeDef

stop_o_tel_enrichment#

Disables enrichment and PromQL access for CloudWatch vended metrics for supported AWS resources in the account.

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

# stop_o_tel_enrichment method definition

def stop_o_tel_enrichment(
    self,
) -> dict[str, Any]:
    ...

tag_resource#

Assigns one or more tags (key-value pairs) to the specified CloudWatch resource.

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

# tag_resource method definition

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

kwargs: TagResourceInputTypeDef = {  # (1)
    "ResourceARN": ...,
    "Tags": ...,
}

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

untag_resource#

Removes one or more tags from the specified resource.

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

# untag_resource method definition

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

kwargs: UntagResourceInputTypeDef = {  # (1)
    "ResourceARN": ...,
    "TagKeys": ...,
}

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

get_paginator#

Type annotations and code completion for boto3.client("cloudwatch").get_paginator method with overloads.

get_waiter#

Type annotations and code completion for boto3.client("cloudwatch").get_waiter method with overloads.