Update Alarm Label
Headers
Authorization: OAuth the-session-uuidBody
{
"updateAlarmLabel": {
"key": "VMUuid",
"value": "e9859e9eb51e4ea583a7c529407208a2",
"operator": "Equal"
},
"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 '{"updateAlarmLabel":{"key":"VMUuid","value":"59ab62f070784eb2b0d98f0d12386f0d","operator":"Equal"}}' http://localhost:8080/zstack/v1/zwatch/alarms/labels/3c228226ca213c18b54627668dd37d80/actionsParameter List
Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
uuid | String | url | The UUID of the resource. Uniquely identifies the resource. |
| 3.3 |
key | String | body (contained in the updateAlarmLabel structure) | Label key. |
| 3.3 |
value | String | body (contained in the updateAlarmLabel structure) | Label value. |
| 3.3 |
operator | String | body (contained in the updateAlarmLabel structure) | Label operator. |
| 3.3 |
systemTags (Optional) | List | body | System tags. |
| 3.3 |
userTags (Optional) | List | body | User tags. |
| 3.3 |
API Response
Response Example
{
"inventory": {
"uuid": "5ea6d350f0e64d0b9467d033e9c6d052",
"key": "VMUuid",
"operator": "=",
"value": "35956236f261467cb2cef1db8626024e"
}
}| 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.3.0 |
| inventory | AlarmLabelInventory | See inventory for details. | 3.3.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.3.0 |
| description | String | A brief description of the error. | 3.3.0 |
| details | String | Detailed information about the error. | 3.3.0 |
| elaboration | String | A reserved field. Default is null. | 3.3.0 |
| opaque | LinkedHashMap | A reserved field. Default is null. | 3.3.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.3.0 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The UUID of the resource. Uniquely identifies the resource. | 3.3.0 |
| key | String | 3.3.0 | |
| operator | String | 3.3.0 | |
| value | String | 3.3.0 |
SDK Examples
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()