Querying Events
Function
This API is used to query the event list, including system events and custom events.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
ces:events:list
List
-
-
-
-
URI
GET /V1.0/{project_id}/events
| 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 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| event_type | No | String | Definition Event type. Constraints N/A Range The value can be: Default Value N/A |
| sub_event_type | No | String | Definition Event subtype. Constraints N/A Range The value can be: Default Value N/A |
| event_name | No | String | Definition Event name, which can be the name of a system event or a custom event. Constraints N/A Range The value must start with a letter. It can contain letters, digits, and underscores (_) and allows 1 to 64 characters. Default Value N/A |
| from | No | Long | Definition Start time of the query. The value is a UNIX timestamp in milliseconds. Constraints N/A Range The millisecond-level timestamp range is [1111111111111,9999999999999]. Default Value N/A |
| to | No | Long | Definition End time of the query. The value is a UNIX timestamp in milliseconds. Constraints The value of from must be earlier than that of to. Range The millisecond-level timestamp range is [1111111111111,9999999999999]. Default Value N/A |
| start | No | String | Definition Pagination start value. Constraints N/A Range 0 or a positive integer. Default Value 0 |
| limit | No | Integer | Definition Maximum number of records that can be queried at a time. Constraints N/A Range [1,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 Default value application/json; charset=UTF-8 is recommended. 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 |
|---|---|---|
| events | Array of EventInfo objects | Definition One or more pieces of event data. |
| meta_data | TotalMetaData object | Definition Number of metadata records in the query results. |
| Parameter | Type | Description |
|---|---|---|
| event_name | String | Definition Event name. Range N/A |
| event_type | String | Definition Event type. Range The value can be: |
| sub_event_type | String | Definition Event subtype. Range The value can be: |
| event_count | Integer | Definition Number of times that the event occurs within the specified time range. Range N/A |
| latest_occur_time | Long | Definition Time when the event last occurred. Range N/A |
| latest_event_source | String | Definition Event source. If the event is a system event, the source is the namespace of each service. For details about service namespaces, see Services Interconnected with Cloud Eye. If the event is a custom event, the event source is defined by the user. Range N/A |
| 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?start=0&limit=10&to=1606557500911&from=1605952700911 Example Responses
Status code: 200
OK
{
"events" : [ {
"event_name" : "rebootServer",
"event_type" : "EVENT.SYS",
"sub_event_type" : "SUB_EVENT.OPS",
"event_count" : 5,
"latest_occur_time" : 1606302400000,
"latest_event_source" : "SYS.ECS"
}, {
"event_name" : "deleteVolume",
"event_type" : "EVENT.SYS",
"sub_event_type" : "SUB_EVENT.PLAN",
"event_count" : 6,
"latest_occur_time" : 1606300359126,
"latest_event_source" : "SYS.EVS"
}, {
"event_name" : "event_001",
"event_type" : "EVENT.CUSTOM",
"sub_event_type" : "SUB_EVENT.CUSTOM",
"event_count" : 4,
"latest_occur_time" : 1606499035522,
"latest_event_source" : "TEST.System"
} ],
"meta_data" : {
"total" : 10
}
} 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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot