Querying the Alarm List

Function

Queries system alarm data. URL parameters are used to specify control conditions for pagination query, alarm category, and query operation type. The alarm information created in the MEF Center database is returned.

Syntax

Operation type: GET

URL: https://{ip}:{port}/alarmmanager/v1/alarms?pageNum={value1}&pageSize={value2}&ifCenter={value3}&sn={value4}&groupId={value5}

Request message body: None

URL Parameters

Table 1 Description

Parameter

Mandatory/Optional

Description

Value

pageNum

Mandatory

Number of pages for pagination query. The value is an ordinal number.

The value is an integer ranging from 1 to 2^31-1.

pageSize

Mandatory

Page size for pagination query

The value is an integer ranging from 1 to 100.

ifCenter

Optional

Whether the node to be queried is an MEF Center node.

The value can be true or false.

NOTE:
  • If ifCenter is set to true, groupId and sn are ignored.
  • If ifCenter is set to false and sn and groupId are not provided, alarms of all MEF Edge nodes are queried by page.

sn

Select either of the two parameters.

Serial number of the MEF Edge device, used to query the alarm information about a node.

The value can contain lowercase letters, uppercase letters, digits, underscores (_), and hyphens (-). It cannot start or end with an underscore (_) or hyphen (-). The maximum length is 64 bytes.

groupId

Node group ID, used to query the alarm information about nodes in a specified node group.

32-bit unsigned number. The minimum value is 1 and the maximum value is 2^32-1.

  • If ifCenter, sn, and groupId are empty, alarms of all nodes are queried by pageNum and pageSize.
  • If only sn or groupId is specified, ifCenter is set to false.

Usage Example

Request:

GET https://10.10.10.10:30035/alarmmanager/v1/alarms?pageNum=1&pageSize=100&ifCenter=false&sn=xxxxxxxxxxxxxx

Request message body: None

Response:
{
    "status": "00000000",
    "msg": "success",
    "data": {
        "records": [
            {
                "id": 1430946159,
                "alarmType": "alarm",
                "createAt": "2023-09-27T16:01:25Z",
                "ip": "xx.xx.xx.xx",
                "serialNumber": "xxxxxxxxxxxxxx",
                "resource": "ALARM DEFAULT RESOURCE",
                "severity": "MINOR"
            },
            {
                "id": 628196293,
                "alarmType": "alarm",
                "createAt": "2023-09-27T16:05:25Z",
                "ip": "xx.xx.xx.xx",
                "serialNumber": "xxxxxxxxxxxxxx",
                "resource": "ALARM DEFAULT RESOURCE",
                "severity": "MAJOR"
            },
            {
                "id": 2136868853,
                "alarmType": "alarm",
                "createAt": "2023-09-27T16:09:25Z",
                "ip": "xx.xx.xx.xx",
                "serialNumber": "xxxxxxxxxxxxxx",
                "resource": "ALARM DEFAULT RESOURCE",
                "severity": "MAJOR"
            }
        ],
        "total": 3
    }
}

Response status code: 200

Output Description

Table 2 Operation output description

Parameter

Type

Description

status

String

Error code

msg

String

Description

data

Object

Query result

Table 3 data field description

Parameter

Type

Description

records

Array

Object array for pagination query

total

Number

Total number of query results

Table 4 records field description

Parameter

Type

Description

id

Number

Alarm ID

alarmType

String

Alarm type. The value is alarm.

createAt

String

Time when an alarm is generated

ip

String

Device IP address

serialNumber

String

For MEF Edge alarms, the value is the device serial number. For MEF Center alarms, the value is an empty string.

resource

String

Alarm source

severity

String

Severity:

  • MINOR
  • MAJOR
  • CRITICAL