SALES: 1-800-867-1380

Origin

Updated: August 12, 2014

ImportantImportant
Starting with Media Services 2.7, the Origin entity was renamed to StreamingEndpoint. If you are using Media Services 2.7 or later, see StreamingEndpoint.

The Origin entity represents a streaming service that can deliver content directly to customers, or to a Content Delivery Network (CDN) for further distribution. Currently, seamless CDN integration is not a feature of Microsoft Azure Media Services, but you can utilize one of the CDN providers on the market (for example, Edgecast or Akamai). The outbound stream from an Origin service is a video on demand that is stored as a blob in one of your storage accounts that you have associated with your Media Services account. In addition, multiple Reserve Units (RUs) are available to an Origin service to handle growing bandwidth needs. You can create RUs in advance, and deploy them as needed using the scale function of the Origin service. For more information, see How to Scale a Media Service.

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

ImportantImportant
When working with the Media Services REST API, the following considerations apply:

Origin Entity Properties

The Origin entity contains the following properties.

 

Property Type Description

Id

Read-only. Set by Media Services.

String

The Origin ID, assigned upon creation. The format is: nb:oid:UUID:<GUID>

Name

String

A friendly name for the Origin service.

  1. Must be unique within your Media Services account.

  2. Maximum length = 32 characters.

  3. Cannot contain spaces.

  4. Hyphens and alphanumeric characters only.

  5. Cannot begin or end with a hyphen.

Description

String

A description of the Origin. The maximum length is 256 characters.

Created

Read-only. Set by Media Services.

DateTime

Created by the Media Services.

State

Read-only. Set by Media Services.

Int32

Values for the property include:

  • Stopped. The initial state of an Origin after creation.

  • Starting. The Origin is transitioning to the running state.

  • Running. The Origin is able to stream content to clients.

  • Scaling. The Reserve Units are being increased or decreased.

  • Stopping. The Origin is transitioning to the stopped state.

HostName

Read-only. Set by Media Services.

String

DNS name for the Origin service. When ReservedUnits is set to 0, this redirects to a shared pool.

LastModified

Read-only. Set by Media Services.

DateTime

Last update time for this entity.

ReservedUnits

Int32

The number of reserved units allocated for the Origin deployment.

Settings

String

A string in JSON format representing the Origin settings.

See the following Setting Descriptions section for more information.

Settings Descriptions

The Settings value is a JSON-formatted string value that you must include when creating an Origin. It describes security settings, cache settings, and so on. An example is shown in the Sample Request section of Create Origins.

 

Name Description

Playback

Optional. Describes playback settings primarily for CDN integration (allowed IP addresses, cache duration, etc.). See the following table for a further description of the Playback setting.

If you wish to stream directly to clients, you may omit the Playback setting from your list of settings.

ClientAccessPolicy

Optional.

CrossDomainPolicy

Optional.

Playback Settings

Name Description

Security

Optional. Describes the allowed IP source addresses that can connect to the Origin streaming endpoint. You can also label each allowed IP address with the “Name” property for tracking purposes. For more information, see the Security Settings table.

MaxCacheAge

Optional. The maximum cache duration in Ticks.

Security Settings

Name Description

IPv4AllowList

Defines the IP addresses that can connect to a streaming Origin endpoint.

noteNote
Setting this value to null allows all IP source addresses to connect. Setting it to an empty set (“”) allows no one to connect.

Name

Sub-setting of IPv4AllowList. The name of the IP address or addresses that are allowed to connect to a streaming Origin endpoint.

IP

Sub-setting of IPv4AllowList.The actual IP address or addresses that can connect to a streaming Origin endpoint. For examples of valid IP formats, see the IP Address Examples table.

AkamaiSignatureHeaderAuthentication

Optional. Defines the Akamai CDN authentication settings. For more information, see the Akamai Authentication Settings table.

IP Address Examples

Description Format

Single IP address

a.b.c.d

Netmask style

a.b.c.d - example: 64.4.0.1 (255.255.0.0)

CIDR style

a.b.c.d/bits - example: 0.0.0.0/0

Akamai Authentication Settings

Name Description

Expiration

DateTime value that specifies when the Akamai authentication expires.

Identifier

Name of authentication settings for tracking purposes.

Base64Key

Base64-encoded authentication key that will be used by the CDN.

Create Origins

Create a new Origin service.

 

Method Request URI HTTP Version

POST

https://media.windows.net/api/Origins

HTTP/1.1

Sample Request

ImportantImportant
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.

POST /api/Origins HTTP/1.1
MaxDataServiceVersion: 3.0;NetFx
Content-Type: application/json;odata=minimalmetadata
Accept: application/json;odata=minimalmetadata
Authorization: Bearer <token value>
x-ms-version: 2.6
Host: <redirected host URI>
Content-Length: 342

{"Name" : "dwredeOrigin2",  "ReservedUnits" : 1, "Settings" : "{\"Playback\":{\"MaxCacheAge\":100,\"Security\":{\"IPv4AllowList\":[{\"Name\":\"CDN\",\"IP\":\"64.4.0.0/18\"}],\"AkamaiSignatureHeaderAuthentication\":[{\"Expiration\":\"\\/Date(1389604014430)\\/\",\"Identifier\":\"Sample Auth Key\",\"Base64Key\":\"1234567890==\"}]}}}"}
ImportantImportant
When creating a request body in JSON, you must pass in an embedded JSON object as a String value in the Settings property. This requires escaping all of the double quotation marks in that embedded object as shown in the example above.

If successful, a 202 Accepted status code is returned along with a representation of the created entity in the response body. The 202 Accepted status code indicates an asynchronous operation, in which case the operation-id header value is also provided for use in polling and tracking the status of long-running operations, such as starting or stopping an Origin. Pass the operation-id header value into the Operation Entity to retrieve the status.

Start Origins

Start the specified Origin. An Origin can only be started when it is in the Stopped state. If the reserved unit count is 0, points the DNS name to the shared pool.

 

Method Request URI HTTP Version

POST

https://media.windows.net/api/Origins(‘OriginId')/Start 

HTTP/1.1

Sample Request

ImportantImportant
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.

POST /api/Origins('nb%3Aoid%3AUUID%3A32ad7fa6-f780-4345-bbc6-45a79a914427')/Start HTTP/1.1
MaxDataServiceVersion: 3.0;NetFx
Content-Type: application/json;odata=minimalmetadata
Accept: application/json;odata=minimalmetadata
Authorization: Bearer <token value>
x-ms-version: 2.6
Host: <redirected host URI>
Content-Length: 0

If successful, a 202 Accepted status code is returned. The 202 Accepted status code indicates an asynchronous operation, in which case the operation-id header value is also provided for use in polling and tracking the status of long-running operations, such as starting or stopping an Origin. Pass the operation-id header value into the Operation Entity to retrieve the status.

Stop Origins

Stop the specified Origin. An Origin can be stopped only when it is in the Running state.

 

Method Request URI HTTP Version

POST

https://media.windows.net/api/Origins(‘OriginId')/Stop 

HTTP/1.1

Sample Request

ImportantImportant
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.

POST /api/Origins('nb%3Aoid%3AUUID%3A32ad7fa6-f780-4345-bbc6-45a79a914427')/Stop HTTP/1.1
MaxDataServiceVersion: 3.0;NetFx
Content-Type: application/json;odata=minimalmetadata
Accept: application/json;odata=minimalmetadata
Authorization: Bearer <token value>
x-ms-version: 2.6
Host: <redirected host URI>
Content-Length: 0

If successful, a 202 Accepted status code is returned. The 202 Accepted status code indicates an asynchronous operation, in which case the operation-id header value is also provided for use in polling and tracking the status of long-running operations, such as starting or stopping an Origin. Pass the operation-id header value into the Operation Entity to retrieve the status.

Scale Origins

Dynamically updates the reserved unit capacity while in the running state.

 

Method Request URI HTTP Version

POST

https://media.windows.net/api/Origins(‘OriginId')/Scale 

HTTP/1.1

Sample Request

ImportantImportant
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.

POST /api/Origins('nb%3Aoid%3AUUID%3A32ad7fa6-f780-4345-bbc6-45a79a914427')/Scale HTTP/1.1
MaxDataServiceVersion: 3.0;NetFx
Content-Type: application/json;odata=minimalmetadata
Accept: application/json;odata=minimalmetadata
Authorization: Bearer <token value>
x-ms-version: 2.6
Host: <redirected host URI>
Content-Length: 21

{"ReservedUnits" : 2}

If successful, a 202 Accepted status code is returned. The 202 Accepted status code indicates an asynchronous operation, in which case the operation-id header value is also provided for use in polling and tracking the status of long-running operations, such as starting or stopping an Origin. Pass the operation-id header value into the Operation Entity to retrieve the status.

List Origins

Origins are retrieved using a GET HTTP request.

 

Method Request URI HTTP Version

GET

https://media.windows.net/api/Origins(‘OriginId’)

HTTP/1.1

 

Method Request URI HTTP Version

GET

https://media.windows.net/api/Origins

HTTP/1.1

Sample Request

ImportantImportant
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.

GET /api/Origins HTTP/1.1
MaxDataServiceVersion: 3.0;NetFx
Content-Type: application/json;odata=minimalmetadata
Accept: application/json;odata=minimalmetadata
Authorization: Bearer <token value>
x-ms-version: 2.6
Host: <redirected host URI>
Content-Length: 0

If successful, this operation returns a 200 OK status code and a list of all of the Origins created in your Media Services account.

Update Origins

Update an Origin with new property values. This is an asynchronous operation if the Origin is running and the settings are changed.

 

Method Request URI HTTP Version

PUT

https://media.windows.net/api/Origins(‘OriginId’)

HTTP/1.1

Sample Request

ImportantImportant
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.

For the following example, an Origin was initially created with the MaxCacheAge value set to 100. Now, in the code example below, the MaxCacheAge value has been set to 200.

PUT api/Origins('nb:oid:UUID:220a4c32-75dc-469c-b85b-c594a0960db4') HTTP/1.1
MaxDataServiceVersion: 3.0;NetFx
Content-Type: application/json;odata=minimalmetadata
Accept: application/json;odata=minimalmetadata
Authorization: Bearer <token value>
x-ms-version: 2.6
Host: <redirected host URI>
Content-Length: 56

{"Settings" : "{\"Playback\" : {\"MaxCacheAge\" : 200}}"}

If the update completes synchronously, it returns a 204 No Content status code; otherwise it returns a 202 Accepted status code. The 202 Accepted status code indicates an asynchronous operation, in which case the operation-id header value is also provided for use in polling and tracking the status of long-running operations, such as starting or stopping an Origin. Pass the operation-id header value into the Operation Entity to retrieve the status.

Delete Origins

Delete an Origin. An Origin can be deleted only when it is in the Stopped state. OriginMetrics are deleted as well.

 

Method Request URI HTTP Version

DELETE

https://media.windows.net/api/Origins(‘OriginId’)

HTTP/1.1

Sample Request

ImportantImportant
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.

DELETE /api/Origins('nb%3Aoid%3AUUID%3A32ad7fa6-f780-4345-bbc6-45a79a914427') HTTP/1.1
MaxDataServiceVersion: 3.0;NetFx
Content-Type: application/json;odata=minimalmetadata
Accept: application/json;odata=minimalmetadata
Authorization: Bearer <token value>
x-ms-version: 2.6
Host: <redirected host URI>
Content-Length: 0

If successful, a 202 Accepted status code is returned. The 202 Accepted status code indicates an asynchronous operation, in which case the operation-id header value is also provided for use in polling and tracking the status of long-running operations, such as starting or stopping an Origin. Pass the operation-id header value into the Operation Entity to retrieve the status.

Streaming from a Dedicated or Shared Pool

There are two states possible when working with Origins: dedicated or shared. If you consent to use reserved units (RU), your Origin performance is governed by a Service Level Agreement (SLA). This state is referred to as “dedicated,” for using dedicated reserve units. If you do not contract to use RUs, you are using computing resources from a shared pool. The shared pool can be used for testing or prototyping, but no SLA governs the performance.

By default, when you create a Microsoft Azure Media Services account, one Origin is created with no reserved units. The Origin has the name “Default,” and it cannot be deleted. The state of the Origin is OriginState.Started. After some time, the state changes to OriginState.Running.

If the reserved unit count is set to 0, and the Origin entity is in the Running state, the streaming will continue from shared pool. To stop streaming at a later point in time, call the Stop operation on the Origin entity. The table summarizes the behavior:

 

State Reserved Units (RU) Description Available Actions

Stopped

0

Not streaming.

Start

Running

0

Streaming from the shared pool.

Stop, Scale

Stopped

>0

Not streaming.

Start, Scale

Running

>0

Streaming from dedicated.

Stop, Scale


Build Date:

2014-09-09
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft