airflow.providers.amazon.aws.hooks.dms¶
Attributes¶
Classes¶
Available AWS DMS Task Waiter statuses. |
|
AWS DMS replication task states. |
|
Interact with AWS Database Migration Service (DMS). |
Module Contents¶
- class airflow.providers.amazon.aws.hooks.dms.DmsTaskWaiterStatus[source]¶
-
Available AWS DMS Task Waiter statuses.
- class airflow.providers.amazon.aws.hooks.dms.DmsTaskState[source]¶
-
AWS DMS replication task states.
Source: https://docs.aws.amazon.com/boto3/latest/reference/services/dms/client/modify_replication_task.html
- airflow.providers.amazon.aws.hooks.dms.DMS_MODIFIABLE_STATES: frozenset[DmsTaskState][source]¶
- class airflow.providers.amazon.aws.hooks.dms.DmsHook(*args, **kwargs)[source]¶
Bases:
airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHookInteract with AWS Database Migration Service (DMS).
Provide thin wrapper around
boto3.client("dms").Additional arguments (such as
aws_conn_id) may be specified and are passed down to the underlying AwsBaseHook.- find_replication_tasks_by_arn(replication_task_arn, without_settings=False)[source]¶
Find and describe replication tasks by task ARN.
- create_replication_task(replication_task_id, source_endpoint_arn, target_endpoint_arn, replication_instance_arn, migration_type, table_mappings, **kwargs)[source]¶
Create DMS replication task.
- Parameters:
replication_task_id (str) – Replication task id
source_endpoint_arn (str) – Source endpoint ARN
target_endpoint_arn (str) – Target endpoint ARN
replication_instance_arn (str) – Replication instance ARN
table_mappings (dict) – Table mappings
migration_type (str) – Migration type (‘full-load’|’cdc’|’full-load-and-cdc’), full-load by default.
- Returns:
Replication task ARN
- Return type:
- start_replication_task(replication_task_arn, start_replication_task_type, **kwargs)[source]¶
Start replication task.
- stop_replication_task(replication_task_arn)[source]¶
Stop replication task.
- Parameters:
replication_task_arn – Replication task ARN
- delete_replication_task(replication_task_arn)[source]¶
Start replication task deletion and waits for it to be deleted.
- Parameters:
replication_task_arn – Replication task ARN
- modify_replication_task(replication_task_arn, table_mappings=None, migration_type=None, replication_task_settings=None, cdc_start_time=None, cdc_start_position=None, cdc_stop_position=None)[source]¶
Modify an existing replication task.
- Parameters:
replication_task_arn (str) – Replication task ARN
table_mappings (dict | None) – JSON table mappings dict
migration_type (str | None) – Migration type (‘full-load’|’cdc’|’full-load-and-cdc’)
replication_task_settings (dict | None) – Task settings dict
cdc_start_time (datetime.datetime | None) – Start time for CDC
cdc_start_position (str | None) – CDC start position (checkpoint or LSN/SCN format)
cdc_stop_position (str | None) – CDC stop position
- Returns:
Modified replication task dict
- Return type:
- wait_for_task_status(replication_task_arn, status)[source]¶
Wait for replication task to reach status; supported statuses: deleted, ready, running, stopped.
- Parameters:
status (DmsTaskWaiterStatus) – Status to wait for
replication_task_arn (str) – Replication task ARN
- describe_replication_configs(filters=None, **kwargs)[source]¶
Return list of serverless replication configs.
- create_replication_config(replication_config_id, source_endpoint_arn, target_endpoint_arn, compute_config, replication_type, table_mappings, additional_config_kwargs=None, **kwargs)[source]¶
Create an AWS DMS Serverless configuration that can be used to start an DMS Serverless replication.
- Parameters:
replicationConfigId – Unique identifier used to create a ReplicationConfigArn.
sourceEndpointArn – ARN of the source endpoint
targetEndpointArn – ARN of the target endpoint
computeConfig – Parameters for provisioning an DMS Serverless replication.
replicationType – type of DMS Serverless replication
tableMappings – JSON table mappings
tags – Key-value tag pairs
resourceId – Unique value or name that you set for a given resource that can be used to construct an Amazon Resource Name (ARN) for that resource.
supplementalSettings – JSON settings for specifying supplemental data
replicationSettings – JSON settings for DMS Serverless replications
- Returns:
ReplicationConfigArn
- delete_replication_config(replication_config_arn, delay=60, max_attempts=120)[source]¶
Delete an AWS DMS Serverless configuration.
- Parameters:
replication_config_arn (str) – ReplicationConfigArn