describe_alarms
async
¶
describe_alarms(
*,
config_overrides: Optional[AsyncCloudWatchClientConfig] = None,
alarm_names: Optional[AlarmNames] = None,
alarm_name_prefix: Optional[AlarmNamePrefix] = None,
alarm_types: Optional[AlarmTypes] = None,
children_of_alarm_name: Optional[AlarmName] = None,
parents_of_alarm_name: Optional[AlarmName] = None,
state_value: Optional[StateValue] = None,
action_prefix: Optional[ActionPrefix] = None,
max_records: Optional[MaxRecords] = None,
next_token: Optional[NextToken] = None,
) -> DescribeAlarmsOutput
Retrieves the specified alarms. You can filter the results by specifying a prefix for the alarm name, the alarm state, or a prefix for any action.
To use this operation and return information about composite alarms, you must be signed on with the cloudwatch:DescribeAlarms permission that is scoped to *. You can't return information about composite alarms if your cloudwatch:DescribeAlarms permission has a narrower scope.
Parameters:
-
alarm_names(Optional[AlarmNames], default:None) –The names of the alarms to retrieve information about.
-
alarm_name_prefix(Optional[AlarmNamePrefix], default:None) –An alarm name prefix. If you specify this parameter, you receive information about all alarms that have names that start with this prefix.
If this parameter is specified, you cannot specify
AlarmNames. -
alarm_types(Optional[AlarmTypes], default:None) –Use this parameter to specify whether you want the operation to return metric alarms, composite alarms, or log alarms. If you omit this parameter, only metric alarms are returned, even if composite alarms or log alarms exist in the account.
For example, if you omit this parameter or specify
MetricAlarms, the operation returns only a list of metric alarms. It does not return any composite alarms or log alarms, even if they exist in the account.If you specify
CompositeAlarms, the operation returns only a list of composite alarms, and does not return any metric alarms or log alarms.If you specify
LogAlarms, the operation returns only a list of log alarms, and does not return any metric alarms or composite alarms. -
children_of_alarm_name(Optional[AlarmName], default:None) –If you use this parameter and specify the name of a composite alarm, the operation returns information about the "children" alarms of the alarm you specify. These are the metric alarms and composite alarms referenced in the
AlarmRulefield of the composite alarm that you specify inChildrenOfAlarmName. Information about the composite alarm that you name inChildrenOfAlarmNameis not returned.If you specify
ChildrenOfAlarmName, you cannot specify any other parameters in the request except forMaxRecordsandNextToken. If you do so, you receive a validation error.Only the
Alarm Name,ARN,StateValue(OK/ALARM/INSUFFICIENT_DATA), andStateUpdatedTimestampinformation are returned by this operation when you use this parameter. To get complete information about these alarms, perform anotherDescribeAlarmsoperation and specify the parent alarm names in theAlarmNamesparameter. -
parents_of_alarm_name(Optional[AlarmName], default:None) –If you use this parameter and specify the name of a metric or composite alarm, the operation returns information about the "parent" alarms of the alarm you specify. These are the composite alarms that have
AlarmRuleparameters that reference the alarm named inParentsOfAlarmName. Information about the alarm that you specify inParentsOfAlarmNameis not returned.If you specify
ParentsOfAlarmName, you cannot specify any other parameters in the request except forMaxRecordsandNextToken. If you do so, you receive a validation error.Only the Alarm Name and ARN are returned by this operation when you use this parameter. To get complete information about these alarms, perform another
DescribeAlarmsoperation and specify the parent alarm names in theAlarmNamesparameter. -
state_value(Optional[StateValue], default:None) –Specify this parameter to receive information only about alarms that are currently in the state that you specify.
-
action_prefix(Optional[ActionPrefix], default:None) –Use this parameter to filter the results of the operation to only those alarms that use a certain alarm action. For example, you could specify the ARN of an SNS topic to find all alarms that send notifications to that topic.
-
max_records(Optional[MaxRecords], default:None) –The maximum number of alarm descriptions to retrieve.
-
next_token(Optional[NextToken], default:None) –The token returned by a previous call to indicate that there is more data available.
Raises:
-
InvalidNextToken–The next token specified is invalid.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cloudwatch/_services/async_cloud_watch.py
1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 | |