Description:This API edits a specific alert. Required Roles:One of the following: URI:/op/api/v2/alert/{{productView}}/{{alertApiReferenceId}}
Request:The request should use the method with the following URL parameters:Name | Required/Optional | Description | Type | Available Options |
---|
productView | Required | The product view. | String | | alertApiReferenceId | Required | The alert UUID. | String | |
The request should use the method with the following fields in its body:Name | Required / Optional | Description | Type | Available Options |
---|
isSystemHealthMetric | Required | Whether or not the alert is a metric. | Boolean | | isActive | Required | Whether or not the alert will be scheduled for execution. | Boolean | | name | Required | The alert name. | String | | description | Required | Text description of the alert’s definition. | String | | productView | Required | The product view assigned to the alert. | String | | indexSets | Required | Which OpenSearch index sets will be queried (according to product view). | String (Comma separated) | See Index Sets. | documentType | Required | Which OpenSearch document types will be queried (according to product view) | String | See Document type. | jsonQuery | Required | An OpenSearch query. | String (JSON) | | jsonParameters | Required | Key-Value Pairs to Replace Values within the Query (JSON). | String (JSON) | | schedule | Required | The scheduling definition using a simplified version of the Cron scheduling format. | String | format: sec min hour day month weekday year | recipients | Required | A list of email addresses the alert will be emailed to. | Array of Strings | | filtersParameters | Required | Alert filters (according to product type and document type). Provided as Key-Value Pairs, where: | Element | See Alert Filters. | serviceNameFieldOverride | Optional | Apply the service filter value to a specific Store field. You may leave this field empty unless otherwise advised. | String | | isPublishToMail | Required | Whether or not an email will be sent. | Boolean | | isPublishToSyslog | Required | Whether or not a syslog message will be sent. | Boolean | | isPublishToMailWs | Required | Whether or not an email will be sent via webservice. | Boolean | | errorThreshold | Required | If the alert value exceeds the error threshold value, the alert is assigned with a severity of error. | Double | Thresholds can be set only for health metrics that support thresholds (such as Frequency or Flat-Line) | warningThreshold | Optional | If the alert value exceeds the warning threshold value, the alert is assigned with a severity of warning. | Double | Thresholds can be set only for health metrics that support thresholds (such as Frequency or Flat-Line) | warningDamagePoints | Optional | The amount of damage points that are assigned for this alert if the alert has a severity of warning. When a specific device has only alerts in a warning severity, and the accumulated damage points of these alerts exceed its Damage Points Threshold, the device transitions into an error state in the System Health dashboard. | Double | Thresholds can be set only for health metrics that support thresholds (such as Frequency or Flat-Line) | alertType | Required | Type of the alert query. | String | | comparator | Required | The comparator used to compare between the OpenSearch query result and the error threshold. | String | | valueFieldName | Optional | The field name which field value is compared to the list of values. | String | Only applicable for alert type "List" and “Frequency“ | listOfValues | Optional | For alert type “Frequency“, is is a delimited final result list which will force the result to include only specific values. Missing values will be added with 0 fetched documents (thus allowing the user to identify missing values such as unused services). For alert type “List”, it is a delimited blacklist or a whitelist of values. | String | Only applicable for alert type "List" and “Frequency“ | listDelimiter | Optional | The delimiter used to delimit the list of values. | String | Only applicable for alert type "List" and “Frequency“ | investigateUri | Required | The investigate link displays the data that triggered each alert in DPOD Web Console. | String | | aggregationNamesToIgnore | Optional | Aggregation names to ignore in results. | String (Comma separated) | |
Example: Code Block |
---|
{
"isSystemHealthMetric": false,
"isActive": false,
"name": "This_is_automationAbc",
"description": "This_is_automationAbc",
"productView": "APIC",
"indexSets": "wdp-device-resources",
"documentType": "WDP_DEVICE_RESOURCES",
"jsonQuery": "{\"query\": {\"bool\": {\"must\": {\"match_all\": {}},\"filter\": {}}},\"aggs\": {\"Device\": {\"terms\": {\"field\":\"deviceName\",\"size\": 1000,\"shard_size\": 10000,\"order\": {\"MaxCpu\":\"desc\"}},\"aggs\": {\"MaxCpu\": {\"max\": {\"field\":\"usedCPUInPercentage\"}}}}},\"size\": 0}",
"jsonParameters": "",
"schedule": "",
"recipients": [],
"filtersParameters": {
"timeRangeType": "recent",
"timeRangePeriod": "86400000"
},
"isPublishToMail": false,
"isPublishToSyslog": true,
"isPublishToMailWs": false,
"errorThreshold": 15.0,
"alertType": "Flatline",
"comparator": "GreaterThanOrEquals",
"investigateUri": ""
} |
Successful Response:The response includes the following fields in its result element: Name | Description | Type | Available Options |
---|
id | The ID of the alert. | Long | | isSystemHealthMetric | See the description in the request above. | isActive | See the description in the request above. | name | See the description in the request above. | description | See the description in the request above. | productView | See the description in the request above. | indexSets | See the description in the request above. | documentType | See the description in the request above. | jsonQuery | See the description in the request above. | jsonParameters | See the description in the request above. | schedule | See the description in the request above. | recipients | See the description in the request above. | filtersParameters | See the description in the request above. | serviceNameFieldOverride | See the description in the request above. | lastUpdateTimeInMillis | Time the alert was created. | Long | | lastUpdateUserName | The user who created the alert. | String | | isPublishToMail | See the description in the request above. | isPublishToSyslog | See the description in the request above. | isPublishToMailWs | See the description in the request above. | errorThreshold | See the description in the request above. | warningThreshold | See the description in the request above. | warningDamagePoints | See the description in the request above. | alertType | See the description in the request above. | comparator | See the description in the request above. | apiReference | Unique alert UUID. | String | | valueFieldName | See the description in the request above. | listOfValues | See the description in the request above. | listDelimiter | See the description in the request above. | investigateUri | See the description in the request above. | aggregationNamesToIgnore | See the description in the request above. |
Example: Code Block |
---|
{
"resultCode": "SUCCESS",
"resultMessage": "Alert updated successfully",
"result": {
"id": 45,
"isSystemHealthMetric": false,
"isActive": false,
"name": "This_is_automationAbc",
"description": "This_is_automationAbc",
"productView": "APIC",
"indexSets": "wdp-device-resources",
"documentType": "WDP_DEVICE_RESOURCES",
"jsonQuery": "{\"query\": {\"bool\": {\"must\": {\"match_all\": {}},\"filter\": {}}},\"aggs\": {\"Device\": {\"terms\": {\"field\":\"deviceName\",\"size\": 1000,\"shard_size\": 10000,\"order\": {\"MaxCpu\":\"desc\"}},\"aggs\": {\"MaxCpu\": {\"max\": {\"field\":\"usedCPUInPercentage\"}}}}},\"size\": 0}",
"jsonParameters": "",
"schedule": "",
"recipients": [],
"filtersParameters": {
"timeRangeType": "recent",
"timeRangePeriod": "86400000"
},
"lastUpdateTimeInMillis": 1727703635726,
"lastUpdateUserName": "admin",
"isPublishToMail": false,
"isPublishToSyslog": true,
"isPublishToMailWs": false,
"errorThreshold": 15.0,
"alertType": "Flatline",
"comparator": "GreaterThanOrEquals",
"apiReference": "BE159C79-EEF9-4C9C-AADE-BDE515FBCAF2",
"investigateUri": ""
}
} |
|