Asset
An Asset is a virtual entity that holds metadata about media. An Asset may contain one or many files including video, audio, images, thumbnail collections, text tracks, closed caption files, and rich media players. The Asset entity defines the abstract concept of an Asset in the Windows Azure Media Services system.
- The following characteristics apply to an Asset in Media Services:
- An Asset is a logical unit that represents a single audiovisual presentation An asset contains a collection of one to many media files The files of an asset are located in a single blob storage container Some examples of an Asset are: a full movie, TV show, specific edit; a clip from a movie, TV show, animation, camera ISO file, or event; a movie trailer or promotional video; an advertisement; an audio file, radio show, podcast, or sound file.
- The following characteristics DO NOT apply to an Asset in Media Services:
- Simply a storage container A folder to organize and store multiple versions of the same presentation in A folder for submitting batch processing of multiple audiovisual presentations to Azure Media Encoder For example, you must not store a movie, its trailer, an advertisement, and an international edit version of the same movie in a single Asset
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. |
-
Asset Entity Properties
-
Create an Asset
-
List an Asset
-
Update an Asset
-
Delete an Asset
-
Publish an Asset
-
Linking Content Keys to Assets
-
Removing ContentKey Links
Important |
|---|
| After successfully connecting to https://media.windows.net, you will receive a 301 redirect specifying another Media Services URI. You must make subsequent calls to the new URI. |
Asset Entity Properties
| Property | Type | Description | ||
|---|---|---|---|---|
|
Id |
String |
Unique identifier set by Media Services. |
||
|
State |
Edm.Int32 |
An enumeration value that describes the state of the asset. Value values are:
|
||
|
Created |
Edm.DateTime |
This value is set by Media Services at creation time. |
||
|
LastModified |
Edm.DateTime |
This value is updated by Media Services after any property changes are made. |
||
|
AlternateId |
Edm.String |
Optional. An alternate Id value that corresponds to an Id in another content management system. |
||
|
Name |
Edm.String |
Optional. Friendly name for your Asset. |
||
|
Options |
Edm.Int32 |
Optional. An enumeration value that describes the encryption options that an Asset can be created with. A valid value is one value from the list below, not a combination of values from this list:
|
||
|
Locators |
Locator entity set |
Navigation property that can be accessed by referencing a specific Asset by Id value. The returned entity set contains all of the Locator entities that are linked to the specified Asset. |
||
|
ContentKeys |
ContentKey entity set |
Navigation property that can be accessed by referencing a specific Asset by Id value. The returned entity set contains all of the ContentKey entities that are linked to the specified Asset. |
||
|
Files |
File entity set |
Navigation property that can be accessed by referencing a specific Asset by Id value. The returned entity set contains all of the File entities that are linked to the specified Asset. |
||
|
ParentAssets |
ParentAsset entity set |
Navigation property that can be accessed by referencing a specific Asset by Id value. The returned entity set contains all of the ParentAsset entities that are linked to the specified Asset. |
Create an Asset
Assets can be created using a POST HTTP request and specifying property values.
| Method | Request URI | HTTP Version |
|---|---|---|
|
POST |
https://media.windows.net/API/Assets |
HTTP/1.1 |
Sample Request
POST https://media.windows.net/API/Assets HTTP/1.1
Content-Type: application/json;odata=verbose
Accept: application/json;odata=verbose
DataServiceVersion: 3.0
MaxDataServiceVersion: 3.0
x-ms-version: 2.1
Authorization: Bearer http%3a%2f%2fschemas.xmlsoap.org%2fws%2f2005%2f05%2fidentity%2fclaims%2fnameidentifier=070500D0-F35C-4A5A-9249-485BBF4EC70B&http%3a%2f%2fschemas.microsoft.com%2faccesscontrolservice%2f2010%2f07%2fclaims%2fidentityprovider=https%3a%2f%2fwamsprodglobal001acs.accesscontrol.windows.net%2f&Audience=urn%3aWindowsAzureMediaServices&ExpiresOn=1334275521&Issuer=https%3a%2f%2fwamsprodglobal001acs.accesscontrol.windows.net%2f&HMACSHA256=GxdBb%2fmEyN7iHdNxbawawHRftLhPFFqxX1JZckuv3hY%3d
Host: media.windows.net
Content-Length: 27
Expect: 100-continue
{ "Name" : "NewJSONAsset" }
List an Asset
Assets can be retrieved using a GET HTTP request.
| Method | Request URI | HTTP Version |
|---|---|---|
|
GET |
https://media.windows.net/API/Assets |
HTTP/1.1 |
| Method | Request URI | HTTP Version |
|---|---|---|
|
GET |
https://media.windows.net/API/Assets('assetid') |
HTTP/1.1 |
Sample Request
GET https://media.windows.net/API/Assets('nb:cid:UUID:fccb8cd9-7afa-4365-a36e-d5d68409bb64') HTTP/1.1
Content-Type: application/json;odata=verbose
Accept: application/json;odata=verbose
DataServiceVersion: 3.0
MaxDataServiceVersion: 3.0
x-ms-version: 2.1
Authorization: Bearer http%3a%2f%2fschemas.xmlsoap.org%2fws%2f2005%2f05%2fidentity%2fclaims%2fnameidentifier=070500D0-F35C-4A5A-9249-485BBF4EC70B&http%3a%2f%2fschemas.microsoft.com%2faccesscontrolservice%2f2010%2f07%2fclaims%2fidentityprovider=https%3a%2f%2fwamsprodglobal001acs.accesscontrol.windows.net%2f&Audience=urn%3aWindowsAzureMediaServices&ExpiresOn=1334275521&Issuer=https%3a%2f%2fwamsprodglobal001acs.accesscontrol.windows.net%2f&HMACSHA256=GxdBb%2fmEyN7iHdNxbawawHRftLhPFFqxX1JZckuv3hY%3d
Host: media.windows.net
Content-Length: 0
Update an Asset
Assets can be updated using a MERGE HTTP request and the specific properties that you want to change.
| Method | Request URI | HTTP Version |
|---|---|---|
|
MERGE |
https://media.windows.net/API/Assets('assetid') |
HTTP/1.1 |
Sample Request
MERGE https://media.windows.net/API/Assets('nb:cid:UUID:80782407-3f87-4e60-a43e-5e4454232f60') HTTP/1.1
Content-Type: application/json;odata=verbose
Accept: application/json;odata=verbose
DataServiceVersion: 3.0
MaxDataServiceVersion: 3.0
x-ms-version: 2.1
Authorization: Bearer http%3a%2f%2fschemas.xmlsoap.org%2fws%2f2005%2f05%2fidentity%2fclaims%2fnameidentifier=youraccountname&urn%3aSubscriptionId=2f84471d-b1ae-4e75-aa09-010f0fc0cf5b&http%3a%2f%2fschemas.microsoft.com%2faccesscontrolservice%2f2010%2f07%2fclaims%2fidentityprovider=https%3a%2f%2fwamsprodglobal001acs.accesscontrol.windows.net%2f&Audience=urn%3aWindowsAzureMediaServices&ExpiresOn=1337083279&Issuer=https%3a%2f%2fwamsprodglobal001acs.accesscontrol.windows.net%2f&HMACSHA256=DMLQXWah4jO0icpfwyws5k%2b1aCDfz9KDGIGao20xk6g%3d
Host: media.windows.net
Content-Length: 21
Expect: 100-continue
{"Name" : "NewName" }
Delete an Asset
Assets can be deleted by referencing the Asset Id value. When an asset is deleted, all of its locators are deleted by Windows Azure Media Services. If the asset had origin locators, these will be revoked and deleted as well. All links to ContentKeys will be deleted and any ContentKeys not linked to other assets will be deleted.
| Method | Request URI | HTTP Version |
|---|---|---|
|
DELETE |
https://media.windows.net/API/Assets('assetid') |
HTTP/1.1 |
Sample Request
DELETE https://media.windows.net/API/Assets('nb:cid:UUID:fccb8cd9-7afa-4365-a36e-d5d68409bb64') HTTP/1.1
Content-Type: application/json;odata=verbose
Accept: application/json;odata=verbose
DataServiceVersion: 3.0
MaxDataServiceVersion: 3.0
x-ms-version: 2.1
Authorization: Bearer http%3a%2f%2fschemas.xmlsoap.org%2fws%2f2005%2f05%2fidentity%2fclaims%2fnameidentifier=070500D0-F35C-4A5A-9249-485BBF4EC70B&http%3a%2f%2fschemas.microsoft.com%2faccesscontrolservice%2f2010%2f07%2fclaims%2fidentityprovider=https%3a%2f%2fwamsprodglobal001acs.accesscontrol.windows.net%2f&Audience=urn%3aWindowsAzureMediaServices&ExpiresOn=1334275521&Issuer=https%3a%2f%2fwamsprodglobal001acs.accesscontrol.windows.net%2f&HMACSHA256=GxdBb%2fmEyN7iHdNxbawawHRftLhPFFqxX1JZckuv3hY%3d
Host: media.windows.net
Content-Length: 0
Publish an Asset
Note |
|---|
The Publish action has been deprecated. Starting with the latest Media Services release, Publish should not be used.
If your code uses Publish, be aware of the following considerations:
|
Linking Content Keys to Assets
You can link a ContentKey to an asset by referencing the asset Id with an HTTP POST request. The Uri of the ContentKey must be included in the body of the request. You can only link a ContentKey type that matches the type specified in the asset’s CreationOptions. For example, if the Asset has options set to StorageEncrypted(1), the ContentKey must be of the StorageEncryption(1) type.
| Method | Request URI | HTTP Version |
|---|---|---|
|
POST |
https://media.windows.net/API/Assets(‘Asset Id')/$links/ContentKeys |
HTTP/1.1 |
Sample Request
POST https://media.windows.net/API/Assets('nb:cid:UUID:3ac4c50a-09c1-4ea3-b39c-c336d97f5a13')/$links/ContentKeys HTTP/1.1
Content-Type: application/json;odata=verbose
Accept: application/json;odata=verbose
DataServiceVersion: 3.0
MaxDataServiceVersion: 3.0
x-ms-version: 2.1
Authorization: Bearer http%3a%2f%2fschemas.xmlsoap.org%2fws%2f2005%2f05%2fidentity%2fclaims%2fnameidentifier=vodbvttest01&urn%3aSubscriptionId=2f84471d-b1ae-4e75-aa09-010f0fc0cf5b&http%3a%2f%2fschemas.microsoft.com%2faccesscontrolservice%2f2010%2f07%2fclaims%2fidentityprovider=https%3a%2f%2fnimbustestaccounts.accesscontrol.windows.net%2f&Audience=urn%3aNimbus&ExpiresOn=1352143039&Issuer=https%3a%2f%2fnimbustestaccounts.accesscontrol.windows.net%2f&HMACSHA256=sx%2bpdQNrEi8FoEVnwnIK1sXe3GWxXELEFbwKNMQ7BNM%3d
Host: media.windows.net
Content-Length: 121
Expect: 100-continue
{ "uri": "https://media.windows.net/api/ContentKeys('nb%3Akid%3AUUID%3A5db89211-c9d9-404b-a6bc-3e6b91c7a214')"}
Removing ContentKey Links
You can remove ContentKey links from an asset by referencing the asset id and the ContentKey Id in a HTTP DELETE request. If the ContentKey is not linked to any other assets, it will be deleted.
| Method | Request URI | HTTP Version |
|---|---|---|
|
DELETE |
https://media.windows.net/API/Assets(‘Asset Id')/$links/ContentKeys('ContentKey Id') |
HTTP/1.1 |
Sample Request
DELETE https://media.windows.net/API/Assets('nb:cid:UUID:3ac4c50a-09c1-4ea3-b39c-c336d97f5a13')/$links/ContentKeys('nb:kid:UUID:5db89211-c9d9-404b-a6bc-3e6b91c7a214') HTTP/1.1
Content-Type: application/json;odata=verbose
Accept: application/json;odata=verbose
DataServiceVersion: 3.0
MaxDataServiceVersion: 3.0
x-ms-version: 2.1
Authorization: Bearer http%3a%2f%2fschemas.xmlsoap.org%2fws%2f2005%2f05%2fidentity%2fclaims%2fnameidentifier=vodbvttest01&urn%3aSubscriptionId=2f84471d-b1ae-4e75-aa09-010f0fc0cf5b&http%3a%2f%2fschemas.microsoft.com%2faccesscontrolservice%2f2010%2f07%2fclaims%2fidentityprovider=https%3a%2f%2fnimbustestaccounts.accesscontrol.windows.net%2f&Audience=urn%3aNimbus&ExpiresOn=1352143039&Issuer=https%3a%2f%2fnimbustestaccounts.accesscontrol.windows.net%2f&HMACSHA256=sx%2bpdQNrEi8FoEVnwnIK1sXe3GWxXELEFbwKNMQ7BNM%3d
Host: media.windows.net
Content-Length: 0
See Also
Build Date:
Important
Warning
Note