Get Alarm Alert Histogram

GET/zstack/v1/zwatch/alert-histories/histogram

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/alert-histories/histogram?startTime=1.623414899E9&endTime=1.623501299E9&intervalHours=8.0&groupColumns=emergencyLevel

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
tableNameStringqueryMessage type. 4.1.0
startTimeLongqueryStart time. 4.1.0
endTimeLongqueryEnd time. 4.1.0
intervalHoursStringqueryInterval hours. 4.1.0
groupColumns (Optional)ListqueryGroup columns. 4.1.0
systemTags (Optional)ListquerySystem tags. 4.1.0
userTags (Optional)ListqueryUser tags. 4.1.0

API Response

Response Example

{
  "histograms": [
    {
      "time": 1510669257141.0,
      "count": 50.0,
      "tags": [
        {
          "name": "emergencyLevel",
          "value": "Emergent"
        }
      ]
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 4.1.0
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

histories

NameTypeDescriptionStarting Version
timelongTime.4.1.0
countlongCount.4.1.0
tagsListSee tags for details.4.1.0

tags

NameTypeDescriptionStarting Version
nameStringTag name.4.1.0
valueStringTag value.4.1.0

SDK Examples

Java SDK

GetZWatchAlertHistogramAction action = new GetZWatchAlertHistogramAction();
action.startTime = 1.623414899E9;
action.endTime = 1.623501299E9;
action.intervalHours = 8.0;
action.groupColumns = asList("emergencyLevel");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetZWatchAlertHistogramAction.Result res = action.call();

Python SDK

GetZWatchAlertHistogramAction action = GetZWatchAlertHistogramAction()
action.startTime = 1.623414899E9
action.endTime = 1.623501299E9
action.intervalHours = 8.0
action.groupColumns = [emergencyLevel]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetZWatchAlertHistogramAction.Result res = action.call()