Skip to content

start_migration async

start_migration(
    *,
    config_overrides: Optional[AsyncElastiCacheClientConfig] = None,
    serverless_cache_name: Optional[String] = None,
    replication_group_id: Optional[String] = None,
    customer_node_endpoint_list: Optional[CustomerNodeEndpointList] = None,
    auto_cutover: Optional[BooleanOptional] = None,
    clear_target_cache_data: Optional[BooleanOptional] = None,
) -> StartMigrationResponse

Starts the migration of data.

Parameters:

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

    The name of the serverless cache to which data is being migrated.

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

    The ID of the replication group to which data should be migrated.

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

    The list of endpoints from which to migrate data. For Valkey or Redis OSS (cluster mode disabled), the list should have only one element. For serverless cache migrations, ElastiCache uses the endpoint that you provided in PrepareMigration.

  • auto_cutover (Optional[BooleanOptional], default: None ) –

    Specifies whether ElastiCache automatically attempts to complete the migration after data sync is established.

  • clear_target_cache_data (Optional[BooleanOptional], default: None ) –

    Specifies whether ElastiCache deletes existing data in the serverless cache before migration begins. After StopMigration, StartMigration requires this option to restart the data sync.

Raises:

Source code in docs_src/capo_elasticache/_services/async_elasti_cache.py
async def start_migration(
    self,
    *,
    config_overrides: Optional[AsyncElastiCacheClientConfig] = None,
    serverless_cache_name: Optional["capo_elasticache.types.string.String"] = None,
    replication_group_id: Optional["capo_elasticache.types.string.String"] = None,
    customer_node_endpoint_list: Optional[
        "capo_elasticache.types.customer_node_endpoint_list.CustomerNodeEndpointList"
    ] = None,
    auto_cutover: Optional[
        "capo_elasticache.types.boolean_optional.BooleanOptional"
    ] = None,
    clear_target_cache_data: Optional[
        "capo_elasticache.types.boolean_optional.BooleanOptional"
    ] = None,
) -> "capo_elasticache.types.start_migration_response.StartMigrationResponse":
    """<p>Starts the migration of data.</p>

    Args:
        serverless_cache_name: <p>The name of the serverless cache to which data is being migrated.</p>
        replication_group_id: <p>The ID of the replication group to which data should be migrated.</p>
        customer_node_endpoint_list: <p>The list of endpoints from which to migrate data. For Valkey or Redis OSS (cluster mode disabled), the list should have only one element. For serverless cache migrations, ElastiCache uses the endpoint that you provided in <code>PrepareMigration</code>.</p>
        auto_cutover: <p>Specifies whether ElastiCache automatically attempts to complete the migration after data sync is established.</p>
        clear_target_cache_data: <p>Specifies whether ElastiCache deletes existing data in the serverless cache before migration begins. After <code>StopMigration</code>, <code>StartMigration</code> requires this option to restart the data sync.</p>

    Raises:
        capo_elasticache.errors.invalid_cache_cluster_state_fault.InvalidCacheClusterStateFault: <p>The requested cluster is not in the <code>available</code> state.</p>
        capo_elasticache.errors.invalid_parameter_combination_exception.InvalidParameterCombinationException: <p>Two or more incompatible parameters were specified.</p>
        capo_elasticache.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value for a parameter is invalid.</p>
        capo_elasticache.errors.invalid_replication_group_state_fault.InvalidReplicationGroupStateFault: <p>The requested replication group is not in the <code>available</code> state.</p>
        capo_elasticache.errors.invalid_serverless_cache_state_fault.InvalidServerlessCacheStateFault: <p>The account for these credentials is not currently active.</p>
        capo_elasticache.errors.migration_health_fault.MigrationHealthFault: <p>The migration is not healthy. Check the events for this serverless cache for more details. For <code>CompleteMigration</code>, set <code>Force</code> to true to bypass this check.</p>
        capo_elasticache.errors.replication_group_already_under_migration_fault.ReplicationGroupAlreadyUnderMigrationFault: <p>The targeted replication group is not available. </p>
        capo_elasticache.errors.replication_group_not_found_fault.ReplicationGroupNotFoundFault: <p>The specified replication group does not exist.</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.serverless_cache_not_under_migration_fault.ServerlessCacheNotUnderMigrationFault: <p>The serverless cache is not currently under migration.</p>
        capo_elasticache.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_elasticache.types.start_migration_message.StartMigrationMessage]",
    ) -> AsyncOperationResponse[
        "capo_elasticache.types.start_migration_response.StartMigrationResponse"
    ]:
        import capo_elasticache._operations.amazon_elasti_cache_v9.start_migration

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartMigration")
    )
    input_: capo_elasticache.types.start_migration_message.StartMigrationMessage = {}
    if serverless_cache_name is not None:
        input_["serverless_cache_name"] = serverless_cache_name
    if replication_group_id is not None:
        input_["replication_group_id"] = replication_group_id
    if customer_node_endpoint_list is not None:
        input_["customer_node_endpoint_list"] = customer_node_endpoint_list
    if auto_cutover is not None:
        input_["auto_cutover"] = auto_cutover
    if clear_target_cache_data is not None:
        input_["clear_target_cache_data"] = clear_target_cache_data

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