list_alerts
async
¶
list_alerts(
space_id: SpaceId,
*,
config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
filter_criteria: Optional[AlertFilterCriteria] = None,
sort_by: Optional[AlertSortField] = None,
sort_order: Optional[AlertSortOrder] = None,
next_token: Optional[NextToken] = None,
max_results: Optional[int] = None,
) -> ListAlertsOutput
Lists alerts within a space, optionally filtered by exact name(s), a single name prefix, or exact alertId(s), with pagination. Use GetAlert to retrieve a single alert's full detail.
Parameters:
-
space_id(SpaceId) –The unique ID of the space.
-
filter_criteria(Optional[AlertFilterCriteria], default:None) –Filter criteria narrowing which alerts are returned. All members are optional; the three name/id filters are mutually exclusive.
-
sort_by(Optional[AlertSortField], default:None) –The field to sort results by.
-
sort_order(Optional[AlertSortOrder], default:None) –The order in which to sort results.
-
next_token(Optional[NextToken], default:None) –A token to retrieve the next page of results.
-
max_results(Optional[int], default:None) –The maximum number of alerts to return per page.
Raises:
-
AccessDeniedException–The caller is not authorized to perform this action.
-
InternalServerException–An unexpected error occurred while processing the request.
-
ResourceNotFoundException–The specified resource does not exist.
-
ThrottlingException–The request was throttled due to exceeding the allowed request rate.
-
ValidationException–A parameter is specified incorrectly.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
List alerts in a space The following example lists the first page of alerts in a space, sorted by state, and returns a nextToken to retrieve the next page. Payloads are shown as JSON; on the wire they are CBOR-encoded.
>>> await client.list_alerts(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', filter_criteria={'namePrefix': 'service-', 'stateValue': ['WARNING', 'CRITICAL']}, sort_by='STATE', sort_order='DESC', max_results=50)
Source code in docs_src/capo_cloudwatchomni/_services/async_cloud_watch_omni.py
2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 | |