Skip to content

Commit 8506e0d

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit ebdc6fd of spec repo
1 parent 892f622 commit 8506e0d

File tree

14 files changed

+561
-2
lines changed

14 files changed

+561
-2
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29063,6 +29063,8 @@ components:
2906329063
additionalProperties: false
2906429064
description: Attributes of the monitor notification rule.
2906529065
properties:
29066+
conditional_recipients:
29067+
$ref: '#/components/schemas/MonitorNotificationRuleConditionalRecipients'
2906629068
filter:
2906729069
$ref: '#/components/schemas/MonitorNotificationRuleFilter'
2906829070
name:
@@ -29071,8 +29073,34 @@ components:
2907129073
$ref: '#/components/schemas/MonitorNotificationRuleRecipients'
2907229074
required:
2907329075
- name
29076+
type: object
29077+
MonitorNotificationRuleCondition:
29078+
description: Conditions for `conditional_recipients`.
29079+
properties:
29080+
recipients:
29081+
$ref: '#/components/schemas/MonitorNotificationRuleRecipients'
29082+
scope:
29083+
$ref: '#/components/schemas/MonitorNotificationRuleScope'
29084+
required:
29085+
- scope
2907429086
- recipients
2907529087
type: object
29088+
MonitorNotificationRuleConditionalRecipients:
29089+
description: Conditional recipients allow client to define recipients with more
29090+
granular control.
29091+
properties:
29092+
conditions:
29093+
description: The `MonitorNotificationRuleConditionalRecipients` `conditions`.
29094+
items:
29095+
$ref: '#/components/schemas/MonitorNotificationRuleCondition'
29096+
type: array
29097+
fallback_recipients:
29098+
$ref: '#/components/schemas/MonitorNotificationRuleRecipients'
29099+
description: If none of the `conditions` applied, `fallback_recipients`
29100+
will get notified.
29101+
required:
29102+
- conditions
29103+
type: object
2907629104
MonitorNotificationRuleCreateRequest:
2907729105
description: Request for creating a monitor notification rule.
2907829106
properties:
@@ -29212,6 +29240,8 @@ components:
2921229240
additionalProperties: {}
2921329241
description: Attributes of the monitor notification rule.
2921429242
properties:
29243+
conditional_recipients:
29244+
$ref: '#/components/schemas/MonitorNotificationRuleConditionalRecipients'
2921529245
created:
2921629246
description: Creation time of the monitor notification rule.
2921729247
example: 2020-01-02 03:04:00+00:00
@@ -29233,6 +29263,12 @@ components:
2923329263
description: An object related to a monitor notification rule.
2923429264
oneOf:
2923529265
- $ref: '#/components/schemas/User'
29266+
MonitorNotificationRuleScope:
29267+
description: The scope to which the monitor applied.
29268+
example: transition_type:alert
29269+
maxLength: 3000
29270+
minLength: 1
29271+
type: string
2923629272
MonitorNotificationRuleUpdateRequest:
2923729273
description: Request for updating a monitor notification rule.
2923829274
properties:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2025-09-22T20:51:10.306Z"
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": "7a116474feddac6149b41cecff4de891",
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": 570,
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-1758574270\"]},\"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": 1057,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 1057,
45+
"text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"relationships\":{\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}},\"attributes\":{\"conditional_recipients\":{\"conditions\":[{\"recipients\":[\"slack-test-channel\",\"jira-test\"],\"scope\":\"transition_type:is_alert\"}],\"fallback_recipients\":[]},\"name\":\"test rule\",\"modified_at\":\"1970-01-01T00:00:00+00:00\",\"filter\":{\"tags\":[\"test:test-create_a_monitor_notification_rule_with_conditional_recipients_returns_ok_response-1758574270\"]},\"created_at\":\"2025-09-22T20:51:10.676117+00:00\"},\"id\":\"decba5cf-f4f0-4750-83cd-cbffe7ce7a7b\"},\"included\":[{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"name\":\"frog\",\"handle\":\"[email protected]\",\"created_at\":\"2019-10-02T08:15:39.795051+00:00\",\"modified_at\":\"2025-09-17T20:56:07.513404+00:00\",\"email\":\"[email protected]\",\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"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": 685,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2025-09-22T20:51:10.312Z",
61+
"time": 509
62+
},
63+
{
64+
"_id": "cc6d58704fc0b20209d793b4edacc678",
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": 543,
78+
"httpVersion": "HTTP/1.1",
79+
"method": "DELETE",
80+
"queryString": [],
81+
"url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/decba5cf-f4f0-4750-83cd-cbffe7ce7a7b"
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": 671,
97+
"httpVersion": "HTTP/1.1",
98+
"redirectURL": "",
99+
"status": 204,
100+
"statusText": "No Content"
101+
},
102+
"startedDateTime": "2025-09-22T20:51:10.830Z",
103+
"time": 163
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-22T20:51:17.180Z"
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": "cbef8362ca8596a3bfa3932963981212",
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": 570,
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-1758574277\"]},\"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": 939,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 939,
45+
"text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"attributes\":{\"filter\":{\"tags\":[\"app:test-update_a_monitor_notification_rule_with_conditional_recipients_returns_ok_response-1758574277\"]},\"recipients\":[\"slack-monitor-app\"],\"name\":\"test rule\",\"modified_at\":\"1970-01-01T00:00:00+00:00\",\"created_at\":\"2025-09-22T20:51:17.282224+00:00\"},\"id\":\"b2f3c7c3-892c-46b2-a870-394f9dadb73d\",\"relationships\":{\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}},\"included\":[{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"name\":\"frog\",\"handle\":\"[email protected]\",\"created_at\":\"2019-10-02T08:15:39.795051+00:00\",\"modified_at\":\"2025-09-17T20:56:07.513404+00:00\",\"email\":\"[email protected]\",\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"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": 684,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2025-09-22T20:51:17.182Z",
61+
"time": 109
62+
},
63+
{
64+
"_id": "7cbd2b08d4b1f3345461adfa4c60ae9d",
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": 608,
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-1758574277\",\"host:abc\"]},\"name\":\"updated rule\"},\"id\":\"b2f3c7c3-892c-46b2-a870-394f9dadb73d\",\"type\":\"monitor-notification-rule\"}}"
89+
},
90+
"queryString": [],
91+
"url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/b2f3c7c3-892c-46b2-a870-394f9dadb73d"
92+
},
93+
"response": {
94+
"bodySize": 1078,
95+
"content": {
96+
"mimeType": "application/json",
97+
"size": 1078,
98+
"text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"attributes\":{\"modified_at\":\"2025-09-22T20:51:17.430016+00:00\",\"name\":\"updated rule\",\"created_at\":\"2025-09-22T20:51:17.282225+00:00\",\"filter\":{\"tags\":[\"test:test-update_a_monitor_notification_rule_with_conditional_recipients_returns_ok_response-1758574277\",\"host:abc\"]},\"conditional_recipients\":{\"conditions\":[{\"scope\":\"transition_type:is_alert\",\"recipients\":[\"slack-test-channel\",\"jira-test\"]}],\"fallback_recipients\":[]}},\"id\":\"b2f3c7c3-892c-46b2-a870-394f9dadb73d\",\"relationships\":{\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}},\"included\":[{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"name\":\"frog\",\"handle\":\"[email protected]\",\"created_at\":\"2019-10-02T08:15:39.795051+00:00\",\"modified_at\":\"2025-09-17T20:56:07.513404+00:00\",\"email\":\"[email protected]\",\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"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": 685,
108+
"httpVersion": "HTTP/1.1",
109+
"redirectURL": "",
110+
"status": 200,
111+
"statusText": "OK"
112+
},
113+
"startedDateTime": "2025-09-22T20:51:17.295Z",
114+
"time": 150
115+
},
116+
{
117+
"_id": "feb607b6d6305c35d0b12fc5bec443e0",
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": 543,
131+
"httpVersion": "HTTP/1.1",
132+
"method": "DELETE",
133+
"queryString": [],
134+
"url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/b2f3c7c3-892c-46b2-a870-394f9dadb73d"
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": 671,
150+
"httpVersion": "HTTP/1.1",
151+
"redirectURL": "",
152+
"status": 204,
153+
"statusText": "No Content"
154+
},
155+
"startedDateTime": "2025-09-22T20:51:17.451Z",
156+
"time": 107
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)