Skip to content

create_snapshot async

create_snapshot(
    application_name: ApplicationName,
    snapshot_name: SnapshotV2Name,
    *,
    config_overrides: Optional[AsyncKinesisAnalyticsV2ClientConfig] = None,
    snapshot_description: Optional[SnapshotV2Description] = None,
    tags: Optional[Tags] = None,
) -> CreateSnapshotResponse

Creates an enhanced snapshot of the state data of a running Managed Service for Apache Flink application. The application must be in the RUNNING status, use Apache Flink version 1.20 or later, and use the ENHANCED_SNAPSHOTS snapshot mode.

This operation is asynchronous. The response returns the snapshot ARN with the CREATING status. To check the status of the snapshot, use DescribeSnapshot. To track the progress of the operation, use DescribeSnapshotOperation.

An application can have only one CreateSnapshot operation in progress at a time. For information about limits, see Managed Service for Apache Flink Quotas. For more information about snapshots, see Enhanced Snapshots.

Parameters:

  • snapshot_name (SnapshotV2Name) –

    The name of the enhanced snapshot. The name must be unique among the snapshots in your account and Region. You can't reuse the name of an existing snapshot, including a snapshot in the FAILED status, until you delete that snapshot. Names that begin with SYSTEMSNAPSHOT are reserved.

  • snapshot_description (Optional[SnapshotV2Description], default: None ) –

    A summary description of the snapshot.

  • tags (Optional[Tags], default: None ) –

    A list of one or more tags to assign to the snapshot. A tag is a key-value pair that identifies a snapshot. For more information, see Using Tagging.

Raises:

  • ConcurrentModificationException –

    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.

  • InvalidApplicationConfigurationException –

    The user-provided application configuration is not valid.

  • InvalidArgumentException –

    The specified input parameter value is not valid.

  • LimitExceededException –

    The number of allowed resources has been exceeded.

  • ResourceInUseException –

    The application or snapshot is not available for this operation.

  • TooManyTagsException –

    Application created with too many tags, or too many tags added to an application. Note that the maximum number of application tags includes system tags. The maximum number of user-defined application tags is 50.

  • UnsupportedOperationException –

    The request was rejected because a specified parameter is not supported or a specified resource is not valid for this operation.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_kinesis_analytics_v2/_services/async_kinesis_analytics_v2.py
async def create_snapshot(
    self,
    application_name: "capo_kinesis_analytics_v2.types.application_name.ApplicationName",
    snapshot_name: "capo_kinesis_analytics_v2.types.snapshot_v2_name.SnapshotV2Name",
    *,
    config_overrides: Optional[AsyncKinesisAnalyticsV2ClientConfig] = None,
    snapshot_description: Optional[
        "capo_kinesis_analytics_v2.types.snapshot_v2_description.SnapshotV2Description"
    ] = None,
    tags: Optional["capo_kinesis_analytics_v2.types.tags.Tags"] = None,
) -> "capo_kinesis_analytics_v2.types.create_snapshot_response.CreateSnapshotResponse":
    """<p>Creates an enhanced snapshot of the state data of a running Managed Service for Apache Flink application. The application must be in the <code>RUNNING</code> status, use Apache Flink version 1.20 or later, and use the <code>ENHANCED_SNAPSHOTS</code> snapshot mode.</p> <p>This operation is asynchronous. The response returns the snapshot ARN with the <code>CREATING</code> status. To check the status of the snapshot, use <code>DescribeSnapshot</code>. To track the progress of the operation, use <code>DescribeSnapshotOperation</code>.</p> <p>An application can have only one <code>CreateSnapshot</code> operation in progress at a time. For information about limits, see <a href="https://docs.aws.amazon.com/managed-flink/latest/java/limits.html">Managed Service for Apache Flink Quotas</a>. For more information about snapshots, see <a href="https://docs.aws.amazon.com/managed-flink/latest/java/how-snapshots.html">Enhanced Snapshots</a>.</p>

    Args:
        snapshot_name: <p>The name of the enhanced snapshot. The name must be unique among the snapshots in your account and Region. You can't reuse the name of an existing snapshot, including a snapshot in the <code>FAILED</code> status, until you delete that snapshot. Names that begin with <code>SYSTEMSNAPSHOT</code> are reserved.</p>
        snapshot_description: <p>A summary description of the snapshot.</p>
        tags: <p>A list of one or more tags to assign to the snapshot. A tag is a key-value pair that identifies a snapshot. For more information, see <a href="https://docs.aws.amazon.com/kinesisanalytics/latest/java/how-tagging.html">Using Tagging</a>.</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_application_configuration_exception.InvalidApplicationConfigurationException: <p>The user-provided application configuration is not valid.</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.limit_exceeded_exception.LimitExceededException: <p>The number of allowed resources has been exceeded.</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.too_many_tags_exception.TooManyTagsException: <p>Application created with too many tags, or too many tags added to an application. Note that the maximum number of application tags includes system tags. The maximum number of user-defined application tags is 50.</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.create_snapshot_request.CreateSnapshotRequest]",
    ) -> AsyncOperationResponse[
        "capo_kinesis_analytics_v2.types.create_snapshot_response.CreateSnapshotResponse"
    ]:
        import capo_kinesis_analytics_v2._operations.kinesis_analytics_20180523.create_snapshot

        (
            output,
            http_response,
        ) = await capo_kinesis_analytics_v2._operations.kinesis_analytics_20180523.create_snapshot.async_create_snapshot(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateSnapshot")
    )
    input_: capo_kinesis_analytics_v2.types.create_snapshot_request.CreateSnapshotRequest = {
        "application_name": application_name,
        "snapshot_name": snapshot_name,
    }
    if snapshot_description is not None:
        input_["snapshot_description"] = snapshot_description
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output