UpdateAlarmData
API Request
URLs
PUT zstack/v1/zwatch/alarm-histories/actions
Headers
Authorization: OAuth the-session-uuid
Body
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"updateAlarmData": {
"dataUuid": "514d4a1ed3573bf8a14ac350de0a2513",
"updateMode": "OnlyOne",
"readStatus": "Read"
},
"systemTags": [],
"userTags": []
}

Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateAlarmData":{"dataUuid":"514d4a1ed3573bf8a14ac350de0a2513","updateMode":"OnlyOne","readStatus":"Read"}}' http://localhost:8080/zstack/v1/zwatch/alarm-histories/actions
Request Parameters
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
dataUuid | String | body (contained in the updateAlarmData structure) | Optional. The resource UUID. | 3.3.0 | |
dataStartTime | Long | body (contained in the updateAlarmData structure) | Optional. The start time of the target messages. Make sure that InRange is transferred to updateMode. | 3.3.0 | |
dataEndTime | Long | body (contained in the updateAlarmData structure) | Optional. The end time of the target messages. Make sure that InRange is transferred to updateMode. | 3.3.0 | |
updateMode | String | body (contained in the updateAlarmData structure) | The range of the target messages to be
updated. Options:
|
|
3.3.0 |
readStatus | String | body (contained in the updateAlarmData structure) | Optional. The read status of the updated messages. |
|
3.3.0 |
systemTags | List | body | Optional. The system tags. | 3.3.0 | |
userTags | List | body | Optional. The user tags. | 3.3.0 |
API Response
When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}
SDK Sample
Java
SDK
UpdateAlarmDataAction action = new UpdateAlarmDataAction();
action.dataUuid = "514d4a1ed3573bf8a14ac350de0a2513";
action.updateMode = "OnlyOne";
action.readStatus = "Read";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateAlarmDataAction.Result res = action.call();
Python
SDK
UpdateAlarmDataAction action = UpdateAlarmDataAction()
action.dataUuid = "514d4a1ed3573bf8a14ac350de0a2513"
action.updateMode = "OnlyOne"
action.readStatus = "Read"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateAlarmDataAction.Result res = action.call()