Skip to main content
Platform O&M/Cloud Monitoring/Monitoring and Alarm/SNS/ZWatch Operations/Alarm Operations
PUTAlarm OperationsSince 2.3SynchronousAuth Required

UpdateAlarm

UpdateAlarm

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Path Parameters

Request Inputs

Path Parameters

  • uuidStringRequired

    The resource UUID.

Body Fields

  • updatealarmObjectRequired

    updatealarm request body object.

    • nameString

      Optional. The resource name.

    • descriptionString

      Optional. The detailed description of the resource.

    • comparisonOperatorString

      Optional. The threshold comparison operator.

    • periodInteger

      Optional. The threshold duration.

    • thresholdDouble

      Optional. The threshold.

    • repeatIntervalInteger

      Optional. The alarm repeat interval.

    • repeatCountInteger

      Optional. The alarm repeat count.

    • repeatCountInteger

      Optional. The alarm repeat count.

    • enableRecoveryBoolean

      Optional. Whether to enable the recovery notification.

    • emergencyLevelString

      The alarm emergency level.

  • systemTagsList

    Optional. The system tags.

  • userTagsList

    Optional. The user tags.

Responses

200 OK

On success, this API returns the following response structure.

  • errorErrorCodeRequired

    The error code. If not null, the operation fails, or vice versa. For more information, see error.

    • codeStringRequired

      The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.

    • descriptionStringRequired

      The brief description of the error.

    • detailsStringRequired

      The details about the error.

    • elaborationStringRequired

      The reserved field. Default value: null.

    • opaqueLinkedHashMapRequired

      The reserved field. Default value: null.

    • causeErrorCodeRequired

      The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.

  • inventoryAlarmInventoryRequired

    See inventory.

    • uuidStringRequired

      The resource UUID.

    • nameStringRequired

      Th resource name.

    • descriptionStringRequired

      The detailed description of the resource.

    • periodIntegerRequired

      The threshold duration.

    • namespaceStringRequired

      The namespace.

    • metricNameStringRequired

      The metric name.

    • thresholdDoubleRequired

      The threshold.

    • repeatIntervalIntegerRequired

      The alarm repeat interval.

    • enableRecoveryBooleanRequired

      Whether to enable the recovery notification.

    • createDateTimestampRequired

      The creation date.

    • lastOpDateTimestampRequired

      The last operation date.

    • comparisonOperatorComparisonOperatorRequired

      See comparisonOperator.

      • nameStringRequired

        The resource name.

      • ordinalintRequired

        No description provided.

    • statusAlarmStatusRequired

      See status.

      • OKAlarmStatusRequired

        The alarm is in normal status.

      • AlarmAlarmStatusRequired

        The alarm is triggered.

      • InsufficientDataAlarmStatusRequired

        The data is insufficient.

    • labelsListRequired

      See labels.

      • uuidStringRequired

        The resource UUID.

      • keyStringRequired

        The label key.

      • operatorStringRequired

        The comparison operator.

      • valueStringRequired

        The label value.

    • actionsListRequired

      See actions.

      • alarmUuidStringRequired

        The alarm UUID.

      • actionTypeStringRequired

        The action type.

      • actionUuidStringRequired

        The action UUID.

Endpoint

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

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

Operation ID

UpdateAlarm

Permalink

Request Example

curl -X PUT 'http://{host}/zstack/v1/zwatch/alarms/{uuid}/actions' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"updatealarm":{"name":"<name>","description":"<description>","comparisonOperator":"<comparisonOperator>","period":1,"threshold":1,"repeatInterval":1,"repeatCount":1,"enableRecovery":true,"emergencyLevel":"<emergencyLevel>"},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "inventory": { "uuid": "33e642a1eb3c4f27a7da7acc5891de0a", "name": "VM CPU Alarm", "comparisonOperator": "LessThanOrEqualTo", "period": 60.0, "namespace": "ZStack/VM", "metricName": "org.zstack.zwatch.datatype.Metric@22c0dd63", "threshold": 30.0, "repeatInterval": 1800.0, "repeatCount": -1.0, "status": "Alarm", "state": "Enabled", "createDate": "Jan 8, 2019 4:11:27 PM", "lastOpDate": "Jan 8, 2019 4:11:27 PM", "labels": [ { "uuid": "c4da2db2fa454368a3a05016ae8c8070", "key": "VMUuid", "operator": "\u003d", "value": "396d863211e446938ea01eb10bc9fd18" } ], "actions": [ { "alarmUuid": "0d18a844bbf544bb914ab9287651f59f", "actionType": "sns", "actionUuid": "17b884822b284e6e9a0b67307a28955c" } ] } }

Change History

This API has no change history records yet.

View all change history