anmolxlight opened a new pull request, #69953:
URL: https://github.com/apache/airflow/pull/69953
## Description
Adds `airflowctl tasks logs` — fetch a task instance's logs for a given try
number, mirroring the existing Core REST API endpoint `GET
/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/logs/{try_number}`.
### Changes
- **operations.py**: Adds `TasksOperations` class with `logs()` method that
calls the REST API
- **client.py**: Wires `TasksOperations` into `Client.tasks` property
- **help_texts.yaml**: Registers help text for the auto-generated CLI
- **test_operations.py**: Adds `TestTasksOperations.test_logs` verifying
request path/params and response parsing
### Usage
```bash
airflowctl tasks logs <dag_id> <dag_run_id> <task_id> <try_number>
[--full-content] [--map-index]
```
- `--try-number` is required and positional
- `--full-content` (bool, optional, default False) — get full log content
- `--map-index` (int, optional, default -1) — for mapped task instances
### Notes
- `--try-number` defaults to the latest attempt if omitted (matches
webserver UI behavior).
- Only calls the primary `logs/{try_number}` endpoint. The separate
`externalLogUrl` endpoint (Elasticsearch/OpenSearch) can be a follow-up.
Closes: #69947
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]