Skip to content

Commit a285bdd

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 10c6f7d of spec repo
1 parent 9c31ab9 commit a285bdd

16 files changed

+335
-21
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32305,15 +32305,23 @@ components:
3230532305
properties:
3230632306
recipients:
3230732307
$ref: '#/components/schemas/MonitorNotificationRuleRecipients'
32308+
description: A list of recipients to notify. Uses the same format as the
32309+
monitor `message` field. Must not start with an '@'.
3230832310
scope:
32309-
$ref: '#/components/schemas/MonitorNotificationRuleScope'
32311+
$ref: '#/components/schemas/MonitorNotificationRuleConditionScope'
3231032312
required:
3231132313
- scope
3231232314
- recipients
3231332315
type: object
32316+
MonitorNotificationRuleConditionScope:
32317+
description: The scope to which the monitor applied.
32318+
example: transition_type:alert
32319+
maxLength: 3000
32320+
minLength: 1
32321+
type: string
3231432322
MonitorNotificationRuleConditionalRecipients:
3231532323
description: Use conditional recipients to define different recipients for different
32316-
situations.
32324+
situations. Cannot be used with `recipients`.
3231732325
properties:
3231832326
conditions:
3231932327
description: Conditions of the notification rule.
@@ -32363,12 +32371,30 @@ components:
3236332371
description: Filter used to associate the notification rule with monitors.
3236432372
oneOf:
3236532373
- $ref: '#/components/schemas/MonitorNotificationRuleFilterTags'
32374+
- $ref: '#/components/schemas/MonitorNotificationRuleFilterScope'
32375+
MonitorNotificationRuleFilterScope:
32376+
additionalProperties: false
32377+
description: Filter monitor notifications. A monitor notification must match
32378+
the scope.
32379+
properties:
32380+
scope:
32381+
description: A scope composed of one or several key:value pairs, which can
32382+
be used to filter monitor notifications on monitor and group tags.
32383+
example: service:(foo OR bar) AND team:test NOT environment:staging
32384+
maxLength: 3000
32385+
minLength: 1
32386+
type: string
32387+
required:
32388+
- scope
32389+
type: object
3236632390
MonitorNotificationRuleFilterTags:
3236732391
additionalProperties: false
32368-
description: Filter monitors by tags. Monitors must match all tags.
32392+
description: Filter monitor notifications by tags. A monitor notification must
32393+
match all tags.
3236932394
properties:
3237032395
tags:
32371-
description: A list of monitor tags.
32396+
description: A list of tags (key:value pairs), which can be used to filter
32397+
monitor notifications on monitor and group tags.
3237232398
example:
3237332399
- team:product
3237432400
- host:abc
@@ -32408,7 +32434,7 @@ components:
3240832434
type: string
3240932435
MonitorNotificationRuleRecipients:
3241032436
description: A list of recipients to notify. Uses the same format as the monitor
32411-
`message` field. Must not start with an '@'.
32437+
`message` field. Must not start with an '@'. Cannot be used with `conditional_recipients`.
3241232438
example:
3241332439
- slack-test-channel
3241432440
- jira-test
@@ -32491,12 +32517,6 @@ components:
3249132517
description: An object related to a monitor notification rule.
3249232518
oneOf:
3249332519
- $ref: '#/components/schemas/User'
32494-
MonitorNotificationRuleScope:
32495-
description: The scope to which the monitor applied.
32496-
example: transition_type:alert
32497-
maxLength: 3000
32498-
minLength: 1
32499-
type: string
3250032520
MonitorNotificationRuleUpdateRequest:
3250132521
description: Request for updating a monitor notification rule.
3250232522
properties:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-11-11T21:28:39.129Z

cassettes/features/v2/monitors/Create-a-monitor-notification-rule-with-scope-returns-OK-response.yml

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-11-11T21:28:40.357Z

cassettes/features/v2/monitors/Update-a-monitor-notification-rule-with-scope-returns-OK-response.yml

Lines changed: 74 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Create a monitor notification rule with scope returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::MonitorsAPI.new
5+
6+
body = DatadogAPIClient::V2::MonitorNotificationRuleCreateRequest.new({
7+
data: DatadogAPIClient::V2::MonitorNotificationRuleCreateRequestData.new({
8+
attributes: DatadogAPIClient::V2::MonitorNotificationRuleAttributes.new({
9+
filter: DatadogAPIClient::V2::MonitorNotificationRuleFilterScope.new({
10+
scope: "test:example-monitor",
11+
}),
12+
name: "test rule",
13+
recipients: [
14+
"slack-test-channel",
15+
"jira-test",
16+
],
17+
}),
18+
type: DatadogAPIClient::V2::MonitorNotificationRuleResourceType::MONITOR_NOTIFICATION_RULE,
19+
}),
20+
})
21+
p api_instance.create_monitor_notification_rule(body)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Update a monitor notification rule with scope returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::MonitorsAPI.new
5+
6+
# there is a valid "monitor_notification_rule" in the system
7+
MONITOR_NOTIFICATION_RULE_DATA_ID = ENV["MONITOR_NOTIFICATION_RULE_DATA_ID"]
8+
9+
body = DatadogAPIClient::V2::MonitorNotificationRuleUpdateRequest.new({
10+
data: DatadogAPIClient::V2::MonitorNotificationRuleUpdateRequestData.new({
11+
attributes: DatadogAPIClient::V2::MonitorNotificationRuleAttributes.new({
12+
filter: DatadogAPIClient::V2::MonitorNotificationRuleFilterScope.new({
13+
scope: "test:example-monitor",
14+
}),
15+
name: "updated rule",
16+
recipients: [
17+
"slack-test-channel",
18+
],
19+
}),
20+
id: MONITOR_NOTIFICATION_RULE_DATA_ID,
21+
type: DatadogAPIClient::V2::MonitorNotificationRuleResourceType::MONITOR_NOTIFICATION_RULE,
22+
}),
23+
})
24+
p api_instance.update_monitor_notification_rule(MONITOR_NOTIFICATION_RULE_DATA_ID, body)

features/v2/monitors.feature

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ Feature: Monitors
5252
Then the response status is 200 OK
5353
And the response "data.attributes.name" is equal to "test rule"
5454

55+
@team:DataDog/monitor-app
56+
Scenario: Create a monitor notification rule with scope returns "OK" response
57+
Given new "CreateMonitorNotificationRule" request
58+
And body with value {"data": {"attributes": {"filter": {"scope": "test:{{ unique_lower }}"}, "name": "test rule", "recipients": ["slack-test-channel", "jira-test"]}, "type": "monitor-notification-rule"}}
59+
When the request is sent
60+
Then the response status is 200 OK
61+
And the response "data.attributes.name" is equal to "test rule"
62+
5563
@skip-validation @team:DataDog/monitor-app
5664
Scenario: Create a monitor user template returns "Bad Request" response
5765
Given new "CreateMonitorUserTemplate" request
@@ -272,6 +280,16 @@ Feature: Monitors
272280
Then the response status is 200 OK
273281
And the response "data.attributes.name" is equal to "updated rule"
274282

283+
@team:DataDog/monitor-app
284+
Scenario: Update a monitor notification rule with scope returns "OK" response
285+
Given there is a valid "monitor_notification_rule" in the system
286+
And new "UpdateMonitorNotificationRule" request
287+
And request contains "rule_id" parameter from "monitor_notification_rule.data.id"
288+
And body with value {"data": {"attributes": {"filter": {"scope": "test:{{ unique_lower }}"}, "name": "updated rule", "recipients": ["slack-test-channel"]}, "id": "{{ monitor_notification_rule.data.id }}", "type": "monitor-notification-rule"}}
289+
When the request is sent
290+
Then the response status is 200 OK
291+
And the response "data.attributes.name" is equal to "updated rule"
292+
275293
@skip-validation @team:DataDog/monitor-app
276294
Scenario: Update a monitor user template to a new version returns "Bad Request" response
277295
Given there is a valid "monitor_user_template" in the system

lib/datadog_api_client/inflector.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2956,6 +2956,7 @@ def overrides
29562956
"v2.monitor_notification_rule_create_request_data" => "MonitorNotificationRuleCreateRequestData",
29572957
"v2.monitor_notification_rule_data" => "MonitorNotificationRuleData",
29582958
"v2.monitor_notification_rule_filter" => "MonitorNotificationRuleFilter",
2959+
"v2.monitor_notification_rule_filter_scope" => "MonitorNotificationRuleFilterScope",
29592960
"v2.monitor_notification_rule_filter_tags" => "MonitorNotificationRuleFilterTags",
29602961
"v2.monitor_notification_rule_list_response" => "MonitorNotificationRuleListResponse",
29612962
"v2.monitor_notification_rule_relationships" => "MonitorNotificationRuleRelationships",

lib/datadog_api_client/v2/models/monitor_notification_rule_attributes.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module DatadogAPIClient::V2
2121
class MonitorNotificationRuleAttributes
2222
include BaseGenericModel
2323

24-
# Use conditional recipients to define different recipients for different situations.
24+
# Use conditional recipients to define different recipients for different situations. Cannot be used with `recipients`.
2525
attr_accessor :conditional_recipients
2626

2727
# Filter used to associate the notification rule with monitors.
@@ -30,7 +30,7 @@ class MonitorNotificationRuleAttributes
3030
# The name of the monitor notification rule.
3131
attr_reader :name
3232

33-
# A list of recipients to notify. Uses the same format as the monitor `message` field. Must not start with an '@'.
33+
# A list of recipients to notify. Uses the same format as the monitor `message` field. Must not start with an '@'. Cannot be used with `conditional_recipients`.
3434
attr_reader :recipients
3535

3636
# Attribute mapping from ruby-style variable name to JSON key.

0 commit comments

Comments
 (0)