Run a task
InfluxDB data processing tasks generally run in defined intervals or at a specific time, however, you can manually run a task from the InfluxDB user interface (UI), the influx command line interface (CLI), or the InfluxDB /api/v2 API.
Run a task from the InfluxDB UI
- In the navigation menu on the left, select Tasks.
Tasks 2. Hover over the task you want to run and click the icon. 3. Select Run Task.
Run a task with the influx CLI
Use the influx task run retry command to run a task.
To run a task from the influx CLI, the task must have already run at least once.
Authentication credentials
The examples below assume your InfluxDB host, organization, and token are provided by either the active influx CLI configuration or by environment variables (INFLUX_HOST, INFLUX_ORG, and INFLUX_TOKEN). If you do not have a CLI configuration set up or the environment variables set, include these required credentials for each command with the following flags:
--host: InfluxDB host-o, --orgor--org-id: InfluxDB organization name or ID-t, --token: InfluxDB API token
1. # List all tasks to find the ID of the task to run
2. influx task list
4. # Use the task ID to list previous runs of the task
5. influx task run list --task-id=0000000000000000
7. # Use the task ID and run ID to retry a run
8. influx task run retry --task-id=0000000000000000 --run-id=0000000000000000
Retry failed task runs
Use the influx task retry-failed command to retry failed task runs.
1. # Retry failed tasks for a specific task
2. influx task retry-failed \
3. --id 0000000000000000
5. # Print information about runs that will be retried
6. influx task retry-failed \
7. --dry-run
9. # Retry failed task runs that occurred in a specific time range
10. influx task retry-failed \
11. --after 2021-01-01T00:00:00Z \
12. --before 2021-01-01T23:59:59Z
Run a task with the InfluxDB API
Use the /tasks/TASK_ID/runs InfluxDB API endpoint to manually start a task run.
1. POST http://localhost:8086/api/v2/tasks/TASK_ID/runs
Retry failed task runs
Use the /tasks/TASK_ID/runs/RUN_ID/retry InfluxDB API endpoint to retry a task run.
1. POST http://localhost:8086/api/v2/tasks/TASK_ID/runs/RUN_ID/retry
Related
- influx task run
- influx task run retry
- influx task retry-failed
- /influxdb/v2/api/#operation/PostTasksIDRuns
- /influxdb/v2/api/#operation/PostTasksIDRunsIDRetry
