UpdateAlarmLabel
API Request
URLs
PUT zstack/v1/zwatch/alarms/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.
{
"updateAlarmLabel": {
"key": "VMUuid",
"value": "e9859e9eb51e4ea583a7c529407208a2",
"operator": "Equal"
},
"systemTags": [],
"userTags": []
}

Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateAlarmLabel":{"key":"VMUuid","value":"59ab62f070784eb2b0d98f0d12386f0d","operator":"Equal"}}' http://localhost:8080/zstack/v1/zwatch/alarms/labels/3c228226ca213c18b54627668dd37d80/actions
Request Parameters
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
uuid | String | url | The resource UUID. | 3.3 | |
key | String | body (contained in the updateAlarmLabel structure) | The label key. | 3.3 | |
value | String | body (contained in the updateAlarmLabel structure) | The label value. | 3.3 | |
operator | String | body (contained in the updateAlarmLabel structure) | The label operator. |
|
3.3 |
systemTags | List | body | Optional. The system tags. | 3.3 | |
userTags | List | body | Optional. The user tags. | 3.3 |
API Response
Sample
Response
{
"inventory": {
"uuid": "5ea6d350f0e64d0b9467d033e9c6d052",
"key": "VMUuid",
"operator": "\u003d",
"value": "35956236f261467cb2cef1db8626024e"
}
}
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.3.0 |
inventory | AlarmLabelInventory | See inventory. | 3.3.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.3.0 |
description | String | The brief description of the error. | 3.3.0 |
details | String | The details about the error. | 3.3.0 |
elaboration | String | The reserved field. Default value: null. | 3.3.0 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 3.3.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.3.0 |
#inventory
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 3.3.0 |
key | String | 3.3.0 | |
operator | String | 3.3.0 | |
value | String | 3.3.0 |
SDK Sample
Java
SDK
UpdateAlarmLabelAction action = new UpdateAlarmLabelAction();
action.uuid = "3c228226ca213c18b54627668dd37d80";
action.key = "VMUuid";
action.value = "1a33d5ce225241e0b2cbc80123e36351";
action.operator = "Equal";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateAlarmLabelAction.Result res = action.call();
Python
SDK
UpdateAlarmLabelAction action = UpdateAlarmLabelAction()
action.uuid = "3c228226ca213c18b54627668dd37d80"
action.key = "VMUuid"
action.value = "20034c6b21a24918912857c8ed923c6b"
action.operator = "Equal"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateAlarmLabelAction.Result res = action.call()