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

replaceMetadata #

Replace metadata of an asset. It will replace only the fields specified in the request body.

Query Syntax #

HTTP #

Copied to clipboard!
URL: http://kuzzle:7512/_/device-manager/:engineId/assets/:_id/metadata
Method: PATCH

Other protocols #

Copied to clipboard!
{
  "controller": "device-manager/assets",
  "action": "replaceMetadata",
  "engineId": "<engineId>",
  "_id": "<assetId>",
  "body": {
    "metadata": {
      "<metadata name>": "<metadata value>"
    }
  }
}

Arguments #

  • engineId: Engine ID
  • _id: Asset ID

Body properties #

  • metadata: Object containing metadata

Response #

Copied to clipboard!
{
    "action": "replaceMetadata",
    "collection": "assets",
    "controller": "device-manager/assets",
    "error": null,
    "headers": {},
    "index": /** index */,
    "node": /** node */,
    "requestId": /** request id */,
    "result": {
        "_id": /** asset id */,
        "_source": {
            "groups": [],
            "lastMeasuredAt": null,
            "linkedDevices": [],
            "measures": {
                /** mesures */
            },
            "metadata": {
                /** REPLACED METADATA */
            },
            "model": /** asset model */,
            "reference": /** asset reference */,
            "_kuzzle_info": {
                /** data management info */
            }
        }
    },
    "status": 200,
    "volatile": null
}