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
3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 | |