Documentation Reference REST API reference API: tasks
Reference For: developers
API: tasks
Operations of the tasks tag of the native REST API.
Tasks
GET /v1/tasks
Lists tasks, oldest first or with order=desc newest first; after takes the next cursor of the previous page.
CLI kyvernon tasks list
Parameters
Name In Type Required Description targetquery string or nullOnly tasks on this target. recursivequery boolean or nullWith target: also tasks on the objects below it (a datacenter, cluster, folder). statequery string or nullComma-separated states (queued,running,success,error,cancelled). operationquery string or nullComma-separated operations (descriptionId, e.g. VirtualMachine.powerOn). userquery string or nullOnly this user. chainIdquery string or nullOnly this chain id. sincequery string or nullOnly tasks queued at or after this time (RFC 3339). untilquery string or nullOnly tasks queued at or before this time (RFC 3339). orderquery string or nullasc (default, oldest first) or desc (newest first).limitquery integer or nullMaximum items. afterquery string or nullCursor: the next of the previous page (in the same order).
Responses
GET /v1/tasks/{id}
One task.
CLI kyvernon tasks get <id>
Parameters
Name In Type Required Description idpath stringyes Id of the task
Responses
Status Description Schema 200 OK TaskView404 Not found (or not visible to the caller) ErrorBody
POST /v1/tasks/{id}/cancel
Cancels a task (own tasks, or Global.CancelTask).
CLI kyvernon tasks cancel <id>
Parameters
Name In Type Required Description idpath stringyes Id of the task
Responses
GET /v1/tasks/{id}/wait
Waits until a task is terminal or the timeout passes (long polling). Answers 200 with the task either way: a task still queued or running at the timeout is returned as it is, and the client asks again.
CLI kyvernon tasks wait <id>
Parameters
Name In Type Required Description idpath stringyes Id of the task timeoutquery integer (int64) or nullSeconds to wait (default 30, maximum 300).
Responses
Status Description Schema 200 The task: terminal, or still queued or running when the timeout passed TaskView404 Not found (or not visible to the caller) ErrorBody
Guides
Previous API: system Next API: tenants
Version 0.1.