Skip to content

Commit 46b30bc

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 627a896 of spec repo
1 parent 7272fd0 commit 46b30bc

File tree

14 files changed

+563
-2
lines changed

14 files changed

+563
-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+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* Create a monitor notification rule with conditional recipients returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.MonitorsApi(configuration);
9+
10+
const params: v2.MonitorsApiCreateMonitorNotificationRuleRequest = {
11+
body: {
12+
data: {
13+
attributes: {
14+
filter: {
15+
tags: ["test:example-monitor"],
16+
},
17+
name: "test rule",
18+
conditionalRecipients: {
19+
conditions: [
20+
{
21+
scope: "transition_type:is_alert",
22+
recipients: ["slack-test-channel", "jira-test"],
23+
},
24+
],
25+
},
26+
},
27+
type: "monitor-notification-rule",
28+
},
29+
},
30+
};
31+
32+
apiInstance
33+
.createMonitorNotificationRule(params)
34+
.then((data: v2.MonitorNotificationRuleResponse) => {
35+
console.log(
36+
"API called successfully. Returned data: " + JSON.stringify(data)
37+
);
38+
})
39+
.catch((error: any) => console.error(error));

0 commit comments

Comments
 (0)