Querying the Event List

Function

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

Syntax

Operation type: GET

URL: https://{ip}:{port}/alarmmanager/v1/events?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, events 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 event 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 event information about MEF Edge 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, events 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/events?pageNum=1&pageSize=100&ifCenter=false&groupId=1

Request message body: None

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

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

Event ID

alarmType

String

Event type. The value is event.

createAt

String

Time when an event is created

ip

String

Device IP address

serialNumber

String

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

resource

String

Event source

severity

String

Event level:

  • MINOR
  • MAJOR
  • CRITICAL
  • OK: normal events