Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"info_version": "2",
"spec_versions": {
"v1": {
"apigentools_version": "1.5.1.dev2",
"regenerated": "2022-01-17 16:31:46.250333",
"spec_repo_commit": "9f83d50"
"apigentools_version": "1.6.1",
"regenerated": "2022-01-18 11:14:16.772290",
"spec_repo_commit": "1d04508"
},
"v2": {
"apigentools_version": "1.5.1.dev2",
"regenerated": "2022-01-17 16:31:46.277137",
"spec_repo_commit": "9f83d50"
"apigentools_version": "1.6.1",
"regenerated": "2022-01-18 11:14:16.785877",
"spec_repo_commit": "1d04508"
}
}
}
14 changes: 14 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16576,6 +16576,14 @@ paths:
required: false
schema:
type: boolean
- description: 'When `true`, this query returns only deleted custom-created

or cloned dashboards. This parameter is incompatible with `filter[shared]`.'
in: query
name: filter[deleted]
required: false
schema:
type: boolean
responses:
'200':
content:
Expand Down Expand Up @@ -16981,6 +16989,12 @@ paths:
summary: Delete a dashboard
tags:
- Dashboards
x-given:
deleted_dashboard:
parameters:
- name: dashboard_id
source: dashboard.id
step: the "dashboard" was deleted
x-menu-order: 3
x-undo:
type: idempotent
Expand Down
18 changes: 14 additions & 4 deletions api/v1/datadog/api_dashboards.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions api/v1/datadog/docs/DashboardsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,10 @@ func main() {
ctx := datadog.NewDefaultContext(context.Background())

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

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

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

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

### Return type

Expand Down
27 changes: 27 additions & 0 deletions examples/v1/dashboards/ListDashboards_1773932563.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Get deleted dashboards returns "OK" response

package main

import (
"context"
"encoding/json"
"fmt"
"os"

datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.DashboardsApi.ListDashboards(ctx, *datadog.NewListDashboardsOptionalParameters().WithFilterDeleted(true))

if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.ListDashboards`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}

responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `DashboardsApi.ListDashboards`:\n%s\n", responseContent)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2022-01-17T17:43:33.193Z
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
interactions:
- request:
body: |
{"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"}}]}
form: {}
headers:
Accept:
- application/json
Content-Type:
- application/json
method: POST
url: https://api.datadoghq.com/api/v1/dashboard
response:
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
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"}'
code: 200
duration: ''
headers:
Content-Type:
- application/json
status: 200 OK
- request:
body: ''
form: {}
headers:
Accept:
- application/json
method: DELETE
url: https://api.datadoghq.com/api/v1/dashboard/ssn-gb2-k7k
response:
body: '{"deleted_dashboard_id":"ssn-gb2-k7k"}'
code: 200
duration: ''
headers:
Content-Type:
- application/json
status: 200 OK
- request:
body: ''
form: {}
headers:
Accept:
- application/json
method: GET
url: https://api.datadoghq.com/api/v1/dashboard?filter%5Bdeleted%5D=true
response:
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
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"}]}'
code: 200
duration: ''
headers:
Content-Type:
- application/json
status: 200 OK
- request:
body: ''
form: {}
headers:
Accept:
- application/json
method: DELETE
url: https://api.datadoghq.com/api/v1/dashboard/ssn-gb2-k7k
response:
body: '{"errors": ["Dashboard with ID ssn-gb2-k7k not found"]}'
code: 404
duration: ''
headers:
Content-Type:
- application/json
status: 404 Not Found
version: 1
9 changes: 9 additions & 0 deletions tests/scenarios/features/v1/dashboards.feature
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,15 @@ Feature: Dashboards
When the request is sent
Then the response status is 200 OK

@team:DataDog/dashboards
Scenario: Get deleted dashboards returns "OK" response
Given new "ListDashboards" request
And there is a valid "dashboard" in the system
And the "dashboard" was deleted
And request contains "filter[deleted]" parameter with value true
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/dashboards
Scenario: Restore deleted dashboards returns "Bad Request" response
Given new "RestoreDashboards" request
Expand Down
12 changes: 12 additions & 0 deletions tests/scenarios/features/v1/given.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
"tag": "Dashboard Lists",
"operationId": "CreateDashboardList"
},
{
"parameters": [
{
"name": "dashboard_id",
"source": "dashboard.id"
}
],
"step": "the \"dashboard\" was deleted",
"key": "deleted_dashboard",
"tag": "Dashboards",
"operationId": "DeleteDashboard"
},
{
"parameters": [
{
Expand Down