Skip to content

prepare_migration async

prepare_migration(
    *,
    config_overrides: Optional[AsyncElastiCacheClientConfig] = None,
    serverless_cache_name: Optional[String] = None,
    customer_node_endpoint_list: Optional[CustomerNodeEndpointList] = None,
    source_authentication_configuration: Optional[
        SourceAuthenticationConfiguration
    ] = None,
    source_tls_configuration: Optional[SourceTlsConfiguration] = None,
) -> PrepareMigrationResponse

Prepares the serverless cache for data migration by validating the configuration and setting up the migration resources.

Parameters:

  • serverless_cache_name (Optional[String], default: None ) –

    The name of the serverless cache to prepare for migration.

  • customer_node_endpoint_list (Optional[CustomerNodeEndpointList], default: None ) –

    The list of endpoints from which to migrate data. For serverless cache migrations, the list should have only one element.

  • source_authentication_configuration (Optional[SourceAuthenticationConfiguration], default: None ) –

    The authentication configuration for connecting to the source during migration.

  • source_tls_configuration (Optional[SourceTlsConfiguration], default: None ) –

    The TLS configuration for connecting to the source during migration.

Raises:

Source code in docs_src/capo_elasticache/_services/async_elasti_cache.py
async def prepare_migration(
    self,
    *,
    config_overrides: Optional[AsyncElastiCacheClientConfig] = None,
    serverless_cache_name: Optional["capo_elasticache.types.string.String"] = None,
    customer_node_endpoint_list: Optional[
        "capo_elasticache.types.customer_node_endpoint_list.CustomerNodeEndpointList"
    ] = None,
    source_authentication_configuration: Optional[
        "capo_elasticache.types.source_authentication_configuration.SourceAuthenticationConfiguration"
    ] = None,
    source_tls_configuration: Optional[
        "capo_elasticache.types.source_tls_configuration.SourceTlsConfiguration"
    ] = None,
) -> "capo_elasticache.types.prepare_migration_response.PrepareMigrationResponse":
    """<p>Prepares the serverless cache for data migration by validating the configuration and setting up the migration resources.</p>

    Args:
        serverless_cache_name: <p>The name of the serverless cache to prepare for migration.</p>
        customer_node_endpoint_list: <p>The list of endpoints from which to migrate data. For serverless cache migrations, the list should have only one element.</p>
        source_authentication_configuration: <p>The authentication configuration for connecting to the source during migration.</p>
        source_tls_configuration: <p>The TLS configuration for connecting to the source during migration.</p>

    Raises:
        capo_elasticache.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value for a parameter is invalid.</p>
        capo_elasticache.errors.invalid_serverless_cache_state_fault.InvalidServerlessCacheStateFault: <p>The account for these credentials is not currently active.</p>
        capo_elasticache.errors.serverless_cache_already_under_migration_fault.ServerlessCacheAlreadyUnderMigrationFault: <p>A migration is already in progress for this serverless cache. You cannot start another migration until the current one completes.</p>
        capo_elasticache.errors.serverless_cache_not_found_fault.ServerlessCacheNotFoundFault: <p>The serverless cache was not found or does not exist.</p>
        capo_elasticache.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_elasticache.types.prepare_migration_request.PrepareMigrationRequest]",
    ) -> AsyncOperationResponse[
        "capo_elasticache.types.prepare_migration_response.PrepareMigrationResponse"
    ]:
        import capo_elasticache._operations.amazon_elasti_cache_v9.prepare_migration

        (
            output,
            http_response,
        ) = await capo_elasticache._operations.amazon_elasti_cache_v9.prepare_migration.async_prepare_migration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PrepareMigration")
    )
    input_: capo_elasticache.types.prepare_migration_request.PrepareMigrationRequest = {}
    if serverless_cache_name is not None:
        input_["serverless_cache_name"] = serverless_cache_name
    if customer_node_endpoint_list is not None:
        input_["customer_node_endpoint_list"] = customer_node_endpoint_list
    if source_authentication_configuration is not None:
        input_["source_authentication_configuration"] = (
            source_authentication_configuration
        )
    if source_tls_configuration is not None:
        input_["source_tls_configuration"] = source_tls_configuration

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