GetEventData
API Request
URLs
GET zstack/v1/zwatch/events
Headers
Authorization: OAuth the-session-uuid
Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zwatch/events?startTime=1.596444516295E12&limit=10.0&conditions=HostUuid=99ca12b945a8489c93a3412cbc744193&count=false&start=0.0
Request Parameters
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
startTime | Long | query | Optional. The start time. | 2.3 | |
endTime | Long | query | Optional. The end time. | 2.3 | |
limit | Integer | query | Optional. The maximum number of returned items. | 2.3 | |
offsetAheadOfCurrentTime | Long | query | Optional. The offset (in milliseconds) between the query time and the current time. Note that the query time is earlier than the current time. For example, if you query messages collected in the last one hour, 3600000 (the offset) will be transferred to the system. | 3.3.0 | |
conditions | List | query | Optional. The filter conditions. | 3.3.0 | |
count | boolean | query | Optional. Whether to query the number of events. | 3.3.0 | |
endpointUuid | String | query | Optional. Endpoint UUID. | 3.3.0 | |
systemTags | List | query | Optional. The system tags. | 2.3 | |
userTags | List | query | Optional. The system tags. | 2.3 |
API Response
Sample
Response
{
"events": [
{
"namespace": "ZStack/VM",
"name": "org.zstack.zwatch.datatype.EventFamily@2c24d960",
"labels": {},
"emergencyLevel": "Normal",
"resourceId": "b7bbe5fb9ab049c5a36bf8a646471cff",
"resourceName": "VmInstanceVO",
"time": 1.596444516324E12
}
]
}
Name | Type | Description | Starting Version |
---|---|---|---|
total | Long | The number of the events. | 3.3.0 |
success | boolean | 3.3.0 | |
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 2.3 |
events | List | See events. | 2.3 |
#error
Name | Type | Description | Starting Version |
---|---|---|---|
code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 2.3 |
description | String | The brief description of the error. | 2.3 |
details | String | The details about the error. | 2.3 |
elaboration | String | The reserved field. Default value: null. | 2.3 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 2.3 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 2.3 |
#events
Name | Type | Description | Starting Version |
---|---|---|---|
namespace | String | The namespace. | 2.3 |
name | String | The event name. | 2.3 |
labels | Map | The labels. | 2.3 |
resourceId | String | The UUID of the resource whose event was generated. If not null, the corresponding alarming messages for the associated resources are triggered. | 2.3 |
resourceName | String | The resource name. | 2.3 |
error | String | If the event means the error, this field is the details about the error. | 2.3 |
time | long | The time when the event was triggered. | 2.3 |
dataUuid | String | The data UUID. | 3.3 |
accountUuid | String | The account UUID. | 3.3 |
emergencyLevel | EmergencyLevel | See emergencyLevel. | 2.3 |
#emergencyLevel
Name | Type | Description | Starting Version |
---|---|---|---|
name | String | The resource name. | 2.3 |
ordinal | int | 2.3 |
#error
Name | Type | Description | Starting Version |
---|---|---|---|
code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 2.3 |
description | String | The brief description of the error. | 2.3 |
details | String | The details about the error. | 2.3 |
elaboration | String | The reserved field. Default value: null. | 2.3 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 2.3 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 2.3 |
SDK Sample
Java
SDK
GetEventDataAction action = new GetEventDataAction();
action.startTime = 1.596444516404E12;
action.limit = 10.0;
action.conditions = asList("HostUuid=00d80d7c47124d6d8e2c7736e9af1c34");
action.count = false;
action.start = 0.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetEventDataAction.Result res = action.call();
Python
SDK
GetEventDataAction action = GetEventDataAction()
action.startTime = 1.596444516405E12
action.limit = 10.0
action.conditions = [HostUuid=7581302347d0439fbdde32b914e2449a]
action.count = false
action.start = 0.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetEventDataAction.Result res = action.call()