Overview
You can call this API to get the current alert.
API details
Constraints
You must be authorized for the application service.
Request path
GET /api/v2/alarm/alarms/actived
Request parameters
body:
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| appType | String | No | OceanBase | The application type (the alert source). Valid values:
|
| scope | String | No | Cluster | The alert scope. Valid values:
|
| target | Array | No | alarm_template_id=0:ob_cluster=TEST_CLUSTER-12:tenant_name=oracle:trans_hash=10609937150880685421 | The target object of the alert, which is generated based on the target template in the alert rule. |
| alarmType | String | No | ob_tenant_exists_expired_xa_trans | The alert type. |
| level | Array | No | 1 | The alert level [1~5], which correspond to Down, Critical, Alert, Caution, and Info, respectively. |
| alarmGroupIds | integer | No | [1,2,3] | The IDs of the alert groups. Separate multiple IDs with commas. |
| status | Array | No | Active | The alert status. Valid values:
|
| activeAtStart | String | No | 2020-11-11T11:12:13.127+08:00 | The start time when the alert is triggered. |
| activeAtEnd | String | No | 2020-11-11T17:11:13.127+08:00 | The end time when the alert is triggered. |
| keyword | String | No | hello | The keyword to match. |
Response parameters
Basic data structure
Parameter |
Type |
Description |
|---|---|---|
| data | Object | The returned data. |
| ├─ contents | Array | The details of the alert. For more information, see OcpAlarm. |
| ├─ page | Object | The pagination information. For more information, see page. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The time taken by the server to process the request, in milliseconds. |
| status | Integer | The HTTP status code. |
| traceId | String | The trace ID of the request. This trace ID is used for troubleshooting. |
| server | String | The address of the application server that responded to the request. |
OcpAlarm data structure
Parameter |
Type |
Description |
|---|---|---|
| gmtCreate | String | The time when the alert was created. |
| gmtModified | String | The time when the alert was last modified. |
| id | Integer | The ID of the alert. |
| alarmId | Integer | The ID of the alert. |
| alarmTemplateId | Integer | The ID of the alert template. |
| appType | String | The application type. Valid values:
|
| alarmType | String | The type of the alert. |
| scope | String | The scope of the alert. Valid values:
|
| level | Integer | The alert level. Valid values: 1 to 5, which correspond to Down, Critical, Alert, Caution, and Info, respectively. |
| status | String | The status of the alert. Valid values:
|
| target | String | The target of the alert, which is generated based on the target template of the alert rule. |
| alarmTarget | Object | The information about the target of the alert. For more information, see AlarmTarget. |
| obCluster | Object | The information about the cluster. For more information, see AlarmTarget. |
| name | String | The name of the alert. |
| summary | String | The summary of the alert, which is generated based on the summary template of the alert rule. |
| description | String | The details of the alert, which are generated based on the details template of the alert rule. |
| activeAt | String | The time when the alert was generated. |
| resolvedAt | String | The time when the alert was resolved. |
| updatedAt | String | The time when the alert was last updated. |
| statusUpdatedAt | String | The time when the status of the alert was last updated. |
| labels | Object | The labels and values of the alert. |
| targetLabels | Object | The labels and values of the target of the alert. For example, svr_ip and ob_tenant_id. |
| metricGroup | Object | The array of metric groups. For more information, see MetricGroup. |
| messagePush | Object | The details about the alert push. For more information, see MessagePush. |
| alarmGroups | Array | The list of alert groups. |
| originalAlarmId | Integer | The ID of the original alert. |
| containSnapshot | Boolean | Indicates whether an abnormal snapshot exists. |
| containSelfcure | Boolean | Indicates whether self-healing is enabled. |
| resolveComment | String | The remarks about how to resolve the alert. |
AlarmTarget data structure
Parameter |
Type |
Description |
|---|---|---|
| appType | String | The application type. Valid values:
|
| scope | String | The scope of the alert. Valid values:
|
| includeTargets | Array | The targets of the alert (forward selection). |
| excludeTargets | Array | The targets to be excluded from the alert (reverse selection). |
MetricGroup data structure
Parameter |
Type |
Description |
|---|---|---|
| id | Integer | The ID of the metric group. |
| key | String | The code name of the metric group. |
| className | String | The class name corresponding to the metric group. |
| name | String | The name of the metric group. This parameter supports internationalization. |
| description | String | The description of the metric group. This parameter supports internationalization. |
| metrics | Array | The array of metric metadata. |
| dimension | String | The dimension of the metric group. |
| withLabel | Boolean | Specifies whether the metric group contains labeled metrics. Default value: false. |
| order | Integer | The sort parameter. |
MessagePush data structure
Parameter |
Type |
Description |
|---|---|---|
| configured | Boolean | Indicates whether alert message push is configured. |
| successCount | Integer | The number of times the alert message is successfully pushed. |
| noSuccessCount | Integer | The number of times the alert message is not successfully pushed. |
page data structure
Parameter |
Type |
Description |
|---|---|---|
| totalElements | Integer | The total number of records. |
| totalPage | Integer | The total number of pages. |
| number | Integer | The current page number. |
| size | Integer | The number of records in the current page. |
Examples
Request example
GET /api/v2/alarm/alarms/actived
Response example
{
"data": {
"contents": [{
"activeAt": "2025-06-06T07:03:07Z",
"alarmGroups": ["Database Kernel", "Performance"],
"alarmTarget": {
"appType": "OceanBase",
"excludeTargets": [],
"includeTargets": [{
"cluster": {
"clusterId": 2,
"name": "ob4253_A",
"obClusterId": 1731295857
},
"tenants": [{
"name": "A_oracle",
"obTenantId": 1004,
"tenantId": 7
}]
}],
"scope": "Tenant"
},
"alarmTemplateId": 0,
"alarmType": "ob_tenant_log_stream_degraded",
"appType": "OceanBase",
"autoResolved": true,
"containSelfcure": false,
"description": "Cluster: ob4253_A, Tenant: A_oracle, Alert: OceanBase tenant has degraded log streams. The log streams of OceanBase tenant A_oracle have been downgraded during arbitration. The count of degraded log streams: 3.",
"gmtCreate": "2025-06-06T07:03:06Z",
"gmtModified": "2025-06-06T07:12:12.916033Z",
"id": 192,
"labels": {
"ob_tenant_id": "1004",
"__ob_tenant.id": "7",
"app_type": "OceanBase",
"alarm_threshold": "0",
"ob_tenant_log_stream_degraded_count_value_zh_tw": "3",
"value_zh_tw": "3",
"alarm_status_native": "Active",
"ob_cluster_type_shown": "Main",
"alarm_level": "2",
"obregion": "ob4253_A",
"app_native": "OB",
"alarm_summary_zh_tw": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:tenant_name=A_oracle OceanBase tenant has degraded log stream",
"alarm_summary_en_us": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:tenant_name=A_oracle OceanBase tenant have degraded log stream",
"ob_tenant": "A_oracle",
"alarm_type": "ob_tenant_log_stream_degraded",
"alarm_status": "Active",
"alarm_group_zh_tw": "Database Kernel, Performance",
"alarm_scope": "Tenant",
"ob_cluster": "ob4253_A",
"alarm_description_zh_tw": "Cluster: ob4253_A, Tenant: A_oracle, Alert: OceanBase tenant has degraded log streams. The log streams of OceanBase tenant A_oracle have been downgraded during arbitration. The count of degraded log streams: 3.",
"value_en_us": "3",
"is_meta_tenant": "0",
"app": "OB",
"__ob_cluster.id": "2",
"contain_selfcure": "0",
"tenant_name": "A_oracle",
"alarm_duration": "545",
"level": "2",
"related_svr_ips": "xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx",
"alarm_name_en_us": "OceanBase tenant has degraded log stream",
"message_type": "Alarm",
"alarm_status_zh_cn": "Active",
"alarm_group_en_us": "dba,performance",
"ob_tenant_log_stream_degraded_count_value_zh_cn": "3",
"value_zh_cn": "3",
"alarm_description_en_us": "OceanBase cluster: ob4253_A, tenant: A_oracle, alert: OceanBase tenant has degraded log stream. The log streams of OceanBase tenant A_oracle have been downgraded during arbitration. The count of degraded log streams: 3.",
"alarm_level_zh_cn": "Critical",
"tenant_role_en_us": "Primary",
"ob_cluster_type": "PRIMARY",
"alarm_summary_zh_cn": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:tenant_name=The OceanBase instance A has degraded log streams.",
"ob_cluster_type_zh_tw": "Primary",
"alarm_description": "Cluster: ob4253_A. Tenant: A_oracle. Alarm: The log streams of the OceanBase tenant are degraded. Number of degraded log streams: 3.",
"ob_cluster_type_native": "PRIMARY",
"app_zh_tw": "OceanBase",
"metrics": "ob_tenant_log_stream_degraded_count",
"ocp_ip": "xxx.xxx.xxx.xxx",
"value_shown": "3",
"tenant_id": "1004",
"ob_tenant_log_stream_degraded_count_alarm_threshold": "0",
"alarm_name": "OceanBase tenant has a degraded log stream",
"alarm_status_zh_tw": "Warning",
"vpc_name": "system-default",
"related_tenant_names": "A_oracle",
"values": "3",
"alarm_level_zh_tw": "嚴重",
"tenant_role": "PRIMARY",
"alarm_level_native": "2",
"app_zh_cn": "OceanBase",
"alarm_level_en_us": "Critical",
"ob_cluster_type_en_us": "Primary",
"auto_resolved": "1",
"alarm_summary": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:tenant_name=A_oracle OceanBase tenant contains a downgraded log stream",
"alarm_active_at": "2025-06-06T15:03:06.671+08:00",
"alarm_target": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:tenant_name=A_oracle",
"tenant_role_zh_tw": "Primary",
"app_en_us": "OceanBase",
"value": "3",
"alarm_name_zh_tw": "OceanBase Database tenant contains a degraded log stream",
"ob_cluster_type_zh_cn": "Primary",
"ob_tenant_log_stream_degraded_count_value_en_us": "3",
"related_ob_cluster_name": "ob4253_A",
"ob_cluster_name": "ob4253_A",
"alarm_name_zh_cn": "An OceanBase log stream has been downgraded.",
"alarm_status_en_us": "Active",
"tenant_role_shown": "Primary",
"alarm_template_id": "0",
"ob_cluster_id": "1731295857",
"ob_tenant_log_stream_degraded_count_value": "3",
"related_ob_cluster_id": "1731295857",
"tenant_role_zh_cn": "Main",
"alarm_description_zh_cn": "Cluster: ob4253_A, Tenant: A_oracle, Alert: Log streams of OceanBase tenant are degraded. Number of degraded log streams of tenant A_oracle: 3.",
"tenant_role_native": "PRIMARY",
"obzone": "zone2",
"alarm_updated_at": "2025-06-06T15:03:06.671+08:00",
"alarm_group_zh_cn": "database kernel, performance"
},
"level": 2,
"messagePush": {
"configured": true,
"noSuccessCount": 0,
"successCount": 2
},
"name": "OceanBase tenants have degraded log streams",
"scope": "Tenant",
"status": "Active",
"statusUpdatedAt": "2025-06-06T07:03:07Z",
"summary": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:tenant_name=A_oracle OceanBase tenant has a log stream that has been downgraded.",
"target": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:tenant_name=A_oracle",
"updatedAt": "2025-06-06T07:12:13Z"
},
{
"activeAt": "2025-06-06T07:01:56Z",
"alarmGroups": ["Database Kernel", "dev", "availability"],
"alarmTarget": {
"appType": "OceanBase",
"excludeTargets": [],
"includeTargets": [{
"cluster": {
"clusterId": 2,
"name": "ob4253_A",
"obClusterId": 1731295857
},
"hosts": [{
"hostId": 2,
"hostIp": "xxx.xxx.xxx.xxx",
"id": 2
}]
}],
"scope": "Host"
},
"alarmTemplateId": 0,
"alarmType": "ob_cannot_connected",
"appType": "OceanBase",
"autoResolved": true,
"containSelfcure": false,
"description": "Cluster: ob4253_A. Host: xxx.xxx.xxx.xxx. Alert: OceanBase Database server is not accessible.",
"gmtCreate": "2025-06-06T07:02:26Z",
"gmtModified": "2025-06-06T07:14:34.327779Z",
"id": 187,
"labels": {
"app_type": "OceanBase",
"alarm_threshold": "0",
"svr_ip": "xxx.xxx.xxx.xxx",
"value_zh_tw": "0",
"alarm_status_native": "Active",
"ob_cluster_type_shown": "Primary",
"alarm_level": "1",
"obregion": "ob4253_A",
"app_native": "OB",
"alarm_summary_zh_tw": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:host=xxx.xxx.xxx.xxx OceanBase server is unable to connect",
"alarm_summary_en_us": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:host=xxx.xxx.xxx.xxx OceanBase host cannot connected",
"alarm_type": "ob_cannot_connected",
"alarm_status": "Active",
"alarm_group_zh_tw": "Database engine,dev,Availability",
"host": "xxx.xxx.xxx.xxx",
"alarm_scope": "Host",
"alarm_scope_native": "Host",
"ob_cluster": "ob4253_A",
"alarm_description_zh_tw": "Cluster: ob4253_A, Server: xxx.xxx.xxx.xxx, Alarm: OceanBase server cannot be connected.",
"value_en_us": "0",
"app": "OB",
"__ob_cluster.id": "2",
"contain_selfcure": "0",
"alarm_duration": "758",
"level": "1",
"related_svr_ips": "xxx.xxx.xxx.xxx",
"alarm_name_en_us": "OceanBase host cannot connected",
"message_type": "Alarm",
"alarm_status_zh_cn": "Alarm in progress",
"alarm_scope_zh_tw": "主機",
"alarm_group_en_us": "dba,dev,availability",
"value_zh_cn": "0",
"alarm_description_en_us": "OceanBase cluster: ob4253_A, host: xxx.xxx.xxx.xxx, alert: OceanBase host cannot connected.",
"__host.id": "2",
"alarm_scope_zh_cn": "Host",
"alarm_level_zh_cn": "Stop",
"ob_cluster_type": "PRIMARY",
"alarm_summary_zh_cn": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:host=xxx.xxx.xxx.xxx Failed to connect to the OceanBase server",
"ob_cluster_type_zh_tw": "Main",
"alarm_description": "Instance: ob4253_A, host: xxx.xxx.xxx.xxx, alert: Cannot connect to the OceanBase server.",
"ob_cluster_type_native": "PRIMARY",
"app_zh_tw": "OceanBase",
"metrics": "ob_connectable",
"ocp_ip": "xxx.xxx.xxx.xxx",
"ob_connectable_value_en_us": "0",
"value_shown": "0",
"alarm_name": "Cannot connect to OceanBase server",
"alarm_status_zh_tw": "Warning",
"vpc_name": "system-default",
"ob_connectable_alarm_threshold": "0",
"related_tenant_names": "sys,A_mysql,A_oracle",
"values": "0",
"alarm_level_zh_tw": "停服",
"ob_connectable_value_zh_cn": "0",
"alarm_level_native": "1",
"alarm_scope_en_us": "Host",
"app_zh_cn": "OceanBase",
"alarm_level_en_us": "Down",
"ob_cluster_type_en_us": "Primary",
"auto_resolved": "1",
"alarm_summary": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:host=xxx.xxx.xxx.xxx The OceanBase Database server cannot be connected to.",
"ob_connectable_value_zh_tw": "0",
"alarm_active_at": "2025-06-06T15:01:55.884+08:00",
"alarm_target": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:host=xxx.xxx.xxx.xxx",
"app_en_us": "OceanBase",
"value": "0",
"alarm_name_zh_tw": "OceanBase伺服器無法連接",
"ob_cluster_type_zh_cn": "Primary",
"__ob_server.id": "2",
"host_ip": "xxx.xxx.xxx.xxx",
"related_ob_cluster_name": "ob4253_A",
"ob_cluster_name": "ob4253_A",
"alarm_name_zh_cn": "OceanBase server cannot be connected to",
"alarm_status_en_us": "Active",
"alarm_template_id": "0",
"ob_cluster_id": "1731295857",
"target": "oceanbase",
"related_ob_cluster_id": "1731295857",
"alarm_description_zh_cn": "Cluster: ob4253_A, Host: xxx.xxx.xxx.xxx, Alert: OceanBase server cannot be connected.",
"obzone": "zone1",
"alarm_updated_at": "2025-06-06T15:01:55.884+08:00",
"host_name": "175fd3f9e29b",
"alarm_group_zh_cn": "Database Kernel,dev,Ava",
"ob_connectable_value": "0"
},
"level": 1,
"messagePush": {
"configured": true,
"noSuccessCount": 0,
"successCount": 2
},
"name": "OceanBase server cannot connect",
"scope": "Host",
"status": "Active",
"statusUpdatedAt": "2025-06-06T07:02:26Z",
"summary": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:host=xxx.xxx.xxx.xxx OceanBase server cannot be connected",
"target": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:host=xxx.xxx.xxx.xxx",
"updatedAt": "2025-06-06T07:14:34Z"
}],
"page": {
"number": 1,
"size": 10,
"totalElements": 6,
"totalPages": 1
}
},
"duration": 316,
"server": "21dc8a9b83",
"status": 200,
"successful": true,
"timestamp": "2025-06-06T15:15:14.569+08:00",
"traceId": "f07227e18398ef0b"
}
