Skip to content

modify_data_migration async

modify_data_migration(
    data_migration_identifier: String,
    *,
    config_overrides: Optional[AsyncDatabaseMigrationServiceClientConfig] = None,
    data_migration_name: Optional[String] = None,
    enable_cloudwatch_logs: Optional[BooleanOptional] = None,
    service_access_role_arn: Optional[String] = None,
    data_migration_type: Optional[MigrationTypeValue] = None,
    source_data_settings: Optional[SourceDataSettings] = None,
    target_data_settings: Optional[TargetDataSettings] = None,
    number_of_jobs: Optional[IntegerOptional] = None,
    selection_rules: Optional[SecretString] = None,
) -> ModifyDataMigrationResponse

Modifies an existing DMS data migration.

Parameters:

  • data_migration_identifier (String) –

    The identifier (name or ARN) of the data migration to modify.

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

    The new name for the data migration.

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

    Whether to enable Cloudwatch logs for the data migration.

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

    The new service access role ARN for the data migration.

  • data_migration_type (Optional[MigrationTypeValue], default: None ) –

    The new migration type for the data migration.

  • source_data_settings (Optional[SourceDataSettings], default: None ) –

    The new information about the source data provider for the data migration.

  • target_data_settings (Optional[TargetDataSettings], default: None ) –

    The new information about the target data provider for the data migration.

  • number_of_jobs (Optional[IntegerOptional], default: None ) –

    The number of parallel jobs that trigger parallel threads to unload the tables from the source, and then load them to the target.

  • selection_rules (Optional[SecretString], default: None ) –

    A JSON-formatted string that defines what objects to include and exclude from the migration.

Raises:

Source code in docs_src/capo_database_migration_service/_services/async_database_migration_service.py
async def modify_data_migration(
    self,
    data_migration_identifier: "capo_database_migration_service.types.string.String",
    *,
    config_overrides: Optional[AsyncDatabaseMigrationServiceClientConfig] = None,
    data_migration_name: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
    enable_cloudwatch_logs: Optional[
        "capo_database_migration_service.types.boolean_optional.BooleanOptional"
    ] = None,
    service_access_role_arn: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
    data_migration_type: Optional[
        "capo_database_migration_service.types.migration_type_value.MigrationTypeValue"
    ] = None,
    source_data_settings: Optional[
        "capo_database_migration_service.types.source_data_settings.SourceDataSettings"
    ] = None,
    target_data_settings: Optional[
        "capo_database_migration_service.types.target_data_settings.TargetDataSettings"
    ] = None,
    number_of_jobs: Optional[
        "capo_database_migration_service.types.integer_optional.IntegerOptional"
    ] = None,
    selection_rules: Optional[
        "capo_database_migration_service.types.secret_string.SecretString"
    ] = None,
) -> "capo_database_migration_service.types.modify_data_migration_response.ModifyDataMigrationResponse":
    """<p>Modifies an existing DMS data migration.</p>

    Args:
        data_migration_identifier: <p>The identifier (name or ARN) of the data migration to modify.</p>
        data_migration_name: <p>The new name for the data migration.</p>
        enable_cloudwatch_logs: <p>Whether to enable Cloudwatch logs for the data migration.</p>
        service_access_role_arn: <p>The new service access role ARN for the data migration.</p>
        data_migration_type: <p>The new migration type for the data migration.</p>
        source_data_settings: <p>The new information about the source data provider for the data migration.</p>
        target_data_settings: <p>The new information about the target data provider for the data migration.</p>
        number_of_jobs: <p>The number of parallel jobs that trigger parallel threads to unload the tables from the source, and then load them to the target.</p>
        selection_rules: <p>A JSON-formatted string that defines what objects to include and exclude from the migration.</p>

    Raises:
        capo_database_migration_service.errors.failed_dependency_fault.FailedDependencyFault: <p>A dependency threw an exception.</p>
        capo_database_migration_service.errors.invalid_resource_state_fault.InvalidResourceStateFault: <p>The resource is in a state that prevents it from being used for database migration.</p>
        capo_database_migration_service.errors.resource_not_found_fault.ResourceNotFoundFault: <p>The resource could not be found.</p>
        capo_database_migration_service.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_database_migration_service.types.modify_data_migration_message.ModifyDataMigrationMessage]",
    ) -> AsyncOperationResponse[
        "capo_database_migration_service.types.modify_data_migration_response.ModifyDataMigrationResponse"
    ]:
        import capo_database_migration_service._operations.amazon_dm_sv20160101.modify_data_migration

        (
            output,
            http_response,
        ) = await capo_database_migration_service._operations.amazon_dm_sv20160101.modify_data_migration.async_modify_data_migration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_database_migration_service.types.modify_data_migration_message.ModifyDataMigrationMessage",
    ) -> dict[str, Any]:
        import capo_database_migration_service.types.modify_data_migration_message

        return capo_database_migration_service.types.modify_data_migration_message.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_database_migration_service.types.modify_data_migration_response.ModifyDataMigrationResponse",
    ) -> dict[str, Any]:
        import capo_database_migration_service.types.modify_data_migration_response

        return capo_database_migration_service.types.modify_data_migration_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "ModifyDataMigration",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_database_migration_service.types.modify_data_migration_message.ModifyDataMigrationMessage = {
        "data_migration_identifier": data_migration_identifier
    }
    if data_migration_name is not None:
        input_["data_migration_name"] = data_migration_name
    if enable_cloudwatch_logs is not None:
        input_["enable_cloudwatch_logs"] = enable_cloudwatch_logs
    if service_access_role_arn is not None:
        input_["service_access_role_arn"] = service_access_role_arn
    if data_migration_type is not None:
        input_["data_migration_type"] = data_migration_type
    if source_data_settings is not None:
        input_["source_data_settings"] = source_data_settings
    if target_data_settings is not None:
        input_["target_data_settings"] = target_data_settings
    if number_of_jobs is not None:
        input_["number_of_jobs"] = number_of_jobs
    if selection_rules is not None:
        input_["selection_rules"] = selection_rules

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