Updates treatments belonging to this given metric with given parameters

Params

Param name Description
treatments
required

Map containing details of the treatments to be updated


Value: Must be a Hash
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean

Examples

Request
  curl -X PUT -H "Content-Type:application/json" -H "X-Auth-Token:olezAZXGQn9MutnfNerKDQ"  -d '{"treatments":{"RangeTreatment":{"_type":"Range","min":2,"max":10,"off_limit_treatment":0},"DerivedTreatment":{"_type":"DerivedTreatment","expression":"$event.data.metric_name * 3"}}}' https://api.datonis.io/api/v3/metrics/4f9b9764t7/update_treatments

Response (containing details of the metric updated)
{
  "metric": {
    "abbreviation": "capacity",
    "created_at": 1448364456,
    "data_type": 0,
    "description": "Metric for thing template Washing Machine",
    "metric_key": "4f9b9764t7",
    "name": "capacity",
    "unit_of_measure": "kg",
    "updated_at": 1448428909,
    "treatments": "{\"treatments\":{ \"RangeTreatment\" : {\"_type\" : \"Range\", \"min\" : 2, \"max\" : 10, \"off_limit_treatment\" : 0}, \"DerivedTreatment\" : {\"_type\" : \"DerivedTreatment\", \"expression\" : \"$event.data.metric_name * 3\"}}}",
    "thing_template_key": "af31ae5fb2"
  }
}