Skip to content

get_monitor async

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

Gets information about a monitor in Amazon CloudWatch Internet Monitor based on a monitor name. The information returned includes the Amazon Resource Name (ARN), create time, modified time, resources included in the monitor, and status information.

Parameters:

  • monitor_name (ResourceName) –

    The name of the monitor.

  • linked_account_id (Optional[AccountId], default: None ) –

    The account ID for an account that you've set up cross-account sharing for 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 get_monitor(
    self,
    monitor_name: "capo_internetmonitor.types.resource_name.ResourceName",
    *,
    config_overrides: Optional[AsyncInternetMonitorClientConfig] = None,
    linked_account_id: Optional[
        "capo_internetmonitor.types.account_id.AccountId"
    ] = None,
) -> "capo_internetmonitor.types.get_monitor_output.GetMonitorOutput":
    """<p>Gets information about a monitor in Amazon CloudWatch Internet Monitor based on a monitor name. The information returned includes the Amazon Resource Name (ARN), create time, modified time, resources included in the monitor, and status information.</p>

    Args:
        monitor_name: <p>The name of the monitor.</p>
        linked_account_id: <p>The account ID for an account that you've set up cross-account sharing for 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.get_monitor_input.GetMonitorInput]",
    ) -> AsyncOperationResponse[
        "capo_internetmonitor.types.get_monitor_output.GetMonitorOutput"
    ]:
        import capo_internetmonitor._operations.internet_monitor20210603.get_monitor

        (
            output,
            http_response,
        ) = await capo_internetmonitor._operations.internet_monitor20210603.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_internetmonitor.types.get_monitor_input.GetMonitorInput = {
        "monitor_name": monitor_name
    }
    if linked_account_id is not None:
        input_["linked_account_id"] = linked_account_id

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