Skip to content

Commit 3efdd1f

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a1d10e5 of spec repo
1 parent 0f05c18 commit 3efdd1f

11 files changed

+316
-8
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32232,11 +32232,17 @@ components:
3223232232
recipients:
3223332233
$ref: '#/components/schemas/MonitorNotificationRuleRecipients'
3223432234
scope:
32235-
$ref: '#/components/schemas/MonitorNotificationRuleScope'
32235+
$ref: '#/components/schemas/MonitorNotificationRuleConditionScope'
3223632236
required:
3223732237
- scope
3223832238
- recipients
3223932239
type: object
32240+
MonitorNotificationRuleConditionScope:
32241+
description: The scope to which the monitor applied.
32242+
example: transition_type:alert
32243+
maxLength: 3000
32244+
minLength: 1
32245+
type: string
3224032246
MonitorNotificationRuleConditionalRecipients:
3224132247
description: Use conditional recipients to define different recipients for different
3224232248
situations.
@@ -32289,6 +32295,20 @@ components:
3228932295
description: Filter used to associate the notification rule with monitors.
3229032296
oneOf:
3229132297
- $ref: '#/components/schemas/MonitorNotificationRuleFilterTags'
32298+
- $ref: '#/components/schemas/MonitorNotificationRuleFilterScope'
32299+
MonitorNotificationRuleFilterScope:
32300+
additionalProperties: false
32301+
description: Filter monitors by scope. Monitors must match the scope evaluation.
32302+
properties:
32303+
scope:
32304+
description: The scope to which the monitor notification rule applies.
32305+
example: env:prod AND datacenter:us-east-1
32306+
maxLength: 3000
32307+
minLength: 1
32308+
type: string
32309+
required:
32310+
- scope
32311+
type: object
3229232312
MonitorNotificationRuleFilterTags:
3229332313
additionalProperties: false
3229432314
description: Filter monitors by tags. Monitors must match all tags.
@@ -32417,12 +32437,6 @@ components:
3241732437
description: An object related to a monitor notification rule.
3241832438
oneOf:
3241932439
- $ref: '#/components/schemas/User'
32420-
MonitorNotificationRuleScope:
32421-
description: The scope to which the monitor applied.
32422-
example: transition_type:alert
32423-
maxLength: 3000
32424-
minLength: 1
32425-
type: string
3242632440
MonitorNotificationRuleUpdateRequest:
3242732441
description: Request for updating a monitor notification rule.
3242832442
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
@@ -2951,6 +2951,7 @@ def overrides
29512951
"v2.monitor_notification_rule_create_request_data" => "MonitorNotificationRuleCreateRequestData",
29522952
"v2.monitor_notification_rule_data" => "MonitorNotificationRuleData",
29532953
"v2.monitor_notification_rule_filter" => "MonitorNotificationRuleFilter",
2954+
"v2.monitor_notification_rule_filter_scope" => "MonitorNotificationRuleFilterScope",
29542955
"v2.monitor_notification_rule_filter_tags" => "MonitorNotificationRuleFilterTags",
29552956
"v2.monitor_notification_rule_list_response" => "MonitorNotificationRuleListResponse",
29562957
"v2.monitor_notification_rule_relationships" => "MonitorNotificationRuleRelationships",

lib/datadog_api_client/v2/models/monitor_notification_rule_filter.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class << self
2626
# List of class defined in oneOf (OpenAPI v3)
2727
def openapi_one_of
2828
[
29-
:'MonitorNotificationRuleFilterTags'
29+
:'MonitorNotificationRuleFilterTags',
30+
:'MonitorNotificationRuleFilterScope'
3031
]
3132
end
3233
# Builds the object

0 commit comments

Comments
 (0)