Deletes an enhanced snapshot. Snapshots are not scoped to an application, so you can delete a snapshot independently of the application that it was created from.
This operation is asynchronous. The response returns the snapshot ARN with the DELETING status. To track the progress of the operation, use DescribeSnapshotOperation.
You can delete a snapshot in the READY or FAILED status. If a snapshot operation, such as an export, uses the snapshot, Managed Service for Apache Flink waits for that operation to finish before it deletes the snapshot. For a snapshot in any other status, ResourceInUseException is returned.
Parameters:
-
snapshot_name
(SnapshotV2Name)
–
The name of the enhanced snapshot to delete.
-
snapshot_creation_timestamp
(Timestamp)
–
The creation timestamp of the enhanced snapshot to delete. Use the DescribeSnapshot operation to get this value.
Raises:
Source code in docs_src/capo_kinesis_analytics_v2/_services/async_kinesis_analytics_v2.py
| async def delete_snapshot(
self,
snapshot_name: "capo_kinesis_analytics_v2.types.snapshot_v2_name.SnapshotV2Name",
snapshot_creation_timestamp: "capo_kinesis_analytics_v2.types.timestamp.Timestamp",
*,
config_overrides: Optional[AsyncKinesisAnalyticsV2ClientConfig] = None,
) -> "capo_kinesis_analytics_v2.types.delete_snapshot_response.DeleteSnapshotResponse":
"""<p>Deletes an enhanced snapshot. Snapshots are not scoped to an application, so you can delete a snapshot independently of the application that it was created from.</p> <p>This operation is asynchronous. The response returns the snapshot ARN with the <code>DELETING</code> status. To track the progress of the operation, use <code>DescribeSnapshotOperation</code>.</p> <p>You can delete a snapshot in the <code>READY</code> or <code>FAILED</code> status. If a snapshot operation, such as an export, uses the snapshot, Managed Service for Apache Flink waits for that operation to finish before it deletes the snapshot. For a snapshot in any other status, <code>ResourceInUseException</code> is returned.</p>
Args:
snapshot_name: <p>The name of the enhanced snapshot to delete.</p>
snapshot_creation_timestamp: <p>The creation timestamp of the enhanced snapshot to delete. Use the <code>DescribeSnapshot</code> operation to get this value.</p>
Raises:
capo_kinesis_analytics_v2.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Exception thrown as a result of concurrent modifications to an application or snapshot. This error can be the result of attempting to modify an application without using the current application ID.</p>
capo_kinesis_analytics_v2.errors.invalid_argument_exception.InvalidArgumentException: <p>The specified input parameter value is not valid.</p>
capo_kinesis_analytics_v2.errors.resource_in_use_exception.ResourceInUseException: <p>The application or snapshot is not available for this operation.</p>
capo_kinesis_analytics_v2.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified application, snapshot, or snapshot operation can't be found.</p>
capo_kinesis_analytics_v2.errors.unsupported_operation_exception.UnsupportedOperationException: <p>The request was rejected because a specified parameter is not supported or a specified resource is not valid for this operation. </p>
capo_kinesis_analytics_v2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_kinesis_analytics_v2.types.delete_snapshot_request.DeleteSnapshotRequest]",
) -> AsyncOperationResponse[
"capo_kinesis_analytics_v2.types.delete_snapshot_response.DeleteSnapshotResponse"
]:
import capo_kinesis_analytics_v2._operations.kinesis_analytics_20180523.delete_snapshot
(
output,
http_response,
) = await capo_kinesis_analytics_v2._operations.kinesis_analytics_20180523.delete_snapshot.async_delete_snapshot(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteSnapshot")
)
input_: capo_kinesis_analytics_v2.types.delete_snapshot_request.DeleteSnapshotRequest = {
"snapshot_name": snapshot_name,
"snapshot_creation_timestamp": snapshot_creation_timestamp,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|