Querying the Monitoring Details of an Event
Function
This API is used to query details of an event based on the event name.
URI
GET /V1.0/{project_id}/event/{event_name}
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition Project ID. It is used to specify the project that an asset belongs to. You can query the assets of a project by project ID. You can obtain the project ID from the API or console. For details, see Obtaining a Project ID. Constraints N/A Range 1 to 64 characters Default Value N/A |
|
event_name |
Yes |
String |
Definition: Event name. The name can be a system event name or a custom event name. Constraints: N/A Range: 1 to 64 characters Default Value: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
event_type |
Yes |
String |
Definition: Event type. Constraints: N/A Range: The value can be:
Default Value: N/A |
|
sub_event_type |
No |
String |
Definition: Event subcategory. Constraints: N/A Range: The value can be:
Default Value: N/A |
|
event_source |
No |
String |
Definition: Event source. The value is the namespace of each cloud service. For details, see Services Interconnected with Cloud Eye. Constraints: N/A Range: The value can contain 0 to 32 characters. A regular expression matches a string that consists of letters, digits, and underscores (_), with a letter at the beginning and a dot (.) in the middle. Default Value: N/A |
|
event_level |
No |
String |
Definition: Event severity. Constraints: N/A Range: The value can be:
Default Value: N/A |
|
event_user |
No |
String |
Definition: Name of the user who reports the event monitoring data. It can also be a project ID. Constraints: N/A Range: The value can contain 0 to 64 characters. A regular expression that matches strings made up of letters (optional), digits, underscores (_), hyphens (-), slashes (/), spaces, at symbols (@), or dots (.). Default Value: N/A |
|
event_state |
No |
String |
Definition: Event status Constraints: N/A Range: The value can be:
Default Value: N/A |
|
from |
No |
Long |
Definition: Start time of the query. The value is a UNIX timestamp in milliseconds. Example: 1605952700911 Constraints: N/A Range: N/A Default Value: N/A |
|
to |
No |
Long |
Definition: End time of the query. The value is a UNIX timestamp in milliseconds. Constraints: The time of from must be earlier than that of to. Range: N/A Default Value: N/A |
|
start |
No |
Long |
Definition: Pagination start value. Constraints: N/A Range: N/A Default Value: 0 |
|
limit |
No |
Integer |
Definition: Maximum number of records that can be queried at a time. Constraints: N/A Range: The value is an integer ranging from 1 to 100. Default Value: 100 |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
Content-Type |
No |
String |
Definition MIME type of the request body. Constraints N/A Range 1 to 64 characters Default Value The default value is application/json; charset=UTF-8. For APIs used to upload objects or images, the MIME type varies with the flow type. |
|
X-Auth-Token |
No |
String |
Definition User token. Constraints N/A Range 1 to 16,384 characters Default Value N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
event_name |
String |
Definition: Event name, which can be the name of a system event or a custom event. Range: N/A |
|
event_type |
String |
Definition: Event type. Range: The value can be:
|
|
sub_event_type |
String |
Definition: Event subcategory. Range: The value can be: If the event type is system event, the value can be SUB_EVENT.OPS or SUB_EVENT.PLAN. If the event type is custom event, the value is SUB_EVENT.CUSTOM.
|
|
event_users |
Array of strings |
Definition: Name of the user who reports the event. It can also be a project ID. Range: N/A |
|
event_sources |
Array of strings |
Definition: Event source. If the event is a system event, the source is the namespace of each service. For details, see "Services Interconnected with Cloud Eye". If the event is a custom event, the event source is defined by the user. Range: N/A |
|
event_info |
Array of EventInfoDetailResp objects |
Definition: Details of one or more events. |
|
meta_data |
TotalMetaData object |
Definition: Number of metadata records in the query results. |
|
Parameter |
Type |
Description |
|---|---|---|
|
event_name |
String |
Definition: Event name. Range: The value must start with a letter and allow 1 to 64 characters. It can only contain letters, digits, and underscores (_). |
|
event_source |
String |
Definition: Event source. Range: The value is in the service.item format. It allows 3 to 32 characters. service and item each must start with a letter and contain only letters, digits, and underscores (_). |
|
time |
Long |
Definition: Time when an event occurred. The value is a UNIX timestamp in milliseconds. Range: Since there is a latency between the client and the server, the timestamp when data was inserted must be within the time range [Current time – 1h + 20s, Current time + 10 mins – 20s]. In this way, the data will be inserted to the database without being affected by the latency. |
|
detail |
ShowEventItemDetailResp object |
Definition: Event details. |
|
event_id |
String |
Definition: Event ID. Range: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
content |
String |
Definition: Event content. Range: 1 to 4,096 characters |
|
group_id |
String |
Definition: Resource group that the event belongs to. Range: 24 characters |
|
resource_id |
String |
Definition: Resource ID. Range: 1 to 128 characters |
|
resource_name |
String |
Definition: Resource name. Range: 1 to 128 characters |
|
event_state |
String |
Definition: Event status. Range: The value can be:
|
|
event_level |
String |
Definition: Event severity. Range: The value can be:
|
|
event_user |
String |
Definition: Event user. Range: The value allows 0 to 64 characters and can contain underscores (_), hyphens (-), slashes (/), at signs (@), and periods (.). |
|
event_type |
String |
Definition: Event type. Range: The value can be:
|
|
dimensions |
Array of MetricsDimensionResp objects |
Definition: Event dimension. Resource information is described by dimension. Event alarm rules can be configured by dimension to monitor specified resources and resource groups. Range: A maximum of four dimensions are supported. |
|
Parameter |
Type |
Description |
|---|---|---|
|
name |
String |
Definition: Dimension of a resource. For example, the dimension of an ECS can be instance_id. A maximum of four dimensions are supported. For the metric dimension of each resource, see Service metric dimension. Range: The value starts with a letter and can contain letters, digits, underscores (_), or hyphens (-). The length is [1,32] characters. |
|
value |
String |
Definition Resource dimension value, which is an instance ID, for example, 4270ff17-aba3-4138-89fa-820594c39755. Range 1 to 256 characters |
|
Parameter |
Type |
Description |
|---|---|---|
|
total |
Integer |
Definition Total number of records. Range [0,2147483647] |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
- |
String |
Request error. |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
- |
String |
The authentication information is not provided or is incorrect. |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
- |
String |
Access to the requested page is forbidden. |
Status code: 408
|
Parameter |
Type |
Description |
|---|---|---|
|
- |
String |
The request timed out. |
Status code: 429
|
Parameter |
Type |
Description |
|---|---|---|
|
- |
String |
Too many requests. |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
- |
String |
Failed to complete the request because of an internal service error. |
Status code: 503
|
Parameter |
Type |
Description |
|---|---|---|
|
- |
String |
The system is currently unavailable. |
Example Requests
/V1.0/{project_id}/events/rebootServer?event_type=EVENT.SYS&start=0&limit=10&from=1603973487399&to=1606565487399
Example Responses
Status code: 200
OK
{
"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",
"dimensions" : [ {
"name" : "cluster_id",
"value" : "xxxxxxxx002"
} ]
}
}, {
"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",
"dimensions" : [ {
"name" : "cluster_id",
"value" : "xxxxxxxx002"
} ]
}
}, {
"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",
"dimensions" : [ {
"name" : "cluster_id",
"value" : "xxxxxxxx002"
} ]
}
} ],
"meta_data" : {
"total" : 5
}
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK |
|
400 |
Bad Request |
|
401 |
Unauthorized |
|
403 |
Forbidden |
|
408 |
Request Timeout |
|
429 |
Too Many Requests |
|
500 |
Internal Server Error |
|
503 |
Service Unavailable |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.