Skip to content

create_job async

create_job(
    *,
    config_overrides: Optional[AsyncMediaConvertClientConfig] = None,
    acceleration_settings: Optional[AccelerationSettings] = None,
    billing_tags_source: Optional[BillingTagsSource] = None,
    client_request_token: Optional[__string] = None,
    hop_destinations: Optional[__listOfHopDestination] = None,
    job_engine_version: Optional[__string] = None,
    job_template: Optional[__string] = None,
    priority: Optional[__integerMinNegative50Max50] = None,
    queue: Optional[__string] = None,
    role: Optional[__string] = None,
    settings: Optional[JobSettings] = None,
    simulate_reserved_queue: Optional[SimulateReservedQueue] = None,
    status_update_interval: Optional[StatusUpdateInterval] = None,
    tags: Optional[__mapOf__string] = None,
    user_metadata: Optional[__mapOf__string] = None,
) -> CreateJobResponse

Create a new transcoding job. For information about jobs and job settings, see the User Guide at http://docs.aws.amazon.com/mediaconvert/latest/ug/what-is.html

Parameters:

  • acceleration_settings (Optional[AccelerationSettings], default: None ) –

    Optional. Accelerated transcoding can significantly speed up jobs with long, visually complex content. Outputs that use this feature incur pro-tier pricing. For information about feature limitations, see the AWS Elemental MediaConvert User Guide.

  • billing_tags_source (Optional[BillingTagsSource], default: None ) –

    Optionally choose a Billing tags source that AWS Billing and Cost Management will use to display tags for individual output costs on any billing report that you set up. Leave blank to use the default value, Job.

  • client_request_token (Optional[__string], default: None ) –

    Prevent duplicate jobs from being created and ensure idempotency for your requests. A client request token can be any string that includes up to 64 ASCII characters. If you reuse a client request token within one minute of a successful request, the API returns the job details of the original request instead. For more information see https://docs.aws.amazon.com/mediaconvert/latest/apireference/idempotency.html.

  • hop_destinations (Optional[__listOfHopDestination], default: None ) –

    Optional. Use queue hopping to avoid overly long waits in the backlog of the queue that you submit your job to. Specify an alternate queue and the maximum time that your job will wait in the initial queue before hopping. For more information about this feature, see the AWS Elemental MediaConvert User Guide.

  • job_engine_version (Optional[__string], default: None ) –

    Use Job engine versions to run jobs for your production workflow on one version, while you test and validate the latest version. Job engine versions represent periodically grouped MediaConvert releases with new features, updates, improvements, and fixes. Job engine versions are in a YYYY-MM-DD format. Note that the Job engine version feature is not publicly available at this time. To request access, contact AWS support.

  • job_template (Optional[__string], default: None ) –

    Optional. When you create a job, you can either specify a job template or specify the transcoding settings individually.

  • priority (Optional[__integerMinNegative50Max50], default: None ) –

    Optional. Specify the relative priority for this job. In any given queue, the service begins processing the job with the highest value first. When more than one job has the same priority, the service begins processing the job that you submitted first. If you don't specify a priority, the service uses the default value 0.

  • queue (Optional[__string], default: None ) –

    Optional. When you create a job, you can specify a queue to send it to. If you don't specify, the job will go to the default queue. For more about queues, see the User Guide topic at https://docs.aws.amazon.com/mediaconvert/latest/ug/what-is.html.

  • role (Optional[__string], default: None ) –

    Required. The IAM role you use for creating this job. For details about permissions, see the User Guide topic at the User Guide at https://docs.aws.amazon.com/mediaconvert/latest/ug/iam-role.html.

  • settings (Optional[JobSettings], default: None ) –

    JobSettings contains all the transcode settings for a job.

  • simulate_reserved_queue (Optional[SimulateReservedQueue], default: None ) –

    Optional. Enable this setting when you run a test job to estimate how many reserved transcoding slots (RTS) you need. When this is enabled, MediaConvert runs your job from an on-demand queue with similar performance to what you will see with one RTS in a reserved queue. This setting is disabled by default.

  • status_update_interval (Optional[StatusUpdateInterval], default: None ) –

    Optional. Specify how often MediaConvert sends STATUS_UPDATE events to Amazon CloudWatch Events. Set the interval, in seconds, between status updates. MediaConvert sends an update at this interval from the time the service begins processing your job to the time it completes the transcode or encounters an error.

  • tags (Optional[__mapOf__string], default: None ) –

    Optional. The tags that you want to add to the resource. You can tag resources with a key-value pair or with only a key. Use standard AWS tags on your job for automatic integration with AWS services and for custom integrations and workflows.

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

    Optional. User-defined metadata that you want to associate with an MediaConvert job. You specify metadata in key/value pairs. Use only for existing integrations or workflows that rely on job metadata tags. Otherwise, we recommend that you use standard AWS tags.

Raises:

  • BadRequestException –

    The service can't process your request because of a problem in the request. Please check your request form and syntax.

  • ConflictException –

    The service couldn't complete your request because there is a conflict with the current state of the resource.

  • ForbiddenException –

    You don't have permissions for this action with the credentials you sent.

  • InternalServerErrorException –

    The service encountered an unexpected condition and can't fulfill your request.

  • NotFoundException –

    The resource you requested doesn't exist.

  • ServiceQuotaExceededException –

    You attempted to create more resources than the service allows based on service quotas.

  • TooManyRequestsException –

    Too many requests have been sent in too short of a time. The service limits the rate at which it will accept requests.

  • UnknownServiceError –

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

Source code in docs_src/capo_mediaconvert/_services/async_media_convert.py
async def create_job(
    self,
    *,
    config_overrides: Optional[AsyncMediaConvertClientConfig] = None,
    acceleration_settings: Optional[
        "capo_mediaconvert.types.acceleration_settings.AccelerationSettings"
    ] = None,
    billing_tags_source: Optional[
        "capo_mediaconvert.types.billing_tags_source.BillingTagsSource"
    ] = None,
    client_request_token: Optional[
        "capo_mediaconvert.types.__string.__string"
    ] = None,
    hop_destinations: Optional[
        "capo_mediaconvert.types.__list_of_hop_destination.__listOfHopDestination"
    ] = None,
    job_engine_version: Optional[
        "capo_mediaconvert.types.__string.__string"
    ] = None,
    job_template: Optional["capo_mediaconvert.types.__string.__string"] = None,
    priority: Optional[
        "capo_mediaconvert.types.__integer_min_negative50_max50.__integerMinNegative50Max50"
    ] = None,
    queue: Optional["capo_mediaconvert.types.__string.__string"] = None,
    role: Optional["capo_mediaconvert.types.__string.__string"] = None,
    settings: Optional["capo_mediaconvert.types.job_settings.JobSettings"] = None,
    simulate_reserved_queue: Optional[
        "capo_mediaconvert.types.simulate_reserved_queue.SimulateReservedQueue"
    ] = None,
    status_update_interval: Optional[
        "capo_mediaconvert.types.status_update_interval.StatusUpdateInterval"
    ] = None,
    tags: Optional[
        "capo_mediaconvert.types.__map_of__string.__mapOf__string"
    ] = None,
    user_metadata: Optional[
        "capo_mediaconvert.types.__map_of__string.__mapOf__string"
    ] = None,
) -> "capo_mediaconvert.types.create_job_response.CreateJobResponse":
    """Create a new transcoding job. For information about jobs and job settings, see the User Guide at http://docs.aws.amazon.com/mediaconvert/latest/ug/what-is.html

    Args:
        acceleration_settings: Optional. Accelerated transcoding can significantly speed up jobs with long, visually complex content. Outputs that use this feature incur pro-tier pricing. For information about feature limitations, see the AWS Elemental MediaConvert User Guide.
        billing_tags_source: Optionally choose a Billing tags source that AWS Billing and Cost Management will use to display tags for individual output costs on any billing report that you set up. Leave blank to use the default value, Job.
        client_request_token: Prevent duplicate jobs from being created and ensure idempotency for your requests. A client request token can be any string that includes up to 64 ASCII characters. If you reuse a client request token within one minute of a successful request, the API returns the job details of the original request instead. For more information see https://docs.aws.amazon.com/mediaconvert/latest/apireference/idempotency.html.
        hop_destinations: Optional. Use queue hopping to avoid overly long waits in the backlog of the queue that you submit your job to. Specify an alternate queue and the maximum time that your job will wait in the initial queue before hopping. For more information about this feature, see the AWS Elemental MediaConvert User Guide.
        job_engine_version: Use Job engine versions to run jobs for your production workflow on one version, while you test and validate the latest version. Job engine versions represent periodically grouped MediaConvert releases with new features, updates, improvements, and fixes. Job engine versions are in a YYYY-MM-DD format. Note that the Job engine version feature is not publicly available at this time. To request access, contact AWS support.
        job_template: Optional. When you create a job, you can either specify a job template or specify the transcoding settings individually.
        priority: Optional. Specify the relative priority for this job. In any given queue, the service begins processing the job with the highest value first. When more than one job has the same priority, the service begins processing the job that you submitted first. If you don't specify a priority, the service uses the default value 0.
        queue: Optional. When you create a job, you can specify a queue to send it to. If you don't specify, the job will go to the default queue. For more about queues, see the User Guide topic at https://docs.aws.amazon.com/mediaconvert/latest/ug/what-is.html.
        role: Required. The IAM role you use for creating this job. For details about permissions, see the User Guide topic at the User Guide at https://docs.aws.amazon.com/mediaconvert/latest/ug/iam-role.html.
        settings: JobSettings contains all the transcode settings for a job.
        simulate_reserved_queue: Optional. Enable this setting when you run a test job to estimate how many reserved transcoding slots (RTS) you need. When this is enabled, MediaConvert runs your job from an on-demand queue with similar performance to what you will see with one RTS in a reserved queue. This setting is disabled by default.
        status_update_interval: Optional. Specify how often MediaConvert sends STATUS_UPDATE events to Amazon CloudWatch Events. Set the interval, in seconds, between status updates. MediaConvert sends an update at this interval from the time the service begins processing your job to the time it completes the transcode or encounters an error.
        tags: Optional. The tags that you want to add to the resource. You can tag resources with a key-value pair or with only a key. Use standard AWS tags on your job for automatic integration with AWS services and for custom integrations and workflows.
        user_metadata: Optional. User-defined metadata that you want to associate with an MediaConvert job. You specify metadata in key/value pairs. Use only for existing integrations or workflows that rely on job metadata tags. Otherwise, we recommend that you use standard AWS tags.

    Raises:
        capo_mediaconvert.errors.bad_request_exception.BadRequestException: The service can't process your request because of a problem in the request. Please check your request form and syntax.
        capo_mediaconvert.errors.conflict_exception.ConflictException: The service couldn't complete your request because there is a conflict with the current state of the resource.
        capo_mediaconvert.errors.forbidden_exception.ForbiddenException: You don't have permissions for this action with the credentials you sent.
        capo_mediaconvert.errors.internal_server_error_exception.InternalServerErrorException: The service encountered an unexpected condition and can't fulfill your request.
        capo_mediaconvert.errors.not_found_exception.NotFoundException: The resource you requested doesn't exist.
        capo_mediaconvert.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: You attempted to create more resources than the service allows based on service quotas.
        capo_mediaconvert.errors.too_many_requests_exception.TooManyRequestsException: Too many requests have been sent in too short of a time. The service limits the rate at which it will accept requests.
        capo_mediaconvert.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mediaconvert.types.create_job_request.CreateJobRequest]",
    ) -> AsyncOperationResponse[
        "capo_mediaconvert.types.create_job_response.CreateJobResponse"
    ]:
        import capo_mediaconvert._operations.media_convert.create_job

        (
            output,
            http_response,
        ) = await capo_mediaconvert._operations.media_convert.create_job.async_create_job(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateJob")
    )
    input_: capo_mediaconvert.types.create_job_request.CreateJobRequest = {}
    if acceleration_settings is not None:
        input_["acceleration_settings"] = acceleration_settings
    if billing_tags_source is not None:
        input_["billing_tags_source"] = billing_tags_source
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token
    if hop_destinations is not None:
        input_["hop_destinations"] = hop_destinations
    if job_engine_version is not None:
        input_["job_engine_version"] = job_engine_version
    if job_template is not None:
        input_["job_template"] = job_template
    if priority is not None:
        input_["priority"] = priority
    if queue is not None:
        input_["queue"] = queue
    if role is not None:
        input_["role"] = role
    if settings is not None:
        input_["settings"] = settings
    if simulate_reserved_queue is not None:
        input_["simulate_reserved_queue"] = simulate_reserved_queue
    if status_update_interval is not None:
        input_["status_update_interval"] = status_update_interval
    if tags is not None:
        input_["tags"] = tags
    if user_metadata is not None:
        input_["user_metadata"] = user_metadata

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