Skip to content

Commit 0b77354

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 1dff133 of spec repo
1 parent ec82e91 commit 0b77354

File tree

12 files changed

+464
-2
lines changed

12 files changed

+464
-2
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29565,6 +29565,8 @@ components:
2956529565
additionalProperties: false
2956629566
description: Attributes of the monitor notification rule.
2956729567
properties:
29568+
conditional_recipients:
29569+
$ref: '#/components/schemas/MonitorNotificationRuleConditionalRecipients'
2956829570
filter:
2956929571
$ref: '#/components/schemas/MonitorNotificationRuleFilter'
2957029572
name:
@@ -29573,8 +29575,36 @@ components:
2957329575
$ref: '#/components/schemas/MonitorNotificationRuleRecipients'
2957429576
required:
2957529577
- name
29578+
type: object
29579+
MonitorNotificationRuleCondition:
29580+
description: Conditions for `conditional_recipients`.
29581+
properties:
29582+
recipients:
29583+
$ref: '#/components/schemas/MonitorNotificationRuleRecipients'
29584+
scope:
29585+
$ref: '#/components/schemas/MonitorNotificationRuleScope'
29586+
required:
29587+
- scope
2957629588
- recipients
2957729589
type: object
29590+
MonitorNotificationRuleConditionalRecipients:
29591+
description: Use conditional recipients to define different recipients for different
29592+
situations.
29593+
properties:
29594+
conditions:
29595+
description: Conditions of the notification rule.
29596+
items:
29597+
$ref: '#/components/schemas/MonitorNotificationRuleCondition'
29598+
maxItems: 10
29599+
minItems: 1
29600+
type: array
29601+
fallback_recipients:
29602+
$ref: '#/components/schemas/MonitorNotificationRuleRecipients'
29603+
description: If none of the `conditions` applied, `fallback_recipients`
29604+
will get notified.
29605+
required:
29606+
- conditions
29607+
type: object
2957829608
MonitorNotificationRuleCreateRequest:
2957929609
description: Request for creating a monitor notification rule.
2958029610
properties:
@@ -29714,6 +29744,8 @@ components:
2971429744
additionalProperties: {}
2971529745
description: Attributes of the monitor notification rule.
2971629746
properties:
29747+
conditional_recipients:
29748+
$ref: '#/components/schemas/MonitorNotificationRuleConditionalRecipients'
2971729749
created:
2971829750
description: Creation time of the monitor notification rule.
2971929751
example: 2020-01-02 03:04:00+00:00
@@ -29735,6 +29767,12 @@ components:
2973529767
description: An object related to a monitor notification rule.
2973629768
oneOf:
2973729769
- $ref: '#/components/schemas/User'
29770+
MonitorNotificationRuleScope:
29771+
description: The scope to which the monitor applied.
29772+
example: transition_type:alert
29773+
maxLength: 3000
29774+
minLength: 1
29775+
type: string
2973829776
MonitorNotificationRuleUpdateRequest:
2973929777
description: Request for updating a monitor notification rule.
2974029778
properties:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2025-09-26T01:50:59.027Z"
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 conditional recipients returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.6"
8+
},
9+
"entries": [
10+
{
11+
"_id": "5a406144918848ee794df49bba5436b3",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 332,
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\":{\"conditional_recipients\":{\"conditions\":[{\"recipients\":[\"slack-test-channel\",\"jira-test\"],\"scope\":\"transition_type:is_alert\"}]},\"filter\":{\"tags\":[\"test:test-create_a_monitor_notification_rule_with_conditional_recipients_returns_ok_response-1758851459\"]},\"name\":\"test rule\"},\"type\":\"monitor-notification-rule\"}}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v2/monitor/notification_rule"
39+
},
40+
"response": {
41+
"bodySize": 1076,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 1076,
45+
"text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"attributes\":{\"name\":\"test rule\",\"filter\":{\"tags\":[\"test:test-create_a_monitor_notification_rule_with_conditional_recipients_returns_ok_response-1758851459\"]},\"created_at\":\"2025-09-26T01:51:00.132009+00:00\",\"conditional_recipients\":{\"conditions\":[{\"recipients\":[\"slack-test-channel\",\"jira-test\"],\"scope\":\"transition_type:is_alert\"}]},\"modified_at\":\"1970-01-01T00:00:00+00:00\"},\"id\":\"707b82d7-6898-4b20-a577-64f76881fe89\",\"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\":\"[email protected]\",\"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\"}}]}\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-09-26T01:50:59.742Z",
61+
"time": 469
62+
},
63+
{
64+
"_id": "c37cabe35cdb94a5aeb80ee7e61c7102",
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/707b82d7-6898-4b20-a577-64f76881fe89"
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-09-26T01:51:00.284Z",
103+
"time": 211
104+
}
105+
],
106+
"pages": [],
107+
"version": "1.2"
108+
}
109+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2025-09-26T01:51:00.504Z"
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 conditional_recipients returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.6"
8+
},
9+
"entries": [
10+
{
11+
"_id": "f74113be194d90918399ff38a8c798db",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 239,
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_conditional_recipients_returns_ok_response-1758851460\"]},\"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": 983,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 983,
45+
"text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"attributes\":{\"filter\":{\"tags\":[\"app:test-update_a_monitor_notification_rule_with_conditional_recipients_returns_ok_response-1758851460\"]},\"created_at\":\"2025-09-26T01:51:00.665373+00:00\",\"name\":\"test rule\",\"recipients\":[\"slack-monitor-app\"],\"modified_at\":\"1970-01-01T00:00:00+00:00\"},\"id\":\"954d2f74-ec41-4f7b-9f63-7146075f3537\",\"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\":\"[email protected]\",\"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\"}}]}\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-09-26T01:51:00.507Z",
61+
"time": 206
62+
},
63+
{
64+
"_id": "56466a6f999a45f8ef1d7f802ab0c507",
65+
"_order": 0,
66+
"cache": {},
67+
"request": {
68+
"bodySize": 390,
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\":{\"conditional_recipients\":{\"conditions\":[{\"recipients\":[\"slack-test-channel\",\"jira-test\"],\"scope\":\"transition_type:is_alert\"}]},\"filter\":{\"tags\":[\"test:test-update_a_monitor_notification_rule_with_conditional_recipients_returns_ok_response-1758851460\",\"host:abc\"]},\"name\":\"updated rule\"},\"id\":\"954d2f74-ec41-4f7b-9f63-7146075f3537\",\"type\":\"monitor-notification-rule\"}}"
89+
},
90+
"queryString": [],
91+
"url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/954d2f74-ec41-4f7b-9f63-7146075f3537"
92+
},
93+
"response": {
94+
"bodySize": 1097,
95+
"content": {
96+
"mimeType": "application/json",
97+
"size": 1097,
98+
"text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"id\":\"954d2f74-ec41-4f7b-9f63-7146075f3537\",\"attributes\":{\"filter\":{\"tags\":[\"test:test-update_a_monitor_notification_rule_with_conditional_recipients_returns_ok_response-1758851460\",\"host:abc\"]},\"modified_at\":\"2025-09-26T01:51:00.876883+00:00\",\"conditional_recipients\":{\"conditions\":[{\"scope\":\"transition_type:is_alert\",\"recipients\":[\"slack-test-channel\",\"jira-test\"]}]},\"name\":\"updated rule\",\"created_at\":\"2025-09-26T01:51:00.665373+00:00\"},\"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\":\"[email protected]\",\"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\"}}]}\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-09-26T01:51:00.719Z",
114+
"time": 200
115+
},
116+
{
117+
"_id": "47601895ff82dd9a14b52f5a0ddc63bd",
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/954d2f74-ec41-4f7b-9f63-7146075f3537"
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-09-26T01:51:00.924Z",
156+
"time": 265
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
@@ -44,6 +44,14 @@ Feature: Monitors
4444
Then the response status is 200 OK
4545
And the response "data.attributes.name" is equal to "test rule"
4646

47+
@team:DataDog/monitor-app
48+
Scenario: Create a monitor notification rule with conditional recipients returns "OK" response
49+
Given new "CreateMonitorNotificationRule" request
50+
And body with value {"data": {"attributes": {"filter": {"tags": ["test:{{ unique_lower }}"]}, "name": "test rule", "conditional_recipients": {"conditions": [{"scope": "transition_type:is_alert", "recipients": ["slack-test-channel", "jira-test"]}]}}, "type": "monitor-notification-rule"}}
51+
When the request is sent
52+
Then the response status is 200 OK
53+
And the response "data.attributes.name" is equal to "test rule"
54+
4755
@skip-validation @team:DataDog/monitor-app
4856
Scenario: Create a monitor user template returns "Bad Request" response
4957
Given new "CreateMonitorUserTemplate" request
@@ -255,6 +263,16 @@ Feature: Monitors
255263
Then the response status is 200 OK
256264
And the response "data.attributes.name" is equal to "updated rule"
257265

266+
@team:DataDog/monitor-app
267+
Scenario: Update a monitor notification rule with conditional_recipients returns "OK" response
268+
Given there is a valid "monitor_notification_rule" in the system
269+
And new "UpdateMonitorNotificationRule" request
270+
And request contains "rule_id" parameter from "monitor_notification_rule.data.id"
271+
And body with value {"data": {"attributes": {"filter": {"tags": ["test:{{ unique_lower }}", "host:abc"]}, "name": "updated rule", "conditional_recipients": {"conditions": [{"scope": "transition_type:is_alert", "recipients": ["slack-test-channel", "jira-test"]}]}}, "id": "{{ monitor_notification_rule.data.id }}", "type": "monitor-notification-rule"}}
272+
When the request is sent
273+
Then the response status is 200 OK
274+
And the response "data.attributes.name" is equal to "updated rule"
275+
258276
@skip-validation @team:DataDog/monitor-app
259277
Scenario: Update a monitor user template to a new version returns "Bad Request" response
260278
Given there is a valid "monitor_user_template" in the system

services/monitors/src/v2/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export { MonitorConfigPolicyTagPolicy } from "./models/MonitorConfigPolicyTagPol
3535
export { MonitorConfigPolicyTagPolicyCreateRequest } from "./models/MonitorConfigPolicyTagPolicyCreateRequest";
3636
export { MonitorConfigPolicyType } from "./models/MonitorConfigPolicyType";
3737
export { MonitorNotificationRuleAttributes } from "./models/MonitorNotificationRuleAttributes";
38+
export { MonitorNotificationRuleCondition } from "./models/MonitorNotificationRuleCondition";
39+
export { MonitorNotificationRuleConditionalRecipients } from "./models/MonitorNotificationRuleConditionalRecipients";
3840
export { MonitorNotificationRuleCreateRequest } from "./models/MonitorNotificationRuleCreateRequest";
3941
export { MonitorNotificationRuleCreateRequestData } from "./models/MonitorNotificationRuleCreateRequestData";
4042
export { MonitorNotificationRuleData } from "./models/MonitorNotificationRuleData";

0 commit comments

Comments
 (0)