Features
This API is used to obtain the current alert.
API details
Constraints
The caller must pass the authentication for the OCP application service.
Request path
GET /api/v2/alarm/alarms/actived
Request parameters
body:
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| appType | String | No | OceanBase | Application category (alert source). Valid values:
|
| scope | String | No | Cluster | 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, generated based on the target template in the alert rule. |
| alarmType | String | No | ob_tenant_exists_expired_xa_trans | Alert type. |
| level | Array | No | 1 | Alert levels [1~5], corresponding to: Down, Critical, Alert, Caution, and Info. |
| alarmGroupIds | integer | No | [1,2,3] | List of alert group IDs, separated by commas. |
| status | Array | No | Active | Alert status. Valid values:
|
| activeAtStart | String | No | 2020-11-11T11:12:13.127+08:00 | The time when the alert was triggered. |
| activeAtEnd | String | No | 2020-11-11T17:11:13.127+08:00 | The deadline for triggering the alert. |
| keyword | String | No | hello | Keyword match. |
Response parameters
Basic Data Structures
Parameter |
Type |
Description |
|---|---|---|
| data | Object | The requested data. |
| ├─ contents | Array | Alert details. For more information, see OcpAlarm data structure. |
| ├─ page | Object | Pagination information. For details, see page data structure. |
| successful | Boolean | 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 | An HTTP status code. |
| traceId | String | The trace ID of the request, used for troubleshooting. |
| server | String | The address of the application service that responded to the request. |
OcpAlarm data structure
Parameter |
Type |
Description |
|---|---|---|
| gmtCreate | String | Creation time. |
| gmtModified | String | Modified at. |
| id | Integer | Alert event ID. |
| alarmId | Integer | Alert ID. |
| alarmTemplateId | Integer | Alert template ID. |
| appType | String | Application type. Valid values:
|
| alarmType | String | Alert type. |
| scope | String | Alert scope. Valid values:
|
| level | Integer | The alert severity levels [1~5] correspond to Down, Critical, Alert, Caution, and Info, respectively. |
| status | String | Alert status. Valid values:
|
| target | String | The target object of the alert, generated based on the target template in the alert rule. |
| alarmTarget | Object | Information about the alert target. For more information, see AlertTarget data structure. |
| obCluster | Object | For more information, see AlarmTarget data structure. |
| name | String | Alert name. |
| summary | String | Alert overview, generated based on the overview template of the alert rule. |
| description | String | Alert details, generated based on the details template of the alert rule. |
| activeAt | String | The time when the alert was generated. |
| resolvedAt | String | Alert clearance time. |
| updatedAt | String | The time when the alert was updated. |
| statusUpdatedAt | String | The time when the alert status was updated. |
| labels | Object | The tag and value of the alert event. |
| targetLabels | Object | The tag and value of the alert object, for example,svr_ip、ob_tenant_idand so on. |
| metricGroup | Object | Array of metric groups. For more information, see MetricGroup data structure. |
| messagePush | Object | Alert push details. For more information, see MessagePush data structure. |
| alarmGroups | Array | The list of alert groups. |
| originalAlarmId | Integer | The plaintiff's ID. |
| containSnapshot | Boolean | Whether to include abnormal snapshots. |
| containSelfcure | Boolean | Whether to include self-healing. |
| resolveComment | String | Additional information about how to resolve the alert. |
AlarmTarget data structure
Parameter |
Type |
Description |
|---|---|---|
| appType | String | Application type. Valid values:
|
| scope | String | Alert scope. Valid values:
|
| includeTargets | Array | Alert target (positive selection). |
| excludeTargets | Array | Exclude Alert Targets (Inverse Selection). |
MetricGroup data structure
Parameter |
Type |
Description |
|---|---|---|
| id | Integer | The ID of the metric group. |
| key | String | The encoded name of the metric group. |
| className | String | The class name corresponding to the metric group. |
| name | String | The name of the metric group, which supports internationalization. |
| description | String | The description of the metric group, which supports internationalization. |
| metrics | Array | An array of metric metadata. |
| dimension | String | The dimension for grouping metrics. |
| withLabel | Boolean | Whether it is a labeled monitoring data group. Default value:false. |
| order | Integer | Sort parameter. |
MessagePush data structure
Parameter |
Type |
Description |
|---|---|---|
| configured | Boolean | Whether to enable alert push. |
| successCount | Integer | Number of successfully pushed messages. |
| noSuccessCount | Integer | The number of failed message pushes. |
Page data structure
Parameter |
Type |
Description |
|---|---|---|
| totalElements | Integer | Total Records. |
| totalPage | Integer | Total number of pages. |
| number | Integer | Current page number. |
| size | Integer | Number of records on 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 tenant A_oracle have undergone arbitration downgrade. Number 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": "Primary",
"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 The OceanBase tenant has degraded log streams.",
"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 tenant A_oracle have undergone arbitration downgrade. Number 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 have degraded log stream",
"message_type": "Alarm",
"alarm_status_zh_cn": "Alerting",
"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 have degraded log stream. The log stream of OceanBase tenant A_oracle exists degraded, the count of degraded log stream: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=A_oracle OceanBase tenant has degraded log streams",
"ob_cluster_type_zh_tw": "Primary",
"alarm_description": "Cluster: ob4253_A, Tenant: A_oracle, Alert: OceanBase tenant has degraded log streams. The log streams of tenant A_oracle have undergone arbitration downgrade. 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 degraded log streams",
"alarm_status_zh_tw": "Alerting",
"vpc_name": "system-default",
"related_tenant_names": "A_oracle",
"values": "3",
"alarm_level_zh_tw": "Critical",
"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 has degraded log streams",
"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 Tenant Has Degraded Log Streams",
"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": "OceanBase Tenant Has Degraded Log Streams",
"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": "Primary",
"alarm_description_zh_cn": "Cluster: ob4253_A, Tenant: A_oracle, Alert: OceanBase tenant has degraded log streams. The log stream of tenant A_oracle has undergone arbitration downgrade. Number of degraded log streams: 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": "Degraded log streams exist in the OceanBase tenant",
"scope": "Tenant",
"status": "Active",
"statusUpdatedAt": "2025-06-06T07:03:07Z",
"summary": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:tenant_name=A_oracle The OceanBase tenant has degraded log streams.",
"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 server cannot be connected.",
"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 cannot be connected",
"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 kernel, 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, Alert: 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": "Alarming",
"alarm_scope_zh_tw": "Host",
"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": "Downtime",
"ob_cluster_type": "PRIMARY",
"alarm_summary_zh_cn": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:host=xxx.xxx.xxx.xxx OceanBase server cannot be connected",
"ob_cluster_type_zh_tw": "Primary",
"alarm_description": "Cluster: ob4253_A, Host: xxx.xxx.xxx.xxx, Alert: OceanBase server cannot be connected.",
"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": "Unable to 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": "Service Disruption",
"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 OceanBase server cannot be connected",
"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": "Unable to connect to OceanBase server",
"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",
"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, availability",
"ob_connectable_value": "0"
},
"level": 1,
"messagePush": {
"configured": true,
"noSuccessCount": 0,
"successCount": 2
},
"name": "Unable to connect to OceanBase server",
"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"
}
