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

NameInTypeRequiredDescription
targetquerystring or nullOnly tasks on this target.
recursivequeryboolean or nullWith target: also tasks on the objects below it (a datacenter, cluster, folder).
statequerystring or nullComma-separated states (queued,running,success,error,cancelled).
operationquerystring or nullComma-separated operations (descriptionId, e.g. VirtualMachine.powerOn).
userquerystring or nullOnly this user.
chainIdquerystring or nullOnly this chain id.
sincequerystring or nullOnly tasks queued at or after this time (RFC 3339).
untilquerystring or nullOnly tasks queued at or before this time (RFC 3339).
orderquerystring or nullasc (default, oldest first) or desc (newest first).
limitqueryinteger or nullMaximum items.
afterquerystring or nullCursor: the next of the previous page (in the same order).

Responses

StatusDescriptionSchema
200OKPaged_TaskView

GET /v1/tasks/{id}

One task.

CLI
kyvernon tasks get <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the task

Responses

StatusDescriptionSchema
200OKTaskView
404Not 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

NameInTypeRequiredDescription
idpathstringyesId of the task

Responses

StatusDescriptionSchema
200OKTaskView

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

NameInTypeRequiredDescription
idpathstringyesId of the task
timeoutqueryinteger (int64) or nullSeconds to wait (default 30, maximum 300).

Responses

StatusDescriptionSchema
200The task: terminal, or still queued or running when the timeout passedTaskView
404Not found (or not visible to the caller)ErrorBody

Version 0.1.