Skip to content

Commit 0eb78aa

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 5ef9da0e of spec repo
1 parent a3fe2e9 commit 0eb78aa

File tree

13 files changed

+340
-24
lines changed

13 files changed

+340
-24
lines changed

.apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2023-10-04 17:33:10.783188",
8-
"spec_repo_commit": "adf28ce4"
7+
"regenerated": "2023-10-05 04:34:20.440449",
8+
"spec_repo_commit": "5ef9da0e"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2023-10-04 17:33:10.804133",
13-
"spec_repo_commit": "adf28ce4"
12+
"regenerated": "2023-10-05 04:34:20.573099",
13+
"spec_repo_commit": "5ef9da0e"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -6839,6 +6839,33 @@ components:
68396839
type: string
68406840
readOnly: true
68416841
type: object
6842+
MonitorOptionsCustomSchedule:
6843+
description: Configuration options for the custom schedule. **This feature is
6844+
in private beta.**
6845+
properties:
6846+
recurrences:
6847+
description: Array of custom schedule recurrences.
6848+
items:
6849+
$ref: '#/components/schemas/MonitorOptionsCustomScheduleRecurrence'
6850+
type: array
6851+
type: object
6852+
MonitorOptionsCustomScheduleRecurrence:
6853+
description: Configuration for a recurrence set on the monitor options for custom
6854+
schedule.
6855+
properties:
6856+
rrule:
6857+
description: Defines the recurrence rule (RRULE) for a given schedule.
6858+
example: FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
6859+
type: string
6860+
start:
6861+
description: Defines the start date and time of the recurring schedule.
6862+
example: '2023-08-31T16:30:00'
6863+
type: string
6864+
timezone:
6865+
description: Defines the timezone the schedule runs on.
6866+
example: Europe/Paris
6867+
type: string
6868+
type: object
68426869
MonitorOptionsNotificationPresets:
68436870
default: show_all
68446871
description: Toggles the display of additional content sent in the monitor notification.
@@ -6856,6 +6883,8 @@ components:
68566883
MonitorOptionsSchedulingOptions:
68576884
description: Configuration options for scheduling.
68586885
properties:
6886+
custom_schedule:
6887+
$ref: '#/components/schemas/MonitorOptionsCustomSchedule'
68596888
evaluation_window:
68606889
$ref: '#/components/schemas/MonitorOptionsSchedulingOptionsEvaluationWindow'
68616890
type: object
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2023-10-04T18:33:20.272Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"log": {
3+
"_recordingName": "Monitors/Create a metric monitor with a custom schedule returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "deccb00240d66320ccd75e55e2dcaa0e",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 556,
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": 554,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Create_a_metric_monitor_with_a_custom_schedule_returns_OK_response-1696444400\",\"options\":{\"include_tags\":false,\"notify_audit\":false,\"on_missing_data\":\"default\",\"scheduling_options\":{\"custom_schedule\":{\"recurrences\":[{\"rrule\":\"FREQ=DAILY;INTERVAL=1\",\"start\":\"2024-10-26T09:13:00\",\"timezone\":\"America/Los_Angeles\"}]},\"evaluation_window\":{\"day_starts\":\"04:00\",\"month_starts\":1}},\"thresholds\":{\"critical\":0.5}},\"query\":\"avg(current_1mo):avg:system.load.5{*} > 0.5\",\"tags\":[],\"type\":\"query alert\"}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v1/monitor"
39+
},
40+
"response": {
41+
"bodySize": 1009,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 1009,
45+
"text": "{\"id\":132537965,\"org_id\":321813,\"type\":\"query alert\",\"name\":\"Test-Create_a_metric_monitor_with_a_custom_schedule_returns_OK_response-1696444400\",\"message\":\"some message Notify: @hipchat-channel\",\"tags\":[],\"query\":\"avg(current_1mo):avg:system.load.5{*} > 0.5\",\"options\":{\"include_tags\":false,\"notify_audit\":false,\"on_missing_data\":\"default\",\"scheduling_options\":{\"custom_schedule\":{\"recurrences\":[{\"rrule\":\"FREQ=DAILY;INTERVAL=1\",\"start\":\"2024-10-26T09:13:00\",\"timezone\":\"America/Los_Angeles\"}]},\"evaluation_window\":{\"day_starts\":\"04:00\",\"month_starts\":1}},\"thresholds\":{\"critical\":0.5},\"new_host_delay\":300,\"silenced\":{}},\"multi\":false,\"created_at\":1696444400000,\"created\":\"2023-10-04T18:33:20.388003+00:00\",\"modified\":\"2023-10-04T18:33:20.388003+00:00\",\"deleted\":null,\"restricted_roles\":null,\"priority\":null,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"creator\":{\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"id\":2320499}}\n"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 650,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2023-10-04T18:33:20.283Z",
61+
"time": 162
62+
},
63+
{
64+
"_id": "c27d7286a947939b7929a8fea2792902",
65+
"_order": 0,
66+
"cache": {},
67+
"request": {
68+
"bodySize": 0,
69+
"cookies": [],
70+
"headers": [
71+
{
72+
"_fromType": "array",
73+
"name": "accept",
74+
"value": "application/json"
75+
}
76+
],
77+
"headersSize": 513,
78+
"httpVersion": "HTTP/1.1",
79+
"method": "DELETE",
80+
"queryString": [],
81+
"url": "https://api.datadoghq.com/api/v1/monitor/132537965"
82+
},
83+
"response": {
84+
"bodySize": 33,
85+
"content": {
86+
"mimeType": "application/json",
87+
"size": 33,
88+
"text": "{\"deleted_monitor_id\":132537965}\n"
89+
},
90+
"cookies": [],
91+
"headers": [
92+
{
93+
"name": "content-type",
94+
"value": "application/json"
95+
}
96+
],
97+
"headersSize": 516,
98+
"httpVersion": "HTTP/1.1",
99+
"redirectURL": "",
100+
"status": 200,
101+
"statusText": "OK"
102+
},
103+
"startedDateTime": "2023-10-04T18:33:20.458Z",
104+
"time": 342
105+
}
106+
],
107+
"pages": [],
108+
"version": "1.2"
109+
}
110+
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2023-01-18T18:37:20.511Z"
1+
"2023-10-04T18:21:59.260Z"

cassettes/v1/Monitors_4022238206/Validate-an-existing-monitor-returns-OK-response_898284207/recording.har

+18-18
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"entries": [
1010
{
11-
"_id": "a6398d92236de6af6e0c182ccfc97958",
11+
"_id": "872abdb5f24e9461c6643498d4bc4eb3",
1212
"_order": 0,
1313
"cache": {},
1414
"request": {
@@ -32,7 +32,7 @@
3232
"postData": {
3333
"mimeType": "application/json",
3434
"params": [],
35-
"text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Validate_an_existing_monitor_returns_OK_response-1674067040\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notification_preset_name\":\"hide_handles\",\"notify_audit\":false,\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testvalidateanexistingmonitorreturnsokresponse1674067040\",\"env:ci\"],\"type\":\"log alert\"}"
35+
"text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Validate_an_existing_monitor_returns_OK_response-1696443719\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notification_preset_name\":\"hide_handles\",\"notify_audit\":false,\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testvalidateanexistingmonitorreturnsokresponse1696443719\",\"env:ci\"],\"type\":\"log alert\"}"
3636
},
3737
"queryString": [],
3838
"url": "https://api.datadoghq.com/api/v1/monitor"
@@ -42,7 +42,7 @@
4242
"content": {
4343
"mimeType": "application/json",
4444
"size": 1182,
45-
"text": "{\"id\":108260307,\"org_id\":321813,\"type\":\"log alert\",\"name\":\"Test-Validate_an_existing_monitor_returns_OK_response-1674067040\",\"message\":\"some message Notify: @hipchat-channel\",\"tags\":[\"test:testvalidateanexistingmonitorreturnsokresponse1674067040\",\"env:ci\"],\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notification_preset_name\":\"hide_handles\",\"notify_audit\":false,\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2.0,\"warning\":1.0},\"timeout_h\":24,\"silenced\":{}},\"multi\":true,\"created_at\":1674067040000,\"created\":\"2023-01-18T18:37:20.717952+00:00\",\"modified\":\"2023-01-18T18:37:20.717952+00:00\",\"deleted\":null,\"restricted_roles\":null,\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"creator\":{\"name\":null,\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"id\":1445416}}\n"
45+
"text": "{\"id\":132537531,\"org_id\":321813,\"type\":\"log alert\",\"name\":\"Test-Validate_an_existing_monitor_returns_OK_response-1696443719\",\"message\":\"some message Notify: @hipchat-channel\",\"tags\":[\"test:testvalidateanexistingmonitorreturnsokresponse1696443719\",\"env:ci\"],\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notification_preset_name\":\"hide_handles\",\"notify_audit\":false,\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2.0,\"warning\":1.0},\"timeout_h\":24,\"silenced\":{}},\"multi\":true,\"created_at\":1696443719000,\"created\":\"2023-10-04T18:21:59.676309+00:00\",\"modified\":\"2023-10-04T18:21:59.676309+00:00\",\"deleted\":null,\"restricted_roles\":null,\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"creator\":{\"name\":null,\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"id\":1445416}}\n"
4646
},
4747
"cookies": [],
4848
"headers": [
@@ -51,17 +51,17 @@
5151
"value": "application/json"
5252
}
5353
],
54-
"headersSize": 623,
54+
"headersSize": 649,
5555
"httpVersion": "HTTP/1.1",
5656
"redirectURL": "",
5757
"status": 200,
5858
"statusText": "OK"
5959
},
60-
"startedDateTime": "2023-01-18T18:37:20.519Z",
61-
"time": 242
60+
"startedDateTime": "2023-10-04T18:21:59.263Z",
61+
"time": 466
6262
},
6363
{
64-
"_id": "b495ccaf91c389cb4434e4eba81e682d",
64+
"_id": "5617e437dd2a9746b727974e417a3e02",
6565
"_order": 0,
6666
"cache": {},
6767
"request": {
@@ -85,10 +85,10 @@
8585
"postData": {
8686
"mimeType": "application/json",
8787
"params": [],
88-
"text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Validate_an_existing_monitor_returns_OK_response-1674067040\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notification_preset_name\":\"hide_handles\",\"notify_audit\":false,\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testvalidateanexistingmonitorreturnsokresponse1674067040\",\"env:ci\"],\"type\":\"log alert\"}"
88+
"text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Validate_an_existing_monitor_returns_OK_response-1696443719\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notification_preset_name\":\"hide_handles\",\"notify_audit\":false,\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testvalidateanexistingmonitorreturnsokresponse1696443719\",\"env:ci\"],\"type\":\"log alert\"}"
8989
},
9090
"queryString": [],
91-
"url": "https://api.datadoghq.com/api/v1/monitor/108260307/validate"
91+
"url": "https://api.datadoghq.com/api/v1/monitor/132537531/validate"
9292
},
9393
"response": {
9494
"bodySize": 3,
@@ -104,17 +104,17 @@
104104
"value": "application/json"
105105
}
106106
],
107-
"headersSize": 465,
107+
"headersSize": 492,
108108
"httpVersion": "HTTP/1.1",
109109
"redirectURL": "",
110110
"status": 200,
111111
"statusText": "OK"
112112
},
113-
"startedDateTime": "2023-01-18T18:37:20.767Z",
114-
"time": 202
113+
"startedDateTime": "2023-10-04T18:21:59.738Z",
114+
"time": 368
115115
},
116116
{
117-
"_id": "446ceaa56aae6e109dbabd3db5f74550",
117+
"_id": "63d7eb81b0cfd7dc7311ab550a0fd2f4",
118118
"_order": 0,
119119
"cache": {},
120120
"request": {
@@ -131,14 +131,14 @@
131131
"httpVersion": "HTTP/1.1",
132132
"method": "DELETE",
133133
"queryString": [],
134-
"url": "https://api.datadoghq.com/api/v1/monitor/108260307"
134+
"url": "https://api.datadoghq.com/api/v1/monitor/132537531"
135135
},
136136
"response": {
137137
"bodySize": 33,
138138
"content": {
139139
"mimeType": "application/json",
140140
"size": 33,
141-
"text": "{\"deleted_monitor_id\":108260307}\n"
141+
"text": "{\"deleted_monitor_id\":132537531}\n"
142142
},
143143
"cookies": [],
144144
"headers": [
@@ -147,14 +147,14 @@
147147
"value": "application/json"
148148
}
149149
],
150-
"headersSize": 489,
150+
"headersSize": 516,
151151
"httpVersion": "HTTP/1.1",
152152
"redirectURL": "",
153153
"status": 200,
154154
"statusText": "OK"
155155
},
156-
"startedDateTime": "2023-01-18T18:37:20.975Z",
157-
"time": 117
156+
"startedDateTime": "2023-10-04T18:22:00.114Z",
157+
"time": 482
158158
}
159159
],
160160
"pages": [],
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/**
2+
* Create a metric monitor with a custom schedule returns "OK" response
3+
*/
4+
5+
import { client, v1 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v1.MonitorsApi(configuration);
9+
10+
const params: v1.MonitorsApiCreateMonitorRequest = {
11+
body: {
12+
message: "some message Notify: @hipchat-channel",
13+
name: "Example-Monitor",
14+
query: "avg(current_1mo):avg:system.load.5{*} > 0.5",
15+
tags: [],
16+
options: {
17+
thresholds: {
18+
critical: 0.5,
19+
},
20+
notifyAudit: false,
21+
onMissingData: "default",
22+
includeTags: false,
23+
schedulingOptions: {
24+
evaluationWindow: {
25+
dayStarts: "04:00",
26+
monthStarts: 1,
27+
},
28+
customSchedule: {
29+
recurrences: [
30+
{
31+
rrule: "FREQ=DAILY;INTERVAL=1",
32+
timezone: "America/Los_Angeles",
33+
start: "2024-10-26T09:13:00",
34+
},
35+
],
36+
},
37+
},
38+
},
39+
type: "query alert",
40+
},
41+
};
42+
43+
apiInstance
44+
.createMonitor(params)
45+
.then((data: v1.Monitor) => {
46+
console.log(
47+
"API called successfully. Returned data: " + JSON.stringify(data)
48+
);
49+
})
50+
.catch((error: any) => console.error(error));

0 commit comments

Comments
 (0)