UpdateSubscribeEvent
API Request
URLs
PUT zstack/v1/zwatch/events/subscriptions/{uuid}/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.
{
"updateSubscribeEvent": {
"emergencyLevel": "Emergent"
},
"systemTags": [],
"userTags": []
}

Curl
Sample
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
Request Parameters
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
uuid | String | url | Optional. The event alarm UUID. | 3.8.0 | |
emergencyLevel | String | body (contained in the updateSubscribeEvent structure) | Optional. The alarm emergency level. |
|
3.8.0 |
systemTags | List | body | Optional. | 3.8.0 | |
userTags | List | body | Optional. | 3.8.0 |
API Response
Sample
Response
{
"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"
}
}
Name | Type | Description | Starting Version |
---|---|---|---|
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.8.0 |
inventory | EventSubscriptionInventory | See inventory. | 3.8.0 |
#error
Name | Type | Description | Starting Version |
---|---|---|---|
code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 3.8.0 |
description | String | The brief description of the error. | 3.8.0 |
details | String | The details about the error. | 3.8.0 |
elaboration | String | The reserved field. Default value: null. | 3.8.0 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 3.8.0 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 3.8.0 |
#inventory
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 3.8.0 |
name | String | The resource name. | 3.8.0 |
namespace | String | The namespace. | 3.8.0 |
eventName | String | The event name. | 3.8.0 |
lastOpDate | Timestamp | The last operation date. | 3.8.0 |
createDate | Timestamp | The creation date. | 3.8.0 |
emergencyLevel | String | The arm emergency level. | 3.8.0 |
state | EventSubscriptionState | See state. | 3.8.0 |
actions | List | See actions. | 3.8.0 |
labels | List | See labels. | 3.8.0 |
#state
Name | Type | Description | Starting Version |
---|---|---|---|
name | String | The resource name. | 3.8.0 |
ordinal | int | 3.8.0 |
#actions
Name | Type | Description | Starting Version |
---|---|---|---|
subscriptionUuid | String | The event subscription UUID. | 3.8.0 |
actionType | String | The action type. | 3.8.0 |
actionUuid | String | The action UUID. | 3.8.0 |
#labels
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 3.8.0 |
key | String | The label key. | 3.8.0 |
value | String | The label value. | 3.8.0 |
operator | Operator | See operator. | 3.8.0 |
#operator
Name | Type | Description | Starting Version |
---|---|---|---|
op | String | 3.8.0 | |
name | String | The resource name. | 3.8.0 |
ordinal | int | 3.8.0 |
SDK Sample
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()