Skip to content

create_job

create_job(
    pipeline_id: Id,
    *,
    config_overrides: Optional[ElasticTranscoderClientConfig] = None,
    input: Optional[JobInput] = None,
    inputs: Optional[JobInputs] = None,
    output: Optional[CreateJobOutput] = None,
    outputs: Optional[CreateJobOutputs] = None,
    output_key_prefix: Optional[Key] = None,
    playlists: Optional[CreateJobPlaylists] = None,
    user_metadata: Optional[UserMetadata] = None,
) -> CreateJobResponse

When you create a job, Elastic Transcoder returns JSON data that includes the values that you specified plus information about the job that is created.

If you have specified more than one output for your jobs (for example, one output for the Kindle Fire and another output for the Apple iPhone 4s), you currently must use the Elastic Transcoder API to list the jobs (as opposed to the AWS Console).

Parameters:

  • pipeline_id (Id) –

    The Id of the pipeline that you want Elastic Transcoder to use for transcoding. The pipeline determines several settings, including the Amazon S3 bucket from which Elastic Transcoder gets the files to transcode and the bucket into which Elastic Transcoder puts the transcoded files.

  • input (Optional[JobInput], default: None ) –

    A section of the request body that provides information about the file that is being transcoded.

  • inputs (Optional[JobInputs], default: None ) –

    A section of the request body that provides information about the files that are being transcoded.

  • output (Optional[CreateJobOutput], default: None ) –

    A section of the request body that provides information about the transcoded (target) file. We strongly recommend that you use the Outputs syntax instead of the Output syntax.

  • outputs (Optional[CreateJobOutputs], default: None ) –

    A section of the request body that provides information about the transcoded (target) files. We recommend that you use the Outputs syntax instead of the Output syntax.

  • output_key_prefix (Optional[Key], default: None ) –

    The value, if any, that you want Elastic Transcoder to prepend to the names of all files that this job creates, including output files, thumbnails, and playlists.

  • playlists (Optional[CreateJobPlaylists], default: None ) –

    If you specify a preset in PresetId for which the value of Container is fmp4 (Fragmented MP4) or ts (MPEG-TS), Playlists contains information about the master playlists that you want Elastic Transcoder to create.

    The maximum number of master playlists in a job is 30.

  • user_metadata (Optional[UserMetadata], default: None ) –

    User-defined metadata that you want to associate with an Elastic Transcoder job. You specify metadata in key/value pairs, and you can add up to 10 key/value pairs per job. Elastic Transcoder does not guarantee that key/value pairs are returned in the same order in which you specify them.

Raises:

  • AccessDeniedException –

    General authentication failure. The request was not signed correctly.

  • InternalServiceException –

    Elastic Transcoder encountered an unexpected exception while trying to fulfill the request.

  • LimitExceededException –

    Too many operations for a given AWS account. For example, the number of pipelines exceeds the maximum allowed.

  • ResourceNotFoundException –

    The requested resource does not exist or is not available. For example, the pipeline to which you're trying to add a job doesn't exist or is still being created.

  • ValidationException –

    One or more required parameter values were not provided in the request.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_elastic_transcoder/_services/elastic_transcoder.py
def create_job(
    self,
    pipeline_id: "capo_elastic_transcoder.types.id.Id",
    *,
    config_overrides: Optional[ElasticTranscoderClientConfig] = None,
    input: Optional["capo_elastic_transcoder.types.job_input.JobInput"] = None,
    inputs: Optional["capo_elastic_transcoder.types.job_inputs.JobInputs"] = None,
    output: Optional[
        "capo_elastic_transcoder.types.create_job_output.CreateJobOutput"
    ] = None,
    outputs: Optional[
        "capo_elastic_transcoder.types.create_job_outputs.CreateJobOutputs"
    ] = None,
    output_key_prefix: Optional["capo_elastic_transcoder.types.key.Key"] = None,
    playlists: Optional[
        "capo_elastic_transcoder.types.create_job_playlists.CreateJobPlaylists"
    ] = None,
    user_metadata: Optional[
        "capo_elastic_transcoder.types.user_metadata.UserMetadata"
    ] = None,
) -> "capo_elastic_transcoder.types.create_job_response.CreateJobResponse":
    """<p>When you create a job, Elastic Transcoder returns JSON data that includes the values that you specified plus information about the job that is created.</p> <p>If you have specified more than one output for your jobs (for example, one output for the Kindle Fire and another output for the Apple iPhone 4s), you currently must use the Elastic Transcoder API to list the jobs (as opposed to the AWS Console).</p>

    Args:
        pipeline_id: <p>The <code>Id</code> of the pipeline that you want Elastic Transcoder to use for transcoding. The pipeline determines several settings, including the Amazon S3 bucket from which Elastic Transcoder gets the files to transcode and the bucket into which Elastic Transcoder puts the transcoded files.</p>
        input: <p>A section of the request body that provides information about the file that is being transcoded.</p>
        inputs: <p>A section of the request body that provides information about the files that are being transcoded.</p>
        output: <p> A section of the request body that provides information about the transcoded (target) file. We strongly recommend that you use the <code>Outputs</code> syntax instead of the <code>Output</code> syntax. </p>
        outputs: <p> A section of the request body that provides information about the transcoded (target) files. We recommend that you use the <code>Outputs</code> syntax instead of the <code>Output</code> syntax. </p>
        output_key_prefix: <p>The value, if any, that you want Elastic Transcoder to prepend to the names of all files that this job creates, including output files, thumbnails, and playlists.</p>
        playlists: <p>If you specify a preset in <code>PresetId</code> for which the value of <code>Container</code> is fmp4 (Fragmented MP4) or ts (MPEG-TS), Playlists contains information about the master playlists that you want Elastic Transcoder to create.</p> <p>The maximum number of master playlists in a job is 30.</p>
        user_metadata: <p>User-defined metadata that you want to associate with an Elastic Transcoder job. You specify metadata in <code>key/value</code> pairs, and you can add up to 10 <code>key/value</code> pairs per job. Elastic Transcoder does not guarantee that <code>key/value</code> pairs are returned in the same order in which you specify them.</p>

    Raises:
        capo_elastic_transcoder.errors.access_denied_exception.AccessDeniedException: <p>General authentication failure. The request was not signed correctly.</p>
        capo_elastic_transcoder.errors.incompatible_version_exception.IncompatibleVersionException
        capo_elastic_transcoder.errors.internal_service_exception.InternalServiceException: <p>Elastic Transcoder encountered an unexpected exception while trying to fulfill the request.</p>
        capo_elastic_transcoder.errors.limit_exceeded_exception.LimitExceededException: <p>Too many operations for a given AWS account. For example, the number of pipelines exceeds the maximum allowed.</p>
        capo_elastic_transcoder.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource does not exist or is not available. For example, the pipeline to which you're trying to add a job doesn't exist or is still being created.</p>
        capo_elastic_transcoder.errors.validation_exception.ValidationException: <p>One or more required parameter values were not provided in the request.</p>
        capo_elastic_transcoder.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_elastic_transcoder.types.create_job_request.CreateJobRequest]",
    ) -> OperationResponse[
        "capo_elastic_transcoder.types.create_job_response.CreateJobResponse"
    ]:
        import capo_elastic_transcoder._operations.ets_customer_service.create_job

        output, http_response = (
            capo_elastic_transcoder._operations.ets_customer_service.create_job.create_job(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateJob")
    )
    input_: capo_elastic_transcoder.types.create_job_request.CreateJobRequest = {
        "pipeline_id": pipeline_id
    }
    if input is not None:
        input_["input"] = input
    if inputs is not None:
        input_["inputs"] = inputs
    if output is not None:
        input_["output"] = output
    if outputs is not None:
        input_["outputs"] = outputs
    if output_key_prefix is not None:
        input_["output_key_prefix"] = output_key_prefix
    if playlists is not None:
        input_["playlists"] = playlists
    if user_metadata is not None:
        input_["user_metadata"] = user_metadata

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