Skip to content

Commit 619b43b

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add citest stream to ListStreamSource (#1045)
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 1dff874 commit 619b43b

File tree

8 files changed

+177
-4
lines changed

8 files changed

+177
-4
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": "2023-03-02 18:29:41.149144",
8-
"spec_repo_commit": "911d7cda"
7+
"regenerated": "2023-03-02 20:54:18.738538",
8+
"spec_repo_commit": "b2aaf22c"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2023-03-02 18:29:41.166069",
13-
"spec_repo_commit": "911d7cda"
12+
"regenerated": "2023-03-02 20:54:18.754815",
13+
"spec_repo_commit": "b2aaf22c"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4137,6 +4137,7 @@ components:
41374137
- logs_stream
41384138
- audit_stream
41394139
- ci_pipeline_stream
4140+
- ci_test_stream
41404141
- rum_issue_stream
41414142
- apm_issue_stream
41424143
- logs_pattern_stream
@@ -4148,6 +4149,7 @@ components:
41484149
- LOGS_STREAM
41494150
- AUDIT_STREAM
41504151
- CI_PIPELINE_STREAM
4152+
- CI_TEST_STREAM
41514153
- RUM_ISSUE_STREAM
41524154
- APM_ISSUE_STREAM
41534155
- LOGS_PATTERN_STREAM
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2023-03-02T20:37:14.366Z"
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 dashboard with ci_test_stream list_stream widget",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "a5e67a9d1b7613483cb583ba7d90f85b",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 357,
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\",\"title\":\"Test-Create_a_new_dashboard_with_ci_test_stream_list_stream_widget-1677789434 with list_stream widget\",\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"}],\"query\":{\"data_source\":\"ci_test_stream\",\"query_string\":\"test_level:suite\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"}}]}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v1/dashboard"
39+
},
40+
"response": {
41+
"bodySize": 771,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 771,
45+
"text": "{\"id\":\"mdr-2je-u6x\",\"title\":\"Test-Create_a_new_dashboard_with_ci_test_stream_list_stream_widget-1677789434 with list_stream widget\",\"description\":null,\"author_handle\":\"[email protected]\",\"author_name\":null,\"layout_type\":\"ordered\",\"url\":\"/dashboard/mdr-2je-u6x/test-createanewdashboardwithciteststreamliststreamwidget-1677789434-with-liststr\",\"is_read_only\":false,\"template_variables\":null,\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"}],\"query\":{\"data_source\":\"ci_test_stream\",\"query_string\":\"test_level:suite\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"},\"id\":1680451278463569}],\"notify_list\":null,\"created_at\":\"2023-03-02T20:37:14.537234+00:00\",\"modified_at\":\"2023-03-02T20:37:14.537234+00:00\",\"restricted_roles\":[]}\n"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 490,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2023-03-02T20:37:14.377Z",
61+
"time": 228
62+
},
63+
{
64+
"_id": "fa10355cf95a97202214aa807ed3f9a8",
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/mdr-2je-u6x"
82+
},
83+
"response": {
84+
"bodySize": 39,
85+
"content": {
86+
"mimeType": "application/json",
87+
"size": 39,
88+
"text": "{\"deleted_dashboard_id\":\"mdr-2je-u6x\"}\n"
89+
},
90+
"cookies": [],
91+
"headers": [
92+
{
93+
"name": "content-type",
94+
"value": "application/json"
95+
}
96+
],
97+
"headersSize": 489,
98+
"httpVersion": "HTTP/1.1",
99+
"redirectURL": "",
100+
"status": 200,
101+
"statusText": "OK"
102+
},
103+
"startedDateTime": "2023-03-02T20:37:14.622Z",
104+
"time": 192
105+
}
106+
],
107+
"pages": [],
108+
"version": "1.2"
109+
}
110+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* Create a new dashboard with ci_test_stream list_stream widget
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+
layoutType: "ordered",
13+
title:
14+
"Example-Create_a_new_dashboard_with_ci_test_stream_list_stream_widget with list_stream widget",
15+
widgets: [
16+
{
17+
definition: {
18+
type: "list_stream",
19+
requests: [
20+
{
21+
columns: [
22+
{
23+
width: "auto",
24+
field: "timestamp",
25+
},
26+
],
27+
query: {
28+
dataSource: "ci_test_stream",
29+
queryString: "test_level:suite",
30+
},
31+
responseFormat: "event_list",
32+
},
33+
],
34+
},
35+
},
36+
],
37+
},
38+
};
39+
40+
apiInstance
41+
.createDashboard(params)
42+
.then((data: v1.Dashboard) => {
43+
console.log(
44+
"API called successfully. Returned data: " + JSON.stringify(data)
45+
);
46+
})
47+
.catch((error: any) => console.error(error));

features/v1/dashboards.feature

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,16 @@ Feature: Dashboards
215215
And the response "widgets[0].definition.check" is equal to "datadog.agent.up"
216216
And the response "widgets[0].definition.grouping" is equal to "check"
217217

218+
@team:DataDog/dashboards
219+
Scenario: Create a new dashboard with ci_test_stream list_stream widget
220+
Given new "CreateDashboard" request
221+
And body with value {"layout_type": "ordered", "title": "{{ unique }} with list_stream widget","widgets": [{"definition": {"type": "list_stream","requests": [{"columns":[{"width":"auto","field":"timestamp"}],"query":{"data_source":"ci_test_stream","query_string":"test_level:suite"},"response_format":"event_list"}]}}]}
222+
When the request is sent
223+
Then the response status is 200 OK
224+
And the response "widgets[0].definition.type" is equal to "list_stream"
225+
And the response "widgets[0].definition.requests[0].query.data_source" is equal to "ci_test_stream"
226+
And the response "widgets[0].definition.requests[0].query.query_string" is equal to "test_level:suite"
227+
218228
@team:DataDog/dashboards
219229
Scenario: Create a new dashboard with distribution widget and apm stats data
220230
Given new "CreateDashboard" request

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export type ListStreamSource =
1414
| typeof LOGS_STREAM
1515
| typeof AUDIT_STREAM
1616
| typeof CI_PIPELINE_STREAM
17+
| typeof CI_TEST_STREAM
1718
| typeof RUM_ISSUE_STREAM
1819
| typeof APM_ISSUE_STREAM
1920
| typeof LOGS_PATTERN_STREAM
@@ -23,6 +24,7 @@ export type ListStreamSource =
2324
export const LOGS_STREAM = "logs_stream";
2425
export const AUDIT_STREAM = "audit_stream";
2526
export const CI_PIPELINE_STREAM = "ci_pipeline_stream";
27+
export const CI_TEST_STREAM = "ci_test_stream";
2628
export const RUM_ISSUE_STREAM = "rum_issue_stream";
2729
export const APM_ISSUE_STREAM = "apm_issue_stream";
2830
export const LOGS_PATTERN_STREAM = "logs_pattern_stream";

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,7 @@ const enumsMap: { [key: string]: any[] } = {
745745
"logs_stream",
746746
"audit_stream",
747747
"ci_pipeline_stream",
748+
"ci_test_stream",
748749
"rum_issue_stream",
749750
"apm_issue_stream",
750751
"logs_pattern_stream",

0 commit comments

Comments
 (0)