Skip to content

Commit e87670f

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 267e916e of spec repo (#805)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent b143c57 commit e87670f

File tree

8 files changed

+198
-5
lines changed

8 files changed

+198
-5
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.4",
7-
"regenerated": "2022-08-29 18:11:35.755375",
8-
"spec_repo_commit": "95e8a34f"
7+
"regenerated": "2022-08-30 09:41:05.808522",
8+
"spec_repo_commit": "267e916e"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2022-08-29 18:11:35.767145",
13-
"spec_repo_commit": "95e8a34f"
12+
"regenerated": "2022-08-30 09:41:05.823617",
13+
"spec_repo_commit": "267e916e"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2485,6 +2485,7 @@ components:
24852485
- profiles
24862486
- audit
24872487
- events
2488+
- ci_tests
24882489
example: logs
24892490
type: string
24902491
x-enum-varnames:
@@ -2496,6 +2497,7 @@ components:
24962497
- PROFILES
24972498
- AUDIT
24982499
- EVENTS
2500+
- CI_TESTS
24992501
FormulaAndFunctionMetricAggregation:
25002502
description: The aggregation methods available for metrics queries.
25012503
enum:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2022-08-22T19:31:16.232Z"
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"log": {
3+
"_recordingName": "Dashboards/Create a new timeseries widget with ci_tests data source",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "5f3037d5856fa51f5a0d0f4b41c83704",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 651,
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": 559,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"layout_type\":\"ordered\",\"reflow_type\":\"auto\",\"title\":\"Test-Create_a_new_timeseries_widget_with_ci_tests_data_source-1661196676 with ci_tests datasource\",\"widgets\":[{\"definition\":{\"legend_columns\":[\"avg\",\"min\",\"max\",\"value\",\"sum\"],\"legend_layout\":\"auto\",\"requests\":[{\"display_type\":\"line\",\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"compute\":{\"aggregation\":\"count\"},\"data_source\":\"ci_tests\",\"group_by\":[],\"indexes\":[\"*\"],\"name\":\"query1\",\"search\":{\"query\":\"test_level:test\"}}],\"response_format\":\"timeseries\",\"style\":{\"line_type\":\"solid\",\"line_width\":\"normal\",\"palette\":\"dog_classic\"}}],\"show_legend\":true,\"time\":{},\"title\":\"\",\"type\":\"timeseries\"}}]}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v1/dashboard"
39+
},
40+
"response": {
41+
"bodySize": 1065,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 1065,
45+
"text": "{\"notify_list\":null,\"description\":null,\"restricted_roles\":[],\"author_name\":null,\"template_variables\":null,\"is_read_only\":false,\"id\":\"ykp-mnk-euu\",\"title\":\"Test-Create_a_new_timeseries_widget_with_ci_tests_data_source-1661196676 with ci_tests datasource\",\"url\":\"/dashboard/ykp-mnk-euu/test-createanewtimeserieswidgetwithcitestsdatasource-1661196676-with-citests-dat\",\"created_at\":\"2022-08-22T19:31:16.421905+00:00\",\"modified_at\":\"2022-08-22T19:31:16.421905+00:00\",\"reflow_type\":\"auto\",\"author_handle\":\"[email protected]\",\"widgets\":[{\"definition\":{\"legend_columns\":[\"avg\",\"min\",\"max\",\"value\",\"sum\"],\"title\":\"\",\"legend_layout\":\"auto\",\"show_legend\":true,\"time\":{},\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"style\":{\"line_width\":\"normal\",\"palette\":\"dog_classic\",\"line_type\":\"solid\"},\"display_type\":\"line\",\"response_format\":\"timeseries\",\"queries\":[{\"search\":{\"query\":\"test_level:test\"},\"data_source\":\"ci_tests\",\"compute\":{\"aggregation\":\"count\"},\"name\":\"query1\",\"indexes\":[\"*\"],\"group_by\":[]}]}],\"type\":\"timeseries\"},\"id\":5710436152334347}],\"layout_type\":\"ordered\"}\n"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 594,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2022-08-22T19:31:16.240Z",
61+
"time": 246
62+
},
63+
{
64+
"_id": "fe4ecd80daea8135e7bcc76fe16fec42",
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": 520,
78+
"httpVersion": "HTTP/1.1",
79+
"method": "DELETE",
80+
"queryString": [],
81+
"url": "https://api.datadoghq.com/api/v1/dashboard/ykp-mnk-euu"
82+
},
83+
"response": {
84+
"bodySize": 39,
85+
"content": {
86+
"mimeType": "application/json",
87+
"size": 39,
88+
"text": "{\"deleted_dashboard_id\":\"ykp-mnk-euu\"}\n"
89+
},
90+
"cookies": [],
91+
"headers": [
92+
{
93+
"name": "content-type",
94+
"value": "application/json"
95+
}
96+
],
97+
"headersSize": 592,
98+
"httpVersion": "HTTP/1.1",
99+
"redirectURL": "",
100+
"status": 200,
101+
"statusText": "OK"
102+
},
103+
"startedDateTime": "2022-08-22T19:31:16.499Z",
104+
"time": 189
105+
}
106+
],
107+
"pages": [],
108+
"version": "1.2"
109+
}
110+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/**
2+
* Create a new timeseries widget with ci_tests data source
3+
*/
4+
5+
import { client, v1 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v1.DashboardsApi(configuration);
9+
10+
const params: v1.DashboardsApiCreateDashboardRequest = {
11+
body: {
12+
title:
13+
"Example-Create_a_new_timeseries_widget_with_ci_tests_data_source with ci_tests datasource",
14+
widgets: [
15+
{
16+
definition: {
17+
title: "",
18+
showLegend: true,
19+
legendLayout: "auto",
20+
legendColumns: ["avg", "min", "max", "value", "sum"],
21+
time: {},
22+
type: "timeseries",
23+
requests: [
24+
{
25+
formulas: [
26+
{
27+
formula: "query1",
28+
},
29+
],
30+
queries: [
31+
{
32+
dataSource: "ci_tests",
33+
name: "query1",
34+
search: {
35+
query: "test_level:test",
36+
},
37+
indexes: ["*"],
38+
compute: {
39+
aggregation: "count",
40+
},
41+
groupBy: [],
42+
},
43+
],
44+
responseFormat: "timeseries",
45+
style: {
46+
palette: "dog_classic",
47+
lineType: "solid",
48+
lineWidth: "normal",
49+
},
50+
displayType: "line",
51+
},
52+
],
53+
},
54+
},
55+
],
56+
layoutType: "ordered",
57+
reflowType: "auto",
58+
},
59+
};
60+
61+
apiInstance
62+
.createDashboard(params)
63+
.then((data: v1.Dashboard) => {
64+
console.log(
65+
"API called successfully. Returned data: " + JSON.stringify(data)
66+
);
67+
})
68+
.catch((error: any) => console.error(error));

features/v1/dashboards.feature

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,15 @@ Feature: Dashboards
441441
And the response "widgets[0].definition.type" is equal to "trace_service"
442442
And the response "widgets[0].definition.env" is equal to "none"
443443

444+
@team:DataDog/dashboards
445+
Scenario: Create a new timeseries widget with ci_tests data source
446+
Given new "CreateDashboard" request
447+
And body with value {"title":"{{ unique }} with ci_tests datasource","widgets":[{"definition":{"title":"","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"time":{},"type":"timeseries","requests":[{"formulas":[{"formula":"query1"}],"queries":[{"data_source":"ci_tests","name":"query1","search":{"query":"test_level:test"},"indexes":["*"],"compute":{"aggregation":"count"},"group_by":[]}],"response_format":"timeseries","style":{"palette":"dog_classic","line_type":"solid","line_width":"normal"},"display_type":"line"}]}}],"layout_type":"ordered","reflow_type":"auto"}
448+
When the request is sent
449+
Then the response status is 200 OK
450+
And the response "widgets[0].definition.requests[0].queries[0].data_source" is equal to "ci_tests"
451+
And the response "widgets[0].definition.requests[0].queries[0].search.query" is equal to "test_level:test"
452+
444453
@generated @skip @team:DataDog/dashboards
445454
Scenario: Delete a dashboard returns "Dashboards Not Found" response
446455
Given new "DeleteDashboard" request

packages/datadog-api-client-v1/models/FormulaAndFunctionEventsDataSource.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export type FormulaAndFunctionEventsDataSource =
1212
| typeof SECURITY_SIGNALS
1313
| typeof PROFILES
1414
| typeof AUDIT
15-
| typeof EVENTS;
15+
| typeof EVENTS
16+
| typeof CI_TESTS;
1617
export const LOGS = "logs";
1718
export const SPANS = "spans";
1819
export const NETWORK = "network";
@@ -21,3 +22,4 @@ export const SECURITY_SIGNALS = "security_signals";
2122
export const PROFILES = "profiles";
2223
export const AUDIT = "audit";
2324
export const EVENTS = "events";
25+
export const CI_TESTS = "ci_tests";

packages/datadog-api-client-v1/models/ObjectSerializer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ const enumsMap: { [key: string]: any[] } = {
629629
"profiles",
630630
"audit",
631631
"events",
632+
"ci_tests",
632633
],
633634
FormulaAndFunctionMetricAggregation: [
634635
"avg",

0 commit comments

Comments
 (0)