createDistribution2017_03_25 method
- required DistributionConfig distributionConfig,
Creates a new web distribution. Send a POST
request to the
/CloudFront API
version/distribution
/distribution ID
resource.
May throw CNAMEAlreadyExists. May throw DistributionAlreadyExists. May throw InvalidOrigin. May throw InvalidOriginAccessIdentity. May throw AccessDenied. May throw TooManyTrustedSigners. May throw TrustedSignerDoesNotExist. May throw InvalidViewerCertificate. May throw InvalidMinimumProtocolVersion. May throw MissingBody. May throw TooManyDistributionCNAMEs. May throw TooManyDistributions. May throw InvalidDefaultRootObject. May throw InvalidRelativePath. May throw InvalidErrorCode. May throw InvalidResponseCode. May throw InvalidArgument. May throw InvalidRequiredProtocol. May throw NoSuchOrigin. May throw TooManyOrigins. May throw TooManyCacheBehaviors. May throw TooManyCookieNamesInWhiteList. May throw InvalidForwardCookies. May throw TooManyHeadersInForwardedValues. May throw InvalidHeadersForS3Origin. May throw InconsistentQuantities. May throw TooManyCertificates. May throw InvalidLocationCode. May throw InvalidGeoRestrictionParameter. May throw InvalidProtocolSettings. May throw InvalidTTLOrder. May throw InvalidWebACLId. May throw TooManyOriginCustomHeaders. May throw TooManyQueryStringParameters. May throw InvalidQueryStringParameters. May throw TooManyDistributionsWithLambdaAssociations. May throw TooManyLambdaFunctionAssociations. May throw InvalidLambdaFunctionAssociation. May throw InvalidOriginReadTimeout. May throw InvalidOriginKeepaliveTimeout.
Parameter distributionConfig
:
The distribution's configuration information.
Implementation
Future<CreateDistributionResult> createDistribution2017_03_25({
required DistributionConfig distributionConfig,
}) async {
ArgumentError.checkNotNull(distributionConfig, 'distributionConfig');
final $result = await _protocol.sendRaw(
method: 'POST',
requestUri: '/2017-03-25/distribution',
payload: distributionConfig.toXml('DistributionConfig'),
exceptionFnMap: _exceptionFns,
);
final $elem = await _s.xmlFromResponse($result);
return CreateDistributionResult(
distribution: Distribution.fromXml($elem),
eTag: _s.extractHeaderStringValue($result.headers, 'ETag'),
location: _s.extractHeaderStringValue($result.headers, 'Location'),
);
}