Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filter[shared] query parameter for searching dashboards #860

Merged
merged 11 commits into from
Apr 19, 2021
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.4.1.dev6",
"regenerated": "2021-04-19 11:04:34.921786",
"spec_repo_commit": "007165a"
"regenerated": "2021-04-19 11:29:39.032677",
"spec_repo_commit": "ed46f8d"
},
"v2": {
"apigentools_version": "1.4.1.dev6",
"regenerated": "2021-04-19 11:04:43.511701",
"spec_repo_commit": "007165a"
"regenerated": "2021-04-19 11:29:46.664798",
"spec_repo_commit": "ed46f8d"
}
}
}
50 changes: 50 additions & 0 deletions api/v1/datadog/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,17 @@ paths:
**Note**: This query will only return custom created or cloned dashboards.
This query will not return preset dashboards.
operationId: ListDashboards
parameters:
- description: |-
When `true`, this query only returns shared custom created
or cloned dashboards.
explode: true
in: query
name: filter[shared]
required: false
schema:
type: boolean
style: form
responses:
"200":
content:
Expand Down Expand Up @@ -901,6 +912,45 @@ paths:
tags:
- Dashboards
x-codegen-request-body-name: body
x-given:
dashboard:
parameters:
- name: body
value: |-
{
"layout_type": "ordered",
"title": "{{ unique }} with Profile Metrics Query",
"widgets": [
{
"definition": {
"type": "timeseries",
"requests": [
{
"profile_metrics_query": {
"compute": {
"aggregation": "sum",
"facet": "@prof_core_cpu_cores"
},
"search": { "query": "runtime:jvm" },
"group_by": [
{
"facet": "service",
"limit": 10,
"sort": {
"aggregation": "sum",
"order": "desc",
"facet": "@prof_core_cpu_cores"
}
}
]
}
}
]
}
}
]
}
step: there is a valid "dashboard" in the system
x-undo:
operationId: DeleteDashboard
parameters:
Expand Down
13 changes: 11 additions & 2 deletions api/v1/datadog/api_dashboards.go

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

11 changes: 8 additions & 3 deletions api/v1/datadog/docs/DashboardsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ Name | Type | Description | Notes

## ListDashboards

> DashboardSummary ListDashboards(ctx).Execute()
> DashboardSummary ListDashboards(ctx).FilterShared(filterShared).Execute()

Get all dashboards

Expand All @@ -257,11 +257,12 @@ import (
func main() {
ctx := datadog.NewDefaultContext(context.Background())

filterShared := true // bool | When `true`, this query only returns shared custom created or cloned dashboards. (optional)

configuration := datadog.NewConfiguration()

apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.DashboardsApi.ListDashboards(ctx).Execute()
resp, r, err := apiClient.DashboardsApi.ListDashboards(ctx).FilterShared(filterShared).Execute()
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)
Expand All @@ -274,13 +275,17 @@ func main() {

### Path Parameters

This endpoint does not need any parameter.


### Other Parameters

Other parameters are passed through a pointer to a apiListDashboardsRequest struct via the builder pattern


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**filterShared** | **bool** | When `true`, this query only returns shared custom created or cloned dashboards. |

### Return type

[**DashboardSummary**](DashboardSummary.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2021-04-16T16:11:43.962041637Z
Loading