Update Event Alarm

PUT/zstack/v1/zwatch/events/subscriptions/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateSubscribeEvent": {
    "emergencyLevel": "Emergent"
  },
  "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 '{"updateSubscribeEvent":{"emergencyLevel":"Emergent"}}' http://localhost:8080/zstack/v1/zwatch/events/subscriptions/37fc1fcc0fa93fb493702469039edbfb/actions

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

uuid

String

url

Event alarm UUID.

 

3.8.0

emergencyLevel (Optional)

String

body (contained in the updateSubscribeEvent structure)

Alarm level.

  • Emergent
  • Important
  • Normal

3.8.0

systemTags (Optional)

List

body

 

 

3.8.0

userTags (Optional)

List

body

 

 

3.8.0

API Response

Response Example:

{
  "inventory": {
    "uuid": "d1b38b37691948218df07900a2c1c065",
    "name": "vm_state_change_event",
    "namespace": "ZStack/VM",
    "eventName": "org.zstack.zwatch.datatype.EventFamily@35324244",
    "state": "Enabled",
    "actions": [
      {
        "subscriptionUuid": "30d1075270c94f6e9312c1a4404cc67a",
        "actionType": "sns",
        "actionUuid": "33308113390a472286df32a99cd477ef"
      }
    ],
    "labels": [
      {
        "uuid": "26246baade39495c99d018d826ae576e",
        "key": "DestinationHostUuid",
        "operator": "Equal",
        "value": "79e249b6995a4c819d8e6cd33798135a"
      }
    ],
    "lastOpDate": "Jan 11, 2020 11:48:35 PM",
    "createDate": "Jan 11, 2020 11:48:35 PM",
    "emergencyLevel": "Emergent"
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeThe error code. If not null, the operation failed. This field is null on success. See error for details.3.8.0
inventoryEventSubscriptionInventorySee inventory for details.3.8.0

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001.3.8.0
descriptionStringA brief description of the error.3.8.0
detailsStringDetailed information about the error.3.8.0
elaborationStringA reserved field. Default is null.3.8.0
opaqueLinkedHashMapA reserved field. Default is null.3.8.0
causeErrorCodeThe root error. The source error that caused the current error. This field is null if there is no root error.3.8.0

inventory

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource. Uniquely identifies the resource.3.8.0
nameStringResource name.3.8.0
namespaceStringNamespace.3.8.0
eventNameStringEvent name.3.8.0
lastOpDateTimestampLast modification time.3.8.0
createDateTimestampCreation time.3.8.0
emergencyLevelStringAlarm level.3.8.0
stateEventSubscriptionStateSee state for details.3.8.0
actionsListSee actions for details.3.8.0
labelsListSee labels for details.3.8.0

state

NameTypeDescriptionStarting Version
nameStringResource name.3.8.0
ordinalint 3.8.0

actions

NameTypeDescriptionStarting Version
subscriptionUuidStringEvent subscription UUID.3.8.0
actionTypeStringAction type.3.8.0
actionUuidStringAction UUID.3.8.0

labels

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource. Uniquely identifies the resource.3.8.0
keyStringLabel name.3.8.0
valueStringLabel value.3.8.0
operatorOperatorSee operator for details.3.8.0

operator

NameTypeDescriptionStarting Version
opString 3.8.0
nameStringResource name.3.8.0
ordinalint 3.8.0

SDK Examples

Java SDK

UpdateSubscribeEventAction action = new UpdateSubscribeEventAction();
action.uuid = "37fc1fcc0fa93fb493702469039edbfb";
action.emergencyLevel = "Emergent";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateSubscribeEventAction.Result res = action.call();

Python SDK

UpdateSubscribeEventAction action = UpdateSubscribeEventAction()
action.uuid = "37fc1fcc0fa93fb493702469039edbfb"
action.emergencyLevel = "Emergent"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateSubscribeEventAction.Result res = action.call()