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

AddLabelToAlarm

AddLabelToAlarm

Execution Availability

Try It Out

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

Path Parameters

Request Inputs

Path Parameters

  • alarmUuidStringRequired

    The alarm UUID.

Body Fields

  • paramsObjectRequired

    Request body parameter object.

    • keyStringRequired

      The label key.

    • valueStringRequired

      The label value.

    • operatorStringRequired

      The operator.

    • resourceUuidString

      Optional.

  • 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 The 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.

    • 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

POST/zstack/v1/zwatch/alarms/{alarmUuid}/labels

/zstack/v1/zwatch/alarms/{alarmUuid}/labels

Operation ID

AddLabelToAlarm

Permalink

Request Example

curl -X POST 'http://{host}/zstack/v1/zwatch/alarms/{alarmUuid}/labels' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"params":{"key":"<key>","value":"<value>","operator":"<operator>","resourceUuid":"<resourceUuid>"},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "inventory": { "uuid": "3f54b760c8d64e17bc282258335b718a", "key": "VMUuid", "operator": "\u003d", "value": "dd5b28c103594573b7bb21a02cb000c4" } }

Change History

This API has no change history records yet.

View all change history