Update Alarm Label

PUT/zstack/v1/zwatch/alarms/labels/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "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/actions

Parameter 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.

  • Regex
  • Equal

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"
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeThe error code. If not null, the operation failed. This field is null on success. See error for details.3.3.0
inventoryAlarmLabelInventorySee inventory for details.3.3.0

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001.3.3.0
descriptionStringA brief description of the error.3.3.0
detailsStringDetailed information about the error.3.3.0
elaborationStringA reserved field. Default is null.3.3.0
opaqueLinkedHashMapA reserved field. Default is null.3.3.0
causeErrorCodeThe root error. The source error that caused the current error. This field is null if there is no root error.3.3.0

inventory

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource. Uniquely identifies the resource.3.3.0
keyString 3.3.0
operatorString 3.3.0
valueString 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()