Skip to content

import_snapshot async

import_snapshot(
    snapshot_name: SnapshotV2Name,
    import_source_configuration: ImportSourceConfiguration,
    *,
    config_overrides: Optional[AsyncKinesisAnalyticsV2ClientConfig] = None,
    destination_encryption_configuration: Optional[
        SnapshotEncryptionConfiguration
    ] = None,
    snapshot_description: Optional[SnapshotV2Description] = None,
    snapshot_format: Optional[SnapshotFormat] = None,
    tags: Optional[Tags] = None,
) -> ImportSnapshotResponse

Imports an Apache Flink savepoint from an Amazon S3 location as an enhanced snapshot. Managed Service for Apache Flink assumes the IAM role that you specify in ImportSourceConfiguration to read the savepoint data.

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

For more information, see Import and export.

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.

  • import_source_configuration (ImportSourceConfiguration) –

    Describes the location, IAM role, and encryption configuration of the savepoint data to import.

  • destination_encryption_configuration (Optional[SnapshotEncryptionConfiguration], default: None ) –

    The encryption configuration of the imported snapshot. If you don't specify this parameter, the snapshot is encrypted using a key of type AWS_OWNED_KEY. If you specify a KMS key, you must specify the key ARN.

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

    A summary description of the snapshot.

  • snapshot_format (Optional[SnapshotFormat], default: None ) –

    The format of the snapshot being imported.

  • 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.

  • 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 import_snapshot(
    self,
    snapshot_name: "capo_kinesis_analytics_v2.types.snapshot_v2_name.SnapshotV2Name",
    import_source_configuration: "capo_kinesis_analytics_v2.types.import_source_configuration.ImportSourceConfiguration",
    *,
    config_overrides: Optional[AsyncKinesisAnalyticsV2ClientConfig] = None,
    destination_encryption_configuration: Optional[
        "capo_kinesis_analytics_v2.types.snapshot_encryption_configuration.SnapshotEncryptionConfiguration"
    ] = None,
    snapshot_description: Optional[
        "capo_kinesis_analytics_v2.types.snapshot_v2_description.SnapshotV2Description"
    ] = None,
    snapshot_format: Optional[
        "capo_kinesis_analytics_v2.types.snapshot_format.SnapshotFormat"
    ] = None,
    tags: Optional["capo_kinesis_analytics_v2.types.tags.Tags"] = None,
) -> "capo_kinesis_analytics_v2.types.import_snapshot_response.ImportSnapshotResponse":
    """<p>Imports an Apache Flink savepoint from an Amazon S3 location as an enhanced snapshot. Managed Service for Apache Flink assumes the IAM role that you specify in <code>ImportSourceConfiguration</code> to read the savepoint data.</p> <p>This operation is asynchronous. The response returns the snapshot ARN with the <code>CREATING</code> status. To track the progress of the import, use <code>DescribeSnapshotOperation</code>.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/managed-flink/latest/java/snapshots-import-export.html">Import and export</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>
        import_source_configuration: <p>Describes the location, IAM role, and encryption configuration of the savepoint data to import.</p>
        destination_encryption_configuration: <p>The encryption configuration of the imported snapshot. If you don't specify this parameter, the snapshot is encrypted using a key of type <code>AWS_OWNED_KEY</code>. If you specify a KMS key, you must specify the key ARN.</p>
        snapshot_description: <p>A summary description of the snapshot.</p>
        snapshot_format: <p>The format of the snapshot being imported.</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_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.import_snapshot_request.ImportSnapshotRequest]",
    ) -> AsyncOperationResponse[
        "capo_kinesis_analytics_v2.types.import_snapshot_response.ImportSnapshotResponse"
    ]:
        import capo_kinesis_analytics_v2._operations.kinesis_analytics_20180523.import_snapshot

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ImportSnapshot")
    )
    input_: capo_kinesis_analytics_v2.types.import_snapshot_request.ImportSnapshotRequest = {
        "snapshot_name": snapshot_name,
        "import_source_configuration": import_source_configuration,
    }
    if destination_encryption_configuration is not None:
        input_["destination_encryption_configuration"] = (
            destination_encryption_configuration
        )
    if snapshot_description is not None:
        input_["snapshot_description"] = snapshot_description
    if snapshot_format is not None:
        input_["snapshot_format"] = snapshot_format
    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