Skip to content

iter_list_monitors async

iter_list_monitors(
    *,
    config_overrides: Optional[AsyncNetworkMonitorClientConfig] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[MaxResults] = None,
    state: Optional[str] = None,
) -> AsyncIterator[MonitorSummary]
Source code in docs_src/capo_networkmonitor/_services/async_network_monitor.py
async def iter_list_monitors(
    self,
    *,
    config_overrides: Optional[AsyncNetworkMonitorClientConfig] = None,
    next_token: Optional[
        "capo_networkmonitor.types.pagination_token.PaginationToken"
    ] = None,
    max_results: Optional[
        "capo_networkmonitor.types.max_results.MaxResults"
    ] = None,
    state: Optional[str] = None,
) -> "AsyncIterator[capo_networkmonitor.types.monitor_summary.MonitorSummary]":
    _token = next_token
    while True:
        _response = await self.list_monitors(
            config_overrides=config_overrides,
            next_token=_token,
            max_results=max_results,
            state=state,
        )
        _page = _resolve_path(_response, ("monitors",))
        for _item in _page or []:
            yield _item
        _token = _resolve_path(_response, ("next_token",))
        if not _token:
            break