Overview
You can call this API to get the current alert.
API details
Constraints
You must be authorized to use OCP application services.
Request path
GET /api/v2/alarm/alarms/actived
Request parameters
body:
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| appType | String | No | OceanBase | The application category (the source of the alert). 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 of the alert rule. |
| alarmType | String | No | ob_tenant_exists_expired_xa_trans | The alert type. |
| level | Array | No | 1 | The alert level. Valid values: 1 to 5. 1: Down; 2: Critical; 3: Alert; 4: Caution; 5: Info. |
| alarmGroupIds | integer | No | [1,2,3] | The IDs of alert groups, which are separated 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 alarm, for more information, see OcpAlarm data structure. |
| ├─ page | Object | The pagination information, for more information, see page data structure. |
| 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 alarm was created. |
| gmtModified | String | The time when the alarm was last modified. |
| id | Integer | The ID of the alarm event. |
| alarmId | Integer | The ID of the alarm. |
| alarmTemplateId | Integer | The ID of the alarm template. |
| appType | String | The type of the application. Valid values:
|
| alarmType | String | The type of the alarm. |
| scope | String | The scope of the alarm. Valid values:
|
| level | Integer | The level of the alarm. Valid values: 1 to 5. 1 indicates Down, 2 indicates Critical, 3 indicates Alert, 4 indicates Caution, and 5 indicates Info. |
| status | String | The status of the alarm. Valid values:
|
| target | String | The target of the alarm, which is generated based on the target template in the alarm rule. |
| alarmTarget | Object | The information about the alarm target. For more information, see AlarmTarget data structure. |
| obCluster | Object | The information about the cluster. For more information, see AlarmTarget data structure. |
| name | String | The name of the alarm. |
| summary | String | The summary of the alarm, which is generated based on the summary template in the alarm rule. |
| description | String | The details of the alarm, which are generated based on the details template in the alarm rule. |
| activeAt | String | The time when the alarm was generated. |
| resolvedAt | String | The time when the alarm was resolved. |
| updatedAt | String | The time when the alarm was last updated. |
| statusUpdatedAt | String | The time when the status of the alarm was last updated. |
| labels | Object | The tags and values of the alarm event. |
| targetLabels | Object | The tags and values of the alarm target, such as svr_ip and ob_tenant_id. |
| metricGroup | Object | The array of metric groups. For more information, see MetricGroup data structure. |
| messagePush | Object | The details about the alarm push. For more information, see MessagePush data structure. |
| alarmGroups | Array | The list of alarm groups. |
| originalAlarmId | Integer | The ID of the original alarm. |
| containSnapshot | Boolean | Indicates whether the alarm contains an abnormal snapshot. |
| containSelfcure | Boolean | Indicates whether the alarm contains self-healing. |
| resolveComment | String | The remarks about the resolution of the alarm. |
AlarmTarget data structure
Parameter |
Type |
Description |
|---|---|---|
| appType | String | The type of the application. Valid values:
|
| scope | String | The scope of the alarm. Valid values:
|
| includeTargets | Array | The targets of the alarm (forward selection). |
| excludeTargets | Array | The targets to be excluded from the alarm (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, which supports internationalization. |
| description | String | The description of the metric group, which 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 monitoring data. Default value: false. |
| order | Integer | The sorting parameter. |
MessagePush data structure
Parameter |
Type |
Description |
|---|---|---|
| configured | Boolean | Indicates whether alert message push is configured. |
| successCount | Integer | The number of successful message pushes. |
| noSuccessCount | Integer | The number of failed message pushes. |
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 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", "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": "The alert indicates that a downgrade arbitration for log streams has occurred for the tenant A_oracle in the cluster ob4253_A. The number of log streams involved in the downgrade arbitration is 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 OceanBase租 戶存在已降級的日誌流",
"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, Performance",
"alarm_scope": "Tenant",
"ob_cluster": "ob4253_A",
"alarm_description_zh_tw": "Instance: ob4253_A, tenant: A_oracle, log stream arbitration downgrade warning: Arbitration downgrade has been performed on three log streams of tenant A_oracle.",
"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": "Alarming",
"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": "Severe",
"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 a downgraded log stream.",
"ob_cluster_type_zh_tw": "Primary",
"alarm_description": "Instance: ob4253_A, Tenant: A_oracle. The OceanBase tenant has 3 streams in arbitration downgrade.",
"ob_cluster_type_native": "PRIMARY",
"app_zh_tw": "OceanBase",
"metrics": "ob_tenant_log_stream_degraded_count",
"ocp_ip": "xx.xx.xx.xx",
"value_shown": "3",
"tenant_id": "1004",
"ob_tenant_log_stream_degraded_count_alarm_threshold": "0",
"alarm_name": "The OceanBase tenant has a degraded log stream.",
"alarm_status_zh_tw": "警示中",
"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 instance has been downgraded in 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": "Owner",
"app_en_us": "OceanBase",
"value": "3",
"alarm_name_zh_tw": "OceanBase Database Tenant has a Downgraded 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": "OceanBase tenants with downgraded 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": "Main",
"alarm_description_zh_cn": "Cluster: ob4253_A, tenant: A_oracle, alarm: The log streams of the OceanBase Database tenant have been downgraded. The number of log streams that are downgraded: 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": "The log stream has been degraded for an 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 OceanBase tenant has degraded log stream.",
"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: The 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 connect to the node",
"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, Alert: OceanBase server failed to 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": "Alerting",
"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": "Stopped",
"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 to",
"ob_cluster_type_zh_tw": "Primary",
"alarm_description": "Cluster: ob4253_A, Host: xxx.xxx.xxx.xxx, Alert: The OceanBase server could not be connected to.",
"ob_cluster_type_native": "PRIMARY",
"app_zh_tw": "OceanBase",
"metrics": "ob_connectable",
"ocp_ip": "xx.xx.xx.xx",
"ob_connectable_value_en_us": "0",
"value_shown": "0",
"alarm_name": "OceanBase Server is unreachable",
"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 OceanBase database 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": "OceanBase伺服器無法連接",
"ob_cluster_type_zh_cn": "Main",
"__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 unreachable",
"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: The server of OceanBase Database is unreachable.",
"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": "OceanBase server cannot be connected to",
"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"
}
