Official Plugins (Kuzzle v2.x)
Device Manager v0.x
2

create #

Creates a new device.

See also the document:create API action.


Query Syntax #

HTTP #

URL: http://kuzzle:7512/_/device-manager/:index/devices/[?refresh=wait_for][&_id=<string>]
Method: POST
Body:
{
  // device content
}

Other protocols #

{
  "index": "<index>",
  "controller": "device-manager/device",
  "action": "create",
  "body": {
    // device content
  }
}

Kourou #

kourou device-manager/device:create <index> --body '{
  model: "<device model>",
  reference: "<device reference>"
}'

Arguments #

  • index: Tenant index name

Optional: #

  • refresh: if set to wait_for, Kuzzle will not respond until the device document is indexed
  • _id: set the document unique ID to the provided value, instead of auto-generating an ID with the model and the reference

Body properties #

Device content.

The body must at least contain the following properties:

  • model: device model designation
  • reference: device unique identifier for the model

Response #

Returns information about the created device:

  • _id: created document unique identifier
  • _source: document content
  • _version: version of the created document (should be 1)
{
  "status": 200,
  "error": null,
  "index": "<index>",
  "controller": "device-manager/device",
  "action": "create",
  "requestId": "<unique request identifier>",
  "result": {
    "_id": "<deviceId>",
    "_version": 2,
    "_source": "<device content>"
  }
}