more WIP task content

pull/20/head
Scott Anderson 2019-01-17 23:04:56 -07:00
parent ac4b488fa4
commit c7a0863550
6 changed files with 48 additions and 14 deletions

View File

@ -24,12 +24,16 @@ It accepts either a file path or raw Flux.
###### Create a task using a file ###### Create a task using a file
```sh ```sh
influx task create --org=org-name @/path/to/task-script.flux # Pattern
influx task create --org <org-name> @</path/to/task-script>
# Example
influx task create --org my-org @/tasks/cq-mean-1h.flux
``` ```
###### Create a task using raw Flux ###### Create a task using raw Flux
```sh ```sh
influx task create --org=org-name - # <return> to open stdin pipe influx task create --org my-org - # <return> to open stdin pipe
options task = { options task = {
name: "task-name", name: "task-name",

View File

@ -15,7 +15,13 @@ menu:
## Delete a task with the `influx` CLI ## Delete a task with the `influx` CLI
Use the `influx task delete` command to delete a task.
It requires a task ID, which is available in the output of `influx task find`.
```sh ```sh
influx task delete -i task-id # Pattern
influx task delete -i <task-id>
# Example
influx task delete -i 0343698431c35000
``` ```

View File

@ -15,7 +15,23 @@ menu:
## Update a task with the `influx` CLI ## Update a task with the `influx` CLI
Use the `influx task update` command to update or change the status of an existing tasks.
It requires a task ID which is available in the output of `influx task find`.
###### Update a task's Flux script
```sh ```sh
influx task update -i task-id --status task-status # Pattern
influx task update -i <task-id> @/path/to/updated-task-script
# Example
influx task update -i 0343698431c35000 @/tasks/cq-mean-1h.flux
```
###### Update the status of a task
```sh
# Pattern
influx task update -i <task-id> --status < active | inactive >
# Example
influx task update -i 0343698431c35000 --status inactive
``` ```

View File

@ -15,7 +15,11 @@ menu:
## View tasks with the `influx` CLI ## View tasks with the `influx` CLI
Use the `influx task find` command to return a list of created tasks.
```sh ```sh
influx task find -i task-id -n user-id --limit=100 --org-id=organization-id influx task find
``` ```
_Other filtering options such as filtering by organization or user, or limiting the number of tasks returned are available.
See the [`influx task find` documentation](#) for information about other available flags._

View File

@ -31,8 +31,8 @@ _**Data type:** String_
```js ```js
options task = { options task = {
// ...
name: "taskName", name: "taskName",
// ...
} }
``` ```
@ -43,17 +43,21 @@ _**Data type:** Duration_
```js ```js
options task = { options task = {
// ...
every: 1h, every: 1h,
} }
``` ```
## cron ## cron
The cron schedule on which the task runs. Cron execution is based on system time. The [cron expression](https://en.wikipedia.org/wiki/Cron#Overview) that
defines the schedule on which the task runs.
Cron scheduling is based on system time.
_**Data type:** String_ _**Data type:** String_
```js ```js
options task = { options task = {
// ...
cron: "0 * * * *", cron: "0 * * * *",
} }
``` ```
@ -63,7 +67,7 @@ Delays the execution of the task but preserves the original time range.
For example, if a task is to run on the hour, a `10m` offset will delay it to 10 For example, if a task is to run on the hour, a `10m` offset will delay it to 10
minutes after the hour, but all time ranges defined in the task are relative to minutes after the hour, but all time ranges defined in the task are relative to
the specified execution time. the specified execution time.
A common use case is to allow late data to come in before executing the task. A common use case is offsetting execution to account for data that may arrive late.
_**Data type:** Duration_ _**Data type:** Duration_
@ -75,9 +79,9 @@ options task = {
``` ```
## concurrency ## concurrency
The number task executions that can run concurrently. The number task of executions that can run concurrently.
If the concurrency limit is reached, all subsequent executions of the task are be queued If the concurrency limit is reached, all subsequent executions are queued until
until other running task executions complete. other running task executions complete.
_**Data type:** Integer_ _**Data type:** Integer_

View File

@ -46,15 +46,15 @@ _See [Task configuration options](/v2.0/process-data/task-options) for detailed
about each option._ about each option._
{{% note %}} {{% note %}}
**When creating a task in the InfluxDB user interface (UI)**, task options are not required If creating a task in the InfluxDB user interface (UI), task options are defined
in your Flux script. They are defined in UI while creating the task. in form fields when creating the task.
{{% /note %}} {{% /note %}}
## Define a data source ## Define a data source
Define a data source using Flux's [`from()` function](#) or any other [Flux input functions](#). Define a data source using Flux's [`from()` function](#) or any other [Flux input functions](#).
For convenience, consider creating a variable that includes the sourced data with For convenience, consider creating a variable that includes the sourced data with
the required `range()` and any relevant filters. the required time range and any relevant filters.
```js ```js
data = from(bucket: "telegraf/default") data = from(bucket: "telegraf/default")