Function Description
Queries notification history based on search conditions, recipient, and send time.
Call instructions
Interface constraints
The caller must have the read permission on the alert feature.
Request path
GET /api/v2/alarm/notifications
Request parameters
body:
Name |
Type |
Required |
Example Value |
Description |
|---|---|---|---|---|
| page | Integer | No | 1 | The page number of the requested data. The value starts from 1. Default value: 1. |
| size | Integer | No | 10 | The size of the requested data. Default value: 10, maximum value: 200. |
| category | String | No | OceanBase | The alert category. Valid values: |
| appType | String | No | OceanBase | The application type (alert source). Valid values: |
| recipientUid | String | No | 216 | The ID of the recipient. |
| alarmType | String | No | obagent_dead | The alert type. |
| scope | String | No | ObCluster | The alert scope. Valid values: |
| level | Integer | No | 1 | The alert level [1~5], corresponding to: Down, Critical, Alert, Caution, and Info, respectively. |
| status | String | No | Success | The notification sending status. Valid values: Pending, Sending, Success, Failed, and Limited. |
| sentAtStart | Datetime | No | 2020-11-11T11:12:13.127+08:00 | The start time of the notification. |
| sentAtEnd | Datetime | No | 2020-11-11T17:11:13.127+08:00 | The end time of the notification. |
| keyword | String | No | foo | Keyword matching. |
| alarmId | Integer | No | 123 | The alert ID. If this parameter is specified, other parameters will be ignored. |
Return result
Basic data structure
Parameter |
Type |
Description |
|---|---|---|
| data | Object | The requested data. |
| ├─ contents | Array | The list of alert notifications. For more information, see Alert notification data structure. |
| ├─ page | Object | The pagination information. |
| ├─ totalElements | Integer | The total number of records. |
| ├─ totalPage | Integer | The total number of pages. |
| ├─ number | Integer | The current page number. |
| ├─ size | Integer | The size of the current page. |
| successful | Boolean | Indicates whether the request is successful. |
| timestamp | Datetime | The timestamp when the server finishes the request. |
| duration | Integer | The time taken by the server to process the request in milliseconds. |
| status | Integer | The HTTP status code that conforms to the HTTP Status standard. |
| traceId | String | The Trace ID of the request, which is used to troubleshoot problems. |
| server | String | The address of the server that responds to the request. |
Alert notification data structure
Name |
Type |
Description |
|---|---|---|
| id | Integer | The notification ID. |
| recipientUid | String | The ID of the recipient. |
| recipientAddr | String | The address of the recipient, which can be an email address, phone number, or employee ID, depending on the recipient field of the channel. |
| channelId | Integer | The ID of the channel. |
| appType | String | The application type (source of the alert). This field can be OB, OCP, OMS, OBProxy, or Backup. |
| scope | String | The scope of the alert. This field can be ObCluster, ObTenant, AppCluster, Service, or Host. |
| alarmType | String | The type of the alert. |
| level | Integer | The alert level, which ranges from 1 to 5. |
| message | String | The message content. |
| status | String | The sending status. This field can be Pending, Sending, Success, Failed, or Limited. |
| channelResponse | String | The response returned by the channel during the last sending attempt. |
| generatedAt | String | The generation time. |
| sentAt | String | The sending time. |
| ob_cluster_group | String | The name of the OBServer cluster group. |
| ob_cluster | String | The name of the OBServer cluster. |
| ob_tenant | String | The name of the OBServer tenant. |
| obregion_group | String | The alias of the OBServer cluster group, which is compatible with OCP. |
| obregion | String | The alias of the OBServer cluster, which is compatible with OCP. |
| tenant_name | String | The alias of the OBServer tenant, which is compatible with OCP. |
| host_name | String | The host name. |
| host_ip | String | The host IP address. |
| svr_ip | String | The alias of the host IP address, which is compatible with OCP. |
| app_cluster | String | The name of the application cluster. |
| service | String | The name of the service. |
| alarmIds | Array | The list of associated alert IDs. |
| isAggregated | Boolean | Indicates whether the notification is aggregated. |
Example
Request example
GET /api/v2/alarm/notifications?page=1&size=2
Example response
{
"data": {
"contents": [
{
"alarmIds": [
1000160
],
"alarmType": "no_enough_exporter",
"appType": "OCP",
"channelId": 100001,
"channelResponse": "stdout=,stderr=",
"generatedAt": "2020-12-03T01:50:12Z",
"id": 1001134,
"isAggregated": false,
"labels": {
"alarm_name": "Insufficient exporter Process Count",
"app_type": "OCP",
"alarm_level_color": "#722ED1",
"alarm_last_interval": "PT6M8.301194S",
"svr_ip": "xxx.xxx.xxx.xxx",
"alarm_description_3": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter process count is insufficient",
"host_services": "OB_CLUSTER,OB_PROXY",
"alarm_level": "Downtime",
"alarm_description_1": "service=OCP:svr_ip=xxx.xxx.xxx.xxx insufficient exporter process count, services OB_CLUSTER, OB_PROXY, expected 6 exporter processes, actual 5",
"alarm_name_3": "Insufficient Exporter Process Count",
"alarm_description_2": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter number not enough, deployed services OB_CLUSTER,OB_PROXY, expected exporter count 6, actual exporter count 5",
"alarm_name_2": "exporter number not enough",
"expected_exporter_count": "6",
"alarm_name_1": "Number of Exporter processes is insufficient",
"alarm_type": "no_enough_exporter",
"alarm_summary": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter process count insufficient",
"alarm_status": "cleared",
"alarm_scope": "Host",
"alarm_active_at": "2020-12-03T09:44:04+08:00",
"alarm_target": "service=OCP:svr_ip=xxx.xxx.xxx.xxx",
"alarm_resolved_at": "2020-12-03T09:50:12+08:00",
"alarm_url": "http://xxx.xxx.xxx.xxx:8080/alarm/event/1000160",
"app": "OCP",
"actual_exporter_count": "5",
"alarm_is_build_in_rule": "true",
"host_ip": "xxx.xxx.xxx.xxx",
"alarm_duration": "0",
"recipients_uids": "",
"service": "OCP",
"alarm_description": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter process count is insufficient. Deploy the services of OB_CLUSTER and OB_PROXY. The expected number of exporters is 6, but the actual number is 5",
"alarm_updated_at": "2020-12-03T09:45:04+08:00",
"alarm_summary_2": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter number not enough",
"alarm_summary_1": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter process count insufficient",
"alarm_id": "1000160",
"alarm_summary_3": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter process quantity is insufficient",
"alarm_evaluation_interval": "60"
},
"level": 1,
"message": "【Alert restored notification】\n- Alert target service=OCP:svr_ip=xxx.xxx.xxx.xxx\n- Alert details service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter process count is insufficient. Deployment services: OB_CLUSTER, OB_PROXY. Expected exporter count: 6. Actual exporter count: 5.\n- Restored at 2020-12-03T09:50:12+08:00",
"scope": "Host",
"sentAt": "2020-12-03T01:50:13Z",
"status": "Failed"
},
{
"alarmIds": [
1000160
],
"alarmType": "no_enough_exporter",
"appType": "OCP",
"channelId": 100000,
"channelResponse": "\r\n{\"status\":1111,\"wait\":5,\"source\":\"x5\",\"punish\":\"deny\",\"uuid\":\"d6937ed81b2e15d7fbf103aae000631e\",\"errjson\": 130101,\"errmsg\": \"send too fast, exceed 20 times per minute\"}",
"generatedAt": "2020-12-03T01:50:12Z",
"id": 1001133,
"isAggregated": false,
"labels": {
"alarm_name": "Insufficient Number of Exporter Processes",
"app_type": "OCP",
"alarm_level_color": "#722ED1",
"alarm_last_interval": "PT6M8.301194S",
"svr_ip": "xxx.xxx.xxx.xxx",
"alarm_description_3": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter process count is insufficient",
"host_services": "OB_CLUSTER,OB_PROXY",
"alarm_level": "Downtime",
"alarm_description_1": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter process count is insufficient. The services OB_CLUSTER and OB_PROXY are deployed, and the expected exporter count is 6, but the actual count is 5.",
"alarm_name_3": "Not enough exporter process instances",
"alarm_description_2": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter number not enough, deployed services OB_CLUSTER,OB_PROXY, expected exporter count 6, actual exporter count 5",
"alarm_name_2": "exporter number not enough",
"expected_exporter_count": "6",
"alarm_name_1": "Insufficient number of exporter processes",
"alarm_type": "no_enough_exporter",
"alarm_summary": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter process count insufficient",
"alarm_status": "Cleared",
"alarm_scope": "Host",
"alarm_active_at": "2020-12-03T09:44:04+08:00",
"alarm_target": "service=OCP:svr_ip=xxx.xxx.xxx.xxx",
"alarm_resolved_at": "2020-12-03T09:50:12+08:00",
"alarm_url": "http://xxx.xxx.xxx.xxx:8080/alarm/event/1000160",
"app": "OCP",
"actual_exporter_count": "5",
"alarm_is_build_in_rule": "true",
"host_ip": "xxx.xxx.xxx.xxx",
"alarm_duration": "0",
"recipients_uids": "",
"service": "OCP",
"alarm_description": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter process count is insufficient. The services to be deployed are OB_CLUSTER and OB_PROXY. The expected number of exporter processes is 6, but the actual number is 5",
"alarm_updated_at": "2020-12-03T09:45:04+08:00",
"alarm_summary_2": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter number not enough",
"alarm_summary_1": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter process count is insufficient",
"alarm_id": "1000160",
"alarm_summary_3": "service=OCP:svr_ip=xxx.xxx.xxx.xxx insufficient number of exporter processes",
"alarm_evaluation_interval": "60"
},
"level": 1,
"message": "【Alert Restored】\n- Alert target service=OCP:svr_ip=xxx.xxx.xxx.xxx\n- Alert details service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter process count is insufficient for deployed services OB_CLUSTER and OB_PROXY. Expected exporter count: 6, Actual exporter count:5\n- Restoration time 2020-12-03T09:50:12+08:00",
"scope": "Host",
"sentAt": "2020-12-03T01:50:13Z",
"status": "Success"
}
],
"page": {
"number": 1,
"size": 2,
"totalElements": 1817,
"totalPages": 909
}
},
"duration": 4,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2020-12-03T09:50:34.281+08:00",
"traceId": "e61c62a983ae4a05"
}
