@ThreadSafe public interface TasksApi
Modifier and Type | Method and Description |
---|---|
LabelResponse |
addLabel(Label label,
Task task)
Add the Task label.
|
LabelResponse |
addLabel(String labelID,
String taskID)
Add the Task label.
|
ResourceMember |
addMember(String memberID,
String taskID)
Add task member.
|
ResourceMember |
addMember(User member,
Task task)
Add task member.
|
ResourceOwner |
addOwner(String ownerID,
String taskID)
Add task owner.
|
ResourceOwner |
addOwner(User owner,
Task task)
Add task owner.
|
void |
cancelRun(Run run)
Cancels a currently running run.
|
void |
cancelRun(String taskID,
String runID)
Cancels a currently running run.
|
Task |
cloneTask(String taskID)
Clone a task.
|
Task |
cloneTask(Task task)
Clone a task.
|
Task |
createTask(Task task)
Creates a new task.
|
Task |
createTask(TaskCreateRequest taskCreateRequest)
Create a new task.
|
Task |
createTaskCron(String name,
String flux,
String cron,
Organization organization)
Creates a new task with task repetition by cron.
|
Task |
createTaskCron(String name,
String flux,
String cron,
String orgID)
Creates a new task with task repetition by cron.
|
Task |
createTaskEvery(String name,
String flux,
String every,
Organization organization)
Creates a new task with task repetition by duration expression ("1h", "30s").
|
Task |
createTaskEvery(String name,
String flux,
String every,
String orgID)
Creates a new task with task repetition by duration expression ("1h", "30s").
|
void |
deleteLabel(Label label,
Task task)
Removes a label from a Task.
|
void |
deleteLabel(String labelID,
String taskID)
Removes a label from a bucket.
|
void |
deleteMember(String memberID,
String taskID)
Removes a member from an task.
|
void |
deleteMember(User member,
Task task)
Removes a member from an task.
|
void |
deleteOwner(String ownerID,
String taskID)
Removes an owner from an task.
|
void |
deleteOwner(User owner,
Task task)
Removes an owner from an task.
|
void |
deleteTask(String taskID)
Delete a task.
|
void |
deleteTask(Task task)
Delete a task.
|
Task |
findTaskByID(String taskID)
Retrieve an task.
|
List<Task> |
findTasks()
Lists tasks, limit 100.
|
List<Task> |
findTasks(String afterID,
String userID,
String orgID)
Lists tasks, limit 100.
|
List<Task> |
findTasksByOrganization(Organization organization)
Lists tasks, limit 100.
|
List<Task> |
findTasksByOrganizationID(String orgID)
Lists tasks, limit 100.
|
List<Task> |
findTasksByUser(User user)
Lists tasks, limit 100.
|
List<Task> |
findTasksByUserID(String userID)
Lists tasks, limit 100.
|
List<Label> |
getLabels(String taskID)
List all labels of a Task.
|
List<Label> |
getLabels(Task task)
List all labels of a Task.
|
List<LogEvent> |
getLogs(String taskID)
Retrieve all logs for a task.
|
List<LogEvent> |
getLogs(Task task)
Retrieve all logs for a task.
|
List<ResourceMember> |
getMembers(String taskID)
List all task members.
|
List<ResourceMember> |
getMembers(Task task)
List all task members.
|
List<ResourceOwner> |
getOwners(String taskID)
List all task owners.
|
List<ResourceOwner> |
getOwners(Task task)
List all task owners.
|
Run |
getRun(Run run)
Retrieve a single run record for a task.
|
Run |
getRun(String taskID,
String runID)
Retrieve a single run record for a task.
|
List<LogEvent> |
getRunLogs(Run run)
Retrieve all logs for a run.
|
List<LogEvent> |
getRunLogs(String taskID,
String runID)
Retrieve all logs for a run.
|
List<Run> |
getRuns(String taskID)
Retrieve list of run records for a task.
|
List<Run> |
getRuns(String taskID,
OffsetDateTime afterTime,
OffsetDateTime beforeTime,
Integer limit)
Retrieve list of run records for a task.
|
List<Run> |
getRuns(Task task)
Retrieve list of run records for a task.
|
List<Run> |
getRuns(Task task,
OffsetDateTime afterTime,
OffsetDateTime beforeTime,
Integer limit)
Retrieve list of run records for a task.
|
Run |
retryRun(Run run)
Retry a task run.
|
Run |
retryRun(String taskID,
String runID)
Retry a task run.
|
Run |
runManually(String taskId,
RunManually runManually)
Manually start a run of the task now overriding the current schedule.
|
Run |
runManually(Task task)
Manually start a run of the task now overriding the current schedule.
|
Task |
updateTask(String taskID,
TaskUpdateRequest request)
Update a task.
|
Task |
updateTask(Task task)
Update a task.
|
@Nonnull Task createTask(@Nonnull Task task)
Task.getFlux()
has to have defined a cron or a every repetition
by the option statement.
Flux example:
option task = { name: "mean", every: 1h, } from(bucket:"metrics/autogen") |> range(start:-task.every) |> group(columns:["level"]) |> mean() |> yield(name:"mean")
task
- the task to create@Nonnull Task createTask(@Nonnull TaskCreateRequest taskCreateRequest)
taskCreateRequest
- task to create (required)@Nonnull Task createTaskCron(@Nonnull String name, @Nonnull String flux, @Nonnull String cron, @Nonnull Organization organization)
Task.getFlux()
is without a cron or a every repetition.
The repetition is automatically append to the option statement.name
- description of the taskflux
- the Flux script to run for this taskcron
- a task repetition schedule in the form '* * * * * *'organization
- the organization that owns this Task@Nonnull Task createTaskCron(@Nonnull String name, @Nonnull String flux, @Nonnull String cron, @Nonnull String orgID)
Task.getFlux()
is without a cron or a every repetition.
The repetition is automatically append to the option statement.name
- description of the taskflux
- the Flux script to run for this taskcron
- a task repetition schedule in the form '* * * * * *'orgID
- an id of the organization that owns this Task@Nonnull Task createTaskEvery(@Nonnull String name, @Nonnull String flux, @Nonnull String every, @Nonnull Organization organization)
Task.getFlux()
is without a cron or a every repetition. The repetition is automatically append
to the option statement.name
- description of the taskflux
- the Flux script to run for this taskevery
- a task repetition by duration expressionorganization
- the organization that owns this Task@Nonnull Task createTaskEvery(@Nonnull String name, @Nonnull String flux, @Nonnull String every, @Nonnull String orgID)
Task.getFlux()
is without a cron or a every repetition. The repetition is automatically append
to the option statement.name
- description of the taskflux
- the Flux script to run for this taskevery
- a task repetition by duration expressionorgID
- an id of the organization that owns this Task@Nonnull Task updateTask(@Nonnull Task task)
task
- task update to apply@Nonnull Task updateTask(@Nonnull String taskID, @Nonnull TaskUpdateRequest request)
taskID
- ID of task to getrequest
- task update to applyvoid deleteTask(@Nonnull Task task)
task
- task to deletevoid deleteTask(@Nonnull String taskID)
taskID
- ID of task to delete@Nonnull Task cloneTask(@Nonnull String taskID)
taskID
- ID of task to clone@Nonnull Task cloneTask(@Nonnull Task task)
task
- task to clone@Nonnull Task findTaskByID(@Nonnull String taskID)
taskID
- ID of task to get@Nonnull List<Task> findTasksByUser(@Nonnull User user)
user
- filter tasks to a specific user@Nonnull List<Task> findTasksByUserID(@Nullable String userID)
userID
- filter tasks to a specific user id@Nonnull List<Task> findTasksByOrganization(@Nonnull Organization organization)
organization
- filter tasks to a specific organization@Nonnull List<Task> findTasksByOrganizationID(@Nullable String orgID)
orgID
- filter tasks to a specific organization id@Nonnull List<Task> findTasks(@Nullable String afterID, @Nullable String userID, @Nullable String orgID)
afterID
- returns tasks after specified IDuserID
- filter tasks to a specific user idorgID
- filter tasks to a specific organization id@Nonnull List<ResourceMember> getMembers(@Nonnull String taskID)
taskID
- ID of the task@Nonnull List<ResourceMember> getMembers(@Nonnull Task task)
task
- the task with members@Nonnull ResourceMember addMember(@Nonnull User member, @Nonnull Task task)
member
- the member of an tasktask
- the task for the member@Nonnull ResourceMember addMember(@Nonnull String memberID, @Nonnull String taskID)
memberID
- the ID of a membertaskID
- the ID of a taskvoid deleteMember(@Nonnull User member, @Nonnull Task task)
member
- the member of a tasktask
- the taskvoid deleteMember(@Nonnull String memberID, @Nonnull String taskID)
taskID
- the ID of a taskmemberID
- the ID of a member@Nonnull List<ResourceOwner> getOwners(@Nonnull Task task)
task
- the task with owners@Nonnull List<ResourceOwner> getOwners(@Nonnull String taskID)
taskID
- ID of task to get owners@Nonnull ResourceOwner addOwner(@Nonnull User owner, @Nonnull Task task)
owner
- the owner of a tasktask
- the task@Nonnull ResourceOwner addOwner(@Nonnull String ownerID, @Nonnull String taskID)
taskID
- the ID of a taskownerID
- the ID of a ownervoid deleteOwner(@Nonnull User owner, @Nonnull Task task)
owner
- the owner of a tasktask
- the taskvoid deleteOwner(@Nonnull String ownerID, @Nonnull String taskID)
taskID
- the ID of a taskownerID
- the ID of a owner@Nonnull List<Run> getRuns(@Nonnull Task task)
task
- task to get runs for@Nonnull List<Run> getRuns(@Nonnull Task task, @Nullable OffsetDateTime afterTime, @Nullable OffsetDateTime beforeTime, @Nullable Integer limit)
task
- task to get runs forafterTime
- filter runs to those scheduled after this timebeforeTime
- filter runs to those scheduled before this timelimit
- the number of runs to return. Default value: 20.@Nonnull List<Run> getRuns(@Nonnull String taskID)
taskID
- ID of task to get runs for@Nonnull List<Run> getRuns(@Nonnull String taskID, @Nullable OffsetDateTime afterTime, @Nullable OffsetDateTime beforeTime, @Nullable Integer limit)
taskID
- ID of task to get runs forafterTime
- filter runs to those scheduled after this timebeforeTime
- filter runs to those scheduled before this timelimit
- the number of runs to return. Default value: 20.@Nonnull Run getRun(@Nonnull Run run)
run
- the run with a taskID and a runID@Nonnull Run getRun(@Nonnull String taskID, @Nonnull String runID)
taskID
- ID of task to get runs forrunID
- ID of run@Nonnull List<LogEvent> getRunLogs(@Nonnull Run run)
run
- the run with a taskID and a runID@Nonnull List<LogEvent> getRunLogs(@Nonnull String taskID, @Nonnull String runID)
taskID
- ID of task to get logs for itrunID
- ID of run@Nonnull Run runManually(@Nonnull Task task)
task
- the task to run@Nonnull Run runManually(@Nonnull String taskId, @Nonnull RunManually runManually)
taskId
- ID of task to runrunManually
- to specify time@Nonnull Run retryRun(@Nonnull Run run)
run
- the run with a taskID and a runID to retry@Nonnull Run retryRun(@Nonnull String taskID, @Nonnull String runID)
taskID
- ID of task to get runs forrunID
- ID of runvoid cancelRun(@Nonnull Run run)
run
- the run with a taskID and a runID to cancelvoid cancelRun(@Nonnull String taskID, @Nonnull String runID)
taskID
- ID of taskrunID
- ID of run@Nonnull List<LogEvent> getLogs(@Nonnull Task task)
task
- task to get logs for@Nonnull List<LogEvent> getLogs(@Nonnull String taskID)
taskID
- ID of task to get logs for@Nonnull List<Label> getLabels(@Nonnull Task task)
task
- the Task with labels@Nonnull List<Label> getLabels(@Nonnull String taskID)
taskID
- ID of Task to get labels@Nonnull LabelResponse addLabel(@Nonnull Label label, @Nonnull Task task)
label
- the label of a Tasktask
- the bucket@Nonnull LabelResponse addLabel(@Nonnull String labelID, @Nonnull String taskID)
taskID
- the ID of a TasklabelID
- the ID of a labelvoid deleteLabel(@Nonnull Label label, @Nonnull Task task)
label
- the Label of a Tasktask
- the TaskCopyright © 2018–2021 InfluxData, Inc.. All rights reserved.