Change Event Subscription State
Headers
Authorization: OAuth the-session-uuidBody
{
"changeEventSubscriptionState": {
"state": "Disabled"
},
"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 '{"changeEventSubscriptionState":{"state":"Disabled"}}' http://localhost:8080/zstack/v1/zwatch/change/eventSubscription/2140655d1d183a6690c0eecdbc721ec0/stateParameter List
Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
uuid | String | url | The UUID of the resource. Uniquely identifies the resource. |
| 4.7.0 |
state | String | body (contained in the changeEventSubscriptionState structure) | Event alarm state. |
| 4.7.0 |
systemTags (Optional) | List | body | System tags. |
| 4.7.0 |
userTags (Optional) | List | body | User tags. |
| 4.7.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
ChangeEventSubscriptionStateAction action = new ChangeEventSubscriptionStateAction();
action.uuid = "2140655d1d183a6690c0eecdbc721ec0";
action.state = "Disabled";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeEventSubscriptionStateAction.Result res = action.call();Python SDK
ChangeEventSubscriptionStateAction action = ChangeEventSubscriptionStateAction()
action.uuid = "2140655d1d183a6690c0eecdbc721ec0"
action.state = "Disabled"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeEventSubscriptionStateAction.Result res = action.call()