UpdateEventSubscriptionLabel
API Request
URLs
PUT zstack/v1/zwatch/events/subscriptions/labels/{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.
{
"updateEventSubscriptionLabel": {
"key": "VMUuid",
"value": "42c233c17c6e4907b7be1f11a41f3a17",
"operator": "Equal"
},
"systemTags": [],
"userTags": []
}

Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateEventSubscriptionLabel":{"key":"VMUuid","value":"228fc2c5041248df9b0d317f6f7a8585","operator":"Equal"}}' http://localhost:8080/zstack/v1/zwatch/events/subscriptions/labels/cfb859d412933a1da57ae99e2aa442ce/actions
Request Parameters
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
uuid | String | url | The UUID of the event subscription. | 3.9.0 | |
key | String | body (contained in the updateEventSubscriptionLabel structure) | The new name of the label. | 3.9.0 | |
value | String | body (contained in the updateEventSubscriptionLabel structure) | The new value of the label. | 3.9.0 | |
operator | String | body (contained in the updateEventSubscriptionLabel structure) | The new operator of the label. |
|
3.9.0 |
systemTags | List | body | Optional. The system tags. | 3.9.0 | |
userTags | List | body | Optional. The user tags. | 3.9.0 |
API Response
Sample
Response
{
"inventory": {
"uuid": "d937a1c6d9de3f2285b0cb23316624a8",
"key": "VMUuid",
"operator": "Equal",
"value": "19cf33283b484ff6b73a6d98e1d762f5"
}
}
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.9.0 |
inventory | EventSubscriptionLabelInventory | See inventory. | 3.9.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.9.0 |
description | String | The brief description of the error. | 3.9.0 |
details | String | The details about the error. | 3.9.0 |
elaboration | String | The reserved field. Default value: null. | 3.9.0 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 3.9.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.9.0 |
#inventory
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 3.9.0 |
key | String | The label name. | 3.9.0 |
value | String | The label key. | 3.9.0 |
operator | Operator | See operator. | 3.9.0 |
#operator
Name | Type | Description | Starting Version |
---|---|---|---|
op | String | 3.9.0 | |
name | String | The resource name. | 3.9.0 |
ordinal | int | 3.9.0 |
SDK Sample
Java
SDK
UpdateEventSubscriptionLabelAction action = new UpdateEventSubscriptionLabelAction();
action.uuid = "cfb859d412933a1da57ae99e2aa442ce";
action.key = "VMUuid";
action.value = "9d7099dd361049aaaf801ca6b17b2858";
action.operator = "Equal";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateEventSubscriptionLabelAction.Result res = action.call();
Python
SDK
UpdateEventSubscriptionLabelAction action = UpdateEventSubscriptionLabelAction()
action.uuid = "cfb859d412933a1da57ae99e2aa442ce"
action.key = "VMUuid"
action.value = "27e59f9fe7ed46118a2f6b8a383ce494"
action.operator = "Equal"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateEventSubscriptionLabelAction.Result res = action.call()