Skip to content

Commit cfcf8c1

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 27106c20 of spec repo (#847)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent c6326e7 commit cfcf8c1

File tree

15 files changed

+590
-4
lines changed

15 files changed

+590
-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": "2022-09-26 09:51:31.902097",
8-
"spec_repo_commit": "24936e30"
7+
"regenerated": "2022-09-26 14:13:13.234730",
8+
"spec_repo_commit": "27106c20"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2022-09-26 09:51:31.917551",
13-
"spec_repo_commit": "24936e30"
12+
"regenerated": "2022-09-26 14:13:13.251814",
13+
"spec_repo_commit": "27106c20"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9270,6 +9270,75 @@ components:
92709270
format: int64
92719271
type: integer
92729272
type: object
9273+
SLOListWidgetDefinition:
9274+
description: Use the SLO List widget to track your SLOs (Service Level Objectives)
9275+
on dashboards.
9276+
properties:
9277+
requests:
9278+
description: Array of one request object to display in the widget.
9279+
items:
9280+
$ref: '#/components/schemas/SLOListWidgetRequest'
9281+
maxItems: 1
9282+
minItems: 1
9283+
type: array
9284+
title:
9285+
description: Title of the widget.
9286+
type: string
9287+
title_align:
9288+
$ref: '#/components/schemas/WidgetTextAlign'
9289+
title_size:
9290+
description: Size of the title.
9291+
type: string
9292+
type:
9293+
$ref: '#/components/schemas/SLOListWidgetDefinitionType'
9294+
required:
9295+
- type
9296+
- requests
9297+
type: object
9298+
SLOListWidgetDefinitionType:
9299+
default: slo_list
9300+
description: Type of the SLO List widget.
9301+
enum:
9302+
- slo_list
9303+
example: slo_list
9304+
type: string
9305+
x-enum-varnames:
9306+
- SLO_LIST
9307+
SLOListWidgetQuery:
9308+
description: Updated SLO List widget.
9309+
properties:
9310+
limit:
9311+
default: 100
9312+
description: Maximum number of results to display in the table.
9313+
format: int64
9314+
maximum: 100
9315+
minimum: 1
9316+
type: integer
9317+
query_string:
9318+
description: Widget query.
9319+
example: env:prod AND service:my-app
9320+
type: string
9321+
required:
9322+
- query_string
9323+
type: object
9324+
SLOListWidgetRequest:
9325+
description: Updated SLO List widget.
9326+
properties:
9327+
query:
9328+
$ref: '#/components/schemas/SLOListWidgetQuery'
9329+
request_type:
9330+
$ref: '#/components/schemas/SLOListWidgetRequestType'
9331+
required:
9332+
- query
9333+
- request_type
9334+
type: object
9335+
SLOListWidgetRequestType:
9336+
description: Widget request type.
9337+
enum:
9338+
- slo_list
9339+
type: string
9340+
x-enum-varnames:
9341+
- SLO_LIST
92739342
SLOOverallStatuses:
92749343
description: Overall status of the SLO by timeframes.
92759344
properties:
@@ -17348,6 +17417,7 @@ components:
1734817417
- $ref: '#/components/schemas/QueryValueWidgetDefinition'
1734917418
- $ref: '#/components/schemas/ScatterPlotWidgetDefinition'
1735017419
- $ref: '#/components/schemas/SLOWidgetDefinition'
17420+
- $ref: '#/components/schemas/SLOListWidgetDefinition'
1735117421
- $ref: '#/components/schemas/ServiceMapWidgetDefinition'
1735217422
- $ref: '#/components/schemas/ServiceSummaryWidgetDefinition'
1735317423
- $ref: '#/components/schemas/SunburstWidgetDefinition'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2022-09-21T14:58:35.783Z"
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
{
2+
"log": {
3+
"_recordingName": "Dashboards/Create a new dashboard with slo list widget",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "2839d3d9d3c57889cd6eee6bb561bac8",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 270,
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": 547,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"name\":\"Test-Create_a_new_dashboard_with_slo_list_widget-1663772315\",\"query\":{\"denominator\":\"sum:httpservice.hits{!code:3xx}.as_count()\",\"numerator\":\"sum:httpservice.hits{code:2xx}.as_count()\"},\"thresholds\":[{\"target\":95,\"timeframe\":\"7d\",\"warning\":98}],\"type\":\"metric\"}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v1/slo"
39+
},
40+
"response": {
41+
"bodySize": 575,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 575,
45+
"text": "{\"data\":[{\"description\":\"\",\"monitor_tags\":[],\"creator\":{\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"thresholds\":[{\"warning\":98.0,\"warning_display\":\"98.\",\"target\":95.0,\"target_display\":\"95.\",\"timeframe\":\"7d\"}],\"type_id\":1,\"query\":{\"denominator\":\"sum:httpservice.hits{!code:3xx}.as_count()\",\"numerator\":\"sum:httpservice.hits{code:2xx}.as_count()\"},\"id\":\"7f88381afe5f5c1e987664e7057253fd\",\"name\":\"Test-Create_a_new_dashboard_with_slo_list_widget-1663772315\",\"created_at\":1663772316,\"tags\":[],\"modified_at\":1663772316,\"type\":\"metric\"}],\"error\":null}\n"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 619,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2022-09-21T14:58:35.802Z",
61+
"time": 574
62+
},
63+
{
64+
"_id": "634c497ca94124af52948714b215b0ee",
65+
"_order": 0,
66+
"cache": {},
67+
"request": {
68+
"bodySize": 410,
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\":\"\",\"is_read_only\":false,\"layout_type\":\"free\",\"notify_list\":[],\"template_variables\":[],\"title\":\"Test-Create_a_new_dashboard_with_slo_list_widget-1663772315\",\"widgets\":[{\"definition\":{\"requests\":[{\"query\":{\"limit\":75,\"query_string\":\"env:prod AND service:my-app\"},\"request_type\":\"slo_list\"}],\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"slo_list\"},\"layout\":{\"height\":21,\"width\":60,\"x\":0,\"y\":0}}]}"
89+
},
90+
"queryString": [],
91+
"url": "https://api.datadoghq.com/api/v1/dashboard"
92+
},
93+
"response": {
94+
"bodySize": 710,
95+
"content": {
96+
"mimeType": "application/json",
97+
"size": 710,
98+
"text": "{\"notify_list\":[],\"description\":\"\",\"restricted_roles\":[],\"author_name\":null,\"template_variables\":[],\"is_read_only\":false,\"id\":\"xf3-y64-ib5\",\"title\":\"Test-Create_a_new_dashboard_with_slo_list_widget-1663772315\",\"url\":\"/dashboard/xf3-y64-ib5/test-createanewdashboardwithslolistwidget-1663772315\",\"created_at\":\"2022-09-21T14:58:36.648616+00:00\",\"modified_at\":\"2022-09-21T14:58:36.648616+00:00\",\"author_handle\":\"frog@datadoghq.com\",\"widgets\":[{\"definition\":{\"type\":\"slo_list\",\"requests\":[{\"query\":{\"query_string\":\"env:prod AND service:my-app\",\"limit\":75},\"request_type\":\"slo_list\"}],\"title_align\":\"left\",\"title_size\":\"16\"},\"layout\":{\"y\":0,\"width\":60,\"x\":0,\"height\":21},\"id\":434825034616209}],\"layout_type\":\"free\"}\n"
99+
},
100+
"cookies": [],
101+
"headers": [
102+
{
103+
"name": "content-type",
104+
"value": "application/json"
105+
}
106+
],
107+
"headersSize": 593,
108+
"httpVersion": "HTTP/1.1",
109+
"redirectURL": "",
110+
"status": 200,
111+
"statusText": "OK"
112+
},
113+
"startedDateTime": "2022-09-21T14:58:36.388Z",
114+
"time": 338
115+
},
116+
{
117+
"_id": "f2ac0c6bc92815ab8c0a6d864b5178f8",
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": 520,
131+
"httpVersion": "HTTP/1.1",
132+
"method": "DELETE",
133+
"queryString": [],
134+
"url": "https://api.datadoghq.com/api/v1/dashboard/xf3-y64-ib5"
135+
},
136+
"response": {
137+
"bodySize": 39,
138+
"content": {
139+
"mimeType": "application/json",
140+
"size": 39,
141+
"text": "{\"deleted_dashboard_id\":\"xf3-y64-ib5\"}\n"
142+
},
143+
"cookies": [],
144+
"headers": [
145+
{
146+
"name": "content-type",
147+
"value": "application/json"
148+
}
149+
],
150+
"headersSize": 592,
151+
"httpVersion": "HTTP/1.1",
152+
"redirectURL": "",
153+
"status": 200,
154+
"statusText": "OK"
155+
},
156+
"startedDateTime": "2022-09-21T14:58:36.737Z",
157+
"time": 374
158+
},
159+
{
160+
"_id": "3ba0b158cb4723a3e05d3ffaa6afb990",
161+
"_order": 0,
162+
"cache": {},
163+
"request": {
164+
"bodySize": 0,
165+
"cookies": [],
166+
"headers": [
167+
{
168+
"_fromType": "array",
169+
"name": "accept",
170+
"value": "application/json"
171+
}
172+
],
173+
"headersSize": 529,
174+
"httpVersion": "HTTP/1.1",
175+
"method": "DELETE",
176+
"queryString": [],
177+
"url": "https://api.datadoghq.com/api/v1/slo/7f88381afe5f5c1e987664e7057253fd"
178+
},
179+
"response": {
180+
"bodySize": 59,
181+
"content": {
182+
"mimeType": "application/json",
183+
"size": 59,
184+
"text": "{\"data\":[\"7f88381afe5f5c1e987664e7057253fd\"],\"error\":null}\n"
185+
},
186+
"cookies": [],
187+
"headers": [
188+
{
189+
"name": "content-type",
190+
"value": "application/json"
191+
}
192+
],
193+
"headersSize": 619,
194+
"httpVersion": "HTTP/1.1",
195+
"redirectURL": "",
196+
"status": 200,
197+
"statusText": "OK"
198+
},
199+
"startedDateTime": "2022-09-21T14:58:37.116Z",
200+
"time": 397
201+
}
202+
],
203+
"pages": [],
204+
"version": "1.2"
205+
}
206+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/**
2+
* Create a new dashboard with slo list 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+
title: "Example-Create_a_new_dashboard_with_slo_list_widget",
13+
description: "",
14+
widgets: [
15+
{
16+
layout: {
17+
x: 0,
18+
y: 0,
19+
width: 60,
20+
height: 21,
21+
},
22+
definition: {
23+
titleSize: "16",
24+
titleAlign: "left",
25+
type: "slo_list",
26+
requests: [
27+
{
28+
query: {
29+
queryString: "env:prod AND service:my-app",
30+
limit: 75,
31+
},
32+
requestType: "slo_list",
33+
},
34+
],
35+
},
36+
},
37+
],
38+
templateVariables: [],
39+
layoutType: "free",
40+
isReadOnly: false,
41+
notifyList: [],
42+
},
43+
};
44+
45+
apiInstance
46+
.createDashboard(params)
47+
.then((data: v1.Dashboard) => {
48+
console.log(
49+
"API called successfully. Returned data: " + JSON.stringify(data)
50+
);
51+
})
52+
.catch((error: any) => console.error(error));

features/v1/dashboards.feature

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,17 @@ Feature: Dashboards
410410
And the response "widgets[0].definition.type" is equal to "servicemap"
411411
And the response "widgets[0].definition.filters" is equal to ["env:none","environment:*"]
412412

413+
@team:DataDog/dashboards
414+
Scenario: Create a new dashboard with slo list widget
415+
Given there is a valid "slo" in the system
416+
And new "CreateDashboard" request
417+
And body from file "dashboards_json_payload/slo_list_widget.json"
418+
When the request is sent
419+
Then the response status is 200 OK
420+
And the response "widgets[0].definition.type" is equal to "slo_list"
421+
And the response "widgets[0].definition.requests[0].query.query_string" is equal to "env:prod AND service:my-app"
422+
And the response "widgets[0].definition.requests[0].query.limit" is equal to 75
423+
413424
@team:DataDog/dashboards
414425
Scenario: Create a new dashboard with slo widget
415426
Given there is a valid "slo" in the system

0 commit comments

Comments
 (0)