list_alerts
¶
list_alerts(
space_id: SpaceId,
*,
config_overrides: Optional[CloudWatchOmniClientConfig] = 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.
>>> 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/cloud_watch_omni.py
2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 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 | |