Skip to content

Commit abb891d

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Notification rule conditionals (#3405)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 85a2d30 commit abb891d

File tree

6 files changed

+38
-22
lines changed

6 files changed

+38
-22
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36811,7 +36811,10 @@ components:
3681136811
- name
3681236812
type: object
3681336813
MonitorNotificationRuleCondition:
36814-
description: Conditions for `conditional_recipients`.
36814+
description: 'A conditional recipient rule composed of a `scope` (the matching
36815+
condition) and
36816+
36817+
`recipients` (who to notify when it matches).'
3681536818
properties:
3681636819
recipients:
3681736820
$ref: '#/components/schemas/MonitorNotificationRuleRecipients'
@@ -36824,8 +36827,13 @@ components:
3682436827
- recipients
3682536828
type: object
3682636829
MonitorNotificationRuleConditionScope:
36827-
description: The scope to which the monitor applied.
36828-
example: transition_type:alert
36830+
description: 'Defines the condition under which the recipients are notified.
36831+
Supported formats:
36832+
36833+
- Monitor status condition using `transition_type:<status>`, for example `transition_type:is_alert`.
36834+
36835+
- A single tag key:value pair, for example `env:prod`.'
36836+
example: transition_type:is_alert
3682936837
maxLength: 3000
3683036838
minLength: 1
3683136839
type: string
@@ -36878,18 +36886,18 @@ components:
3687836886
$ref: '#/components/schemas/MonitorNotificationRuleResourceType'
3687936887
type: object
3688036888
MonitorNotificationRuleFilter:
36881-
description: Filter used to associate the notification rule with monitors.
36889+
description: Specifies the matching criteria for monitor notifications.
3688236890
oneOf:
3688336891
- $ref: '#/components/schemas/MonitorNotificationRuleFilterTags'
3688436892
- $ref: '#/components/schemas/MonitorNotificationRuleFilterScope'
3688536893
MonitorNotificationRuleFilterScope:
3688636894
additionalProperties: false
36887-
description: Filter monitor notifications. A monitor notification must match
36888-
the scope.
36895+
description: Filters monitor notifications using a scope expression over key:value
36896+
pairs with boolean logic (AND, OR, NOT).
3688936897
properties:
3689036898
scope:
36891-
description: A scope composed of one or several key:value pairs, which can
36892-
be used to filter monitor notifications on monitor and group tags.
36899+
description: A scope expression composed by key:value pairs (e.g. `service:foo`)
36900+
with boolean operators (AND, OR, NOT) and parentheses for grouping.
3689336901
example: service:(foo OR bar) AND team:test NOT environment:staging
3689436902
maxLength: 3000
3689536903
minLength: 1
@@ -36899,12 +36907,11 @@ components:
3689936907
type: object
3690036908
MonitorNotificationRuleFilterTags:
3690136909
additionalProperties: false
36902-
description: Filter monitor notifications by tags. A monitor notification must
36903-
match all tags.
36910+
description: Filters monitor notifications by a list of tag key:value pairs.
3690436911
properties:
3690536912
tags:
36906-
description: A list of tags (key:value pairs), which can be used to filter
36907-
monitor notifications on monitor and group tags.
36913+
description: A list of tag key:value pairs (e.g. `team:product`). All tags
36914+
must match (AND semantics).
3690836915
example:
3690936916
- team:product
3691036917
- host:abc

src/main/java/com/datadog/api/client/v2/model/MonitorNotificationRuleAttributes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public MonitorNotificationRuleAttributes filter(MonitorNotificationRuleFilter fi
7878
}
7979

8080
/**
81-
* Filter used to associate the notification rule with monitors.
81+
* Specifies the matching criteria for monitor notifications.
8282
*
8383
* @return filter
8484
*/

src/main/java/com/datadog/api/client/v2/model/MonitorNotificationRuleCondition.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
import java.util.Map;
2020
import java.util.Objects;
2121

22-
/** Conditions for <code>conditional_recipients</code>. */
22+
/**
23+
* A conditional recipient rule composed of a <code>scope</code> (the matching condition) and <code>
24+
* recipients</code> (who to notify when it matches).
25+
*/
2326
@JsonPropertyOrder({
2427
MonitorNotificationRuleCondition.JSON_PROPERTY_RECIPIENTS,
2528
MonitorNotificationRuleCondition.JSON_PROPERTY_SCOPE
@@ -76,7 +79,10 @@ public MonitorNotificationRuleCondition scope(String scope) {
7679
}
7780

7881
/**
79-
* The scope to which the monitor applied.
82+
* Defines the condition under which the recipients are notified. Supported formats: - Monitor
83+
* status condition using <code>transition_type:&lt;status&gt;</code>, for example <code>
84+
* transition_type:is_alert</code>. - A single tag key:value pair, for example <code>env:prod
85+
* </code>.
8086
*
8187
* @return scope
8288
*/

src/main/java/com/datadog/api/client/v2/model/MonitorNotificationRuleFilterScope.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
1414
import java.util.Objects;
1515

16-
/** Filter monitor notifications. A monitor notification must match the scope. */
16+
/**
17+
* Filters monitor notifications using a scope expression over key:value pairs with boolean logic
18+
* (AND, OR, NOT).
19+
*/
1720
@JsonPropertyOrder({MonitorNotificationRuleFilterScope.JSON_PROPERTY_SCOPE})
1821
@jakarta.annotation.Generated(
1922
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
@@ -36,8 +39,8 @@ public MonitorNotificationRuleFilterScope scope(String scope) {
3639
}
3740

3841
/**
39-
* A scope composed of one or several key:value pairs, which can be used to filter monitor
40-
* notifications on monitor and group tags.
42+
* A scope expression composed by key:value pairs (e.g. <code>service:foo</code>) with boolean
43+
* operators (AND, OR, NOT) and parentheses for grouping.
4144
*
4245
* @return scope
4346
*/

src/main/java/com/datadog/api/client/v2/model/MonitorNotificationRuleFilterTags.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import java.util.List;
1616
import java.util.Objects;
1717

18-
/** Filter monitor notifications by tags. A monitor notification must match all tags. */
18+
/** Filters monitor notifications by a list of tag key:value pairs. */
1919
@JsonPropertyOrder({MonitorNotificationRuleFilterTags.JSON_PROPERTY_TAGS})
2020
@jakarta.annotation.Generated(
2121
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
@@ -43,8 +43,8 @@ public MonitorNotificationRuleFilterTags addTagsItem(String tagsItem) {
4343
}
4444

4545
/**
46-
* A list of tags (key:value pairs), which can be used to filter monitor notifications on monitor
47-
* and group tags.
46+
* A list of tag key:value pairs (e.g. <code>team:product</code>). All tags must match (AND
47+
* semantics).
4848
*
4949
* @return tags
5050
*/

src/main/java/com/datadog/api/client/v2/model/MonitorNotificationRuleResponseAttributes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public MonitorNotificationRuleResponseAttributes filter(MonitorNotificationRuleF
103103
}
104104

105105
/**
106-
* Filter used to associate the notification rule with monitors.
106+
* Specifies the matching criteria for monitor notifications.
107107
*
108108
* @return filter
109109
*/

0 commit comments

Comments
 (0)