Skip to content

Commit

Permalink
Regenerate client from commit 512d0225 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Aug 26, 2022
1 parent b8bfbf2 commit d9db6d7
Show file tree
Hide file tree
Showing 8 changed files with 198 additions and 5 deletions.
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": "2022-08-26 14:03:05.460342",
"spec_repo_commit": "3f049059"
"regenerated": "2022-08-26 17:29:50.316181",
"spec_repo_commit": "512d0225"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2022-08-26 14:03:05.477840",
"spec_repo_commit": "3f049059"
"regenerated": "2022-08-26 17:29:50.331185",
"spec_repo_commit": "512d0225"
}
}
}
2 changes: 2 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2485,6 +2485,7 @@ components:
- profiles
- audit
- events
- ci_tests
example: logs
type: string
x-enum-varnames:
Expand All @@ -2496,6 +2497,7 @@ components:
- PROFILES
- AUDIT
- EVENTS
- CI_TESTS
FormulaAndFunctionMetricAggregation:
description: The aggregation methods available for metrics queries.
enum:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2022-08-22T19:31:16.232Z"
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"log": {
"_recordingName": "Dashboards/Create a new timeseries widget with ci_tests data source",
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "6.0.5"
},
"entries": [
{
"_id": "5f3037d5856fa51f5a0d0f4b41c83704",
"_order": 0,
"cache": {},
"request": {
"bodySize": 651,
"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\",\"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\"}}]}"
},
"queryString": [],
"url": "https://api.datadoghq.com/api/v1/dashboard"
},
"response": {
"bodySize": 1065,
"content": {
"mimeType": "application/json",
"size": 1065,
"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"
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/json"
}
],
"headersSize": 594,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2022-08-22T19:31:16.240Z",
"time": 246
},
{
"_id": "fe4ecd80daea8135e7bcc76fe16fec42",
"_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/ykp-mnk-euu"
},
"response": {
"bodySize": 39,
"content": {
"mimeType": "application/json",
"size": 39,
"text": "{\"deleted_dashboard_id\":\"ykp-mnk-euu\"}\n"
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/json"
}
],
"headersSize": 592,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2022-08-22T19:31:16.499Z",
"time": 189
}
],
"pages": [],
"version": "1.2"
}
}
68 changes: 68 additions & 0 deletions examples/v1/dashboards/CreateDashboard_1307120899.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/**
* Create a new timeseries widget with ci_tests data source
*/

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

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

const params: v1.DashboardsApiCreateDashboardRequest = {
body: {
title:
"Example-Create_a_new_timeseries_widget_with_ci_tests_data_source with ci_tests datasource",
widgets: [
{
definition: {
title: "",
showLegend: true,
legendLayout: "auto",
legendColumns: ["avg", "min", "max", "value", "sum"],
time: {},
type: "timeseries",
requests: [
{
formulas: [
{
formula: "query1",
},
],
queries: [
{
dataSource: "ci_tests",
name: "query1",
search: {
query: "test_level:test",
},
indexes: ["*"],
compute: {
aggregation: "count",
},
groupBy: [],
},
],
responseFormat: "timeseries",
style: {
palette: "dog_classic",
lineType: "solid",
lineWidth: "normal",
},
displayType: "line",
},
],
},
},
],
layoutType: "ordered",
reflowType: "auto",
},
};

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

@team:DataDog/dashboards
Scenario: Create a new timeseries widget with ci_tests data source
Given new "CreateDashboard" request
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"}
When the request is sent
Then the response status is 200 OK
And the response "widgets[0].definition.requests[0].queries[0].data_source" is equal to "ci_tests"
And the response "widgets[0].definition.requests[0].queries[0].search.query" is equal to "test_level:test"

@generated @skip @team:DataDog/dashboards
Scenario: Delete a dashboard returns "Dashboards Not Found" response
Given new "DeleteDashboard" request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export type FormulaAndFunctionEventsDataSource =
| typeof SECURITY_SIGNALS
| typeof PROFILES
| typeof AUDIT
| typeof EVENTS;
| typeof EVENTS
| typeof CI_TESTS;
export const LOGS = "logs";
export const SPANS = "spans";
export const NETWORK = "network";
Expand All @@ -21,3 +22,4 @@ export const SECURITY_SIGNALS = "security_signals";
export const PROFILES = "profiles";
export const AUDIT = "audit";
export const EVENTS = "events";
export const CI_TESTS = "ci_tests";
1 change: 1 addition & 0 deletions packages/datadog-api-client-v1/models/ObjectSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,7 @@ const enumsMap: { [key: string]: any[] } = {
"profiles",
"audit",
"events",
"ci_tests",
],
FormulaAndFunctionMetricAggregation: [
"avg",
Expand Down

0 comments on commit d9db6d7

Please sign in to comment.