Skip to content

Commit cbe6014

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a1d10e5 of spec repo
1 parent 357aba1 commit cbe6014

File tree

10 files changed

+356
-8
lines changed

10 files changed

+356
-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:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2025-11-11T21:28:39.129Z"
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
{
2+
"log": {
3+
"_recordingName": "Monitors/Create a monitor notification rule with scope returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.6"
8+
},
9+
"entries": [
10+
{
11+
"_id": "e4be868dca8d74340ab17b06ab95288e",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 235,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "content-type",
26+
"value": "application/json"
27+
}
28+
],
29+
"headersSize": 589,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"data\":{\"attributes\":{\"filter\":{\"scope\":\"test:test-create_a_monitor_notification_rule_with_scope_returns_ok_response-1762896519\"},\"name\":\"test rule\",\"recipients\":[\"slack-test-channel\",\"jira-test\"]},\"type\":\"monitor-notification-rule\"}}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v2/monitor/notification_rule"
39+
},
40+
"response": {
41+
"bodySize": 1002,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 1002,
45+
"text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"attributes\":{\"modified_at\":\"1970-01-01T00:00:00+00:00\",\"filter\":{\"scope\":\"test:test-create_a_monitor_notification_rule_with_scope_returns_ok_response-1762896519\"},\"name\":\"test rule\",\"recipients\":[\"slack-test-channel\",\"jira-test\"],\"created_at\":\"2025-11-11T21:28:40.032148+00:00\"},\"relationships\":{\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}},\"id\":\"bbea2907-c191-48d0-9e0f-1ec5881ee37c\"},\"included\":[{\"type\":\"users\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"attributes\":{\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"created_at\":\"2020-12-29T22:58:44.733921+00:00\",\"modified_at\":\"2021-04-27T13:54:01.547888+00:00\",\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/b7c189b5b4c2c429d7c1e0bc3749330e?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":true,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\",\"last_login_time\":null}}]}\n"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 704,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2025-11-11T21:28:39.744Z",
61+
"time": 338
62+
},
63+
{
64+
"_id": "00d5556e17c827a0dc4aa1c17361ac26",
65+
"_order": 0,
66+
"cache": {},
67+
"request": {
68+
"bodySize": 0,
69+
"cookies": [],
70+
"headers": [
71+
{
72+
"_fromType": "array",
73+
"name": "accept",
74+
"value": "*/*"
75+
}
76+
],
77+
"headersSize": 562,
78+
"httpVersion": "HTTP/1.1",
79+
"method": "DELETE",
80+
"queryString": [],
81+
"url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/bbea2907-c191-48d0-9e0f-1ec5881ee37c"
82+
},
83+
"response": {
84+
"bodySize": 0,
85+
"content": {
86+
"mimeType": "text/html; charset=utf-8",
87+
"size": 0
88+
},
89+
"cookies": [],
90+
"headers": [
91+
{
92+
"name": "content-type",
93+
"value": "text/html; charset=utf-8"
94+
}
95+
],
96+
"headersSize": 690,
97+
"httpVersion": "HTTP/1.1",
98+
"redirectURL": "",
99+
"status": 204,
100+
"statusText": "No Content"
101+
},
102+
"startedDateTime": "2025-11-11T21:28:40.100Z",
103+
"time": 249
104+
}
105+
],
106+
"pages": [],
107+
"version": "1.2"
108+
}
109+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2025-11-11T21:28:40.357Z"
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
{
2+
"log": {
3+
"_recordingName": "Monitors/Update a monitor notification rule with scope returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.6"
8+
},
9+
"entries": [
10+
{
11+
"_id": "00cda7cffe4c75a8bc28baa5933cbfec",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 222,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "content-type",
26+
"value": "application/json"
27+
}
28+
],
29+
"headersSize": 589,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"app:test-update_a_monitor_notification_rule_with_scope_returns_ok_response-1762896520\"]},\"name\":\"test rule\",\"recipients\":[\"slack-monitor-app\"]},\"type\":\"monitor-notification-rule\"}}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v2/monitor/notification_rule"
39+
},
40+
"response": {
41+
"bodySize": 989,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 989,
45+
"text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"attributes\":{\"recipients\":[\"slack-monitor-app\"],\"modified_at\":\"1970-01-01T00:00:00+00:00\",\"created_at\":\"2025-11-11T21:28:40.540848+00:00\",\"name\":\"test rule\",\"filter\":{\"tags\":[\"app:test-update_a_monitor_notification_rule_with_scope_returns_ok_response-1762896520\"]}},\"relationships\":{\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}},\"id\":\"827442a0-5d3e-408c-a930-7ac44775fff1\"},\"included\":[{\"type\":\"users\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"attributes\":{\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"created_at\":\"2020-12-29T22:58:44.733921+00:00\",\"modified_at\":\"2021-04-27T13:54:01.547888+00:00\",\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/b7c189b5b4c2c429d7c1e0bc3749330e?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":true,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\",\"last_login_time\":null}}]}\n"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 703,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2025-11-11T21:28:40.361Z",
61+
"time": 227
62+
},
63+
{
64+
"_id": "91f1a6b8c117246dfceb72c3ec665801",
65+
"_order": 0,
66+
"cache": {},
67+
"request": {
68+
"bodySize": 270,
69+
"cookies": [],
70+
"headers": [
71+
{
72+
"_fromType": "array",
73+
"name": "accept",
74+
"value": "application/json"
75+
},
76+
{
77+
"_fromType": "array",
78+
"name": "content-type",
79+
"value": "application/json"
80+
}
81+
],
82+
"headersSize": 627,
83+
"httpVersion": "HTTP/1.1",
84+
"method": "PATCH",
85+
"postData": {
86+
"mimeType": "application/json",
87+
"params": [],
88+
"text": "{\"data\":{\"attributes\":{\"filter\":{\"scope\":\"test:test-update_a_monitor_notification_rule_with_scope_returns_ok_response-1762896520\"},\"name\":\"updated rule\",\"recipients\":[\"slack-test-channel\"]},\"id\":\"827442a0-5d3e-408c-a930-7ac44775fff1\",\"type\":\"monitor-notification-rule\"}}"
89+
},
90+
"queryString": [],
91+
"url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/827442a0-5d3e-408c-a930-7ac44775fff1"
92+
},
93+
"response": {
94+
"bodySize": 1000,
95+
"content": {
96+
"mimeType": "application/json",
97+
"size": 1000,
98+
"text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"attributes\":{\"filter\":{\"scope\":\"test:test-update_a_monitor_notification_rule_with_scope_returns_ok_response-1762896520\"},\"recipients\":[\"slack-test-channel\"],\"created_at\":\"2025-11-11T21:28:40.540848+00:00\",\"name\":\"updated rule\",\"modified_at\":\"2025-11-11T21:28:40.815544+00:00\"},\"id\":\"827442a0-5d3e-408c-a930-7ac44775fff1\",\"relationships\":{\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}},\"included\":[{\"type\":\"users\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"attributes\":{\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"created_at\":\"2020-12-29T22:58:44.733921+00:00\",\"modified_at\":\"2021-04-27T13:54:01.547888+00:00\",\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/b7c189b5b4c2c429d7c1e0bc3749330e?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":true,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\",\"last_login_time\":null}}]}\n"
99+
},
100+
"cookies": [],
101+
"headers": [
102+
{
103+
"name": "content-type",
104+
"value": "application/json"
105+
}
106+
],
107+
"headersSize": 704,
108+
"httpVersion": "HTTP/1.1",
109+
"redirectURL": "",
110+
"status": 200,
111+
"statusText": "OK"
112+
},
113+
"startedDateTime": "2025-11-11T21:28:40.594Z",
114+
"time": 277
115+
},
116+
{
117+
"_id": "d37e3788b9fdb86941bed09511fde9b5",
118+
"_order": 0,
119+
"cache": {},
120+
"request": {
121+
"bodySize": 0,
122+
"cookies": [],
123+
"headers": [
124+
{
125+
"_fromType": "array",
126+
"name": "accept",
127+
"value": "*/*"
128+
}
129+
],
130+
"headersSize": 562,
131+
"httpVersion": "HTTP/1.1",
132+
"method": "DELETE",
133+
"queryString": [],
134+
"url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/827442a0-5d3e-408c-a930-7ac44775fff1"
135+
},
136+
"response": {
137+
"bodySize": 0,
138+
"content": {
139+
"mimeType": "text/html; charset=utf-8",
140+
"size": 0
141+
},
142+
"cookies": [],
143+
"headers": [
144+
{
145+
"name": "content-type",
146+
"value": "text/html; charset=utf-8"
147+
}
148+
],
149+
"headersSize": 690,
150+
"httpVersion": "HTTP/1.1",
151+
"redirectURL": "",
152+
"status": 204,
153+
"statusText": "No Content"
154+
},
155+
"startedDateTime": "2025-11-11T21:28:40.876Z",
156+
"time": 246
157+
}
158+
],
159+
"pages": [],
160+
"version": "1.2"
161+
}
162+
}

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

services/monitors/src/v2/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export { MonitorNotificationRuleCreateRequest } from "./models/MonitorNotificati
4141
export { MonitorNotificationRuleCreateRequestData } from "./models/MonitorNotificationRuleCreateRequestData";
4242
export { MonitorNotificationRuleData } from "./models/MonitorNotificationRuleData";
4343
export { MonitorNotificationRuleFilter } from "./models/MonitorNotificationRuleFilter";
44+
export { MonitorNotificationRuleFilterScope } from "./models/MonitorNotificationRuleFilterScope";
4445
export { MonitorNotificationRuleFilterTags } from "./models/MonitorNotificationRuleFilterTags";
4546
export { MonitorNotificationRuleListResponse } from "./models/MonitorNotificationRuleListResponse";
4647
export { MonitorNotificationRuleRelationships } from "./models/MonitorNotificationRuleRelationships";
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { UnparsedObject } from "@datadog/datadog-api-client";
22

3+
import { MonitorNotificationRuleFilterScope } from "./MonitorNotificationRuleFilterScope";
34
import { MonitorNotificationRuleFilterTags } from "./MonitorNotificationRuleFilterTags";
45

56
/**
67
* Filter used to associate the notification rule with monitors.
78
*/
89
export type MonitorNotificationRuleFilter =
910
| MonitorNotificationRuleFilterTags
11+
| MonitorNotificationRuleFilterScope
1012
| UnparsedObject;

0 commit comments

Comments
 (0)