airflow.providers.amazon.aws.operators.dms

DmsCreateTaskOperator

建立 AWS DMS 複製任務。

DmsDeleteTaskOperator

刪除 AWS DMS 複製任務。

DmsDescribeTasksOperator

描述 AWS DMS 複製任務。

DmsStartTaskOperator

啟動 AWS DMS 複製任務。

DmsStopTaskOperator

停止 AWS DMS 複製任務。

DmsDescribeReplicationConfigsOperator

描述 AWS DMS Serverless 複製配置。

DmsCreateReplicationConfigOperator

建立 AWS DMS Serverless 複製配置。

DmsDeleteReplicationConfigOperator

刪除 AWS DMS Serverless 複製配置。

DmsDescribeReplicationsOperator

描述 AWS DMS Serverless 複製。

DmsStartReplicationOperator

啟動 AWS DMS Serverless 複製。

DmsStopReplicationOperator

停止 AWS DMS Serverless 複製。

模組內容

class airflow.providers.amazon.aws.operators.dms.DmsCreateTaskOperator(*, replication_task_id, source_endpoint_arn, target_endpoint_arn, replication_instance_arn, table_mappings, migration_type='full-load', create_task_kwargs=None, aws_conn_id='aws_default', **kwargs)[source]

Bases: airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.dms.DmsHook]

建立 AWS DMS 複製任務。

另請參閱

有關如何使用此 operator 的更多資訊,請參閱指南:建立複製任務

引數:
  • replication_task_id (str) – 複製任務 ID

  • source_endpoint_arn (str) – 源端點 ARN

  • target_endpoint_arn (str) – 目標端點 ARN

  • replication_instance_arn (str) – 複製例項 ARN

  • table_mappings (dict) – 表對映

  • migration_type (str) – 遷移型別 ('full-load'|'cdc'|'full-load-and-cdc'),預設為 full-load。

  • create_task_kwargs (dict | None) – 用於建立 DMS 複製任務的額外引數。

  • aws_conn_id (str | None) – 用於 AWS 憑據的 Airflow 連線。如果為 None 或空,則使用預設的 boto3 行為。如果在分散式環境中執行 Airflow 且 aws_conn_id 為 None 或空,則會使用預設的 boto3 配置(並且必須在每個 worker 節點上維護)。

  • region_name – AWS region_name。如果未指定,則使用預設的 boto3 行為。

  • verify – 是否驗證 SSL 證書。參見:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html

  • botocore_config – botocore 客戶端的配置字典(鍵值對)。參見:https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html

aws_hook_class[source]
template_fields: collections.abc.Sequence[str][source]
template_fields_renderers: ClassVar[dict][source]
replication_task_id[source]
source_endpoint_arn[source]
target_endpoint_arn[source]
replication_instance_arn[source]
migration_type = 'full-load'[source]
table_mappings[source]
create_task_kwargs[source]
aws_conn_id = 'aws_default'[source]
execute(context)[source]

從 Airflow 建立 AWS DMS 複製任務。

返回:

複製任務 ARN

class airflow.providers.amazon.aws.operators.dms.DmsDeleteTaskOperator(*, replication_task_arn=None, **kwargs)[source]

Bases: airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.dms.DmsHook]

刪除 AWS DMS 複製任務。

另請參閱

有關如何使用此 operator 的更多資訊,請參閱指南:刪除複製任務

引數:
aws_hook_class[source]
template_fields: collections.abc.Sequence[str][source]
replication_task_arn = None[source]
execute(context)[source]

從 Airflow 刪除 AWS DMS 複製任務。

返回:

複製任務 ARN

class airflow.providers.amazon.aws.operators.dms.DmsDescribeTasksOperator(*, describe_tasks_kwargs=None, **kwargs)[source]

Bases: airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.dms.DmsHook]

描述 AWS DMS 複製任務。

另請參閱

有關如何使用此 operator 的更多資訊,請參閱指南:獲取複製任務詳細資訊

引數:
aws_hook_class[source]
template_fields: collections.abc.Sequence[str][source]
template_fields_renderers: ClassVar[dict[str, str]][source]
describe_tasks_kwargs[source]
execute(context)[source]

從 Airflow 描述 AWS DMS 複製任務。

返回:

標記和複製任務列表

返回型別:

tuple[str | None, list]

class airflow.providers.amazon.aws.operators.dms.DmsStartTaskOperator(*, replication_task_arn, start_replication_task_type='start-replication', start_task_kwargs=None, aws_conn_id='aws_default', **kwargs)[source]

Bases: airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.dms.DmsHook]

啟動 AWS DMS 複製任務。

另請參閱

有關如何使用此 operator 的更多資訊,請參閱指南:啟動複製任務

引數:
  • replication_task_arn (str) – 複製任務 ARN

  • start_replication_task_type (str) – 複製任務啟動型別 (預設='start-replication') ('start-replication'|'resume-processing'|'reload-target')

  • start_task_kwargs (dict | None) – 額外的啟動複製任務引數

  • aws_conn_id (str | None) – 用於 AWS 憑據的 Airflow 連線。如果為 None 或空,則使用預設的 boto3 行為。如果在分散式環境中執行 Airflow 且 aws_conn_id 為 None 或空,則會使用預設的 boto3 配置(並且必須在每個 worker 節點上維護)。

  • region_name – AWS region_name。如果未指定,則使用預設的 boto3 行為。

  • verify – 是否驗證 SSL 證書。參見:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html

  • botocore_config – botocore 客戶端的配置字典(鍵值對)。參見:https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html

aws_hook_class[source]
template_fields: collections.abc.Sequence[str][source]
template_fields_renderers[source]
replication_task_arn[source]
start_replication_task_type = 'start-replication'[source]
start_task_kwargs[source]
aws_conn_id = 'aws_default'[source]
execute(context)[source]

從 Airflow 啟動 AWS DMS 複製任務。

class airflow.providers.amazon.aws.operators.dms.DmsStopTaskOperator(*, replication_task_arn=None, **kwargs)[source]

Bases: airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.dms.DmsHook]

停止 AWS DMS 複製任務。

另請參閱

有關如何使用此 operator 的更多資訊,請參閱指南:停止複製任務

引數:
aws_hook_class[source]
template_fields: collections.abc.Sequence[str][source]
replication_task_arn = None[source]
execute(context)[source]

從 Airflow 停止 AWS DMS 複製任務。

class airflow.providers.amazon.aws.operators.dms.DmsDescribeReplicationConfigsOperator(*, filter=None, aws_conn_id='aws_default', **kwargs)[source]

Bases: airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.dms.DmsHook]

描述 AWS DMS Serverless 複製配置。

另請參閱

有關如何使用此 operator 的更多資訊,請參閱指南:描述無伺服器複製配置

引數:
  • describe_config_filter – 用於過濾結果的過濾器塊。

  • aws_conn_id (str | None) – 用於 AWS 憑據的 Airflow 連線。如果為 None 或空,則使用預設的 boto3 行為。如果在分散式環境中執行 Airflow 且 aws_conn_id 為 None 或空,則將使用預設的 boto3 配置(且必須在每個 worker 節點上維護)。

aws_hook_class[source]
template_fields: collections.abc.Sequence[str][source]
template_fields_renderers[source]
filter = None[source]
execute(context)[source]

描述 AWS DMS 複製配置。

返回:

複製配置列表

返回型別:

list

class airflow.providers.amazon.aws.operators.dms.DmsCreateReplicationConfigOperator(*, replication_config_id, source_endpoint_arn, target_endpoint_arn, compute_config, replication_type, table_mappings, additional_config_kwargs=None, aws_conn_id='aws_default', **kwargs)[原始碼]

Bases: airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.dms.DmsHook]

建立 AWS DMS Serverless 複製配置。

另請參閱

有關如何使用此 operator 的更多資訊,請參閱指南:建立無伺服器複製配置

引數:
  • replication_config_id (str) – 用於建立 ReplicationConfigArn 的唯一識別符號。

  • source_endpoint_arn (str) – 源端點的 ARN

  • target_endpoint_arn (str) – 目標端點的 ARN

  • compute_config (dict[str, Any]) – 用於預置 DMS 無伺服器複製的引數。

  • replication_type (str) – DMS 無伺服器複製的型別

  • table_mappings (str) – JSON 表對映

  • tags – 鍵值標籤對

  • additional_config_kwargs (dict | None) – DMS 無伺服器複製的附加配置引數。直接傳遞給 API

  • aws_conn_id (str | None) – 用於 AWS 憑據的 Airflow 連線。如果為 None 或空,則使用預設的 boto3 行為。如果在分散式環境中執行 Airflow 且 aws_conn_id 為 None 或空,則將使用預設的 boto3 配置(且必須在每個 worker 節點上維護)。

aws_hook_class[原始碼]
template_fields: collections.abc.Sequence[str][原始碼]
template_fields_renderers[原始碼]
replication_config_id[原始碼]
source_endpoint_arn[原始碼]
target_endpoint_arn[原始碼]
compute_config[原始碼]
replication_type[原始碼]
table_mappings[原始碼]
additional_config_kwargs[原始碼]
execute(context)[原始碼]

建立 operator 時派生。

Context 是用於渲染 jinja 模板的同一字典。

有關更多上下文,請參閱 get_template_context。

class airflow.providers.amazon.aws.operators.dms.DmsDeleteReplicationConfigOperator(*, replication_config_arn, wait_for_completion=True, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), waiter_delay=60, waiter_max_attempts=60, aws_conn_id='aws_default', **kwargs)[原始碼]

Bases: airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.dms.DmsHook]

刪除 AWS DMS Serverless 複製配置。

另請參閱

有關如何使用此 operator 的更多資訊,請參閱指南:刪除無伺服器複製配置

引數:
  • replication_config_arn (str) – 複製配置的 ARN

  • wait_for_completion (bool) – 如果為 True,則等待複製配置被刪除後才返回。如果為 False,則 operator 在發出請求後立即返回。

  • deferrable (bool) – 在可推遲模式下執行 operator。

  • waiter_delay (int) – 兩次重試之間的等待秒數(預設值:60)。

  • waiter_max_attempts (int) – 最大嘗試次數(預設值:60)。

  • aws_conn_id (str | None) – 用於 AWS 憑據的 Airflow 連線。如果為 None 或空,則使用預設的 boto3 行為。如果在分散式環境中執行 Airflow 且 aws_conn_id 為 None 或空,則將使用預設的 boto3 配置(且必須在每個 worker 節點上維護)。

aws_hook_class[原始碼]
template_fields: collections.abc.Sequence[str][原始碼]
VALID_STATES = ['failed', 'stopped', 'created'][原始碼]
DELETING_STATES = ['deleting'][原始碼]
TERMINAL_PROVISION_STATES = ['deprovisioned', ''][原始碼]
replication_config_arn[原始碼]
wait_for_completion = True[原始碼]
deferrable = True[原始碼]
waiter_delay = 60[原始碼]
waiter_max_attempts = 60[原始碼]
execute(context)[原始碼]

建立 operator 時派生。

Context 是用於渲染 jinja 模板的同一字典。

有關更多上下文,請參閱 get_template_context。

handle_delete_wait()[原始碼]
execute_complete(context, event=None)[原始碼]
retry_execution(context, event=None)[原始碼]
class airflow.providers.amazon.aws.operators.dms.DmsDescribeReplicationsOperator(*, filter=None, aws_conn_id='aws_default', **kwargs)[原始碼]

Bases: airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.dms.DmsHook]

描述 AWS DMS Serverless 複製。

另請參閱

有關如何使用此 operator 的更多資訊,請參閱指南:獲取無伺服器複製的狀態

引數:
  • filter (list[dict[str, Any]] | None) – 用於過濾結果的過濾器塊。

  • aws_conn_id (str | None) – 用於 AWS 憑據的 Airflow 連線。如果為 None 或空,則使用預設的 boto3 行為。如果在分散式環境中執行 Airflow 且 aws_conn_id 為 None 或空,則將使用預設的 boto3 配置(且必須在每個 worker 節點上維護)。

aws_hook_class[原始碼]
template_fields: collections.abc.Sequence[str][原始碼]
template_fields_renderer[原始碼]
filter = None[原始碼]
execute(context)[原始碼]

描述 AWS DMS 複製。

返回:

複製(Replications)

返回型別:

list[dict[str, Any]]

class airflow.providers.amazon.aws.operators.dms.DmsStartReplicationOperator(*, replication_config_arn, replication_start_type, cdc_start_time=None, cdc_start_pos=None, cdc_stop_pos=None, wait_for_completion=True, waiter_delay=30, waiter_max_attempts=60, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), aws_conn_id='aws_default', **kwargs)[原始碼]

Bases: airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.dms.DmsHook]

啟動 AWS DMS Serverless 複製。

另請參閱

有關如何使用此 operator 的更多資訊,請參閱指南:啟動無伺服器複製

引數:
  • replication_config_arn (str) – 複製配置的 ARN

  • replication_start_type (str) – 複製型別。

  • cdc_start_time (datetime.datetime | str | None) – CDC 的開始時間

  • cdc_start_pos (str | None) – 指示 CDC 何時開始。

  • cdc_stop_pos (str | None) – 指示 CDC 何時停止。

  • aws_conn_id (str | None) – 用於 AWS 憑據的 Airflow 連線。如果為 None 或空,則使用預設的 boto3 行為。如果在分散式環境中執行 Airflow 且 aws_conn_id 為 None 或空,則將使用預設的 boto3 配置(且必須在每個 worker 節點上維護)。

RUNNING_STATES = ['running'][原始碼]
STARTABLE_STATES = ['stopped', 'failed', 'created'][原始碼]
TERMINAL_STATES = ['failed', 'stopped', 'created'][原始碼]
TERMINAL_PROVISION_STATES = ['deprovisioned', ''][原始碼]
aws_hook_class[原始碼]
template_fields: collections.abc.Sequence[str][原始碼]
replication_config_arn[原始碼]
replication_start_type[原始碼]
cdc_start_time = None[原始碼]
cdc_start_pos = None[原始碼]
cdc_stop_pos = None[原始碼]
deferrable = True[原始碼]
waiter_delay = 30[原始碼]
waiter_max_attempts = 60[原始碼]
wait_for_completion = True[原始碼]
execute(context)[原始碼]

建立 operator 時派生。

Context 是用於渲染 jinja 模板的同一字典。

有關更多上下文,請參閱 get_template_context。

execute_complete(context, event=None)[原始碼]
retry_execution(context, event=None)[原始碼]
class airflow.providers.amazon.aws.operators.dms.DmsStopReplicationOperator(*, replication_config_arn, wait_for_completion=True, waiter_delay=30, waiter_max_attempts=60, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), aws_conn_id='aws_default', **kwargs)[原始碼]

Bases: airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.dms.DmsHook]

停止 AWS DMS Serverless 複製。

另請參閱

有關如何使用此 operator 的更多資訊,請參閱指南: 停止無伺服器複製

引數:
  • replication_config_arn (str) – 複製配置的 ARN

  • aws_conn_id (str | None) – 用於 AWS 憑據的 Airflow 連線。如果為 None 或空,則使用預設的 boto3 行為。如果在分散式環境中執行 Airflow 且 aws_conn_id 為 None 或空,則將使用預設的 boto3 配置(且必須在每個 worker 節點上維護)。

STOPPED_STATES = ['stopped'][source]
NON_STOPPABLE_STATES = ['stopped'][source]
aws_hook_class[source]
template_fields: collections.abc.Sequence[str][source]
replication_config_arn[source]
wait_for_completion = True[source]
waiter_delay = 30[source]
waiter_max_attempts = 60[source]
deferrable = True[source]
execute(context)[source]

建立 operator 時派生。

Context 是用於渲染 jinja 模板的同一字典。

有關更多上下文,請參閱 get_template_context。

execute_complete(context, event=None)[source]

此條目是否有幫助?