Skip to content

Commit f96ec97

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit adf28ce4 of spec repo
1 parent 5e10410 commit f96ec97

File tree

14 files changed

+614
-4
lines changed

14 files changed

+614
-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.6",
7-
"regenerated": "2023-10-02 18:58:17.891416",
8-
"spec_repo_commit": "aee9e14a"
7+
"regenerated": "2023-10-04 17:33:10.783188",
8+
"spec_repo_commit": "adf28ce4"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2023-10-02 18:58:17.905529",
13-
"spec_repo_commit": "aee9e14a"
12+
"regenerated": "2023-10-04 17:33:10.804133",
13+
"spec_repo_commit": "adf28ce4"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9085,6 +9085,86 @@ components:
90859085
maxItems: 2
90869086
minItems: 2
90879087
type: array
9088+
PowerpackTemplateVariableContents:
9089+
description: Powerpack template variable contents.
9090+
properties:
9091+
name:
9092+
description: The name of the variable.
9093+
example: host1
9094+
type: string
9095+
prefix:
9096+
description: The tag prefix associated with the variable.
9097+
type: string
9098+
values:
9099+
description: One or many template variable values within the saved view,
9100+
which will be unioned together using `OR` if more than one is specified.
9101+
example:
9102+
- my-host
9103+
- host1
9104+
- host2
9105+
items:
9106+
description: One or more possible values of the template variable.
9107+
minLength: 1
9108+
type: string
9109+
type: array
9110+
required:
9111+
- name
9112+
- values
9113+
type: object
9114+
PowerpackTemplateVariables:
9115+
description: Powerpack template variables.
9116+
properties:
9117+
controlled_by_powerpack:
9118+
description: Template variables controlled at the powerpack level.
9119+
items:
9120+
$ref: '#/components/schemas/PowerpackTemplateVariableContents'
9121+
type: array
9122+
controlled_externally:
9123+
description: Template variables controlled by the external resource, such
9124+
as the dashboard this powerpack is on.
9125+
items:
9126+
$ref: '#/components/schemas/PowerpackTemplateVariableContents'
9127+
type: array
9128+
type: object
9129+
PowerpackWidgetDefinition:
9130+
description: The powerpack widget allows you to keep similar graphs together
9131+
on your timeboard. Each group has a custom header, can hold one to many graphs,
9132+
and is collapsible.
9133+
properties:
9134+
background_color:
9135+
description: Background color of the powerpack title.
9136+
type: string
9137+
banner_img:
9138+
description: URL of image to display as a banner for the powerpack.
9139+
type: string
9140+
powerpack_id:
9141+
description: UUID of the associated powerpack.
9142+
example: df43cf2a-6475-490d-b686-6fbc6cb9a49c
9143+
type: string
9144+
show_title:
9145+
default: true
9146+
description: Whether to show the title or not.
9147+
type: boolean
9148+
template_variables:
9149+
$ref: '#/components/schemas/PowerpackTemplateVariables'
9150+
title:
9151+
description: Title of the widget.
9152+
type: string
9153+
type:
9154+
$ref: '#/components/schemas/PowerpackWidgetDefinitionType'
9155+
required:
9156+
- type
9157+
- powerpack_id
9158+
type: object
9159+
PowerpackWidgetDefinitionType:
9160+
default: powerpack
9161+
description: Type of the powerpack widget.
9162+
enum:
9163+
- powerpack
9164+
example: powerpack
9165+
type: string
9166+
x-enum-varnames:
9167+
- POWERPACK
90889168
ProcessQueryDefinition:
90899169
description: The process query to use in the widget.
90909170
properties:
@@ -19975,6 +20055,7 @@ components:
1997520055
- $ref: '#/components/schemas/LogStreamWidgetDefinition'
1997620056
- $ref: '#/components/schemas/MonitorSummaryWidgetDefinition'
1997720057
- $ref: '#/components/schemas/NoteWidgetDefinition'
20058+
- $ref: '#/components/schemas/PowerpackWidgetDefinition'
1997820059
- $ref: '#/components/schemas/QueryValueWidgetDefinition'
1997920060
- $ref: '#/components/schemas/RunWorkflowWidgetDefinition'
1998020061
- $ref: '#/components/schemas/SLOListWidgetDefinition'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2023-09-26T21:29:30.230Z"
Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
{
2+
"log": {
3+
"_recordingName": "Dashboards/Create a new dashboard with powerpack widget",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "8305fb3779a403a2aa69f085c06f0597",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 404,
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": "{\"data\":{\"attributes\":{\"description\":\"Sample powerpack\",\"group_widget\":{\"definition\":{\"layout_type\":\"ordered\",\"show_title\":true,\"title\":\"Sample Powerpack\",\"type\":\"group\",\"widgets\":[{\"definition\":{\"content\":\"test\",\"type\":\"note\"}}]},\"layout\":{\"height\":3,\"width\":12,\"x\":0,\"y\":0}},\"name\":\"Sample Powerpack\",\"tags\":[\"tag:sample\"],\"template_variables\":[{\"defaults\":[\"*\"],\"name\":\"sample\"}]},\"type\":\"powerpack\"}}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v2/powerpacks"
39+
},
40+
"response": {
41+
"bodySize": 698,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 698,
45+
"text": "{\"data\":{\"type\":\"powerpack\",\"id\":\"c71559ce-5cb3-11ee-9164-da7ad0900002\",\"attributes\":{\"name\":\"Sample Powerpack\",\"description\":\"Sample powerpack\",\"group_widget\":{\"definition\":{\"layout_type\":\"ordered\",\"show_title\":true,\"title\":\"Sample Powerpack\",\"type\":\"group\",\"widgets\":[{\"definition\":{\"content\":\"test\",\"type\":\"note\"},\"id\":8492163139927418}]},\"layout\":{\"height\":3,\"width\":12,\"x\":0,\"y\":0}},\"template_variables\":[{\"defaults\":[\"*\"],\"name\":\"sample\"}],\"tags\":[\"tag:sample\"]},\"relationships\":{\"author\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}},\"included\":[{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"name\":null,\"email\":\"frog@datadoghq.com\"}}]}\n"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 652,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2023-09-26T21:29:30.244Z",
61+
"time": 221
62+
},
63+
{
64+
"_id": "d8ab64132eff60527bbe0ca82fcf0d6c",
65+
"_order": 0,
66+
"cache": {},
67+
"request": {
68+
"bodySize": 475,
69+
"cookies": [],
70+
"headers": [
71+
{
72+
"_fromType": "array",
73+
"name": "accept",
74+
"value": "application/json"
75+
},
76+
{
77+
"_fromType": "array",
78+
"name": "content-type",
79+
"value": "application/json"
80+
}
81+
],
82+
"headersSize": 558,
83+
"httpVersion": "HTTP/1.1",
84+
"method": "POST",
85+
"postData": {
86+
"mimeType": "application/json",
87+
"params": [],
88+
"text": "{\"description\":\"description\",\"is_read_only\":false,\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_new_dashboard_with_powerpack_widget-1695763770 with powerpack widget\",\"widgets\":[{\"definition\":{\"powerpack_id\":\"c71559ce-5cb3-11ee-9164-da7ad0900002\",\"template_variables\":{\"controlled_by_powerpack\":[{\"name\":\"foo\",\"prefix\":\"bar\",\"values\":[\"baz\",\"qux\",\"quuz\"]}],\"controlled_externally\":[]},\"type\":\"powerpack\"},\"layout\":{\"height\":2,\"is_column_break\":false,\"width\":2,\"x\":1,\"y\":1}}]}"
89+
},
90+
"queryString": [],
91+
"url": "https://api.datadoghq.com/api/v1/dashboard"
92+
},
93+
"response": {
94+
"bodySize": 845,
95+
"content": {
96+
"mimeType": "application/json",
97+
"size": 845,
98+
"text": "{\"id\":\"qk3-bn8-9pa\",\"title\":\"Test-Create_a_new_dashboard_with_powerpack_widget-1695763770 with powerpack widget\",\"description\":\"description\",\"author_handle\":\"frog@datadoghq.com\",\"author_name\":null,\"layout_type\":\"ordered\",\"url\":\"/dashboard/qk3-bn8-9pa/test-createanewdashboardwithpowerpackwidget-1695763770-with-powerpack-widget\",\"is_read_only\":false,\"template_variables\":null,\"widgets\":[{\"definition\":{\"powerpack_id\":\"c71559ce-5cb3-11ee-9164-da7ad0900002\",\"template_variables\":{\"controlled_by_powerpack\":[{\"name\":\"foo\",\"prefix\":\"bar\",\"values\":[\"baz\",\"qux\",\"quuz\"]}],\"controlled_externally\":[]},\"type\":\"powerpack\"},\"layout\":{\"height\":2,\"is_column_break\":false,\"width\":2,\"x\":1,\"y\":1},\"id\":5618921727592736}],\"notify_list\":null,\"created_at\":\"2023-09-26T21:29:30.677263+00:00\",\"modified_at\":\"2023-09-26T21:29:30.677263+00:00\",\"restricted_roles\":[]}\n"
99+
},
100+
"cookies": [],
101+
"headers": [
102+
{
103+
"name": "content-type",
104+
"value": "application/json"
105+
}
106+
],
107+
"headersSize": 517,
108+
"httpVersion": "HTTP/1.1",
109+
"redirectURL": "",
110+
"status": 200,
111+
"statusText": "OK"
112+
},
113+
"startedDateTime": "2023-09-26T21:29:30.475Z",
114+
"time": 282
115+
},
116+
{
117+
"_id": "665b2997a64faf9f478024ce79a28eef",
118+
"_order": 0,
119+
"cache": {},
120+
"request": {
121+
"bodySize": 0,
122+
"cookies": [],
123+
"headers": [
124+
{
125+
"_fromType": "array",
126+
"name": "accept",
127+
"value": "application/json"
128+
}
129+
],
130+
"headersSize": 519,
131+
"httpVersion": "HTTP/1.1",
132+
"method": "DELETE",
133+
"queryString": [],
134+
"url": "https://api.datadoghq.com/api/v1/dashboard/qk3-bn8-9pa"
135+
},
136+
"response": {
137+
"bodySize": 39,
138+
"content": {
139+
"mimeType": "application/json",
140+
"size": 39,
141+
"text": "{\"deleted_dashboard_id\":\"qk3-bn8-9pa\"}\n"
142+
},
143+
"cookies": [],
144+
"headers": [
145+
{
146+
"name": "content-type",
147+
"value": "application/json"
148+
}
149+
],
150+
"headersSize": 516,
151+
"httpVersion": "HTTP/1.1",
152+
"redirectURL": "",
153+
"status": 200,
154+
"statusText": "OK"
155+
},
156+
"startedDateTime": "2023-09-26T21:29:30.766Z",
157+
"time": 236
158+
},
159+
{
160+
"_id": "d8baa7c8cbe4b53a57847782abf4c72e",
161+
"_order": 0,
162+
"cache": {},
163+
"request": {
164+
"bodySize": 0,
165+
"cookies": [],
166+
"headers": [
167+
{
168+
"_fromType": "array",
169+
"name": "accept",
170+
"value": "*/*"
171+
}
172+
],
173+
"headersSize": 532,
174+
"httpVersion": "HTTP/1.1",
175+
"method": "DELETE",
176+
"queryString": [],
177+
"url": "https://api.datadoghq.com/api/v2/powerpacks/c71559ce-5cb3-11ee-9164-da7ad0900002"
178+
},
179+
"response": {
180+
"bodySize": 0,
181+
"content": {
182+
"mimeType": "text/html; charset=utf-8",
183+
"size": 0
184+
},
185+
"cookies": [],
186+
"headers": [
187+
{
188+
"name": "content-type",
189+
"value": "text/html; charset=utf-8"
190+
}
191+
],
192+
"headersSize": 639,
193+
"httpVersion": "HTTP/1.1",
194+
"redirectURL": "",
195+
"status": 204,
196+
"statusText": "No Content"
197+
},
198+
"startedDateTime": "2023-09-26T21:29:31.006Z",
199+
"time": 223
200+
}
201+
],
202+
"pages": [],
203+
"version": "1.2"
204+
}
205+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* Create a new dashboard with powerpack 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+
// there is a valid "powerpack" in the system
11+
const POWERPACK_DATA_ID = process.env.POWERPACK_DATA_ID as string;
12+
13+
const params: v1.DashboardsApiCreateDashboardRequest = {
14+
body: {
15+
title: "Example-Dashboard with powerpack widget",
16+
layoutType: "ordered",
17+
widgets: [
18+
{
19+
definition: {
20+
type: "powerpack",
21+
powerpackId: POWERPACK_DATA_ID,
22+
templateVariables: {
23+
controlledExternally: [],
24+
controlledByPowerpack: [
25+
{
26+
name: "foo",
27+
prefix: "bar",
28+
values: ["baz", "qux", "quuz"],
29+
},
30+
],
31+
},
32+
},
33+
layout: {
34+
x: 1,
35+
y: 1,
36+
width: 2,
37+
height: 2,
38+
isColumnBreak: false,
39+
},
40+
},
41+
],
42+
description: "description",
43+
isReadOnly: false,
44+
},
45+
};
46+
47+
apiInstance
48+
.createDashboard(params)
49+
.then((data: v1.Dashboard) => {
50+
console.log(
51+
"API called successfully. Returned data: " + JSON.stringify(data)
52+
);
53+
})
54+
.catch((error: any) => console.error(error));

features/v1/dashboards.feature

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,16 @@ Feature: Dashboards
541541
And the response "widgets[0].definition.type" is equal to "note"
542542
And the response "widgets[0].definition.content" is equal to "# Example Note"
543543

544+
@team:DataDog/dashboards-backend
545+
Scenario: Create a new dashboard with powerpack widget
546+
Given new "CreateDashboard" request
547+
And there is a valid "powerpack" in the system
548+
And body from file "dashboards_json_payload/powerpack_widget.json"
549+
When the request is sent
550+
Then the response status is 200 OK
551+
And the response "widgets[0].definition.type" is equal to "powerpack"
552+
And the response "widgets[0].definition.powerpack_id" has the same value as "powerpack.data.id"
553+
544554
@team:DataDog/dashboards-backend
545555
Scenario: Create a new dashboard with query_table widget
546556
Given new "CreateDashboard" request

0 commit comments

Comments
 (0)