Skip to content

get_monitor async

get_monitor(
    monitor_name: ResourceName,
    *,
    config_overrides: Optional[AsyncNetworkMonitorClientConfig] = None,
) -> GetMonitorOutput

Returns details about a specific monitor.

This action requires the monitorName parameter. Run ListMonitors to get a list of monitor names.

Parameters:

  • monitor_name (ResourceName) –

    The name of the monitor that details are returned for.

Raises:

Source code in docs_src/capo_networkmonitor/_services/async_network_monitor.py
async def get_monitor(
    self,
    monitor_name: "capo_networkmonitor.types.resource_name.ResourceName",
    *,
    config_overrides: Optional[AsyncNetworkMonitorClientConfig] = None,
) -> "capo_networkmonitor.types.get_monitor_output.GetMonitorOutput":
    """<p>Returns details about a specific monitor. </p> <p>This action requires the <code>monitorName</code> parameter. Run <code>ListMonitors</code> to get a list of monitor names. </p>

    Args:
        monitor_name: <p>The name of the monitor that details are returned for.</p>

    Raises:
        capo_networkmonitor.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_networkmonitor.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_networkmonitor.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_networkmonitor.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling</p>
        capo_networkmonitor.errors.validation_exception.ValidationException: <p>One of the parameters for the request is not valid.</p>
        capo_networkmonitor.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_networkmonitor.types.get_monitor_input.GetMonitorInput]",
    ) -> AsyncOperationResponse[
        "capo_networkmonitor.types.get_monitor_output.GetMonitorOutput"
    ]:
        import capo_networkmonitor._operations.network_monitor.get_monitor

        (
            output,
            http_response,
        ) = await capo_networkmonitor._operations.network_monitor.get_monitor.async_get_monitor(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetMonitor")
    )
    input_: capo_networkmonitor.types.get_monitor_input.GetMonitorInput = {
        "monitor_name": monitor_name
    }

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