Jobs - Create

Create Job
Creates a Job.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}?api-version=2018-07-01

URI Parameters

Name In Required Type Description
subscriptionId
path True
  • string

The unique identifier for a Microsoft Azure subscription.

resourceGroupName
path True
  • string

The name of the resource group within the Azure subscription.

accountName
path True
  • string

The Media Services account name.

transformName
path True
  • string

The Transform name.

jobName
path True
  • string

The Job name.

api-version
query True
  • string

The Version of the API to be used with the client request.

Request Body

Name Required Type Description
properties.correlationData
  • object

Customer provided key, value pairs that will be returned in Job and JobOutput state events.

properties.description
  • string

Optional customer supplied description of the Job.

properties.input True JobInput:

The inputs for the Job.

properties.outputs True JobOutput[]:

The outputs for the Job.

properties.priority

Priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal.

Responses

Name Type Description
201 Created

Created

Other Status Codes

Detailed error information.

Examples

Create a Job

Sample Request

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Media/mediaServices/contosomedia/transforms/exampleTransform/jobs/job1?api-version=2018-07-01
{
  "properties": {
    "input": {
      "@odata.type": "#Microsoft.Media.JobInputAsset",
      "assetName": "job1-InputAsset"
    },
    "outputs": [
      {
        "@odata.type": "#Microsoft.Media.JobOutputAsset",
        "assetName": "job1-OutputAsset"
      }
    ],
    "correlationData": {
      "key1": "value1",
      "Key 2": "Value 2"
    }
  }
}

Sample Response

{
  "name": "job1",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Media/mediaservices/contosomedia/transforms/exampleTransform/jobs/job1",
  "type": "Microsoft.Media/mediaservices/transforms/jobs",
  "properties": {
    "created": "2018-08-08T16:29:58.2188352Z",
    "state": "Queued",
    "input": {
      "@odata.type": "#Microsoft.Media.JobInputAsset",
      "files": [],
      "assetName": "job1-InputAsset"
    },
    "lastModified": "2018-08-08T16:29:58.2188352Z",
    "outputs": [
      {
        "@odata.type": "#Microsoft.Media.JobOutputAsset",
        "state": "Queued",
        "progress": 0,
        "label": "BuiltInStandardEncoderPreset_0",
        "assetName": "job1-OutputAsset"
      }
    ],
    "priority": "Normal",
    "correlationData": {
      "key1": "value1",
      "Key 2": "Value 2"
    }
  }
}

Definitions

AbsoluteClipTime

Specifies the clip time as an absolute time position in the media file. The absolute time can point to a different position depending on whether the media file starts from a timestamp of zero or not.

ApiError

The API error.

Job

A Job resource type. The progress and state can be obtained by polling a Job or subscribing to events using EventGrid.

JobError

Details of JobOutput errors.

JobErrorCategory

Helps with categorization of errors.

JobErrorCode

Error code describing the error.

JobErrorDetail

Details of JobOutput errors.

JobInputAsset

Represents an Asset for input into a Job.

JobInputClip

Represents input files for a Job.

JobInputHttp

Represents HTTPS job input.

JobInputs

Describes a list of inputs to a Job.

JobOutputAsset

Represents an Asset used as a JobOutput.

JobRetry

Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal.

JobState

Describes the state of the JobOutput.

ODataError

Information about an error.

Priority

Sets the relative priority of the TransformOutputs within a Transform. This sets the priority that the service uses for processing TransformOutputs. The default priority is Normal.

AbsoluteClipTime

Specifies the clip time as an absolute time position in the media file. The absolute time can point to a different position depending on whether the media file starts from a timestamp of zero or not.

Name Type Description
@odata.type string:
  • #Microsoft.Media.AbsoluteClipTime

The discriminator for derived types.

time
  • string

The time position on the timeline of the input media. It is usually specified as an ISO8601 period. e.g PT30S for 30 seconds.

ApiError

The API error.

Name Type Description
error

The error properties.

Job

A Job resource type. The progress and state can be obtained by polling a Job or subscribing to events using EventGrid.

Name Type Description
id
  • string

Fully qualified resource ID for the resource.

name
  • string

The name of the resource.

properties.correlationData
  • object

Customer provided key, value pairs that will be returned in Job and JobOutput state events.

properties.created
  • string

The UTC date and time when the Job was created, in 'YYYY-MM-DDThh:mm:ssZ' format.

properties.description
  • string

Optional customer supplied description of the Job.

properties.input JobInput:

The inputs for the Job.

properties.lastModified
  • string

The UTC date and time when the Job was last updated, in 'YYYY-MM-DDThh:mm:ssZ' format.

properties.outputs JobOutput[]:

The outputs for the Job.

properties.priority

Priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal.

properties.state

The current state of the job.

type
  • string

The type of the resource.

JobError

Details of JobOutput errors.

Name Type Description
category

Helps with categorization of errors.

code

Error code describing the error.

details

An array of details about specific errors that led to this reported error.

message
  • string

A human-readable language-dependent representation of the error.

retry

Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal.

JobErrorCategory

Helps with categorization of errors.

Name Type Description
Configuration
  • string

The error is configuration related.

Content
  • string

The error is related to data in the input files.

Download
  • string

The error is download related.

Service
  • string

The error is service related.

Upload
  • string

The error is upload related.

JobErrorCode

Error code describing the error.

Name Type Description
ConfigurationUnsupported
  • string

There was a problem with the combination of input files and the configuration settings applied, fix the configuration settings and retry with the same input, or change input to match the configuration.

ContentMalformed
  • string

There was a problem with the input content (for example: zero byte files, or corrupt/non-decodable files), check the input files.

ContentUnsupported
  • string

There was a problem with the format of the input (not valid media file, or an unsupported file/codec), check the validity of the input files.

DownloadNotAccessible
  • string

While trying to download the input files, the files were not accessible, please check the availability of the source.

DownloadTransientError
  • string

While trying to download the input files, there was an issue during transfer (storage service, network errors), see details and check your source.

ServiceError
  • string

Fatal service error, please contact support.

ServiceTransientError
  • string

Transient error, please retry, if retry is unsuccessful, please contact support.

UploadNotAccessible
  • string

While trying to upload the output files, the destination was not reachable, please check the availability of the destination.

UploadTransientError
  • string

While trying to upload the output files, there was an issue during transfer (storage service, network errors), see details and check your destination.

JobErrorDetail

Details of JobOutput errors.

Name Type Description
code
  • string

Code describing the error detail.

message
  • string

A human-readable representation of the error.

JobInputAsset

Represents an Asset for input into a Job.

Name Type Description
@odata.type string:
  • #Microsoft.Media.JobInputAsset

The discriminator for derived types.

assetName
  • string

The name of the input Asset.

end ClipTime:

Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media.

files
  • string[]

List of files. Required for JobInputHttp. Maximum of 4000 characters each.

label
  • string

A label that is assigned to a JobInputClip, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'.

start ClipTime:

Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media.

JobInputClip

Represents input files for a Job.

Name Type Description
@odata.type string:
  • #Microsoft.Media.JobInputClip

The discriminator for derived types.

end ClipTime:

Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media.

files
  • string[]

List of files. Required for JobInputHttp. Maximum of 4000 characters each.

label
  • string

A label that is assigned to a JobInputClip, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'.

start ClipTime:

Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media.

JobInputHttp

Represents HTTPS job input.

Name Type Description
@odata.type string:
  • #Microsoft.Media.JobInputHttp

The discriminator for derived types.

baseUri
  • string

Base URI for HTTPS job input. It will be concatenated with provided file names. If no base uri is given, then the provided file list is assumed to be fully qualified uris. Maximum length of 4000 characters.

end ClipTime:

Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media.

files
  • string[]

List of files. Required for JobInputHttp. Maximum of 4000 characters each.

label
  • string

A label that is assigned to a JobInputClip, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'.

start ClipTime:

Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media.

JobInputs

Describes a list of inputs to a Job.

Name Type Description
@odata.type string:
  • #Microsoft.Media.JobInputs

The discriminator for derived types.

inputs JobInput[]:

List of inputs to a Job.

JobOutputAsset

Represents an Asset used as a JobOutput.

Name Type Description
@odata.type string:
  • #Microsoft.Media.JobOutputAsset

The discriminator for derived types.

assetName
  • string

The name of the output Asset.

error

If the JobOutput is in the Error state, it contains the details of the error.

label
  • string

A label that is assigned to a JobOutput in order to help uniquely identify it. This is useful when your Transform has more than one TransformOutput, whereby your Job has more than one JobOutput. In such cases, when you submit the Job, you will add two or more JobOutputs, in the same order as TransformOutputs in the Transform. Subsequently, when you retrieve the Job, either through events or on a GET request, you can use the label to easily identify the JobOutput. If a label is not provided, a default value of '{presetName}_{outputIndex}' will be used, where the preset name is the name of the preset in the corresponding TransformOutput and the output index is the relative index of the this JobOutput within the Job. Note that this index is the same as the relative index of the corresponding TransformOutput within its Transform.

progress
  • integer

If the JobOutput is in a Processing state, this contains the Job completion percentage. The value is an estimate and not intended to be used to predict Job completion times. To determine if the JobOutput is complete, use the State property.

state

Describes the state of the JobOutput.

JobRetry

Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal.

Name Type Description
DoNotRetry
  • string

Issue needs to be investigated and then the job resubmitted with corrections or retried once the underlying issue has been corrected.

MayRetry
  • string

Issue may be resolved after waiting for a period of time and resubmitting the same Job.

JobState

Describes the state of the JobOutput.

Name Type Description
Canceled
  • string

The job was canceled. This is a final state for the job.

Canceling
  • string

The job is in the process of being canceled. This is a transient state for the job.

Error
  • string

The job has encountered an error. This is a final state for the job.

Finished
  • string

The job is finished. This is a final state for the job.

Processing
  • string

The job is processing. This is a transient state for the job.

Queued
  • string

The job is in a queued state, waiting for resources to become available. This is a transient state.

Scheduled
  • string

The job is being scheduled to run on an available resource. This is a transient state, between queued and processing states.

ODataError

Information about an error.

Name Type Description
code
  • string

A language-independent error name.

details

The error details.

message
  • string

The error message.

target
  • string

The target of the error (for example, the name of the property in error).

Priority

Sets the relative priority of the TransformOutputs within a Transform. This sets the priority that the service uses for processing TransformOutputs. The default priority is Normal.

Name Type Description
High
  • string

Used for TransformOutputs that should take precedence over others.

Low
  • string

Used for TransformOutputs that can be generated after Normal and High priority TransformOutputs.

Normal
  • string

Used for TransformOutputs that can be generated at Normal priority.