Skip to content

Commit 71dfc24

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a78f06e of spec repo
1 parent a063366 commit 71dfc24

File tree

9 files changed

+160
-13
lines changed

9 files changed

+160
-13
lines changed

.apigentools-info

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
"info_version": "2",
44
"spec_versions": {
55
"v1": {
6-
"apigentools_version": "1.5.1.dev2",
7-
"regenerated": "2022-01-17 16:31:46.250333",
8-
"spec_repo_commit": "9f83d50"
6+
"apigentools_version": "1.6.1",
7+
"regenerated": "2022-01-18 10:09:27.902001",
8+
"spec_repo_commit": "a78f06e"
99
},
1010
"v2": {
11-
"apigentools_version": "1.5.1.dev2",
12-
"regenerated": "2022-01-17 16:31:46.277137",
13-
"spec_repo_commit": "9f83d50"
11+
"apigentools_version": "1.6.1",
12+
"regenerated": "2022-01-18 10:09:27.916870",
13+
"spec_repo_commit": "a78f06e"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16576,6 +16576,14 @@ paths:
1657616576
required: false
1657716577
schema:
1657816578
type: boolean
16579+
- description: 'When `true`, this query returns only deleted custom-created
16580+
16581+
or cloned dashboards. This parameter is incompatible with `filter[shared]`.'
16582+
in: query
16583+
name: filter[deleted]
16584+
required: false
16585+
schema:
16586+
type: boolean
1657916587
responses:
1658016588
'200':
1658116589
content:
@@ -16981,6 +16989,12 @@ paths:
1698116989
summary: Delete a dashboard
1698216990
tags:
1698316991
- Dashboards
16992+
x-given:
16993+
deleted_dashboard:
16994+
parameters:
16995+
- name: dashboard_id
16996+
source: dashboard.id
16997+
step: the "dashboard" was deleted
1698416998
x-menu-order: 3
1698516999
x-undo:
1698617000
type: idempotent

api/v1/datadog/api_dashboards.go

Lines changed: 14 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1/datadog/docs/DashboardsApi.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,10 @@ func main() {
299299
ctx := datadog.NewDefaultContext(context.Background())
300300

301301
filterShared := true // bool | When `true`, this query only returns shared custom created or cloned dashboards. (optional)
302+
filterDeleted := true // bool | When `true`, this query returns only deleted custom-created or cloned dashboards. This parameter is incompatible with `filter[shared]`. (optional)
302303
optionalParams := datadog.ListDashboardsOptionalParameters{
303304
FilterShared: &filterShared,
305+
FilterDeleted: &filterDeleted,
304306
}
305307

306308
configuration := datadog.NewConfiguration()
@@ -323,9 +325,10 @@ func main() {
323325

324326
Other parameters are passed through a pointer to a ListDashboardsOptionalParameters struct.
325327

326-
| Name | Type | Description | Notes |
327-
| ---------------- | -------- | ------------------------------------------------------------------------------------------ | ----- |
328-
| **filterShared** | **bool** | When `true`, this query only returns shared custom created or cloned dashboards. |
328+
| Name | Type | Description | Notes |
329+
| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
330+
| **filterShared** | **bool** | When `true`, this query only returns shared custom created or cloned dashboards. |
331+
| **filterDeleted** | **bool** | When `true`, this query returns only deleted custom-created or cloned dashboards. This parameter is incompatible with `filter[shared]`. |
329332

330333
### Return type
331334

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Get deleted dashboards returns "OK" response
2+
3+
package main
4+
5+
import (
6+
"context"
7+
"encoding/json"
8+
"fmt"
9+
"os"
10+
11+
datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
12+
)
13+
14+
func main() {
15+
ctx := datadog.NewDefaultContext(context.Background())
16+
configuration := datadog.NewConfiguration()
17+
apiClient := datadog.NewAPIClient(configuration)
18+
resp, r, err := apiClient.DashboardsApi.ListDashboards(ctx, *datadog.NewListDashboardsOptionalParameters().WithFilterDeleted(true))
19+
20+
if err != nil {
21+
fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.ListDashboards`: %v\n", err)
22+
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23+
}
24+
25+
responseContent, _ := json.MarshalIndent(resp, "", " ")
26+
fmt.Fprintf(os.Stdout, "Response from `DashboardsApi.ListDashboards`:\n%s\n", responseContent)
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2022-01-17T17:43:33.193Z
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
interactions:
2+
- request:
3+
body: |
4+
{"layout_type":"ordered","title":"Test-Get_deleted_dashboards_returns_OK_response-1642441413 with Profile Metrics Query","widgets":[{"definition":{"requests":[{"profile_metrics_query":{"compute":{"aggregation":"sum","facet":"@prof_core_cpu_cores"},"group_by":[{"facet":"service","limit":10,"sort":{"aggregation":"sum","facet":"@prof_core_cpu_cores","order":"desc"}}],"search":{"query":"runtime:jvm"}}}],"type":"timeseries"}}]}
5+
form: {}
6+
headers:
7+
Accept:
8+
- application/json
9+
Content-Type:
10+
- application/json
11+
method: POST
12+
url: https://api.datadoghq.com/api/v1/dashboard
13+
response:
14+
body: '{"notify_list":null,"description":null,"restricted_roles":[],"author_name":null,"template_variables":null,"is_read_only":false,"id":"ssn-gb2-k7k","title":"Test-Get_deleted_dashboards_returns_OK_response-1642441413
15+
with Profile Metrics Query","url":"/dashboard/ssn-gb2-k7k/test-getdeleteddashboardsreturnsokresponse-1642441413-with-profile-metrics-query","created_at":"2022-01-17T17:43:33.361797+00:00","modified_at":"2022-01-17T17:43:33.361797+00:00","author_handle":"[email protected]","widgets":[{"definition":{"requests":[{"profile_metrics_query":{"search":{"query":"runtime:jvm"},"group_by":[{"facet":"service","sort":{"facet":"@prof_core_cpu_cores","aggregation":"sum","order":"desc"},"limit":10}],"compute":{"facet":"@prof_core_cpu_cores","aggregation":"sum"}}}],"type":"timeseries"},"id":748946470803570}],"layout_type":"ordered"}'
16+
code: 200
17+
duration: ''
18+
headers:
19+
Content-Type:
20+
- application/json
21+
status: 200 OK
22+
- request:
23+
body: ''
24+
form: {}
25+
headers:
26+
Accept:
27+
- application/json
28+
method: DELETE
29+
url: https://api.datadoghq.com/api/v1/dashboard/ssn-gb2-k7k
30+
response:
31+
body: '{"deleted_dashboard_id":"ssn-gb2-k7k"}'
32+
code: 200
33+
duration: ''
34+
headers:
35+
Content-Type:
36+
- application/json
37+
status: 200 OK
38+
- request:
39+
body: ''
40+
form: {}
41+
headers:
42+
Accept:
43+
- application/json
44+
method: GET
45+
url: https://api.datadoghq.com/api/v1/dashboard?filter%5Bdeleted%5D=true
46+
response:
47+
body: '{"dashboards":[{"created_at":"2022-01-17T17:43:33.361797+00:00","author_handle":"[email protected]","is_read_only":false,"description":null,"title":"Test-Get_deleted_dashboards_returns_OK_response-1642441413
48+
with Profile Metrics Query","url":"/dashboard/ssn-gb2-k7k/test-getdeleteddashboardsreturnsokresponse-1642441413-with-profile-metrics-query","layout_type":"ordered","deleted_at":"2022-01-17T17:43:33.502200+00:00","modified_at":"2022-01-17T17:43:33.361797+00:00","id":"ssn-gb2-k7k"}]}'
49+
code: 200
50+
duration: ''
51+
headers:
52+
Content-Type:
53+
- application/json
54+
status: 200 OK
55+
- request:
56+
body: ''
57+
form: {}
58+
headers:
59+
Accept:
60+
- application/json
61+
method: DELETE
62+
url: https://api.datadoghq.com/api/v1/dashboard/ssn-gb2-k7k
63+
response:
64+
body: '{"errors": ["Dashboard with ID ssn-gb2-k7k not found"]}'
65+
code: 404
66+
duration: ''
67+
headers:
68+
Content-Type:
69+
- application/json
70+
status: 404 Not Found
71+
version: 1

tests/scenarios/features/v1/dashboards.feature

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,15 @@ Feature: Dashboards
432432
When the request is sent
433433
Then the response status is 200 OK
434434

435+
@team:DataDog/dashboards
436+
Scenario: Get deleted dashboards returns "OK" response
437+
Given new "ListDashboards" request
438+
And there is a valid "dashboard" in the system
439+
And the "dashboard" was deleted
440+
And request contains "filter[deleted]" parameter with value true
441+
When the request is sent
442+
Then the response status is 200 OK
443+
435444
@generated @skip @team:DataDog/dashboards
436445
Scenario: Restore deleted dashboards returns "Bad Request" response
437446
Given new "RestoreDashboards" request

tests/scenarios/features/v1/given.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@
2323
"tag": "Dashboard Lists",
2424
"operationId": "CreateDashboardList"
2525
},
26+
{
27+
"parameters": [
28+
{
29+
"name": "dashboard_id",
30+
"source": "dashboard.id"
31+
}
32+
],
33+
"step": "the \"dashboard\" was deleted",
34+
"key": "deleted_dashboard",
35+
"tag": "Dashboards",
36+
"operationId": "DeleteDashboard"
37+
},
2638
{
2739
"parameters": [
2840
{

0 commit comments

Comments
 (0)