Skip to content

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

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

Merged
merged 12 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:05:24.457674",
"spec_repo_commit": "007165a"
"regenerated": "2021-04-19 11:30:05.068946",
"spec_repo_commit": "ed46f8d"
},
"v2": {
"apigentools_version": "1.4.1.dev6",
"regenerated": "2021-04-19 11:05:54.990741",
"spec_repo_commit": "007165a"
"regenerated": "2021-04-19 11:30:31.823853",
"spec_repo_commit": "ed46f8d"
}
}
}
2 changes: 2 additions & 0 deletions .generator/templates/api_client.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,8 @@ class ApiClient(object):
new_params.append(
(k, delimiter.join(str(value) for value in v)))
else:
if isinstance(v, bool):
v = json.dumps(v)
new_params.append((k, v))
return new_params

Expand Down
11 changes: 8 additions & 3 deletions docs/v1/DashboardsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,19 +278,24 @@ configuration = Configuration()
with ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = dashboards_api.DashboardsApi(api_client)
filter_shared = True # bool | When `true`, this query only returns shared custom created or cloned dashboards. (optional)

# example, this endpoint has no required or optional parameters
# example passing only required values which don't have defaults set
# and optional values
try:
# Get all dashboards
api_response = api_instance.list_dashboards()
api_response = api_instance.list_dashboards(filter_shared=filter_shared)
pprint(api_response)
except ApiException as e:
print("Exception when calling DashboardsApi->list_dashboards: %s\n" % e)
```


### Parameters
This endpoint does not need any parameter.

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

### Return type

Expand Down
23 changes: 19 additions & 4 deletions src/datadog_api_client/v1/api/dashboards_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,27 @@ def __init__(self, api_client=None):
"http_method": "GET",
"servers": None,
},
params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []},
params_map={
"all": [
"filter_shared",
],
"required": [],
"nullable": [],
"enum": [],
"validation": [],
},
root_map={
"validations": {},
"allowed_values": {},
"openapi_types": {},
"attribute_map": {},
"location_map": {},
"openapi_types": {
"filter_shared": (bool,),
},
"attribute_map": {
"filter_shared": "filter[shared]",
},
"location_map": {
"filter_shared": "query",
},
"collection_format_map": {},
},
headers_map={
Expand Down Expand Up @@ -360,6 +374,7 @@ def list_dashboards(self, **kwargs):


Keyword Args:
filter_shared (bool): When `true`, this query only returns shared custom created or cloned dashboards.. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
Expand Down
2 changes: 2 additions & 0 deletions src/datadog_api_client/v1/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,8 @@ def parameters_to_tuples(self, params, collection_formats):
delimiter = ","
new_params.append((k, delimiter.join(str(value) for value in v)))
else:
if isinstance(v, bool):
v = json.dumps(v)
new_params.append((k, v))
return new_params

Expand Down
28 changes: 28 additions & 0 deletions src/datadog_api_client/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12097,6 +12097,15 @@ paths:

This query will not return preset dashboards.'
operationId: ListDashboards
parameters:
- description: 'When `true`, this query only returns shared custom created

or cloned dashboards.'
in: query
name: filter[shared]
required: false
schema:
type: boolean
responses:
'200':
content:
Expand Down Expand Up @@ -12153,6 +12162,25 @@ paths:
tags:
- Dashboards
x-codegen-request-body-name: body
x-given:
dashboard:
parameters:
- name: body
value: "{\n \"layout_type\": \"ordered\",\n \"title\": \"{{ unique }}\
\ with Profile Metrics Query\",\n \"widgets\": [\n {\n \"definition\"\
: {\n \"type\": \"timeseries\",\n \"requests\": [\n \
\ {\n \"profile_metrics_query\": {\n \
\ \"compute\": {\n \"aggregation\": \"sum\",\n \
\ \"facet\": \"@prof_core_cpu_cores\"\n },\n \
\ \"search\": { \"query\": \"runtime:jvm\" },\n \
\ \"group_by\": [\n {\n \"facet\"\
: \"service\",\n \"limit\": 10,\n \
\ \"sort\": {\n \"aggregation\": \"sum\",\n \
\ \"order\": \"desc\",\n \"facet\"\
: \"@prof_core_cpu_cores\"\n }\n }\n\
\ ]\n }\n }\n ]\n }\n \
\ }\n ]\n}"
step: there is a valid "dashboard" in the system
x-undo:
operationId: DeleteDashboard
parameters:
Expand Down
2 changes: 2 additions & 0 deletions src/datadog_api_client/v2/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,8 @@ def parameters_to_tuples(self, params, collection_formats):
delimiter = ","
new_params.append((k, delimiter.join(str(value) for value in v)))
else:
if isinstance(v, bool):
v = json.dumps(v)
new_params.append((k, v))
return new_params

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2021-04-16T18:21:50.778356+02:00
Loading