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 towait_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 themodel
and thereference
Body properties #
Device content.
The body must at least contain the following properties:
model
: device model designationreference
: 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 be1
)
{
"status": 200,
"error": null,
"index": "<index>",
"controller": "device-manager/device",
"action": "create",
"requestId": "<unique request identifier>",
"result": {
"_id": "<deviceId>",
"_version": 2,
"_source": "<device content>"
}
}
Edit this page on Github(opens new window)