createStreamingDistribution2018_11_05 method

Future<CreateStreamingDistributionResult> createStreamingDistribution2018_11_05({
  1. required StreamingDistributionConfig streamingDistributionConfig,
})

Creates a new RMTP distribution. An RTMP distribution is similar to a web distribution, but an RTMP distribution streams media files using the Adobe Real-Time Messaging Protocol (RTMP) instead of serving files using HTTP.

To create a new web distribution, submit a POST request to the CloudFront API version/distribution resource. The request body must include a document with a StreamingDistributionConfig element. The response echoes the StreamingDistributionConfig element and returns other information about the RTMP distribution.

To get the status of your request, use the GET StreamingDistribution API action. When the value of Enabled is true and the value of Status is Deployed, your distribution is ready. A distribution usually deploys in less than 15 minutes.

For more information about web distributions, see Working with RTMP Distributions in the Amazon CloudFront Developer Guide.

May throw CNAMEAlreadyExists. May throw StreamingDistributionAlreadyExists. May throw InvalidOrigin. May throw InvalidOriginAccessIdentity. May throw AccessDenied. May throw TooManyTrustedSigners. May throw TrustedSignerDoesNotExist. May throw MissingBody. May throw TooManyStreamingDistributionCNAMEs. May throw TooManyStreamingDistributions. May throw InvalidArgument. May throw InconsistentQuantities.

Parameter streamingDistributionConfig : The streaming distribution's configuration information.

Implementation

Future<CreateStreamingDistributionResult>
    createStreamingDistribution2018_11_05({
  required StreamingDistributionConfig streamingDistributionConfig,
}) async {
  ArgumentError.checkNotNull(
      streamingDistributionConfig, 'streamingDistributionConfig');
  final $result = await _protocol.sendRaw(
    method: 'POST',
    requestUri: '/2018-11-05/streaming-distribution',
    payload: streamingDistributionConfig.toXml('StreamingDistributionConfig'),
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return CreateStreamingDistributionResult(
    streamingDistribution: StreamingDistribution.fromXml($elem),
    eTag: _s.extractHeaderStringValue($result.headers, 'ETag'),
    location: _s.extractHeaderStringValue($result.headers, 'Location'),
  );
}