Skip to main content
O&M Management/Monitoring APIs/Monitoring and Alarm APIs/Alarm
PUTAlarmSince 2.3SynchronousAuth Required

Update Alarm

Update Alarm

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 UUID of the resource. Uniquely identifies the resource.

Body Fields

  • updatealarmObjectRequired

    updatealarm request body object.

    • nameString

      Resource name.

    • descriptionString

      Detailed description of the resource.

    • comparisonOperatorString

      Comparison operator.

    • periodInteger

      Threshold duration.

    • thresholdDouble

      Threshold.

    • repeatIntervalInteger

      Alarm repeat interval.

    • repeatCountInteger

      Alarm repeat count.

    • repeatCountInteger

      Alarm repeat count.

    • emergencyLevelString

      Alarm level.

  • systemTagsList

    System tags.

  • userTagsList

    User tags.

  • enableRecoveryBoolean

    是否恢复。

Responses

200 OK

On success, this API returns the following response structure.

  • errorErrorCodeRequired

    The error code. If not null, the operation failed. This field is null on success. See error for details.

    • codeStringRequired

      The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001.

    • descriptionStringRequired

      A brief description of the error.

    • detailsStringRequired

      Detailed information about the error.

    • elaborationStringRequired

      A reserved field. Default is null.

    • opaqueLinkedHashMapRequired

      A reserved field. Default is null.

    • causeErrorCodeRequired

      The root error. The source error that caused the current error. This field is null if there is no root error.

  • inventoryAlarmInventoryRequired

    See inventory for details.

    • uuidStringRequired

      The UUID of the resource. Uniquely identifies the resource.

    • nameStringRequired

      Resource name.

    • descriptionStringRequired

      Detailed description of the resource.

    • periodIntegerRequired

      Threshold duration.

    • namespaceStringRequired

      Namespace.

    • metricNameStringRequired

      Metric name.

    • thresholdDoubleRequired

      Threshold.

    • repeatIntervalIntegerRequired

      Alarm repeat interval.

    • enableRecoveryBooleanRequired

      Enable recovery notification.

    • createDateTimestampRequired

      Creation time.

    • lastOpDateTimestampRequired

      Last modification time.

    • comparisonOperatorComparisonOperatorRequired

      See comparisonOperator for details.

      • nameStringRequired

        Resource name.

      • ordinalintRequired

        No description provided.

    • statusAlarmStatusRequired

      See status for details.

      • OKAlarmStatusRequired

        Monitoring.

      • AlarmAlarmStatusRequired

        Triggered.

      • InsufficientDataAlarmStatusRequired

        Insufficient data.

    • labelsListRequired

      See labels for details.

      • uuidStringRequired

        The UUID of the resource. Uniquely identifies the resource.

      • keyStringRequired

        Label key.

      • operatorStringRequired

        Comparison operator.

      • valueStringRequired

        Label value.

    • actionsListRequired

      See actions for details.

      • alarmUuidStringRequired

        Alarm UUID.

      • actionTypeStringRequired

        Alarm action type.

      • actionUuidStringRequired

        Alarm 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,"emergencyLevel":"<emergencyLevel>"},"systemTags":["<systemTags>"],"userTags":["<userTags>"],"enableRecovery":true}'

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