Skip to content

create_export_job async

create_export_job(
    export_data_source: ExportDataSource,
    export_destination: ExportDestination,
    *,
    config_overrides: Optional[AsyncSESv2ClientConfig] = None,
) -> CreateExportJobResponse

Creates an export job for a data source and destination.

Export jobs run asynchronously. This operation returns a JobId. Call GetExportJob with that ID until JobStatus is COMPLETED, FAILED, or CANCELLED. When the status is COMPLETED, download the export file from the pre-signed URL in ExportDestination.S3Url. When the status is FAILED, see FailureInfo. To store a copy in your own bucket, upload the downloaded file to your bucket. Do not include S3Url in the request.

You can execute this operation no more than once per second.

Parameters:

  • export_data_source (ExportDataSource) –

    The data source for the export job.

  • export_destination (ExportDestination) –

    The destination for the export job. Specify only DataFormat. Do not include S3Url in this request. SES writes the export file to a location that it manages and returns the download URL in GetExportJob.

Raises:

Source code in docs_src/capo_sesv2/_services/async_se_sv2.py
async def create_export_job(
    self,
    export_data_source: "capo_sesv2.types.export_data_source.ExportDataSource",
    export_destination: "capo_sesv2.types.export_destination.ExportDestination",
    *,
    config_overrides: Optional[AsyncSESv2ClientConfig] = None,
) -> "capo_sesv2.types.create_export_job_response.CreateExportJobResponse":
    """<p>Creates an export job for a data source and destination.</p> <p>Export jobs run asynchronously. This operation returns a <code>JobId</code>. Call <code>GetExportJob</code> with that ID until <code>JobStatus</code> is <code>COMPLETED</code>, <code>FAILED</code>, or <code>CANCELLED</code>. When the status is <code>COMPLETED</code>, download the export file from the pre-signed URL in <code>ExportDestination.S3Url</code>. When the status is <code>FAILED</code>, see <code>FailureInfo</code>. To store a copy in your own bucket, upload the downloaded file to your bucket. Do not include <code>S3Url</code> in the request.</p> <p>You can execute this operation no more than once per second.</p>

    Args:
        export_data_source: <p>The data source for the export job.</p>
        export_destination: <p>The destination for the export job. Specify only <code>DataFormat</code>. Do not include <code>S3Url</code> in this request. SES writes the export file to a location that it manages and returns the download URL in <code>GetExportJob</code>.</p>

    Raises:
        capo_sesv2.errors.bad_request_exception.BadRequestException: <p>The input you provided is invalid.</p>
        capo_sesv2.errors.limit_exceeded_exception.LimitExceededException: <p>There are too many instances of the specified resource type.</p>
        capo_sesv2.errors.not_found_exception.NotFoundException: <p>The resource you attempted to access doesn't exist.</p>
        capo_sesv2.errors.too_many_requests_exception.TooManyRequestsException: <p>Too many requests have been made to the operation.</p>
        capo_sesv2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sesv2.types.create_export_job_request.CreateExportJobRequest]",
    ) -> AsyncOperationResponse[
        "capo_sesv2.types.create_export_job_response.CreateExportJobResponse"
    ]:
        import capo_sesv2._operations.simple_email_service_v2.create_export_job

        (
            output,
            http_response,
        ) = await capo_sesv2._operations.simple_email_service_v2.create_export_job.async_create_export_job(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_sesv2.types.create_export_job_request.CreateExportJobRequest",
    ) -> dict[str, Any]:
        import capo_sesv2.types.create_export_job_request

        return capo_sesv2.types.create_export_job_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateExportJob", redact_input=_redact_input),
    )
    input_: capo_sesv2.types.create_export_job_request.CreateExportJobRequest = {
        "export_data_source": export_data_source,
        "export_destination": export_destination,
    }

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