TaskTemplate

TaskTemplates provide reusable settings for tasks that run within a JobTemplate definition.

This article gives an overview of the TaskTemplate entity and also demonstrates how to execute various operations with the Media Services REST API.

Important

When accessing entities in Media Services, you must set specific header fields and values in your HTTP requests.
For more information, see Setup for Media Services REST API Development and Connecting to Media Services with the Media Services REST API.

TaskTemplate Entity Properties

Property Type Description
Id

Read-only. Set by Media Services at creation time.
Edm.String User-defined unique identifier of the following format, "nb:ttid:UUID:<INSERT NEW GUID STRING>."
Configuration

Optional.
Edm.String Preset that defines processing actions, such as encoding, protection, and so on, that the TaskTemplate will perform. Maximum length is 100000.
Created

Read-only. Set by Media Services at creation time.
Edm.DateTime This value is set by Media Services at creation time.
Description

Optional.
Edm.String The description of the TaskTemplate. Maximum length is 4000.
LastModified

Read-only. Set by Media Services.
Edm.DateTime This value is updated by Media Services after any property changes are made.
MediaProcessorId

Optional.
Edm.String Id of the MediaProcessor that will be used in the TaskTemplate. Valid values can be retrieved by performing GET request on /API/MediaProcessors.
Name

Optional.
Edm.String Friendly name for the task template. Maximum length is 4000.
NumberofInputAssets

Required.
Edm.Int32 Number of input Assets the TaskTemplate must process.
NumberofOutputAssets

Required.
Edm.Int32 Number of output Assets the TaskTemplate must create if they are not already specified, or use if they are specified.
Options

Optional.
Edm.Int32 An enumeration value that describes the encryption options that a TaskTemplate can be created with. Valid values are:

- None = 0
- ProtectedConfiguration = 1
EncryptionKeyId

Optional.
Edm.String The encrypted Key Id.
EncryptionScheme

Optional.
Edm.String The EncryptionScheme used with the configuration file. The valid value is "ConfigurationEncryption."
EncryptionVersion

Optional.
Edm.String The version of configuration encryption to use. The currently supported version is "1.0."
InitializationVector

Optional.
Edm.String The InitializationVector of the configuration file.

Create a TaskTemplate

TaskTemplates are created by creating a JobTemplate. For an example, see Create a JobTemplate.

List TaskTemplates

Tasks are retrieved using a GET HTTP request.

Method Request URI HTTP Version
GET https://<accountname>.restv2.<location>.media.azure.net/api/TaskTemplates HTTP/1.1
Method Request URI HTTP Version
GET https://<accountname>.restv2.<location>.media.azure.net/api/JobTemplates('jobtemplateid')/TaskTemplates HTTP/1.1

Sample Request

To get the latest x-ms-version:, see Media Services REST.

GET https://<accountname>.restv2.<location>.media.azure.net/api/JobTemplates('nb:jtid:UUID:b1f956b3-774c-bb44-a3f7-ee47e23aed38')/TaskTemplates HTTP/1.1  
Content-Type: application/json;odata=verbose  
Accept: application/json;odata=verbose  
DataServiceVersion: 3.0  
MaxDataServiceVersion: 3.0  
x-ms-version: 2.19
Authorization: Bearer <token value>  
Host: media.windows.net  

See Also

ContentKey
Asset
AccessPolicy
AssetFile
Job
Locator
MediaProcessor
Task
JobTemplate
Quotas and Limitations