writeMeasure #
Write a measure model.
This action acts like a create or replace
Query Syntax #
HTTP #
URL: http://kuzzle:7512/_/device-manager/models/measures
Method: POSTOther protocols #
{
  "controller": "device-manager/models",
  "action": "writeMeasure",
  "body": {
    "type": "<measure type>",
    "valuesMappings": {
      // Values mappings
    },
      // Optional
    "valuesDetails":{
      // Values details and translation
    },
      // Optional
    "validationSchema": {
      // Valid JSON Schema
    }
  }
}Body properties #
model: Measure model namevaluesMappings: Mappings of the measure values in Elasticsearch formatvaluesDetails: (optional) Measurement translations and unitsvalidationSchema: (optional) Measurement validation JSON schema
Response #
{
  "status": 200,
  "error": null,
  "controller": "device-manager/models",
  "action": "writeMeasure",
  "requestId": "<unique request identifier>",
  "result": {
    "_id": "<modelId>",
    "_source": {
      // Measure model content
    },
  }
}Errors #
Writing a measure with values mappings can cause conflicts, in this case a MappingsConflictsError will be thrown with the HTTP code 409.