Skip to content

CloudWatchServiceResource#

Index > CloudWatch > CloudWatchServiceResource

Auto-generated documentation for CloudWatch type annotations stubs module mypy-boto3-cloudwatch.

CloudWatchServiceResource#

Type annotations and code completion for boto3.resource("cloudwatch"), included resources and collections. boto3 documentation

# CloudWatchServiceResource usage example

from mypy_boto3_cloudwatch.service_resource import CloudWatchServiceResource

def get_cloudwatch_resource() -> CloudWatchServiceResource:
    return boto3.resource("cloudwatch")

Attributes#

Collections#

ServiceResourceAlarmsCollection#

Provides access to Alarm resource.

Type annotations and code completion for boto3.resource("cloudwatch").alarms collection. boto3 documentation

# ServiceResourceAlarmsCollection usage example

from mypy_boto3_cloudwatch.service_resource import ServiceResourceAlarmsCollection

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

ServiceResourceMetricsCollection#

Provides access to Metric resource.

Type annotations and code completion for boto3.resource("cloudwatch").metrics collection. boto3 documentation

# ServiceResourceMetricsCollection usage example

from mypy_boto3_cloudwatch.service_resource import ServiceResourceMetricsCollection

def get_collection() -> ServiceResourceMetricsCollection:
    return boto3.resource("cloudwatch").metrics

Methods#

CloudWatchServiceResource.Alarm method#

Creates a Alarm resource.

Type annotations and code completion for boto3.resource("cloudwatch").Alarm method. boto3 documentation

# Alarm method definition

def Alarm(
    self,
    name: str,
) -> Alarm:
    ...

CloudWatchServiceResource.Metric method#

Creates a Metric resource.

Type annotations and code completion for boto3.resource("cloudwatch").Metric method. boto3 documentation

# Metric method definition

def Metric(
    self,
    namespace: str,
    name: str,
) -> Metric:
    ...

CloudWatchServiceResource.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("cloudwatch").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

Alarm#

Type annotations and code completion for boto3.resource("cloudwatch").Alarm class. boto3 documentation

# Alarm usage example

from mypy_boto3_cloudwatch.service_resource import Alarm

def get_resource() -> Alarm:
    return boto3.resource("cloudwatch").Alarm(...)

Alarm attributes#

  • alarm_name: str
  • alarm_arn: str
  • alarm_description: str
  • alarm_configuration_updated_timestamp: datetime
  • actions_enabled: bool
  • ok_actions: List[str]
  • alarm_actions: List[str]
  • insufficient_data_actions: List[str]
  • state_value: StateValueType
  • state_reason: str
  • state_reason_data: str
  • state_updated_timestamp: datetime
  • metric_name: str
  • namespace: str
  • statistic: StatisticType
  • extended_statistic: str
  • dimensions: List[DimensionTypeDef]
  • period: int
  • unit: StandardUnitType
  • evaluation_periods: int
  • datapoints_to_alarm: int
  • threshold: float
  • comparison_operator: ComparisonOperatorType
  • treat_missing_data: str
  • evaluate_low_sample_count_percentile: str
  • metrics: List[MetricDataQueryAlarmTypeDef]
  • threshold_metric_id: str
  • evaluation_state: Literal['PARTIAL_DATA'] (see EvaluationStateType)
  • state_transitioned_timestamp: datetime
  • name: str
  • metric: Metric
  • meta: CloudWatchResourceMeta

Alarm methods#

Alarm.delete method#

Deletes the specified alarms.

Type annotations and code completion for boto3.resource("cloudwatch").delete method. boto3 documentation

# delete method definition

def delete(
    self,
) -> None:
    ...

Alarm.describe_history method#

Retrieves the history for the specified alarm.

Type annotations and code completion for boto3.resource("cloudwatch").describe_history method. boto3 documentation

# describe_history method definition

def describe_history(
    self,
    *,
    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