This repository was archived by the owner on Jun 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Alert Management
adrianweber edited this page Sep 23, 2014
·
17 revisions
The Alert API is a REST Interface for informing alerts to be analyzed and processed by the platform.
Param | Type | Description | Value |
---|---|---|---|
Authorization | HTTP Header | Access Token | Authorization: Bearer 23094823424y2i3uy4i2u3y4i2i43uy |
Content-Type | HTTP Header | Type of body content | application/json |
Request
POST /alerts
Request
{
"msgType": "alertsPush",
"data": [{
"accountId": "35548686-35bc-47a3-b137-579fdd496101",
"alertId": 75,
"ruleId": 1206,
"deviceId": "00-00-00-00-a8-9c",
"alertStatus": "Open",
"timestamp": 1402580459000,
"resetTimestamp": 123,
"resetType": "Automatic",
"lastUpdateDate": 2934209384029,
"ruleName": "rule 2 - basic condition new",
"rulePriority": "Low",
"naturalLangAlert": "temperature > 17.2",
"ruleExecutionTimestamp": 1402580459000,
"conditions": [{
"conditionSequence": 1,
"naturalLangCondition": "temperature > 17.2",
"components": [{
"componentId": "e5f09130-c70e-4082-9801-49833c853493",
"dataType": "Number",
"componentName": "GA9c-3-Temp.Sensor",
"valuePoints": [{
"timestamp": 1402580459000,
"value": "21"
}]
}]
}]
}]
}
Get a list of all alerts for the specified account.
Param | Type | Description | Value |
---|---|---|---|
Authorization | HTTP Header | Access Token | Authorization: Bearer 23094823424y2i3uy4i2u3y4i2i43uy |
accountId | URL Slug | The ID of an Account | 534da46c820cb9f74a0d3de6 |
Request
GET /accounts/{accountId}/alerts
Response 200 OK (application/json)
[
{
"accountId": "0d66c8b6-9f4d-4551-a9c8-d356c2dd033d",
"alertId": "75",
"deviceId": "00-00-00-00-a8-9c",
"ruleId": 6832,
"ruleName": "rule 2 - basic condition new",
"priority": "Low",
"triggered": 1402580459000,
"created": 1411130946286,
"naturalLangAlert": "temperature > 17.2",
"conditions": [
{
"sequence": 1,
"condition": "temperature > 17.2"
}
],
"status": "New",
"updated": 1411130946286,
"_id": "541c2642b3700bcbe9c76fc5"
}
]
Get specific alert details connected with the account.
Param | Type | Description | Value |
---|---|---|---|
Authorization | HTTP Header | Access Token | Authorization: Bearer 23094823424y2i3uy4i2u3y4i2i43uy |
accountId | URL Slug | The ID of an Account | 0d66c8b6-9f4d-4551-a9c8-d356c2dd033d |
alertId | URL Slug | The ID of an Alert | 75 |
Request
GET /accounts/{accountId}/alerts/{alertId}
Response 200 OK
{
"accountId": "0d66c8b6-9f4d-4551-a9c8-d356c2dd033d",
"alertId": "75",
"deviceId": "00-00-00-00-a8-9c",
"ruleId": 6832,
"ruleName": "rule 2 - basic condition new",
"priority": "Low",
"triggered": 1402580459000,
"created": 1411130946286,
"naturalLangAlert": "temperature > 17.2",
"conditions": [
{
"sequence": 1,
"condition": "temperature > 17.2",
"components": [
{
"componentId": "e5f09130-c70e-4082-9801-49833c853493",
"dataType": "Number",
"componentName": "GA9c-3-Temp.Sensor",
"valuePoints": [
{
"timestamp": 1402580459000,
"value": "21"
}
]
}
]
}
],
"status": "New",
"updated": 1411130946286,
"_id": "541c2642b3700bcbe9c76fc5"
}
Change alert status to - "Closed". Alert won't be active any more.
Param | Type | Description | Value |
---|---|---|---|
Authorization | HTTP Header | Access Token | Authorization: Bearer 23094823424y2i3uy4i2u3y4i2i43uy |
accountId | URL Slug | The ID of an Account | 0d66c8b6-9f4d-4551-a9c8-d356c2dd033d |
alertId | URL Slug | The ID of an Alert | 75 |
Request
PUT /accounts/{accountId}/alerts/{alertId}/reset
Response 200 OK
Change status of the Alert. Status should have one of the following values: ['New', 'Open', 'Closed']
Param | Type | Description | Value |
---|---|---|---|
Authorization | HTTP Header | Access Token | Authorization: Bearer 23094823424y2i3uy4i2u3y4i2i43uy |
accountId | URL Slug | The ID of an Account | 0d66c8b6-9f4d-4551-a9c8-d356c2dd033d |
alertId | URL Slug | The ID of an Alert | 75 |
statusName | URL Slug | The Name of a new alert status | "Closed" |
Request
PUT /accounts/{accountId}/alerts/{alertId}/status/{statusName}
Response 200 OK
Add list of comments to the alert.
Param | Type | Description | Value |
---|---|---|---|
Authorization | HTTP Header | Access Token | Authorization: Bearer 23094823424y2i3uy4i2u3y4i2i43uy |
Content-Type | HTTP Header | Type of body content | application/json |
accountId | URL Slug | The ID of an Account | 0d66c8b6-9f4d-4551-a9c8-d356c2dd033d |
alertId | URL Slug | The ID of an Alert | 75 |
Request
POST /accounts/{accountId}/alerts/{alertId}/comments
[
{
"user": "test@gmail.com",
"timestamp": 123233231221,
"text": "comment"
}
]
Response 200 OK