Skip to content

list_monitors async

list_monitors(
    *,
    config_overrides: Optional[AsyncInternetMonitorClientConfig] = None,
    next_token: Optional[str] = None,
    max_results: Optional[MaxResults] = None,
    monitor_status: Optional[str] = None,
    include_linked_accounts: Optional[bool] = None,
) -> ListMonitorsOutput

Lists all of your monitors for Amazon CloudWatch Internet Monitor and their statuses, along with the Amazon Resource Name (ARN) and name of each monitor.

Parameters:

  • next_token (Optional[str], default: None ) –

    The token for the next set of results. You receive this token from a previous call.

  • max_results (Optional[MaxResults], default: None ) –

    The number of monitor objects that you want to return with this call.

  • monitor_status (Optional[str], default: None ) –

    The status of a monitor. This includes the status of the data processing for the monitor and the status of the monitor itself.

    For information about the statuses for a monitor, see Monitor.

  • include_linked_accounts (Optional[bool], default: None ) –

    A boolean option that you can set to TRUE to include monitors for linked accounts in a list of monitors, when you've set up cross-account sharing in Amazon CloudWatch Internet Monitor. You configure cross-account sharing by using Amazon CloudWatch Observability Access Manager. For more information, see Internet Monitor cross-account observability in the Amazon CloudWatch Internet Monitor User Guide.

Raises:

Source code in docs_src/capo_internetmonitor/_services/async_internet_monitor.py
async def list_monitors(
    self,
    *,
    config_overrides: Optional[AsyncInternetMonitorClientConfig] = None,
    next_token: Optional[str] = None,
    max_results: Optional[
        "capo_internetmonitor.types.max_results.MaxResults"
    ] = None,
    monitor_status: Optional[str] = None,
    include_linked_accounts: Optional[bool] = None,
) -> "capo_internetmonitor.types.list_monitors_output.ListMonitorsOutput":
    """<p>Lists all of your monitors for Amazon CloudWatch Internet Monitor and their statuses, along with the Amazon Resource Name (ARN) and name of each monitor.</p>

    Args:
        next_token: <p>The token for the next set of results. You receive this token from a previous call.</p>
        max_results: <p>The number of monitor objects that you want to return with this call.</p>
        monitor_status: <p>The status of a monitor. This includes the status of the data processing for the monitor and the status of the monitor itself.</p> <p>For information about the statuses for a monitor, see <a href="https://docs.aws.amazon.com/internet-monitor/latest/api/API_Monitor.html"> Monitor</a>.</p>
        include_linked_accounts: <p>A boolean option that you can set to <code>TRUE</code> to include monitors for linked accounts in a list of monitors, when you've set up cross-account sharing in Amazon CloudWatch Internet Monitor. You configure cross-account sharing by using Amazon CloudWatch Observability Access Manager. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cwim-cross-account.html">Internet Monitor cross-account observability</a> in the Amazon CloudWatch Internet Monitor User Guide.</p>

    Raises:
        capo_internetmonitor.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permission to perform this action.</p>
        capo_internetmonitor.errors.internal_server_exception.InternalServerException: <p>An internal error occurred.</p>
        capo_internetmonitor.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_internetmonitor.errors.validation_exception.ValidationException: <p>Invalid request.</p>
        capo_internetmonitor.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_internetmonitor.types.list_monitors_input.ListMonitorsInput]",
    ) -> AsyncOperationResponse[
        "capo_internetmonitor.types.list_monitors_output.ListMonitorsOutput"
    ]:
        import capo_internetmonitor._operations.internet_monitor20210603.list_monitors

        (
            output,
            http_response,
        ) = await capo_internetmonitor._operations.internet_monitor20210603.list_monitors.async_list_monitors(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListMonitors")
    )
    input_: capo_internetmonitor.types.list_monitors_input.ListMonitorsInput = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if monitor_status is not None:
        input_["monitor_status"] = monitor_status
    if include_linked_accounts is not None:
        input_["include_linked_accounts"] = include_linked_accounts

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output