Skip to content

start_analysis_log_export

start_analysis_log_export(
    membership_identifier: MembershipIdentifier,
    analysis_id: UUID,
    analysis_type: LogExportAnalysisType,
    result_configuration: AnalysisLogExportResultConfiguration,
    *,
    config_overrides: Optional[CleanRoomsClientConfig] = None,
) -> StartAnalysisLogExportOutput

Starts an export of the Apache Spark logs for a protected query to an Amazon S3 bucket that you own. Use the exported logs to diagnose a query that failed or that ran more slowly than you expected.

Clean Rooms exports a redacted copy of the Spark logs instead of the raw logs. Analyze the exported logs with the tooling of your choice, such as Spark History Server. For details about what the exported logs contain, see https://docs.aws.amazon.com/clean-rooms/latest/userguide/export-analysis-logs-contents.html.

The export runs asynchronously and returns with a status of IN_PROGRESS. Call GetAnalysisLogExport to poll for the final status.

To use this operation, you must have the CAN_EXPORT_QUERY_ANALYSIS_LOG ability for your membership. You must also be the query runner or the query payer. Having the ability alone is not sufficient.

The query must have reached a terminal state, and it must have reached the execution stage. A query that failed validation or that was canceled before it started produces no Spark logs.

Log export isn't supported for queries that use differential privacy, and isn't supported for PySpark jobs.

The destination bucket must be in the same Amazon Web Services Region as the collaboration. Cross-Region export isn't supported.

For more information, see https://docs.aws.amazon.com/clean-rooms/latest/userguide/export-analysis-logs.html.

Parameters:

  • membership_identifier (MembershipIdentifier) –

    A unique identifier for the membership to export the analysis logs for. Currently accepts a membership ID.

  • analysis_id (UUID) –

    The unique identifier of the protected query that you want to export the analysis logs for.

  • analysis_type (LogExportAnalysisType) –

    The type of analysis that the logs are exported for. Currently, only PROTECTED_QUERY is supported.

  • result_configuration (AnalysisLogExportResultConfiguration) –

    The details needed to write the exported analysis logs.

    You don't need to create an IAM role for log export. Clean Rooms writes the exported logs using your own identity, so Clean Rooms writes the exported logs only where your existing permissions allow.

Raises:

Source code in docs_src/capo_cleanrooms/_services/clean_rooms.py
def start_analysis_log_export(
    self,
    membership_identifier: "capo_cleanrooms.types.membership_identifier.MembershipIdentifier",
    analysis_id: "capo_cleanrooms.types.uuid.UUID",
    analysis_type: "capo_cleanrooms.types.log_export_analysis_type.LogExportAnalysisType",
    result_configuration: "capo_cleanrooms.types.analysis_log_export_result_configuration.AnalysisLogExportResultConfiguration",
    *,
    config_overrides: Optional[CleanRoomsClientConfig] = None,
) -> "capo_cleanrooms.types.start_analysis_log_export_output.StartAnalysisLogExportOutput":
    """<p>Starts an export of the Apache Spark logs for a protected query to an Amazon S3 bucket that you own. Use the exported logs to diagnose a query that failed or that ran more slowly than you expected.</p> <p>Clean Rooms exports a redacted copy of the Spark logs instead of the raw logs. Analyze the exported logs with the tooling of your choice, such as Spark History Server. For details about what the exported logs contain, see <a href="https://docs.aws.amazon.com/clean-rooms/latest/userguide/export-analysis-logs-contents.html">https://docs.aws.amazon.com/clean-rooms/latest/userguide/export-analysis-logs-contents.html</a>.</p> <p>The export runs asynchronously and returns with a <code>status</code> of <code>IN_PROGRESS</code>. Call <code>GetAnalysisLogExport</code> to poll for the final status.</p> <important> <p>To use this operation, you must have the <code>CAN_EXPORT_QUERY_ANALYSIS_LOG</code> ability for your membership. You must also be the query runner or the query payer. Having the ability alone is not sufficient.</p> <p>The query must have reached a terminal state, and it must have reached the execution stage. A query that failed validation or that was canceled before it started produces no Spark logs.</p> <p>Log export isn't supported for queries that use differential privacy, and isn't supported for PySpark jobs.</p> <p>The destination bucket must be in the same Amazon Web Services Region as the collaboration. Cross-Region export isn't supported.</p> </important> <p>For more information, see <a href="https://docs.aws.amazon.com/clean-rooms/latest/userguide/export-analysis-logs.html">https://docs.aws.amazon.com/clean-rooms/latest/userguide/export-analysis-logs.html</a>.</p>

    Args:
        membership_identifier: <p>A unique identifier for the membership to export the analysis logs for. Currently accepts a membership ID.</p>
        analysis_id: <p>The unique identifier of the protected query that you want to export the analysis logs for.</p>
        analysis_type: <p>The type of analysis that the logs are exported for. Currently, only <code>PROTECTED_QUERY</code> is supported.</p>
        result_configuration: <p>The details needed to write the exported analysis logs.</p> <p>You don't need to create an IAM role for log export. Clean Rooms writes the exported logs using your own identity, so Clean Rooms writes the exported logs only where your existing permissions allow.</p>

    Raises:
        capo_cleanrooms.errors.access_denied_exception.AccessDeniedException: <p>Caller does not have sufficient access to perform this action.</p>
        capo_cleanrooms.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
        capo_cleanrooms.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
        capo_cleanrooms.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Request denied because service quota has been exceeded.</p>
        capo_cleanrooms.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling.</p>
        capo_cleanrooms.errors.validation_exception.ValidationException: <p>The input fails to satisfy the specified constraints.</p>
        capo_cleanrooms.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cleanrooms.types.start_analysis_log_export_input.StartAnalysisLogExportInput]",
    ) -> OperationResponse[
        "capo_cleanrooms.types.start_analysis_log_export_output.StartAnalysisLogExportOutput"
    ]:
        import capo_cleanrooms._operations.aws_bastion_control_plane_service_lambda.start_analysis_log_export

        output, http_response = (
            capo_cleanrooms._operations.aws_bastion_control_plane_service_lambda.start_analysis_log_export.start_analysis_log_export(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartAnalysisLogExport")
    )
    input_: capo_cleanrooms.types.start_analysis_log_export_input.StartAnalysisLogExportInput = {
        "membership_identifier": membership_identifier,
        "analysis_id": analysis_id,
        "analysis_type": analysis_type,
        "result_configuration": result_configuration,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output