Skip to content

Add citest stream to ListStreamSource #1045

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.4",
"regenerated": "2023-03-02 18:29:41.149144",
"spec_repo_commit": "911d7cda"
"regenerated": "2023-03-02 20:54:18.738538",
"spec_repo_commit": "b2aaf22c"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2023-03-02 18:29:41.166069",
"spec_repo_commit": "911d7cda"
"regenerated": "2023-03-02 20:54:18.754815",
"spec_repo_commit": "b2aaf22c"
}
}
}
2 changes: 2 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4137,6 +4137,7 @@ components:
- logs_stream
- audit_stream
- ci_pipeline_stream
- ci_test_stream
- rum_issue_stream
- apm_issue_stream
- logs_pattern_stream
Expand All @@ -4148,6 +4149,7 @@ components:
- LOGS_STREAM
- AUDIT_STREAM
- CI_PIPELINE_STREAM
- CI_TEST_STREAM
- RUM_ISSUE_STREAM
- APM_ISSUE_STREAM
- LOGS_PATTERN_STREAM
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2023-03-02T20:37:14.366Z"
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"log": {
"_recordingName": "Dashboards/Create a new dashboard with ci_test_stream list_stream widget",
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "6.0.5"
},
"entries": [
{
"_id": "a5e67a9d1b7613483cb583ba7d90f85b",
"_order": 0,
"cache": {},
"request": {
"bodySize": 357,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "accept",
"value": "application/json"
},
{
"_fromType": "array",
"name": "content-type",
"value": "application/json"
}
],
"headersSize": 559,
"httpVersion": "HTTP/1.1",
"method": "POST",
"postData": {
"mimeType": "application/json",
"params": [],
"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\"}}]}"
},
"queryString": [],
"url": "https://api.datadoghq.com/api/v1/dashboard"
},
"response": {
"bodySize": 771,
"content": {
"mimeType": "application/json",
"size": 771,
"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\":\"frog@datadoghq.com\",\"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"
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/json"
}
],
"headersSize": 490,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2023-03-02T20:37:14.377Z",
"time": 228
},
{
"_id": "fa10355cf95a97202214aa807ed3f9a8",
"_order": 0,
"cache": {},
"request": {
"bodySize": 0,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "accept",
"value": "application/json"
}
],
"headersSize": 520,
"httpVersion": "HTTP/1.1",
"method": "DELETE",
"queryString": [],
"url": "https://api.datadoghq.com/api/v1/dashboard/mdr-2je-u6x"
},
"response": {
"bodySize": 39,
"content": {
"mimeType": "application/json",
"size": 39,
"text": "{\"deleted_dashboard_id\":\"mdr-2je-u6x\"}\n"
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/json"
}
],
"headersSize": 489,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2023-03-02T20:37:14.622Z",
"time": 192
}
],
"pages": [],
"version": "1.2"
}
}
47 changes: 47 additions & 0 deletions examples/v1/dashboards/CreateDashboard_3195475781.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* Create a new dashboard with ci_test_stream list_stream widget
*/

import { client, v1 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v1.DashboardsApi(configuration);

const params: v1.DashboardsApiCreateDashboardRequest = {
body: {
layoutType: "ordered",
title:
"Example-Create_a_new_dashboard_with_ci_test_stream_list_stream_widget with list_stream widget",
widgets: [
{
definition: {
type: "list_stream",
requests: [
{
columns: [
{
width: "auto",
field: "timestamp",
},
],
query: {
dataSource: "ci_test_stream",
queryString: "test_level:suite",
},
responseFormat: "event_list",
},
],
},
},
],
},
};

apiInstance
.createDashboard(params)
.then((data: v1.Dashboard) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
10 changes: 10 additions & 0 deletions features/v1/dashboards.feature
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,16 @@ Feature: Dashboards
And the response "widgets[0].definition.check" is equal to "datadog.agent.up"
And the response "widgets[0].definition.grouping" is equal to "check"

@team:DataDog/dashboards
Scenario: Create a new dashboard with ci_test_stream list_stream widget
Given new "CreateDashboard" request
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"}]}}]}
When the request is sent
Then the response status is 200 OK
And the response "widgets[0].definition.type" is equal to "list_stream"
And the response "widgets[0].definition.requests[0].query.data_source" is equal to "ci_test_stream"
And the response "widgets[0].definition.requests[0].query.query_string" is equal to "test_level:suite"

@team:DataDog/dashboards
Scenario: Create a new dashboard with distribution widget and apm stats data
Given new "CreateDashboard" request
Expand Down
2 changes: 2 additions & 0 deletions packages/datadog-api-client-v1/models/ListStreamSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export type ListStreamSource =
| typeof LOGS_STREAM
| typeof AUDIT_STREAM
| typeof CI_PIPELINE_STREAM
| typeof CI_TEST_STREAM
| typeof RUM_ISSUE_STREAM
| typeof APM_ISSUE_STREAM
| typeof LOGS_PATTERN_STREAM
Expand All @@ -23,6 +24,7 @@ export type ListStreamSource =
export const LOGS_STREAM = "logs_stream";
export const AUDIT_STREAM = "audit_stream";
export const CI_PIPELINE_STREAM = "ci_pipeline_stream";
export const CI_TEST_STREAM = "ci_test_stream";
export const RUM_ISSUE_STREAM = "rum_issue_stream";
export const APM_ISSUE_STREAM = "apm_issue_stream";
export const LOGS_PATTERN_STREAM = "logs_pattern_stream";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,7 @@ const enumsMap: { [key: string]: any[] } = {
"logs_stream",
"audit_stream",
"ci_pipeline_stream",
"ci_test_stream",
"rum_issue_stream",
"apm_issue_stream",
"logs_pattern_stream",
Expand Down