Skip to content

Commit 7ab12b3

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 9f3c740 of spec repo (#473)
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 f4d3fa0 commit 7ab12b3

File tree

8 files changed

+235
-13
lines changed

8 files changed

+235
-13
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.5.1.dev2",
7-
"regenerated": "2022-01-12 15:42:12.238883",
8-
"spec_repo_commit": "9a4c69f"
7+
"regenerated": "2022-01-12 16:37:00.597589",
8+
"spec_repo_commit": "9f3c740"
99
},
1010
"v2": {
1111
"apigentools_version": "1.5.1.dev2",
12-
"regenerated": "2022-01-12 15:42:12.264357",
13-
"spec_repo_commit": "9a4c69f"
12+
"regenerated": "2022-01-12 16:37:00.624199",
13+
"spec_repo_commit": "9f3c740"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12260,9 +12260,6 @@ components:
1226012260
required:
1226112261
- type
1226212262
- requests
12263-
- size_by
12264-
- color_by
12265-
- group_by
1226612263
type: object
1226712264
TreeMapWidgetDefinitionType:
1226812265
default: treemap
@@ -12276,9 +12273,23 @@ components:
1227612273
TreeMapWidgetRequest:
1227712274
description: An updated treemap widget.
1227812275
properties:
12276+
formulas:
12277+
description: List of formulas that operate on queries. **This feature is
12278+
currently in beta.**
12279+
items:
12280+
$ref: '#/components/schemas/WidgetFormula'
12281+
type: array
1227912282
q:
1228012283
description: The widget metrics query.
1228112284
type: string
12285+
queries:
12286+
description: List of queries that can be returned directly or used in formulas.
12287+
**This feature is currently in beta.**
12288+
items:
12289+
$ref: '#/components/schemas/FormulaAndFunctionQueryDefinition'
12290+
type: array
12291+
response_format:
12292+
$ref: '#/components/schemas/FormulaAndFunctionResponseFormat'
1228212293
type: object
1228312294
UsageAnalyzedLogsHour:
1228412295
description: The number of analyzed logs for each hour for a given organization.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2022-01-12T10:11:31.394Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"log": {
3+
"_recordingName": "Dashboards/Create a new dashboard with a formulas and functions treemap widget",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "5.1.1"
8+
},
9+
"entries": [
10+
{
11+
"_id": "14594ccf095daa90968969cdd40b4adb",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 467,
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": 475,
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_a_formulas_and_functions_treemap_widget-1641982291\",\"widgets\":[{\"definition\":{\"requests\":[{\"formulas\":[{\"formula\":\"hour_before(query1)\"},{\"formula\":\"query1\"}],\"queries\":[{\"compute\":{\"aggregation\":\"count\"},\"data_source\":\"logs\",\"group_by\":[],\"indexes\":[\"*\"],\"name\":\"query1\",\"search\":{\"query\":\"\"}}],\"response_format\":\"scalar\"}],\"title\":\"\",\"type\":\"treemap\"},\"layout\":{\"height\":4,\"width\":4,\"x\":0,\"y\":0}}]}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v1/dashboard"
39+
},
40+
"response": {
41+
"bodySize": 873,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 873,
45+
"text": "{\"notify_list\":null,\"description\":null,\"restricted_roles\":[],\"author_name\":null,\"template_variables\":null,\"is_read_only\":false,\"id\":\"2ar-acj-hxc\",\"title\":\"Test-Create_a_new_dashboard_with_a_formulas_and_functions_treemap_widget-1641982291\",\"url\":\"/dashboard/2ar-acj-hxc/test-createanewdashboardwithaformulasandfunctionstreemapwidget-1641982291\",\"created_at\":\"2022-01-12T10:11:31.601485+00:00\",\"modified_at\":\"2022-01-12T10:11:31.601485+00:00\",\"author_handle\":\"[email protected]\",\"widgets\":[{\"definition\":{\"requests\":[{\"formulas\":[{\"formula\":\"hour_before(query1)\"},{\"formula\":\"query1\"}],\"response_format\":\"scalar\",\"queries\":[{\"search\":{\"query\":\"\"},\"data_source\":\"logs\",\"compute\":{\"aggregation\":\"count\"},\"name\":\"query1\",\"indexes\":[\"*\"],\"group_by\":[]}]}],\"type\":\"treemap\",\"title\":\"\"},\"layout\":{\"y\":0,\"width\":4,\"x\":0,\"height\":4},\"id\":2836171994664464}],\"layout_type\":\"ordered\"}"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 383,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2022-01-12T10:11:31.410Z",
61+
"time": 229
62+
},
63+
{
64+
"_id": "657dda1a8731f8491b143842fe7d0347",
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": 436,
78+
"httpVersion": "HTTP/1.1",
79+
"method": "DELETE",
80+
"queryString": [],
81+
"url": "https://api.datadoghq.com/api/v1/dashboard/2ar-acj-hxc"
82+
},
83+
"response": {
84+
"bodySize": 38,
85+
"content": {
86+
"mimeType": "application/json",
87+
"size": 38,
88+
"text": "{\"deleted_dashboard_id\":\"2ar-acj-hxc\"}"
89+
},
90+
"cookies": [],
91+
"headers": [
92+
{
93+
"name": "content-type",
94+
"value": "application/json"
95+
}
96+
],
97+
"headersSize": 382,
98+
"httpVersion": "HTTP/1.1",
99+
"redirectURL": "",
100+
"status": 200,
101+
"statusText": "OK"
102+
},
103+
"startedDateTime": "2022-01-12T10:11:31.649Z",
104+
"time": 146
105+
}
106+
],
107+
"pages": [],
108+
"version": "1.2"
109+
}
110+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/**
2+
* Create a new dashboard with a formulas and functions treemap widget
3+
*/
4+
5+
import { v1 } from "@datadog/datadog-api-client";
6+
7+
const configuration = v1.createConfiguration();
8+
const apiInstance = new v1.DashboardsApi(configuration);
9+
10+
let params: v1.DashboardsApiCreateDashboardRequest = {
11+
body: {
12+
title:
13+
"Example-Create_a_new_dashboard_with_a_formulas_and_functions_treemap_widget",
14+
widgets: [
15+
{
16+
definition: {
17+
title: "",
18+
type: "treemap",
19+
requests: [
20+
{
21+
formulas: [
22+
{
23+
formula: "hour_before(query1)",
24+
},
25+
{
26+
formula: "query1",
27+
},
28+
],
29+
queries: [
30+
{
31+
dataSource: "logs",
32+
name: "query1",
33+
search: {
34+
query: "",
35+
},
36+
indexes: ["*"],
37+
compute: {
38+
aggregation: "count",
39+
},
40+
groupBy: [],
41+
},
42+
],
43+
responseFormat: "scalar",
44+
},
45+
],
46+
},
47+
layout: {
48+
x: 0,
49+
y: 0,
50+
width: 4,
51+
height: 4,
52+
},
53+
},
54+
],
55+
layoutType: "ordered",
56+
},
57+
};
58+
59+
apiInstance
60+
.createDashboard(params)
61+
.then((data: any) => {
62+
console.log(
63+
"API called successfully. Returned data: " + JSON.stringify(data)
64+
);
65+
})
66+
.catch((error: any) => console.error(error));

features/v1/dashboards.feature

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@ Feature: Dashboards
4141
And the response "widgets[0].definition.requests[0].formulas[0].formula" is equal to "hour_before(query1)"
4242
And the response "widgets[0].definition.requests[0].formulas[1].formula" is equal to "query1"
4343

44+
@team:DataDog/dashboards
45+
Scenario: Create a new dashboard with a formulas and functions treemap widget
46+
Given new "CreateDashboard" request
47+
And body with value { "title": "{{ unique }}", "widgets": [ { "definition": { "title": "", "type": "treemap", "requests": [ { "formulas": [ { "formula": "hour_before(query1)" }, { "formula": "query1" } ], "queries": [ { "data_source": "logs", "name": "query1", "search": { "query": "" }, "indexes": [ "*" ], "compute": { "aggregation": "count" }, "group_by": [] } ], "response_format": "scalar" } ] }, "layout": { "x": 0, "y": 0, "width": 4, "height": 4 } } ], "layout_type": "ordered" }
48+
When the request is sent
49+
Then the response status is 200 OK
50+
And the response "widgets[0].definition.requests[0].response_format" is equal to "scalar"
51+
And the response "widgets[0].definition.requests[0].queries[0].data_source" is equal to "logs"
52+
And the response "widgets[0].definition.requests[0].queries[0].name" is equal to "query1"
53+
And the response "widgets[0].definition.requests[0].queries[0].compute.aggregation" is equal to "count"
54+
And the response "widgets[0].definition.requests[0].formulas[0].formula" is equal to "hour_before(query1)"
55+
And the response "widgets[0].definition.requests[0].formulas[1].formula" is equal to "query1"
56+
4457
@team:DataDog/dashboards
4558
Scenario: Create a new dashboard with a query value widget using the percentile aggregator
4659
Given new "CreateDashboard" request

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ import { AttributeTypeMap } from "./ObjectSerializer";
2020
*/
2121

2222
export class TreeMapWidgetDefinition {
23-
"colorBy": TreeMapColorBy;
24-
"groupBy": TreeMapGroupBy;
23+
"colorBy"?: TreeMapColorBy;
24+
"groupBy"?: TreeMapGroupBy;
2525
/**
2626
* List of top list widget requests.
2727
*/
2828
"requests": Array<TreeMapWidgetRequest>;
29-
"sizeBy": TreeMapSizeBy;
29+
"sizeBy"?: TreeMapSizeBy;
3030
/**
3131
* Title of your widget.
3232
*/
@@ -39,12 +39,10 @@ export class TreeMapWidgetDefinition {
3939
colorBy: {
4040
baseName: "color_by",
4141
type: "TreeMapColorBy",
42-
required: true,
4342
},
4443
groupBy: {
4544
baseName: "group_by",
4645
type: "TreeMapGroupBy",
47-
required: true,
4846
},
4947
requests: {
5048
baseName: "requests",
@@ -54,7 +52,6 @@ export class TreeMapWidgetDefinition {
5452
sizeBy: {
5553
baseName: "size_by",
5654
type: "TreeMapSizeBy",
57-
required: true,
5855
},
5956
title: {
6057
baseName: "title",

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,49 @@
88
* Do not edit the class manually.
99
*/
1010

11+
import { FormulaAndFunctionQueryDefinition } from "./FormulaAndFunctionQueryDefinition";
12+
import { FormulaAndFunctionResponseFormat } from "./FormulaAndFunctionResponseFormat";
13+
import { WidgetFormula } from "./WidgetFormula";
1114
import { AttributeTypeMap } from "./ObjectSerializer";
1215

1316
/**
1417
* An updated treemap widget.
1518
*/
1619

1720
export class TreeMapWidgetRequest {
21+
/**
22+
* List of formulas that operate on queries. **This feature is currently in beta.**
23+
*/
24+
"formulas"?: Array<WidgetFormula>;
1825
/**
1926
* The widget metrics query.
2027
*/
2128
"q"?: string;
29+
/**
30+
* List of queries that can be returned directly or used in formulas. **This feature is currently in beta.**
31+
*/
32+
"queries"?: Array<FormulaAndFunctionQueryDefinition>;
33+
"responseFormat"?: FormulaAndFunctionResponseFormat;
2234

2335
"unparsedObject"?: any;
2436

2537
static readonly attributeTypeMap: AttributeTypeMap = {
38+
formulas: {
39+
baseName: "formulas",
40+
type: "Array<WidgetFormula>",
41+
},
2642
q: {
2743
baseName: "q",
2844
type: "string",
2945
},
46+
queries: {
47+
baseName: "queries",
48+
type: "Array<FormulaAndFunctionQueryDefinition>",
49+
},
50+
responseFormat: {
51+
baseName: "response_format",
52+
type: "FormulaAndFunctionResponseFormat",
53+
},
3054
};
3155

3256
static getAttributeTypeMap(): AttributeTypeMap {

0 commit comments

Comments
 (0)