This reference does not cover the JSON payload supplied to each endpoint. That is documented in detail in Understanding Tasks.
We recommend using the Receptor http client to communicate with Diego's API. The methods on the client are self-explanatory.
When making a POST or a PUT request to the Receptor HTTP API with a JSON payload, clients should include a Content-Type: application/json
header in the request. If a different header is present, it may interfere with the correct processing of the request.
To create a Task submit a valid TaskCreateRequest
via:
POST /v1/tasks
To fetch all Tasks:
GET /v1/tasks
This returns an array of TaskResponse
objects
To fetch all Tasks in a given domain
:
GET /v1/tasks?domain=domain-name
This returns an array of TaskResponse
objects
To fetch a Task by task_guid
:
GET /v1/tasks/:task_guid
This returns a single TaskResponse
object or 404
if none is found.
When a Task enters the COMPLETED
state (see The Task Lifecycle for details) you are responsible for resolving it.
This is done via:
DELETE /v1/tasks/:task_guid
You can only resolve a task in the COMPLETED
state. Anything else is an error.
Tasks in the PENDING
and RUNNING
states (see The Task Lifecycle for details) can be cancelled. This results in a Task in the COMPLETED
state with failed = true
.
To cancel a task:
POST /v1/tasks/:task_guid/cancel
Note, you must resolve the cancelled Task once it enters the COMPLETED
state.