Documentation

Manage Kapacitor Flux task runs

Use the kapacitor CLI or the Kapacitor HTTP API to manage Kapacitor Flux task runs. Each Flux task execution is considered a “run.”

List Kapacitor Flux task runs

Use the following request method and endpoint to list Kapacitor Flux task runs.

GET /kapacitor/v1/api/v2/tasks/{taskID}/runs
  • Copy
  • Fill window

Provide the following with your request (* Required):

Headers

  • * Content-type: application/json

Path parameters

  • * taskID: Task ID

Query parameters

  • after: List task runs after a specific run ID
  • afterTime: Return task runs that occurred after this time (RFC3339 timestamp)
  • beforeTime: Return task runs that occurred before this time (RFC3339 timestamp)
  • limit: Limit the number of task runs returned (default is 100)

API examples

The following examples use the task ID 000x00xX0xXXx00.

List all runs for a Flux task
curl --GET 'http://localhost:9092/kapacitor/v1/api/v2/tasks/000x00xX0xXXx00/runs' \
  --header 'Content-Type: application/json'
  • Copy
  • Fill window
List a limited number of runs for a Flux task
curl --GET 'http://localhost:9092/kapacitor/v1/api/v2/tasks/000x00xX0xXXx00/runs' \
  --header 'Content-Type: application/json' \
  --data-urlencode "limit=10"
  • Copy
  • Fill window
List Flux task runs after a specific run ID
curl --GET 'http://localhost:9092/kapacitor/v1/api/v2/tasks/000x00xX0xXXx00/runs' \
  --header 'Content-Type: application/json' \
  --data-urlencode "after=XXX0xx0xX00Xx0X"
  • Copy
  • Fill window
List Flux task runs that occurred in a time range
curl --GET 'http://localhost:9092/kapacitor/v1/api/v2/tasks/000x00xX0xXXx00/runs' \
  --header 'Content-Type: application/json' \
  --data-urlencode 'afterTime=2021-01-01T00:00:00Z' \
  --data-urlencode 'beforeTime=2021-01-31T00:00:00Z'
  • Copy
  • Fill window

Retry a Kapacitor Flux task run

Use the following request method and endpoint to retry a Kapacitor Flux task run.

POST /kapacitor/v1/api/v2/tasks/{taskID}/runs/{runID}/retry
  • Copy
  • Fill window

Provide the following with your request (* Required):

Path parameters

  • * taskID: Task ID
  • * runID: Run ID to retry
# Retry run ID XXX0xx0xX00Xx0X for task ID 000x00xX0xXXx00
curl --request POST \
  'http://localhost:9092/kapacitor/v1/api/v2/tasks/000x00xX0xXXx00/runs/XXX0xx0xX00Xx0X'
  • Copy
  • Fill window

For an easy way to retry all failed task runs, see Retry failed Kapacitor tasks.


Was this page helpful?

Thank you for your feedback!


The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Read more

InfluxDB 3 Core and Enterprise are now in Beta

InfluxDB 3 Core and Enterprise are now available for beta testing, available under MIT or Apache 2 license.

InfluxDB 3 Core is a high-speed, recent-data engine that collects and processes data in real-time, while persisting it to local disk or object storage. InfluxDB 3 Enterprise is a commercial product that builds on Core’s foundation, adding high availability, read replicas, enhanced security, and data compaction for faster queries. A free tier of InfluxDB 3 Enterprise will also be available for at-home, non-commercial use for hobbyists to get the full historical time series database set of capabilities.

For more information, check out: