Query Alarm Records

GET/zstack/v1/zwatch/alarm-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/alarm-records?q=dataUuid=f30e0a92898a3cf39b98c7b20d5d09d7

Queryable Fields

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

API Response

Response Example

{
  "inventories": [
    {
      "id": 1.0,
      "createTime": 1510669257141.0,
      "accountUuid": "ce8e0ae7bfb93fb09c3339443fb79b5a",
      "alarmName": "ZStack Primary Storage Physical Available Capacity Alarm",
      "alarmStatus": "Alarm",
      "alarmUuid": "701f9528318737bb9db81c4f9b5721a7",
      "comparisonOperator": "LessThan",
      "context": "{\"PrimaryStorageType\":\"LocalStorage\"}",
      "dataUuid": "2e6afdb668443ef9a9a82fcba794d21b",
      "emergencyLevel": "Emergent",
      "metricName": "AvailablePhysicalCapacityInPercent",
      "metricValue": 20.0,
      "namespace": "ZStack/PrimaryStorage",
      "period": 600.0,
      "readStatus": false,
      "resourceUuid": "8a596bd1689c3e83a408c2713d99fc6e",
      "threshold": 21.0
    }
  ]
}
NameTypeDescriptionStarting Version
errorErrorCodeThe error code. If not null, the operation failed. This field is null on success. See error for details.4.1.0
histogramsList 4.1.0

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001.4.1.0
descriptionStringA brief description of the error.4.1.0
detailsStringDetailed information about the error.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 error.4.1.0

inventories

NameTypeDescriptionStarting Version
idlongMessage ID.4.1.0
createTimelongCreation time.4.1.0
accountUuidStringAccount UUID.4.1.0
alarmNameStringAlarm name.4.1.0
alarmStatusStringAlarm status.4.1.0
alarmUuidStringAlarm UUID.4.1.0
comparisonOperatorStringComparison operator.4.1.0
contextStringContent.4.1.0
dataUuidStringMessage UUID.4.1.0
emergencyLevelStringAlarm level.4.1.0
labelsStringTag list.4.1.0
metricNameStringMetric name.4.1.0
metricValueDoubleMetric value.4.1.0
namespaceStringNamespace.4.1.0
periodintThreshold duration.4.1.0
readStatusBooleanRead status.4.1.0
resourceUuidStringResource UUID.4.1.0
thresholdDoubleThreshold.4.1.0

SDK Examples

Java SDK

QueryAlarmRecordAction action = new QueryAlarmRecordAction();
action.conditions = asList("dataUuid=8860f33a964e3141aee2c3ffde2918b7");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryAlarmRecordAction.Result res = action.call();

Python SDK

QueryAlarmRecordAction action = QueryAlarmRecordAction()
action.conditions = ["dataUuid=a83224ddc145340b9b7b12170ba614ba"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryAlarmRecordAction.Result res = action.call()