Skip to content

Commit 509cfaf

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit d65e6213 of spec repo (#670)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 34e8587 commit 509cfaf

File tree

13 files changed

+389
-6
lines changed

13 files changed

+389
-6
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.2",
7-
"regenerated": "2022-05-18 14:23:35.705111",
8-
"spec_repo_commit": "e1764101"
7+
"regenerated": "2022-05-19 09:29:35.796721",
8+
"spec_repo_commit": "d65e6213"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.2",
12-
"regenerated": "2022-05-18 14:23:35.717964",
13-
"spec_repo_commit": "e1764101"
12+
"regenerated": "2022-05-19 09:29:35.808666",
13+
"spec_repo_commit": "d65e6213"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5814,11 +5814,13 @@ components:
58145814
enum:
58155815
- rum
58165816
- ci_pipelines
5817+
- ci_tests
58175818
example: rum
58185819
type: string
58195820
x-enum-varnames:
58205821
- RUM
58215822
- CI_PIPELINES
5823+
- CI_TESTS
58225824
MonitorFormulaAndFunctionQueryDefinition:
58235825
description: A formula and function query.
58245826
oneOf:
@@ -6513,6 +6515,7 @@ components:
65136515
- event-v2 alert
65146516
- audit alert
65156517
- ci-pipelines alert
6518+
- ci-tests alert
65166519
- error-tracking alert
65176520
example: query alert
65186521
type: string
@@ -6531,6 +6534,7 @@ components:
65316534
- EVENT_V2_ALERT
65326535
- AUDIT_ALERT
65336536
- CI_PIPELINES_ALERT
6537+
- CI_TESTS_ALERT
65346538
- ERROR_TRACKING_ALERT
65356539
MonitorUpdateRequest:
65366540
description: Object describing a monitor update request.
@@ -21644,6 +21648,32 @@ paths:
2164421648
**NOTE** CI Pipeline monitors are in alpha on US1, EU, US3 and US5.
2164521649

2164621650

21651+
**CI Tests Alert Query**
21652+
21653+
21654+
Example: `ci-tests(query).rollup(rollup_method[, measure]).last(time_window)
21655+
operator #`
21656+
21657+
21658+
- **`query`** The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/).
21659+
21660+
- **`rollup_method`** The stats roll-up method - supports `count`, `avg`,
21661+
and `cardinality`.
21662+
21663+
- **`measure`** For `avg` and cardinality `rollup_method` - specify the measure
21664+
or the facet name you want to use.
21665+
21666+
- **`time_window`** #m (between 1 and 2880), #h (between 1 and 48).
21667+
21668+
- **`operator`** `<`, `<=`, `>`, `>=`, `==`, or `!=`.
21669+
21670+
- **`#`** an integer or decimal number used to set the threshold.
21671+
21672+
21673+
**NOTE** CI Test monitors are available only in closed beta on US1, EU, US3
21674+
and US5.
21675+
21676+
2164721677
**Error Tracking Alert Query**
2164821678

2164921679

Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2022-05-13T10:40:35.052Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"log": {
3+
"_recordingName": "Monitors/Create a ci-tests formula and functions monitor returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "c36810ff495319ae0cd0828b5101c6d9",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 675,
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": 555,
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_ci_tests_formula_and_functions_monitor_returns_OK_response-1652438435\",\"options\":{\"thresholds\":{\"critical\":0.8},\"variables\":[{\"compute\":{\"aggregation\":\"count\"},\"data_source\":\"ci_tests\",\"group_by\":[],\"indexes\":[\"*\"],\"name\":\"query1\",\"search\":{\"query\":\"@test.status:fail\"}},{\"compute\":{\"aggregation\":\"count\"},\"data_source\":\"ci_tests\",\"group_by\":[],\"indexes\":[\"*\"],\"name\":\"query2\",\"search\":{\"query\":\"\"}}]},\"priority\":3,\"query\":\"formula(\\\"query1 / query2 * 100\\\").last(\\\"15m\\\") >= 0.8\",\"tags\":[\"test:testcreateacitestsformulaandfunctionsmonitorreturnsokresponse1652438435\",\"env:ci\"],\"type\":\"ci-tests alert\"}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v1/monitor"
39+
},
40+
"response": {
41+
"bodySize": 1158,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 1158,
45+
"text": "{\"restricted_roles\":null,\"tags\":[\"test:testcreateacitestsformulaandfunctionsmonitorreturnsokresponse1652438435\",\"env:ci\"],\"deleted\":null,\"query\":\"formula(\\\"query1 / query2 * 100\\\").last(\\\"15m\\\") >= 0.8\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":71427772,\"multi\":false,\"name\":\"Test-Create_a_ci_tests_formula_and_functions_monitor_returns_OK_response-1652438435\",\"created\":\"2022-05-13T10:40:35.341131+00:00\",\"created_at\":1652438435000,\"creator\":{\"id\":1445416,\"handle\":\"[email protected]\",\"name\":null,\"email\":\"[email protected]\"},\"org_id\":321813,\"modified\":\"2022-05-13T10:40:35.341131+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"ci-tests alert\",\"options\":{\"notify_audit\":false,\"silenced\":{},\"include_tags\":true,\"thresholds\":{\"critical\":0.8},\"new_host_delay\":300,\"notify_no_data\":false,\"groupby_simple_monitor\":false,\"variables\":[{\"search\":{\"query\":\"@test.status:fail\"},\"data_source\":\"ci_tests\",\"compute\":{\"aggregation\":\"count\"},\"name\":\"query1\",\"indexes\":[\"*\"],\"group_by\":[]},{\"search\":{\"query\":\"\"},\"data_source\":\"ci_tests\",\"compute\":{\"aggregation\":\"count\"},\"name\":\"query2\",\"indexes\":[\"*\"],\"group_by\":[]}]}}"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 665,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2022-05-13T10:40:35.072Z",
61+
"time": 317
62+
},
63+
{
64+
"_id": "6524c107d23a50b1c0979ec092fdd5b7",
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/71427772"
82+
},
83+
"response": {
84+
"bodySize": 31,
85+
"content": {
86+
"mimeType": "application/json",
87+
"size": 31,
88+
"text": "{\"deleted_monitor_id\":71427772}"
89+
},
90+
"cookies": [],
91+
"headers": [
92+
{
93+
"name": "content-type",
94+
"value": "application/json"
95+
}
96+
],
97+
"headersSize": 635,
98+
"httpVersion": "HTTP/1.1",
99+
"redirectURL": "",
100+
"status": 200,
101+
"statusText": "OK"
102+
},
103+
"startedDateTime": "2022-05-13T10:40:35.400Z",
104+
"time": 187
105+
}
106+
],
107+
"pages": [],
108+
"version": "1.2"
109+
}
110+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2022-05-17T15:10:28.775Z"
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"log": {
3+
"_recordingName": "Monitors/Create a ci-tests monitor returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "5d54baddeeb7b289605f8786d77c594a",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 405,
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": 555,
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_ci_tests_monitor_returns_OK_response-1652800228\",\"options\":{\"thresholds\":{\"critical\":1}},\"priority\":3,\"query\":\"ci-tests(\\\"type:test @git.branch:staging* @test.status:fail\\\").rollup(\\\"count\\\").by(\\\"@test.name\\\").last(\\\"5m\\\") >= 1\",\"tags\":[\"test:testcreateacitestsmonitorreturnsokresponse1652800228\",\"env:ci\"],\"type\":\"ci-tests alert\"}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v1/monitor"
39+
},
40+
"response": {
41+
"bodySize": 889,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 889,
45+
"text": "{\"restricted_roles\":null,\"tags\":[\"test:testcreateacitestsmonitorreturnsokresponse1652800228\",\"env:ci\"],\"deleted\":null,\"query\":\"ci-tests(\\\"type:test @git.branch:staging* @test.status:fail\\\").rollup(\\\"count\\\").by(\\\"@test.name\\\").last(\\\"5m\\\") >= 1\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":71774917,\"multi\":true,\"name\":\"Test-Create_a_ci_tests_monitor_returns_OK_response-1652800228\",\"created\":\"2022-05-17T15:10:29.357369+00:00\",\"created_at\":1652800229000,\"creator\":{\"id\":1445416,\"handle\":\"[email protected]\",\"name\":null,\"email\":\"[email protected]\"},\"org_id\":321813,\"modified\":\"2022-05-17T15:10:29.357369+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"ci-tests alert\",\"options\":{\"notify_audit\":false,\"silenced\":{},\"include_tags\":true,\"thresholds\":{\"critical\":1.0},\"new_host_delay\":300,\"notify_no_data\":false,\"groupby_simple_monitor\":false}}"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 664,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2022-05-17T15:10:28.797Z",
61+
"time": 634
62+
},
63+
{
64+
"_id": "cbc18bbbc0dbd12f3ff430a5a5a36c29",
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/71774917"
82+
},
83+
"response": {
84+
"bodySize": 31,
85+
"content": {
86+
"mimeType": "application/json",
87+
"size": 31,
88+
"text": "{\"deleted_monitor_id\":71774917}"
89+
},
90+
"cookies": [],
91+
"headers": [
92+
{
93+
"name": "content-type",
94+
"value": "application/json"
95+
}
96+
],
97+
"headersSize": 635,
98+
"httpVersion": "HTTP/1.1",
99+
"redirectURL": "",
100+
"status": 200,
101+
"statusText": "OK"
102+
},
103+
"startedDateTime": "2022-05-17T15:10:29.443Z",
104+
"time": 451
105+
}
106+
],
107+
"pages": [],
108+
"version": "1.2"
109+
}
110+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/**
2+
* Create a ci-tests formula and functions monitor returns "OK" response
3+
*/
4+
5+
import { v1 } from "@datadog/datadog-api-client";
6+
7+
const configuration = v1.createConfiguration();
8+
const apiInstance = new v1.MonitorsApi(configuration);
9+
10+
const params: v1.MonitorsApiCreateMonitorRequest = {
11+
body: {
12+
name: "Example-Create_a_ci_tests_formula_and_functions_monitor_returns_OK_response",
13+
type: "ci-tests alert",
14+
query: `formula("query1 / query2 * 100").last("15m") >= 0.8`,
15+
message: "some message Notify: @hipchat-channel",
16+
tags: [
17+
"test:examplecreateacitestsformulaandfunctionsmonitorreturnsokresponse",
18+
"env:ci",
19+
],
20+
priority: 3,
21+
options: {
22+
thresholds: {
23+
critical: 0.8,
24+
},
25+
variables: [
26+
{
27+
dataSource: "ci_tests",
28+
name: "query1",
29+
search: {
30+
query: "@test.status:fail",
31+
},
32+
indexes: ["*"],
33+
compute: {
34+
aggregation: "count",
35+
},
36+
groupBy: [],
37+
},
38+
{
39+
dataSource: "ci_tests",
40+
name: "query2",
41+
search: {
42+
query: "",
43+
},
44+
indexes: ["*"],
45+
compute: {
46+
aggregation: "count",
47+
},
48+
groupBy: [],
49+
},
50+
],
51+
},
52+
},
53+
};
54+
55+
apiInstance
56+
.createMonitor(params)
57+
.then((data: v1.Monitor) => {
58+
console.log(
59+
"API called successfully. Returned data: " + JSON.stringify(data)
60+
);
61+
})
62+
.catch((error: any) => console.error(error));

0 commit comments

Comments
 (0)