Help Center> Cloud Eye> API Reference> API Description> Event Monitoring> Querying the Monitoring Details of an Event

Querying the Monitoring Details of an Event

Function

This API is used to query the event details based on the event name.

URI

GET /V1.0/{project_id}/event/{event_name}

  • Parameter description
    Table 1 Parameter description

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Specifies the project ID.

    For details about how to obtain the project ID, see Obtaining a Project ID.

  • Example
    GET https://{Cloud Eye endpoint}/V1.0/{project_id}/event/{event_name}

Request

Table 2 Parameter description

Parameter

Type

Mandatory

Description

event_name

String

Yes

Specifies the event name.

event_type

String

Yes

Specifies the event type. Possible values are EVENT.SYS, indicating a system event, and EVENT.CUSTOM, indicating a custom event.

event_source

String

No

Specifies the event name. The value can be a system event name or a custom event name.

event_level

String

No

Specifies the event severity. Possible values are Critical, Major, Minor, and Info.

event_user

String

No

Specifies the name of the user who reports the event monitoring data. It can also be a project ID.

event_state

String

No

Specifies the event status. Possible values are normal, warning, or incident.

from

Integer

No

Specifies the start time of the query. The value is a UNIX timestamp and the unit is ms. Example: 1605952700911

to

Integer

No

Specifies the end time of the query. The value is a UNIX timestamp and the unit is ms. The from value must be smaller than the to value.

start

Integer

No

Specifies the start value of pagination. The value is an integer. The default value is 0.

limit

Integer

No

Specifies the maximum number of the custom alarm template that can be queried at a time. The value range is (0,100] and the default value is 100.

Response

  • Response parameters
Table 3 Parameter description

Parameter

Type

Mandatory

Description

event_name

string

No

Specifies the event name. The value can be a system event name or a custom event name.

event_type

string

No

Specifies the event type. Possible values are EVENT.SYS, indicating a system event, and EVENT.CUSTOM, indicating a custom event.

event_users

string

No

Specifies the name of the user who reports the event. It can also be a project ID.

event_sources

string

No

Specifies the event source. If the event is a system event, the value is the namespace of each service. To view the namespace of each service, see Services Interconnected with Cloud Eye. If the event is a custom event, the event source is defined by the user.

event_info

Array of objects

No

Specifies details about one or more events.

meta_data

MetaData object

No

Specifies the number of metadata records in the query result.

Table 4 event_info field data structure description

Parameter

Type

Mandatory

Description

event_name

string

Yes

Specifies the event name. The value can be a string of 1 to 64 characters, must start with a letter, and contain only letters, digits, and underscores (_).

event_source

string

No

Specifies the event source in the format of service.item. service and item each must be a string that starts with a letter and contains 3 to 32 characters, including only letters, digits, and underscores (_).

time

long

Yes

Specifies the time when the event occurred. The time is UNIX timestamp (ms) format. Since there is a latency between the client and the server, the data timestamp to be inserted should be within the period that starts from one hour before the current time plus 20s to 10 minutes after the current time minus 20s. In this way, the timestamp will be inserted to the database without being affected by the latency.

detail

Detail object

Yes

Specifies the event details.

event_id

string

No

Specifies the event ID.

Table 5 detail field data structure description

Parameter

Type

Mandatory

Description

content

string

No

Specifies the event content. The value can contain a maximum of 4096 characters.

group_id

string

No

Specifies the resource group the event belongs to. The resource group ID must be an existing resource group ID.

resource_id

string

No

Specifies the resource ID. The value contains a maximum of 128 characters.

resource_name

string

No

Specifies the resource name. The value contains a maximum of 128 characters.

event_state

string

No

Specifies the event status.

Valid value can be normal, warning, or incident.

event_level

string

No

Specifies the event severity.

Its value can be Critical, Major, Minor, or Info.

event_user

string

No

Specifies the event user. The value can contain a maximum of 4096 characters.

Table 6 meta_data field data structure description

Parameter

Type

Mandatory

Description

total

Integer

No

Specifies the total number of events.

  • Example response
    {
     "event_name": "rebootServer",
     "event_type": "EVENT.SYS",
     "event_users": [
       ""
     ],
     "event_sources": [
       "SYS.ECS"
     ],
     "event_info": [
       {
         "event_id": "ev1606302402256R6doP5YeZ",
         "event_name": "rebootServer",
         "event_source": "SYS.ECS",
         "time": 1606302400000,
         "detail": {
           "content": "{\"resourceSpecCode\":\"kc1.4xlarge.2.linux\",\"enterpriseProjectId\":\"6efb843e-391a-46a8-afc8-7fe51c9dd575\"}",
           "group_id": "",
           "resource_id": "ef8dad27-0488-4de7-bb43-1a0df9806d90",
           "resource_name": "CES-POROS-0001",
           "event_state": "normal",
           "event_level": "Minor",
           "event_user": "",
           "event_type": "EVENT.SYS"
         }
       },
       {
         "event_id": "ev1606296088071wGoAOxVYa",
         "event_name": "rebootServer",
         "event_source": "SYS.ECS",
         "time": 1606296086000,
         "detail": {
           "content": "{\"resourceSpecCode\":\"kc1.4xlarge.2.linux\",\"enterpriseProjectId\":\"6efb843e-391a-46a8-afc8-7fe51c9dd575\"}",
           "group_id": "",
           "resource_id": "ef8dad27-0488-4de7-bb43-1a0df9806d90",
           "resource_name": "CES-POROS-0001",
           "event_state": "normal",
           "event_level": "Minor",
           "event_user": "",
           "event_type": "EVENT.SYS"
         }
       },
       {
         "event_id": "ev1604654426090g7g37E6Yb",
         "event_name": "rebootServer",
         "event_source": "SYS.ECS",
         "time": 1604654425000,
         "detail": {
           "content": "{\"resourceSpecCode\":\"c6.4xlarge.2.linux\",\"enterpriseProjectId\":\"129559eb-f795-4b5f-9e46-cbd43a462362\"}",
           "group_id": "",
           "resource_id": "0bfa63ee-31f5-40a9-b992-50992c80c58a",
           "resource_name": "ndrv2-pod-ops-0001",
           "event_state": "normal",
           "event_level": "Minor",
           "event_user": "",
           "event_type": "EVENT.SYS"
         }
       }
     ],
     "meta_data": {
       "total": 5
     }
    }

Returned Value

  • Normal

    200

  • Abnormal

    Returned Values

    Description

    400 Bad Request

    Request error.

    401 Unauthorized

    The authentication information is not provided or is incorrect.

    403 Forbidden

    You are forbidden to access the page requested.

    408 Request Timeout

    The request timed out.

    429 Too Many Requests

    Concurrent requests are excessive.

    500 Internal Server Error

    Failed to complete the request because of an internal service error.

    503 Service Unavailable

    The service is currently unavailable.

Error Code

For details, see Error Codes.