Operations

The following is a list of operations understood by the server with examples of the expected request payload followed by an example response.

In each case only the specific operation payload is shown, but keep in mind that an operation must always be included in a list. If you haven’t already, read the Overview to see a full example of a request.

Create

Request

action:The action name. Must be ‘create’.
entity_type:Type of entity to create.
entity_data:Dictionary of initial data to create entity with.
[
  {
    "action": "create",
    "entity_type": "Job",
    "entity_data": {
      "type": "api_job"
    }
  }
]

Response

action:The name of the action executed.
data:Dictionary representing the created entity. Will contain special __entity_type__ key that indicates the entity type.
[
  {
    "action": "create",
    "data": {
      "status": "queued",
      "__entity_type__": "Job",
      "type": "api_job",
      "id": "aa3f5bd6-8de7-11e5-a7c8-42010af0eaa2"
    }
  }
]

Update

Request body

[
  {
    "action": "update",
    "entity_type": "Job",
    "entity_key": "aa3f5bd6-8de7-11e5-a7c8-42010af0eaa2",
    "entity_data": {
      "status": "running"
    }
  }
]

Response body

[
  {
    "action": "update",
    "data": {
      "status": "running",
      "__entity_type__": "Job",
      "id": "aa3f5bd6-8de7-11e5-a7c8-42010af0eaa2"
    }
  }
]

Delete

Request body

[
  {
    "action": "delete",
    "entity_type": "Job",
    "entity_key": "aa3f5bd6-8de7-11e5-a7c8-42010af0eaa2"
  }
]

Response body

[
  {
    "action": "delete",
    "data": true
  }
]