Update Event Subscription Label
Headers
Authorization: OAuth the-session-uuidBody
{
"updateEventSubscriptionLabel": {
"key": "VMUuid",
"value": "42c233c17c6e4907b7be1f11a41f3a17",
"operator": "Equal"
},
"systemTags": [],
"userTags": []
}In the above example, the systemTags and userTags fields are optional. They are listed 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 '{"updateEventSubscriptionLabel":{"key":"VMUuid","value":"228fc2c5041248df9b0d317f6f7a8585","operator":"Equal"}}' http://localhost:8080/zstack/v1/zwatch/events/subscriptions/labels/cfb859d412933a1da57ae99e2aa442ce/actionsParameter List
Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
uuid | String | url | The UUID of the original event subscription label. Uniquely identifies the resource |
| 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 (Optional) | List | body |
|
| 3.9.0 |
userTags (Optional) | List | body |
|
| 3.9.0 |
API Response
Response Example
{
"inventory": {
"uuid": "d937a1c6d9de3f2285b0cb23316624a8",
"key": "VMUuid",
"operator": "Equal",
"value": "19cf33283b484ff6b73a6d98e1d762f5"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation failed. This field is null on success. See error | 3.9.0 |
| inventory | EventSubscriptionLabelInventory | See inventory | 3.9.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, such as SYS.1000, HOST.1001 | 3.9.0 |
| description | String | A brief description of the error | 3.9.0 |
| details | String | The detailed error information | 3.9.0 |
| elaboration | String | Reserved field. Default is null | 3.9.0 |
| opaque | LinkedHashMap | Reserved field. Default is null | 3.9.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.9.0 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The UUID of the resource. Uniquely identifies the resource | 3.9.0 |
| key | String | The label name | 3.9.0 |
| value | String | The label value | 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 Examples
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()