upsert #
Update or Create a device. The Upsert operation allows you to create a new device or update an existing one if it already exists. This operation is useful when you want to ensure that an device is either created or updated in a single request.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/_/device-manager/:engineId/devices/:_id
Method: POST
Other protocols #
{
"controller": "device-manager/devices",
"action": "upsert",
"engineId": "<engineId>",
"reference": "<deviceReference>",
"model": "<deviceModel>",
"body": {
"metadata": {
"<metadata name>": "<metadata value>"
}
}
}
Arguments #
engineId
: Engine IDreference
: device referencemodel
: device model
Body properties #
metadata
: Object containing metadata
Response #
{
"status": 200,
"error": null,
"controller": "device-manager/devices",
"action": "update",
"requestId": "<unique request identifier>",
"result": {
"_id": "<deviceId>",
"_source": {
// device content
},
}
}
Edit this page on Github(opens new window)