Update Alarm Data

PUT/zstack/v1/zwatch/alarm-histories/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateAlarmData": {
    "dataUuid": "514d4a1ed3573bf8a14ac350de0a2513",
    "updateMode": "OnlyOne",
    "readStatus": "Read"
  },
  "systemTags": [],
  "userTags": []
}

In the above example, the systemTags and userTags fields can be omitted. They are listed here to indicate that the body can contain these two fields.

Curl Example

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

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

dataUuid (Optional)

String

body (contained in the updateAlarmData structure)

The UUID of the resource. Uniquely identifies the resource.

 

3.3.0

dataStartTime (Optional)

Long

body (contained in the updateAlarmData structure)

Start time for selecting target messages. The updateMode must be set to InRange.

 

3.3.0

dataEndTime (Optional)

Long

body (contained in the updateAlarmData structure)

End time for selecting target messages. The updateMode must be set to InRange.

 

3.3.0

updateMode

String

body (contained in the updateAlarmData structure)

The scope of target messages to update. OnlyOne updates only the specified message, InRange updates messages within a time range, and All updates all messages.

  • OnlyOne
  • InRange
  • All

3.3.0

readStatus (Optional)

String

body (contained in the updateAlarmData structure)

Update message read status.

  • Read
  • Unread

3.3.0

systemTags (Optional)

List

body

System tags.

 

3.3.0

userTags (Optional)

List

body

User tags.

 

3.3.0

API Response

On success, this API returns an empty JSON structure {}. On failure, the returned JSON structure contains 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 Examples

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()