請求方式:PUT
URL: http://api.onenet.hk.chinamobile.com/triggers/trigger_id
trigger_id:需要替換為觸發器lD
| 參數名稱 | 格式 | 是否必須 | 說明 |
|---|---|---|---|
| title | string | 否 | 觸發器名稱 |
| ds_id | string | 是 | 數據流名稱 |
| dev_ids | array-string | 否 | 設備ID,缺省時預設為全部設備 |
| url | string | 否 | 告警通知地址 |
| type | string | 否 | 觸發條件,見type說明列表 |
| threshold | 否 | 觸發條件門限值,與type配合使用,見type說明列表 |
type說明列表
| type | 說明 |
|---|---|
| > | threshold必須為數值 |
| \< | threshold必須為數值 |
| >= | threshold必須為數值 |
| \<= | threshold必須為數值 |
| inout | threshold設置為{“lolmt”:40,“uplmt”:52},表示數據值進入或離開閉區間[40,52]時觸發 |
| change | threshold 參數不用傳遞;當上載的值有改變時觸發告警 |
| frozen | threshold 為數值,指定多少秒內未上報數據觸發告警,同時被監控物件進入frozen狀態 |
| live | threshold為數值,指定多少秒後上報數據觸發告警 |
| 參數名稱 | 格式 | 說明 |
|---|---|---|
| errno | int | 調用錯誤碼,為0表示調用成功 |
| error | string | 錯誤描述,為“succ”表示調用成功 |
PUT http://api.onenet.hk.chinamobile.com/triggers/145709 HTTP/1.1 api-key: YHC**************VqKA=
Host: api.onenet.hk.chinamobile.com
{
"title": "trigger",
"ds_id": "gps",
"url": "http://aoic.choqf.com",
"type": ">",
"threshold": 100
}
{
"errno":0,
"error":"succ"
}