airflow.providers.edge.worker_api.datamodels

Classes

WorkerApiDocs

Documentation collection for the worker API.

JsonRpcRequestBase

Base JSON RPC request model to define just the method.

JsonRpcRequest

JSON RPC request model.

EdgeJobBase

Basic attributes of a job on the edge worker.

EdgeJobFetched

Job that is to be executed on the edge worker.

WorkerQueuesBase

Queues that a worker supports to run jobs on.

WorkerQueuesBody

Queues that a worker supports to run jobs on.

WorkerStateBody

Details of the worker state sent to the scheduler.

WorkerQueueUpdateBody

Changed queues for the worker.

PushLogsBody

Incremental new log content from worker.

WorkerSetStateReturn

The return class for the worker set state.

Module Contents

class airflow.providers.edge.worker_api.datamodels.WorkerApiDocs[source]

Documentation collection for the worker API.

dag_id[source]
task_id[source]
run_id[source]
try_number[source]
map_index[source]
state[source]
class airflow.providers.edge.worker_api.datamodels.JsonRpcRequestBase(/, **data)[source]

Bases: pydantic.BaseModel

Base JSON RPC request model to define just the method.

method: Annotated[str, Field(description='Fully qualified python module method name that is called via JSON RPC.')][source]
class airflow.providers.edge.worker_api.datamodels.JsonRpcRequest(/, **data)[source]

Bases: JsonRpcRequestBase

JSON RPC request model.

jsonrpc: Annotated[str, Field(description='JSON RPC Version', examples=['2.0'])][source]
params: Annotated[dict[str, Any] | None, Field(description='Dictionary of parameters passed to the method.')][source]
class airflow.providers.edge.worker_api.datamodels.EdgeJobBase(/, **data)[source]

Bases: pydantic.BaseModel

Basic attributes of a job on the edge worker.

dag_id: Annotated[str, Field(title='Dag ID', description='Identifier of the DAG to which the task belongs.')][source]
task_id: Annotated[str, Field(title='Task ID', description='Task name in the DAG.')][source]
run_id: Annotated[str, Field(title='Run ID', description='Run ID of the DAG execution.')][source]
map_index: Annotated[int, Field(title='Map Index', description='For dynamically mapped tasks the mapping number, -1 if the task is not mapped.')][source]
try_number: Annotated[int, Field(title='Try Number', description='The number of attempt to execute this task.')][source]
property key: airflow.models.taskinstancekey.TaskInstanceKey[source]
class airflow.providers.edge.worker_api.datamodels.EdgeJobFetched(/, **data)[source]

Bases: EdgeJobBase

Job that is to be executed on the edge worker.

command: Annotated[airflow.providers.edge.worker_api.routes._v2_compat.ExecuteTask, Field(title='Command', description='Command line to use to execute the job in Airflow 2. Task definition in Airflow 3')][source]
concurrency_slots: Annotated[int, Field(description='Number of concurrency slots the job requires.')][source]
class airflow.providers.edge.worker_api.datamodels.WorkerQueuesBase(/, **data)[source]

Bases: pydantic.BaseModel

Queues that a worker supports to run jobs on.

queues: Annotated[list[str] | None, Field(None, description='List of queues the worker is pulling jobs from. If not provided, worker pulls from all queues.')][source]
class airflow.providers.edge.worker_api.datamodels.WorkerQueuesBody(/, **data)[source]

Bases: WorkerQueuesBase

Queues that a worker supports to run jobs on.

free_concurrency: Annotated[int, Field(description='Number of free concurrency slots on the worker.')][source]
class airflow.providers.edge.worker_api.datamodels.WorkerStateBody(/, **data)[source]

Bases: WorkerQueuesBase

Details of the worker state sent to the scheduler.

state: Annotated[airflow.providers.edge.models.edge_worker.EdgeWorkerState, Field(description='State of the worker from the view of the worker.')][source]
jobs_active: Annotated[int, Field(description='Number of active jobs the worker is running.')] = 0[source]
queues: Annotated[list[str] | None, Field(description='List of queues the worker is pulling jobs from. If not provided, worker pulls from all queues.')] = None[source]
sysinfo: Annotated[dict[str, str | int], Field(description='System information of the worker.', examples=[{'concurrency': 4, 'free_concurrency': 3, 'airflow_version': '2.0.0', 'edge_provider_version': '1.0.0'}])][source]
class airflow.providers.edge.worker_api.datamodels.WorkerQueueUpdateBody(/, **data)[source]

Bases: pydantic.BaseModel

Changed queues for the worker.

new_queues: Annotated[list[str] | None, Field(description='Additional queues to be added to worker.')][source]
remove_queues: Annotated[list[str] | None, Field(description='Queues to remove from worker.')][source]
class airflow.providers.edge.worker_api.datamodels.PushLogsBody(/, **data)[source]

Bases: pydantic.BaseModel

Incremental new log content from worker.

log_chunk_time: Annotated[datetime.datetime, Field(description='Time of the log chunk at point of sending.')][source]
log_chunk_data: Annotated[str, Field(description='Log chunk data as incremental log text.')][source]
class airflow.providers.edge.worker_api.datamodels.WorkerSetStateReturn(/, **data)[source]

Bases: pydantic.BaseModel

The return class for the worker set state.

state: Annotated[airflow.providers.edge.models.edge_worker.EdgeWorkerState, Field(description='State of the worker from the view of the server.')][source]
queues: Annotated[list[str] | None, Field(description='List of queues the worker is pulling jobs from. If not provided, worker pulls from all queues.')][source]

Was this entry helpful?