Skip to content

start_protected_job

start_protected_job(
    type: ProtectedJobType,
    membership_identifier: MembershipIdentifier,
    job_parameters: ProtectedJobParameters,
    *,
    config_overrides: Optional[CleanRoomsClientConfig] = None,
    result_configuration: Optional[ProtectedJobResultConfigurationInput] = None,
    compute_configuration: Optional[ProtectedJobComputeConfiguration] = None,
    job_compute_payer_account_id: Optional[AccountId] = None,
) -> StartProtectedJobOutput

Creates a protected job that is started by Clean Rooms.

Parameters:

Raises:

Source code in docs_src/capo_cleanrooms/_services/clean_rooms.py
def start_protected_job(
    self,
    type: "capo_cleanrooms.types.protected_job_type.ProtectedJobType",
    membership_identifier: "capo_cleanrooms.types.membership_identifier.MembershipIdentifier",
    job_parameters: "capo_cleanrooms.types.protected_job_parameters.ProtectedJobParameters",
    *,
    config_overrides: Optional[CleanRoomsClientConfig] = None,
    result_configuration: Optional[
        "capo_cleanrooms.types.protected_job_result_configuration_input.ProtectedJobResultConfigurationInput"
    ] = None,
    compute_configuration: Optional[
        "capo_cleanrooms.types.protected_job_compute_configuration.ProtectedJobComputeConfiguration"
    ] = None,
    job_compute_payer_account_id: Optional[
        "capo_cleanrooms.types.account_id.AccountId"
    ] = None,
) -> "capo_cleanrooms.types.start_protected_job_output.StartProtectedJobOutput":
    """<p>Creates a protected job that is started by Clean Rooms.</p>

    Args:
        type: <p> The type of protected job to start.</p>
        membership_identifier: <p>A unique identifier for the membership to run this job against. Currently accepts a membership ID.</p>
        job_parameters: <p> The job parameters.</p>
        result_configuration: <p>The details needed to write the job results.</p>
        compute_configuration: <p>The compute configuration for the protected job.</p>
        job_compute_payer_account_id: <p>The account ID of the member that pays for the job compute costs.</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_protected_job_input.StartProtectedJobInput]",
    ) -> OperationResponse[
        "capo_cleanrooms.types.start_protected_job_output.StartProtectedJobOutput"
    ]:
        import capo_cleanrooms._operations.aws_bastion_control_plane_service_lambda.start_protected_job

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

    def _redact_input(
        input_: "capo_cleanrooms.types.start_protected_job_input.StartProtectedJobInput",
    ) -> dict[str, Any]:
        import capo_cleanrooms.types.start_protected_job_input

        return capo_cleanrooms.types.start_protected_job_input.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_cleanrooms.types.start_protected_job_output.StartProtectedJobOutput",
    ) -> dict[str, Any]:
        import capo_cleanrooms.types.start_protected_job_output

        return capo_cleanrooms.types.start_protected_job_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "StartProtectedJob",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_cleanrooms.types.start_protected_job_input.StartProtectedJobInput = {
        "type": type,
        "membership_identifier": membership_identifier,
        "job_parameters": job_parameters,
    }
    if result_configuration is not None:
        input_["result_configuration"] = result_configuration
    if compute_configuration is not None:
        input_["compute_configuration"] = compute_configuration
    if job_compute_payer_account_id is not None:
        input_["job_compute_payer_account_id"] = job_compute_payer_account_id

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