Query Event Alarm Records

GET/zstack/v1/zwatch/event-records

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zwatch/event-records?q=dataUuid=bcb5816592553e04a101e37c69d1837a

Queryable Fields

Run the CLI command-line tool, enter QueryEventRecord, and press the Tab key to view all queryable fields and cross-table queryable resource names.

API Response

Response Example

{
  "inventories": [
    {
      "id": 1.0,
      "createTime": 1510669257141.0,
      "namespace": "ZStack/PrimaryStorage",
      "name": "PrimaryStorageDisconnected",
      "emergencyLevel": "Emergent",
      "resourceId": "ff1d1d9429da35cfb3d4dfad772d0f3a",
      "dataUuid": "64f3d04e7144348db07585dfc9293582",
      "accountUuid": "1f2c621ce02d37268da28bb368f6b265",
      "subscriptionUuid": "e30c7668d9c13585915da7e6442f6749",
      "readStatus": true,
      "labels": "{\"Error\":\"No Host state is Enabled, Please check the availability of the host\"}"
    }
  ]
}
NameTypeDescriptionStarting Version
errorErrorCodeThe error code. If not null, the operation failed. This field is null when the operation succeeds. See error for details.4.1.0
inventoriesListSee inventories for details.4.1.0

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.1001.4.1.0
descriptionStringA brief description of the error.4.1.0
detailsStringThe detailed error information.4.1.0
elaborationStringA reserved field. Default is null.4.1.0
opaqueLinkedHashMapA reserved field. Default is null.4.1.0
causeErrorCodeThe root error. The source error that caused the current error. This field is null if there is no root cause.4.1.0

inventories

NameTypeDescriptionStarting Version
timelongThe time.4.1.0
countlongThe count.4.1.0
idlongThe message ID.4.1.0
createTimelongThe creation time.4.1.0
namespaceStringThe namespace.4.1.0
nameStringThe name.4.1.0
emergencyLevelStringThe alarm level.4.1.0
resourceIdStringThe resource UUID.4.1.0
errorStringThe error information.4.1.0
dataUuidStringThe message UUID.4.1.0
accountUuidStringThe account UUID.4.1.0
subscriptionUuidStringThe event alarm UUID.4.1.0
readStatusBooleanThe read status.4.1.0
labelsStringThe label list.4.1.0

SDK Examples

Java SDK

QueryEventRecordAction action = new QueryEventRecordAction();
action.conditions = asList("dataUuid=1e5badf2a4a43bae91b16dbd1aee0c0b");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryEventRecordAction.Result res = action.call();

Python SDK

QueryEventRecordAction action = QueryEventRecordAction()
action.conditions = ["dataUuid=60290f65736a317cb52b0721d90ce315"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryEventRecordAction.Result res = action.call()