Skip to content

update_scraper_logging_configuration async

update_scraper_logging_configuration(
    scraper_id: ScraperId,
    logging_destination: ScraperLoggingDestination,
    *,
    config_overrides: Optional[AsyncampClientConfig] = None,
    scraper_components: Optional[ScraperComponents] = None,
) -> UpdateScraperLoggingConfigurationResponse

Updates the logging configuration for a Amazon Managed Service for Prometheus scraper.

Parameters:

  • scraper_id (ScraperId) –

    The ID of the scraper whose logging configuration will be updated.

  • logging_destination (ScraperLoggingDestination) –

    The destination where scraper logs will be sent.

  • scraper_components (Optional[ScraperComponents], default: None ) –

    The list of scraper components to configure for logging.

Raises:

Source code in docs_src/capo_amp/_services/async_amp.py
async def update_scraper_logging_configuration(
    self,
    scraper_id: "capo_amp.types.scraper_id.ScraperId",
    logging_destination: "capo_amp.types.scraper_logging_destination.ScraperLoggingDestination",
    *,
    config_overrides: Optional[AsyncampClientConfig] = None,
    scraper_components: Optional[
        "capo_amp.types.scraper_components.ScraperComponents"
    ] = None,
) -> "capo_amp.types.update_scraper_logging_configuration_response.UpdateScraperLoggingConfigurationResponse":
    """<p>Updates the logging configuration for a Amazon Managed Service for Prometheus scraper.</p>

    Args:
        scraper_id: <p>The ID of the scraper whose logging configuration will be updated.</p>
        logging_destination: <p>The destination where scraper logs will be sent.</p>
        scraper_components: <p>The list of scraper components to configure for logging.</p>

    Raises:
        capo_amp.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_amp.errors.conflict_exception.ConflictException: <p>The request would cause an inconsistent state.</p>
        capo_amp.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred during the processing of the request.</p>
        capo_amp.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resources that doesn't exist.</p>
        capo_amp.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_amp.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_amp.types.update_scraper_logging_configuration_request.UpdateScraperLoggingConfigurationRequest]",
    ) -> AsyncOperationResponse[
        "capo_amp.types.update_scraper_logging_configuration_response.UpdateScraperLoggingConfigurationResponse"
    ]:
        import capo_amp._operations.amazon_prometheus_service.update_scraper_logging_configuration

        (
            output,
            http_response,
        ) = await capo_amp._operations.amazon_prometheus_service.update_scraper_logging_configuration.async_update_scraper_logging_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateScraperLoggingConfiguration")
    )
    input_: capo_amp.types.update_scraper_logging_configuration_request.UpdateScraperLoggingConfigurationRequest = {
        "scraper_id": scraper_id,
        "logging_destination": logging_destination,
    }
    if scraper_components is not None:
        input_["scraper_components"] = scraper_components

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