Update Event Alarm
Headers
Authorization: OAuth the-session-uuidBody
{
"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/actionsParameter 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. |
| 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"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation failed. This field is null on success. See error for details. | 3.8.0 |
| inventory | EventSubscriptionInventory | See inventory for details. | 3.8.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001. | 3.8.0 |
| description | String | A brief description of the error. | 3.8.0 |
| details | String | Detailed information about the error. | 3.8.0 |
| elaboration | String | A reserved field. Default is null. | 3.8.0 |
| opaque | LinkedHashMap | A reserved field. Default is null. | 3.8.0 |
| cause | ErrorCode | The root error. The source error that caused the current error. This field is null if there is no root error. | 3.8.0 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The UUID of the resource. Uniquely identifies the resource. | 3.8.0 |
| name | String | Resource name. | 3.8.0 |
| namespace | String | Namespace. | 3.8.0 |
| eventName | String | Event name. | 3.8.0 |
| lastOpDate | Timestamp | Last modification time. | 3.8.0 |
| createDate | Timestamp | Creation time. | 3.8.0 |
| emergencyLevel | String | Alarm level. | 3.8.0 |
| state | EventSubscriptionState | See state for details. | 3.8.0 |
| actions | List | See actions for details. | 3.8.0 |
| labels | List | See labels for details. | 3.8.0 |
state
| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | Resource name. | 3.8.0 |
| ordinal | int | 3.8.0 |
actions
| Name | Type | Description | Starting Version |
|---|---|---|---|
| subscriptionUuid | String | Event subscription UUID. | 3.8.0 |
| actionType | String | Action type. | 3.8.0 |
| actionUuid | String | Action UUID. | 3.8.0 |
labels
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The UUID of the resource. Uniquely identifies the resource. | 3.8.0 |
| key | String | Label name. | 3.8.0 |
| value | String | Label value. | 3.8.0 |
| operator | Operator | See operator for details. | 3.8.0 |
operator
| Name | Type | Description | Starting Version |
|---|---|---|---|
| op | String | 3.8.0 | |
| name | String | Resource name. | 3.8.0 |
| ordinal | int | 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()