delete_streaming_distribution(
id: string,
*,
config_overrides: Optional[CloudFrontClientConfig] = None,
if_match: Optional[string] = None,
) -> None
Delete a streaming distribution. To delete an RTMP distribution using the CloudFront API, perform the following steps.
To delete an RTMP distribution using the CloudFront API:
-
Disable the RTMP distribution.
-
Submit a GET Streaming Distribution Config request to get the current configuration and the Etag header for the distribution.
-
Update the XML document that was returned in the response to your GET Streaming Distribution Config request to change the value of Enabled to false.
-
Submit a PUT Streaming Distribution Config request to update the configuration for your distribution. In the request body, include the XML document that you updated in Step 3. Then set the value of the HTTP If-Match header to the value of the ETag header that CloudFront returned when you submitted the GET Streaming Distribution Config request in Step 2.
-
Review the response to the PUT Streaming Distribution Config request to confirm that the distribution was successfully disabled.
-
Submit a GET Streaming Distribution Config request to confirm that your changes have propagated. When propagation is complete, the value of Status is Deployed.
-
Submit a DELETE Streaming Distribution request. Set the value of the HTTP If-Match header to the value of the ETag header that CloudFront returned when you submitted the GET Streaming Distribution Config request in Step 2.
-
Review the response to your DELETE Streaming Distribution request to confirm that the distribution was successfully deleted.
For information about deleting a distribution using the CloudFront console, see Deleting a Distribution in the Amazon CloudFront Developer Guide.
Parameters:
-
id
(string)
–
-
if_match
(Optional[string], default:
None
)
–
The value of the ETag header that you received when you disabled the streaming distribution. For example: E2QWRUHAPOMQZL.
Raises:
Source code in docs_src/capo_cloudfront/_services/cloud_front.py
| def delete_streaming_distribution(
self,
id: "capo_cloudfront.types.string.string",
*,
config_overrides: Optional[CloudFrontClientConfig] = None,
if_match: Optional["capo_cloudfront.types.string.string"] = None,
) -> None:
"""<p>Delete a streaming distribution. To delete an RTMP distribution using the CloudFront API, perform the following steps.</p> <p> <b>To delete an RTMP distribution using the CloudFront API</b>:</p> <ol> <li> <p>Disable the RTMP distribution.</p> </li> <li> <p>Submit a <code>GET Streaming Distribution Config</code> request to get the current configuration and the <code>Etag</code> header for the distribution. </p> </li> <li> <p>Update the XML document that was returned in the response to your <code>GET Streaming Distribution Config</code> request to change the value of <code>Enabled</code> to <code>false</code>.</p> </li> <li> <p>Submit a <code>PUT Streaming Distribution Config</code> request to update the configuration for your distribution. In the request body, include the XML document that you updated in Step 3. Then set the value of the HTTP <code>If-Match</code> header to the value of the <code>ETag</code> header that CloudFront returned when you submitted the <code>GET Streaming Distribution Config</code> request in Step 2.</p> </li> <li> <p>Review the response to the <code>PUT Streaming Distribution Config</code> request to confirm that the distribution was successfully disabled.</p> </li> <li> <p>Submit a <code>GET Streaming Distribution Config</code> request to confirm that your changes have propagated. When propagation is complete, the value of <code>Status</code> is <code>Deployed</code>.</p> </li> <li> <p>Submit a <code>DELETE Streaming Distribution</code> request. Set the value of the HTTP <code>If-Match</code> header to the value of the <code>ETag</code> header that CloudFront returned when you submitted the <code>GET Streaming Distribution Config</code> request in Step 2.</p> </li> <li> <p>Review the response to your <code>DELETE Streaming Distribution</code> request to confirm that the distribution was successfully deleted.</p> </li> </ol> <p>For information about deleting a distribution using the CloudFront console, see <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/HowToDeleteDistribution.html">Deleting a Distribution</a> in the <i>Amazon CloudFront Developer Guide</i>.</p>
Args:
id: <p>The distribution ID.</p>
if_match: <p>The value of the <code>ETag</code> header that you received when you disabled the streaming distribution. For example: <code>E2QWRUHAPOMQZL</code>.</p>
Raises:
capo_cloudfront.errors.access_denied.AccessDenied: <p>Access denied.</p>
capo_cloudfront.errors.invalid_if_match_version.InvalidIfMatchVersion: <p>The <code>If-Match</code> version is missing or not valid.</p>
capo_cloudfront.errors.no_such_streaming_distribution.NoSuchStreamingDistribution: <p>The specified streaming distribution does not exist.</p>
capo_cloudfront.errors.precondition_failed.PreconditionFailed: <p>The precondition in one or more of the request fields evaluated to <code>false</code>.</p>
capo_cloudfront.errors.streaming_distribution_not_disabled.StreamingDistributionNotDisabled: <p>The specified CloudFront distribution is not disabled. You must disable the distribution before you can delete it.</p>
capo_cloudfront.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_cloudfront.types.delete_streaming_distribution_request.DeleteStreamingDistributionRequest]",
) -> OperationResponse[None]:
import capo_cloudfront._operations.cloudfront2020_05_31.delete_streaming_distribution
output, http_response = (
capo_cloudfront._operations.cloudfront2020_05_31.delete_streaming_distribution.delete_streaming_distribution(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteStreamingDistribution")
)
input_: capo_cloudfront.types.delete_streaming_distribution_request.DeleteStreamingDistributionRequest = {
"id": id
}
if if_match is not None:
input_["if_match"] = if_match
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|