airflow.providers.amazon.aws.hooks.ecs

EcsClusterStates

包含 ECS 集群可能的状态值。

EcsTaskDefinitionStates

包含 ECS 任务定义可能的状态值。

EcsTaskStates

包含 ECS 任务可能的状态值。

EcsHook

与 Amazon Elastic Container Service (ECS) 交互。

EcsProtocol

boto3.client('ecs') 的结构化协议。

函数

should_retry(exception)

检查异常是否与 ECS 资源配额 (CPU, MEM) 相关。

should_retry_eni(exception)

检查异常是否与 ENI (弹性网络接口) 相关。

模块内容

airflow.providers.amazon.aws.hooks.ecs.should_retry(exception)[source]

检查异常是否与 ECS 资源配额 (CPU, MEM) 相关。

airflow.providers.amazon.aws.hooks.ecs.should_retry_eni(exception)[source]

检查异常是否与 ENI (弹性网络接口) 相关。

class airflow.providers.amazon.aws.hooks.ecs.EcsClusterStates[source]

Bases: airflow.providers.amazon.aws.utils._StringCompareEnum

包含 ECS 集群可能的状态值。

ACTIVE = 'ACTIVE'[source]
PROVISIONING = 'PROVISIONING'[source]
DEPROVISIONING = 'DEPROVISIONING'[source]
FAILED = 'FAILED'[source]
INACTIVE = 'INACTIVE'[source]
class airflow.providers.amazon.aws.hooks.ecs.EcsTaskDefinitionStates[source]

Bases: airflow.providers.amazon.aws.utils._StringCompareEnum

包含 ECS 任务定义可能的状态值。

ACTIVE = 'ACTIVE'[source]
INACTIVE = 'INACTIVE'[source]
DELETE_IN_PROGRESS = 'DELETE_IN_PROGRESS'[source]
class airflow.providers.amazon.aws.hooks.ecs.EcsTaskStates[source]

Bases: airflow.providers.amazon.aws.utils._StringCompareEnum

包含 ECS 任务可能的状态值。

PROVISIONING = 'PROVISIONING'[source]
PENDING = 'PENDING'[source]
ACTIVATING = 'ACTIVATING'[source]
RUNNING = 'RUNNING'[source]
DEACTIVATING = 'DEACTIVATING'[source]
STOPPING = 'STOPPING'[source]
DEPROVISIONING = 'DEPROVISIONING'[source]
STOPPED = 'STOPPED'[source]
NONE = 'NONE'[source]
class airflow.providers.amazon.aws.hooks.ecs.EcsHook(*args, **kwargs)[source]

Bases: airflow.providers.amazon.aws.hooks.base_aws.AwsGenericHook

与 Amazon Elastic Container Service (ECS) 交互。

boto3.client("ecs") 提供精简封装。

可以指定其他参数(例如 aws_conn_id),这些参数将传递给底层的 AwsBaseHook。

get_cluster_state(cluster_name)[source]

获取 ECS 集群状态。

参数:

cluster_name (str) – ECS 集群名称或完整的集群 Amazon Resource Name (ARN) 条目。

get_task_definition_state(task_definition)[source]

获取 ECS 任务定义状态。

参数:

task_definition (str) – 最新 ACTIVE 版本的族,或特定版本的族和版本(family:revision),或要描述的任务定义的完整 Amazon Resource Name (ARN)。

get_task_state(cluster, task)[source]

获取 ECS 任务状态。

参数:
  • cluster – 托管要描述的一个或多个任务的集群的短名称或完整 Amazon Resource Name (ARN)。

  • task – 任务 ID 或完整的 ARN 条目。

class airflow.providers.amazon.aws.hooks.ecs.EcsProtocol[source]

Bases: Protocol

boto3.client('ecs') 的结构化协议。

用于 EcsOperator.client() 的类型提示。

run_task(**kwargs)[source]

运行一个任务。

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html#ECS.Client.run_task

get_waiter(x)[source]

获取一个 waiter。

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html#ECS.Client.get_waiter

describe_tasks(cluster, tasks)[source]

描述任务。

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html#ECS.Client.describe_tasks

stop_task(cluster, task, reason)[source]

停止一个任务。

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html#ECS.Client.stop_task

describe_task_definition(taskDefinition)[source]

描述任务定义。

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html#ECS.Client.describe_task_definition

list_tasks(cluster, launchType, desiredStatus, family)[source]

列出任务。

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html#ECS.Client.list_tasks

此条目有帮助吗?