CloudWatchServiceResource#
Index > CloudWatch > CloudWatchServiceResource
Auto-generated documentation for CloudWatch type annotations stubs module types-aiobotocore-cloudwatch.
CloudWatchServiceResource#
Type annotations and code completion for session.resource("cloudwatch")
, included resources and collections.
boto3 documentation
# CloudWatchServiceResource usage example
from types_aiobotocore_cloudwatch.service_resource import CloudWatchServiceResource
def get_cloudwatch_resource() -> CloudWatchServiceResource:
return session.resource("cloudwatch")
Attributes#
-
meta
: CloudWatchResourceMeta -
alarms
: ServiceResourceAlarmsCollection -
metrics
: ServiceResourceMetricsCollection
Collections#
ServiceResourceAlarmsCollection#
Provides access to Alarm resource.
Type annotations and code completion for session.resource("cloudwatch").alarms
collection.
boto3 documentation
# ServiceResourceAlarmsCollection usage example
from types_aiobotocore_cloudwatch.service_resource import ServiceResourceAlarmsCollection
def get_collection() -> ServiceResourceAlarmsCollection:
return session.resource("cloudwatch").alarms
ServiceResourceMetricsCollection#
Provides access to Metric resource.
Type annotations and code completion for session.resource("cloudwatch").metrics
collection.
boto3 documentation
# ServiceResourceMetricsCollection usage example
from types_aiobotocore_cloudwatch.service_resource import ServiceResourceMetricsCollection
def get_collection() -> ServiceResourceMetricsCollection:
return session.resource("cloudwatch").metrics
Methods#
CloudWatchServiceResource.Alarm method#
Creates a Alarm resource.
Type annotations and code completion for session.resource("cloudwatch").Alarm
method.
boto3 documentation
# Alarm method definition
await def Alarm(
self,
name: str,
) -> Alarm:
...
CloudWatchServiceResource.Metric method#
Creates a Metric resource.
Type annotations and code completion for session.resource("cloudwatch").Metric
method.
boto3 documentation
# Metric method definition
await 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 session.resource("cloudwatch").get_available_subresources
method.
boto3 documentation
# get_available_subresources method definition
await def get_available_subresources(
self,
) -> Sequence[str]:
...
Alarm#
Type annotations and code completion for session.resource("cloudwatch").Alarm
class.
boto3 documentation
# Alarm usage example
from types_aiobotocore_cloudwatch.service_resource import Alarm
def get_resource() -> Alarm:
return session.resource("cloudwatch").Alarm(...)
Alarm attributes#
alarm_name
:Awaitable
[str
]alarm_arn
:Awaitable
[str
]alarm_description
:Awaitable
[str
]alarm_configuration_updated_timestamp
:Awaitable
[datetime
]actions_enabled
:Awaitable
[bool
]ok_actions
:Awaitable
[List
[str
]]alarm_actions
:Awaitable
[List
[str
]]insufficient_data_actions
:Awaitable
[List
[str
]]state_value
:Awaitable
[StateValueType]state_reason
:Awaitable
[str
]state_reason_data
:Awaitable
[str
]state_updated_timestamp
:Awaitable
[datetime
]metric_name
:Awaitable
[str
]namespace
:Awaitable
[str
]statistic
:Awaitable
[StatisticType]extended_statistic
:Awaitable
[str
]dimensions
:Awaitable
[List
[DimensionTypeDef]]period
:Awaitable
[int
]unit
:Awaitable
[StandardUnitType]evaluation_periods
:Awaitable
[int
]datapoints_to_alarm
:Awaitable
[int
]threshold
:Awaitable
[float
]comparison_operator
:Awaitable
[ComparisonOperatorType]treat_missing_data
:Awaitable
[str
]evaluate_low_sample_count_percentile
:Awaitable
[str
]metrics
:Awaitable
[List
[MetricDataQueryAlarmTypeDef]]threshold_metric_id
:Awaitable
[str
]evaluation_state
:Awaitable
[Literal['PARTIAL_DATA']
(see EvaluationStateType)]state_transitioned_timestamp
:Awaitable
[datetime
]name
:str
metric
: Metric
Alarm methods#
Alarm.delete method#
Deletes the specified alarms.
Type annotations and code completion for aiobotocore.resource("cloudwatch").delete
method.
boto3 documentation
# delete method definition
await def delete(
self,
) -> None:
...
Alarm.describe_history method#
Retrieves the history for the specified alarm.
Type annotations and code completion for aiobotocore.resource("cloudwatch").describe_history
method.
boto3 documentation
# describe_history method definition
await 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)
...
- See AlarmTypeType
- See HistoryItemTypeType
- See ScanByType
- See DescribeAlarmHistoryOutputTypeDef
# describe_history method usage example with argument unpacking
kwargs: DescribeAlarmHistoryInputAlarmDescribeHistoryTypeDef = { # (1)
"AlarmTypes": ...,
}
parent.describe_history(**kwargs)
Alarm.disable_actions method#
Disables the actions for the specified alarms.
Type annotations and code completion for aiobotocore.resource("cloudwatch").disable_actions
method.
boto3 documentation
# disable_actions method definition
await def disable_actions(
self,
) -> None:
...
Alarm.enable_actions method#
Enables the actions for the specified alarms.
Type annotations and code completion for aiobotocore.resource("cloudwatch").enable_actions
method.
boto3 documentation
# enable_actions method definition
await def enable_actions(
self,
) -> None:
...
Alarm.get_available_subresources method#
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for aiobotocore.resource("cloudwatch").get_available_subresources
method.
boto3 documentation
# get_available_subresources method definition
await def get_available_subresources(
self,
) -> Sequence[str]:
...
Alarm.load method#
Calls meth:CloudWatch.Client.describe_alarms
to update the attributes of
the Alarm resource.
Type annotations and code completion for aiobotocore.resource("cloudwatch").load
method.
boto3 documentation
# load method definition
await def load(
self,
) -> None:
...
Alarm.reload method#
Calls meth:CloudWatch.Client.describe_alarms
to update the attributes of
the Alarm resource.
Type annotations and code completion for aiobotocore.resource("cloudwatch").reload
method.
boto3 documentation
# reload method definition
await def reload(
self,
) -> None:
...
Alarm.set_state method#
Temporarily sets the state of an alarm for testing purposes.
Type annotations and code completion for aiobotocore.resource("cloudwatch").set_state
method.
boto3 documentation
# set_state method definition
await def set_state(
self,
*,
StateValue: StateValueType, # (1)
StateReason: str,
StateReasonData: str = ...,
) -> None:
...
- See StateValueType
# set_state method usage example with argument unpacking
kwargs: SetAlarmStateInputAlarmSetStateTypeDef = { # (1)
"StateValue": ...,
"StateReason": ...,
}
parent.set_state(**kwargs)
Metric#
Type annotations and code completion for session.resource("cloudwatch").Metric
class.
boto3 documentation
# Metric usage example
from types_aiobotocore_cloudwatch.service_resource import Metric
def get_resource() -> Metric:
return session.resource("cloudwatch").Metric(...)
Metric attributes#
metric_name
:Awaitable
[str
]dimensions
:Awaitable
[List
[DimensionTypeDef]]namespace
:str
name
:str
alarms
: MetricAlarmsCollection
Metric collections#
Metric.alarms#
Provides access to Alarm resource.
Type annotations and code completion for session.resource("cloudwatch").Metric(...).alarms
collection.
boto3 documentation
# MetricAlarmsCollection usage example
from types_aiobotocore_cloudwatch.service_resource import MetricAlarmsCollection
def get_collection() -> MetricAlarmsCollection:
resource = session.resource("cloudwatch").Metric(...)
return resource.alarms
Metric methods#
Metric.get_available_subresources method#
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for aiobotocore.resource("cloudwatch").get_available_subresources
method.
boto3 documentation
# get_available_subresources method definition
await def get_available_subresources(
self,
) -> Sequence[str]:
...
Metric.get_statistics method#
Gets statistics for the specified metric.
Type annotations and code completion for aiobotocore.resource("cloudwatch").get_statistics
method.
boto3 documentation
# get_statistics method definition
await def get_statistics(
self,
*,
StartTime: Union[datetime, str],
EndTime: Union[datetime, str],
Period: int,
Dimensions: Sequence[DimensionTypeDef] = ..., # (1)
Statistics: Sequence[StatisticType] = ..., # (2)
ExtendedStatistics: Sequence[str] = ...,
Unit: StandardUnitType = ..., # (3)
) -> GetMetricStatisticsOutputTypeDef: # (4)
...
# get_statistics method usage example with argument unpacking
kwargs: GetMetricStatisticsInputMetricGetStatisticsTypeDef = { # (1)
"StartTime": ...,
"EndTime": ...,
"Period": ...,
}
parent.get_statistics(**kwargs)
Metric.load method#
Calls meth:CloudWatch.Client.list_metrics
to update the attributes of the
Metric resource.
Type annotations and code completion for aiobotocore.resource("cloudwatch").load
method.
boto3 documentation
# load method definition
await def load(
self,
) -> None:
...
Metric.put_alarm method#
Creates or updates an alarm and associates it with the specified metric, metric math expression, anomaly detection model, or Metrics Insights query.
Type annotations and code completion for aiobotocore.resource("cloudwatch").put_alarm
method.
boto3 documentation
# put_alarm method definition
await def put_alarm(
self,
*,
AlarmName: str,
EvaluationPeriods: int,
ComparisonOperator: ComparisonOperatorType, # (1)
AlarmDescription: str = ...,
ActionsEnabled: bool = ...,
OKActions: Sequence[str] = ...,
AlarmActions: Sequence[str] = ...,
InsufficientDataActions: Sequence[str] = ...,
Statistic: StatisticType = ..., # (2)
ExtendedStatistic: str = ...,
Dimensions: Sequence[DimensionTypeDef] = ..., # (3)
Period: int = ...,
Unit: StandardUnitType = ..., # (4)
DatapointsToAlarm: int = ...,
Threshold: float = ...,
TreatMissingData: str = ...,
EvaluateLowSampleCountPercentile: str = ...,
Metrics: Sequence[MetricDataQueryTypeDef] = ..., # (5)
Tags: Sequence[TagTypeDef] = ..., # (6)
ThresholdMetricId: str = ...,
) -> Alarm:
...
- See ComparisonOperatorType
- See StatisticType
- See DimensionTypeDef
- See StandardUnitType
- See MetricDataQueryTypeDef
- See TagTypeDef
# put_alarm method usage example with argument unpacking
kwargs: PutMetricAlarmInputMetricPutAlarmTypeDef = { # (1)
"AlarmName": ...,
"EvaluationPeriods": ...,
"ComparisonOperator": ...,
}
parent.put_alarm(**kwargs)
Metric.put_data method#
Publishes metric data points to Amazon CloudWatch.
Type annotations and code completion for aiobotocore.resource("cloudwatch").put_data
method.
boto3 documentation
# put_data method definition
await def put_data(
self,
) -> None:
...
Metric.reload method#
Calls meth:CloudWatch.Client.list_metrics
to update the attributes of the
Metric resource.
Type annotations and code completion for aiobotocore.resource("cloudwatch").reload
method.
boto3 documentation
# reload method definition
await def reload(
self,
) -> None:
...