Amazon CloudFront
API Reference (API Version 2010-11-01)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

POST Streaming Distribution

Description

This action creates a new streaming distribution. A streaming distribution looks similar to a distribution, except it streams media files over an Adobe Real-Time Messaging Protocol (RTMP) connection, instead of serving files over HTTP. You can create up to 100 streaming distributions per AWS account. For more information about streaming distributions, go to Working with Distributions and Streaming Media Files in the Amazon CloudFront Developer Guide.

To create a new streaming distribution, you do a POST on the 2010-11-01/streaming-distribution resource. The request body must include an XML document with a StreamingDistributionConfig element. The response echoes the StreamingDistributionConfig element and returns other metadata about the streaming distribution. For more information, go to Parts of a Basic Distribution in the Amazon CloudFront Developer Guide.

Requests

Syntax

POST /2010-11-01/streaming-distribution HTTP/1.1
Host: cloudfront.amazonaws.com
Authorization: [AWS authentication string]
Date: [time stamp]
[Other required headers]	

<?xml version="1.0" encoding="UTF-8"?>
<StreamingDistributionConfig xmlns="http://cloudfront.amazonaws.com/doc/2010-11-01/">
   <S3Origin>
      <DNSName>dns name</DNSName>
   </S3Origin>
   <CallerReference>ref</CallerReference>
   <CNAME>far.example.com</CNAME>
   <CNAME>farther.example.com;/CNAME>
   <Comment>The comment.</Comment>
   <Enabled>true|false</Enabled>
      <Enabled>true|false</Enabled>
   <Logging>
      <Bucket>mylogs.s3.amazonaws.com</Bucket>
      <Prefix/>
   </Logging>
</StreamingDistributionConfig>

Headers

The request must include the headers required in all CloudFront requests. For more information, see Common REST Headers.

Elements

Name Description Required

StreamingDistributionConfig

The streaming distribution's configuration information. For more information, see StreamingDistributionConfig Complex Type.

Type: StreamingDistributionConfig complex type

Default: None

Yes

Responses

Syntax

201 Created
Location: [URI of new streaming distribution]
x-amz-request-id: [Request ID]

<?xml version="1.0" encoding="UTF-8"?>
<StreamingDistribution xmlns="http://cloudfront.amazonaws.com/doc/2010-11-01/">
   <Id>S3FC98xK7ETSU1</Id>
   <Status>Disabled</Status>
   <LastModifiedTime>2009-11-19T19:37:58Z</LastModifiedTime>
   <DomainName>d8jveqvsk3u8gy.cloudfront.net</DomainName>
   <StreamingDistributionConfig>
      <S3Origin>
         <DNSName>test-streaming-dist.s3.amazonaws.com</DNSName>
         <OriginAccessIdentity>OAI</OriginAccessIdentity>
      <S3Origin>origin</S3Origin> 
      <CallerReference>ref</CallerReference>
      <CNAME>far.example.com</CNAME>
      <Comment>The comment.</Comment>
      <Enabled>true|false</Enabled>
      <Logging>
         <Bucket>mylogs.s3.amazonaws.com</Bucket>
         <Prefix>myprefix/</Prefix>
      </Logging>
   </StreamingDistributionConfig>
</StreamingDistribution>

Headers

NameDescription

Location

The fully qualified URI of the new streaming distribution resource just created. For example: https://cloudfront.amazonaws.com/2010-11-01/streaming-distribution/EGTXBD79H29TRA8

Type: String

Elements

NameDescription

StreamingDistribution

The streaming distribution's information. For more information, see StreamingDistribution Complex Type.

Type: StreamingDistribution datatype

Special Errors

The following table lists the special errors returned in addition to the common errors all actions return (for more information, see Errors).

ErrorDescriptionHTTP Status Code

CNAMEAlreadyExists

One or more of the CNAMEs you provided are already associated with a different distribution.

409

StreamingDistributionAlreadyExists

The caller reference you attempted to create the streaming distribution with is associated with another streaming distribution.

409

InvalidOrigin

The origin server specified does not refer to a valid Amazon S3 bucket.

400

MissingBody

This operation requires a body. Ensure that the body is present and the Content-Type header is set.

400

TooManyStreamingDistributionCNAMEs

Your request contains more CNAMEs than are allowed per streaming distribution.

400

TooManyStreamingDistributions

Processing your request would cause you to exceed the maximum number of streaming distributions allowed.

400

Examples

The following example request creates a new streaming distribution that corresponds to the bucket mystreamingbucket.s3.amazonaws.com. The request enables logging.

Sample Request

POST /2010-11-01/streaming-distribution HTTP/1.1
Host: cloudfront.amazonaws.com
Authorization: AWS O39F6A430S6FJNPPGDR2:frJIUN8DYpKDtOLEXAMPLE=
Date: Thu, 19 Nov 2009 19:37:58 GMT
[Other required headers]

<?xml version="1.0" encoding="UTF-8"?>
<StreamingDistribution xmlns="http://cloudfront.amazonaws.com/doc/2010-11-01/">
   <Id>id</Id>
   <Status>status</Status>
   <LastModifiedTime>time</LastModifiedTime>
   <DomainName>domain name</DomainName>
   <StreamingDistributionConfig>
      <S3Origin>
         <DNSName>name</DNSName>
         <OriginAccessIdentity>OAI</OriginAccessIdentity>
      <S3Origin>origin</S3Origin> 
      <CallerReference>ref</CallerReference>
      <CNAME>near.example.com</CNAME>
      <Comment>The comment.</Comment>
      <Enabled>true|false</Enabled>
      <Logging>
         <Bucket>mylogs.s3.amazonaws.com</Bucket>
         <Prefix>myprefix/</Prefix>
      </Logging>
   </StreamingDistributionConfig>
</StreamingDistribution>

Sample Response

201 Created
Location: https://cloudfront.amazonaws.com/2010-11-01/streaming-distribution/EGTXBD79H29TRA8
x-amz-request-id: request_id

<?xml version="1.0" encoding="UTF-8"?>
<StreamingDistribution xmlns="http://cloudfront.amazonaws.com/doc/2010-11-01/">
    <Id>EGTXBD79H29TRA8</Id>
    <Status>InProgress</Status>
    <LastModifiedTime>2009-11-19T19:37:58Z</LastModifiedTime>
    <DomainName>s5c39gqb8ow64r.cloudfront.net</DomainName>
    <StreamingDistributionConfig>
      <S3Origin>
         <DNSName>mystreamingbucket.s3.amazonaws.com</DNSName>
      </S3Origin>   
      <CallerReference>20091130090000</CallerReference>
      <Comment>My comments</Comment>
      <Enabled>true</Enabled>
      <Logging>
         <Bucket>mylogs.s3.amazonaws.com</Bucket>
         <Prefix>myprefix/</Prefix>
      </Logging>
    </StreamingDistributionConfig>
</StreamingDistribution>