Skip to content

CloudWatch module#

Index > CloudWatch

Auto-generated documentation for CloudWatch type annotations stubs module types-aiobotocore-cloudwatch.

How to install#

From PyPI with pip#

Install types-aiobotocore for CloudWatch service.

# install with aiobotocore type annotations
python -m pip install 'types-aiobotocore[cloudwatch]'


# Lite version does not provide session.client/resource overloads
# it is more RAM-friendly, but requires explicit type annotations
python -m pip install 'types-aiobotocore-lite[cloudwatch]'


# standalone installation
python -m pip install types-aiobotocore-cloudwatch

How to uninstall#

python -m pip uninstall -y types-aiobotocore-cloudwatch

Usage#

Code samples can be found in Examples.

CloudWatchClient#

Type annotations and code completion for session.create_client("cloudwatch") as CloudWatchClient boto3 documentation

# CloudWatchClient usage example

from aiobotocore.session import get_session

from types_aiobotocore_cloudwatch.client import CloudWatchClient


session = get_session()
async with session.create_client("cloudwatch") as client:
    client: CloudWatchClient

Paginators#

Type annotations and code completion for paginators from session.create_client("cloudwatch").get_paginator("...").

# DescribeAlarmHistoryPaginator usage example

from types_aiobotocore_cloudwatch.paginator import DescribeAlarmHistoryPaginator

def get_describe_alarm_history_paginator() -> DescribeAlarmHistoryPaginator:
    return client.get_paginator("describe_alarm_history"))

Waiters#

Type annotations and code completion for waiters from session.create_client("cloudwatch").get_waiter("...").

# AlarmExistsWaiter usage example

from types_aiobotocore_cloudwatch.waiter import AlarmExistsWaiter

def get_alarm_exists_waiter() -> AlarmExistsWaiter:
    return Session().client("cloudwatch").get_waiter("alarm_exists")

CloudWatchServiceResource#

Type annotations and code completion for session.resource("cloudwatch") as CloudWatchServiceResource boto3 documentation

# CloudWatchServiceResource usage example

from types_aiobotocore_cloudwatch.service_resource import CloudWatchServiceResource

Collections#

Type annotations and code completion for collections from session.resource("cloudwatch").*.

# ServiceResourceAlarmsCollection usage example

from types_aiobotocore_cloudwatch.service_resource import ServiceResourceAlarmsCollection

def get_collection() -> ServiceResourceAlarmsCollection:
    return resource.alarms

Resources#

Type annotations and code completion for additional resources from session.resource("cloudwatch").*.

# Alarm usage example

from types_aiobotocore_cloudwatch.service_resource import Alarm

def get_resource() -> Alarm:
    return resource.Alarm(...)

Literals#

Type annotations for literals used in methods and schema.

# ActionsSuppressedByType usage example

from types_aiobotocore_cloudwatch.literals import ActionsSuppressedByType

def get_value() -> ActionsSuppressedByType:
    return "Alarm"

Type definitions#

Type annotations for type definitions used in methods and schema.