Skip to content

Commit 295acc9

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 88fa4c2 of spec repo
1 parent 17eaf9e commit 295acc9

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
@@ -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,36 @@ 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: Use conditional recipients to define different recipients for different
29090+
situations.
29091+
properties:
29092+
conditions:
29093+
description: Conditions of the notification rule.
29094+
items:
29095+
$ref: '#/components/schemas/MonitorNotificationRuleCondition'
29096+
maxItems: 10
29097+
minItems: 1
29098+
type: array
29099+
fallback_recipients:
29100+
$ref: '#/components/schemas/MonitorNotificationRuleRecipients'
29101+
description: If none of the `conditions` applied, `fallback_recipients`
29102+
will get notified.
29103+
required:
29104+
- conditions
29105+
type: object
2907629106
MonitorNotificationRuleCreateRequest:
2907729107
description: Request for creating a monitor notification rule.
2907829108
properties:
@@ -29212,6 +29242,8 @@ components:
2921229242
additionalProperties: {}
2921329243
description: Attributes of the monitor notification rule.
2921429244
properties:
29245+
conditional_recipients:
29246+
$ref: '#/components/schemas/MonitorNotificationRuleConditionalRecipients'
2921529247
created:
2921629248
description: Creation time of the monitor notification rule.
2921729249
example: 2020-01-02 03:04:00+00:00
@@ -29233,6 +29265,12 @@ components:
2923329265
description: An object related to a monitor notification rule.
2923429266
oneOf:
2923529267
- $ref: '#/components/schemas/User'
29268+
MonitorNotificationRuleScope:
29269+
description: The scope to which the monitor applied.
29270+
example: transition_type:alert
29271+
maxLength: 3000
29272+
minLength: 1
29273+
type: string
2923629274
MonitorNotificationRuleUpdateRequest:
2923729275
description: Request for updating a monitor notification rule.
2923829276
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)