Skip to content

Commit ea5221d

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 097113a of spec repo
1 parent 6d40c6d commit ea5221d

16 files changed

Lines changed: 1055 additions & 13 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26248,7 +26248,7 @@ components:
2624826248
- attributes
2624926249
type: object
2625026250
DashboardUsageAttributes:
26251-
description: Usage statistics for a dashboard.
26251+
description: Usage statistics for a dashboard. The `viewer` field and all view-count fields (`total_views`, `viewed_at`, `total_views_by_type`) are populated only when Real User Monitoring (RUM) is active for the org.
2625226252
properties:
2625326253
author:
2625426254
$ref: "#/components/schemas/DashboardUsageUser"
@@ -26287,7 +26287,7 @@ components:
2628726287
example: My production overview
2628826288
type: string
2628926289
total_views:
26290-
description: The total number of times the dashboard has been viewed.
26290+
description: Total view count for the dashboard. Counts only views captured by Real User Monitoring (RUM); `0` in orgs without RUM.
2629126291
example: 42
2629226292
format: int64
2629326293
type: integer
@@ -26296,11 +26296,11 @@ components:
2629626296
description: View count for that view type.
2629726297
format: int64
2629826298
type: integer
26299-
description: View counts keyed by view type. Possible keys are `in_app`, `embed`, `public`, `shared`, `api`, and `unknown`.
26299+
description: View counts keyed by view type (`in_app`, `embed`, `public`, `shared`, `api`, `unknown`). Counts only views captured by Real User Monitoring (RUM); empty in orgs without RUM.
2630026300
nullable: true
2630126301
type: object
2630226302
viewed_at:
26303-
description: When the dashboard was most recently viewed.
26303+
description: When the dashboard was most recently viewed. Populated only when Real User Monitoring (RUM) is active for the org; `null` in orgs without RUM.
2630426304
example: "2026-05-01T14:22:10.000Z"
2630526305
format: date-time
2630626306
nullable: true
@@ -115352,7 +115352,7 @@ paths:
115352115352
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
115353115353
/api/v2/dashboards/usage:
115354115354
get:
115355-
description: Get paginated usage statistics for every dashboard in the caller's organization. Use `page[limit]` and `page[offset]` to walk the result set.
115355+
description: Get paginated usage statistics for every dashboard in the caller's organization. Use `page[limit]` and `page[offset]` to walk the result set. View-count fields depend on Real User Monitoring (RUM) and are `null` or `0` in orgs without RUM.
115356115356
operationId: ListDashboardsUsage
115357115357
parameters:
115358115358
- description: Maximum number of dashboards to return per page. Server-side maximum is 500; values above 500 return a 400 Bad Request.
@@ -115372,6 +115372,22 @@ paths:
115372115372
format: int64
115373115373
minimum: 0
115374115374
type: integer
115375+
- description: Return only dashboards whose last edit (`edited_at`) is strictly before this timestamp (`edited_at < value`; boundary matches are excluded). Must be an ISO 8601 datetime with a timezone offset (for example, `Z` or `+00:00`); naive timestamps return HTTP 400.
115376+
in: query
115377+
name: filter[edited_before]
115378+
required: false
115379+
schema:
115380+
example: "2025-04-26T00:00:00Z"
115381+
format: date-time
115382+
type: string
115383+
- description: Return only dashboards whose most recent view (`viewed_at`) is strictly before this timestamp, including dashboards that have never been viewed. Must be an ISO 8601 datetime with a timezone offset; naive timestamps return HTTP 400. Orgs without Real User Monitoring (RUM) will see all dashboards returned by this filter.
115384+
in: query
115385+
name: filter[viewed_before]
115386+
required: false
115387+
schema:
115388+
example: "2025-04-26T00:00:00Z"
115389+
format: date-time
115390+
type: string
115375115391
responses:
115376115392
"200":
115377115393
content:
@@ -115453,7 +115469,7 @@ paths:
115453115469
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
115454115470
/api/v2/dashboards/{dashboard_id}/usage:
115455115471
get:
115456-
description: Get usage statistics for a single dashboard. The response includes view counts, the most recent view and edit times, widget counts, and the dashboard quality score.
115472+
description: Get usage statistics for a single dashboard. The response includes view counts, the most recent view and edit times, widget counts, and the dashboard quality score. View-count fields depend on Real User Monitoring (RUM) and are `null` or `0` in orgs without RUM.
115457115473
operationId: GetDashboardUsage
115458115474
parameters:
115459115475
- description: The ID of the dashboard.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""
2+
Get usage stats for all dashboards with edited_before filter returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.dashboards_api import DashboardsApi
7+
from datetime import datetime
8+
from dateutil.tz import tzutc
9+
10+
configuration = Configuration()
11+
configuration.unstable_operations["list_dashboards_usage"] = True
12+
with ApiClient(configuration) as api_client:
13+
api_instance = DashboardsApi(api_client)
14+
response = api_instance.list_dashboards_usage(
15+
filter_edited_before=datetime(2025, 4, 26, 0, 0, tzinfo=tzutc()),
16+
)
17+
18+
print(response)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""
2+
Get usage stats for all dashboards with viewed_before filter returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.dashboards_api import DashboardsApi
7+
from datetime import datetime
8+
from dateutil.tz import tzutc
9+
10+
configuration = Configuration()
11+
configuration.unstable_operations["list_dashboards_usage"] = True
12+
with ApiClient(configuration) as api_client:
13+
api_instance = DashboardsApi(api_client)
14+
response = api_instance.list_dashboards_usage(
15+
filter_viewed_before=datetime(2025, 4, 26, 0, 0, tzinfo=tzutc()),
16+
)
17+
18+
print(response)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""
2+
Get usage stats for all dashboards with both filters returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.dashboards_api import DashboardsApi
7+
from datetime import datetime
8+
from dateutil.tz import tzutc
9+
10+
configuration = Configuration()
11+
configuration.unstable_operations["list_dashboards_usage"] = True
12+
with ApiClient(configuration) as api_client:
13+
api_instance = DashboardsApi(api_client)
14+
response = api_instance.list_dashboards_usage(
15+
filter_edited_before=datetime(2025, 4, 26, 0, 0, tzinfo=tzutc()),
16+
filter_viewed_before=datetime(2025, 4, 26, 0, 0, tzinfo=tzutc()),
17+
)
18+
19+
print(response)

src/datadog_api_client/v2/api/dashboards_api.py

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint
1010
from datadog_api_client.configuration import Configuration
1111
from datadog_api_client.model_utils import (
12+
datetime,
1213
set_attribute_from_path,
1314
get_attribute_from_path,
1415
UnsetType,
@@ -78,6 +79,16 @@ def __init__(self, api_client=None):
7879
"attribute": "page[offset]",
7980
"location": "query",
8081
},
82+
"filter_edited_before": {
83+
"openapi_types": (datetime,),
84+
"attribute": "filter[edited_before]",
85+
"location": "query",
86+
},
87+
"filter_viewed_before": {
88+
"openapi_types": (datetime,),
89+
"attribute": "filter[viewed_before]",
90+
"location": "query",
91+
},
8192
},
8293
headers_map={
8394
"accept": ["application/json"],
@@ -91,7 +102,7 @@ def get_dashboard_usage(
91102
) -> DashboardUsageResponse:
92103
"""Get usage stats for a dashboard.
93104
94-
Get usage statistics for a single dashboard. The response includes view counts, the most recent view and edit times, widget counts, and the dashboard quality score.
105+
Get usage statistics for a single dashboard. The response includes view counts, the most recent view and edit times, widget counts, and the dashboard quality score. View-count fields depend on Real User Monitoring (RUM) and are ``null`` or ``0`` in orgs without RUM.
95106
96107
:param dashboard_id: The ID of the dashboard.
97108
:type dashboard_id: str
@@ -107,15 +118,21 @@ def list_dashboards_usage(
107118
*,
108119
page_limit: Union[int, UnsetType] = unset,
109120
page_offset: Union[int, UnsetType] = unset,
121+
filter_edited_before: Union[datetime, UnsetType] = unset,
122+
filter_viewed_before: Union[datetime, UnsetType] = unset,
110123
) -> ListDashboardsUsageResponse:
111124
"""Get usage stats for all dashboards.
112125
113-
Get paginated usage statistics for every dashboard in the caller's organization. Use ``page[limit]`` and ``page[offset]`` to walk the result set.
126+
Get paginated usage statistics for every dashboard in the caller's organization. Use ``page[limit]`` and ``page[offset]`` to walk the result set. View-count fields depend on Real User Monitoring (RUM) and are ``null`` or ``0`` in orgs without RUM.
114127
115128
:param page_limit: Maximum number of dashboards to return per page. Server-side maximum is 500; values above 500 return a 400 Bad Request.
116129
:type page_limit: int, optional
117130
:param page_offset: Zero-based offset into the result set.
118131
:type page_offset: int, optional
132+
:param filter_edited_before: Return only dashboards whose last edit ( ``edited_at`` ) is strictly before this timestamp ( ``edited_at < value`` ; boundary matches are excluded). Must be an ISO 8601 datetime with a timezone offset (for example, ``Z`` or ``+00:00`` ); naive timestamps return HTTP 400.
133+
:type filter_edited_before: datetime, optional
134+
:param filter_viewed_before: Return only dashboards whose most recent view ( ``viewed_at`` ) is strictly before this timestamp, including dashboards that have never been viewed. Must be an ISO 8601 datetime with a timezone offset; naive timestamps return HTTP 400. Orgs without Real User Monitoring (RUM) will see all dashboards returned by this filter.
135+
:type filter_viewed_before: datetime, optional
119136
:rtype: ListDashboardsUsageResponse
120137
"""
121138
kwargs: Dict[str, Any] = {}
@@ -125,13 +142,21 @@ def list_dashboards_usage(
125142
if page_offset is not unset:
126143
kwargs["page_offset"] = page_offset
127144

145+
if filter_edited_before is not unset:
146+
kwargs["filter_edited_before"] = filter_edited_before
147+
148+
if filter_viewed_before is not unset:
149+
kwargs["filter_viewed_before"] = filter_viewed_before
150+
128151
return self._list_dashboards_usage_endpoint.call_with_http_info(**kwargs)
129152

130153
def list_dashboards_usage_with_pagination(
131154
self,
132155
*,
133156
page_limit: Union[int, UnsetType] = unset,
134157
page_offset: Union[int, UnsetType] = unset,
158+
filter_edited_before: Union[datetime, UnsetType] = unset,
159+
filter_viewed_before: Union[datetime, UnsetType] = unset,
135160
) -> collections.abc.Iterable[DashboardUsage]:
136161
"""Get usage stats for all dashboards.
137162
@@ -141,6 +166,10 @@ def list_dashboards_usage_with_pagination(
141166
:type page_limit: int, optional
142167
:param page_offset: Zero-based offset into the result set.
143168
:type page_offset: int, optional
169+
:param filter_edited_before: Return only dashboards whose last edit ( ``edited_at`` ) is strictly before this timestamp ( ``edited_at < value`` ; boundary matches are excluded). Must be an ISO 8601 datetime with a timezone offset (for example, ``Z`` or ``+00:00`` ); naive timestamps return HTTP 400.
170+
:type filter_edited_before: datetime, optional
171+
:param filter_viewed_before: Return only dashboards whose most recent view ( ``viewed_at`` ) is strictly before this timestamp, including dashboards that have never been viewed. Must be an ISO 8601 datetime with a timezone offset; naive timestamps return HTTP 400. Orgs without Real User Monitoring (RUM) will see all dashboards returned by this filter.
172+
:type filter_viewed_before: datetime, optional
144173
145174
:return: A generator of paginated results.
146175
:rtype: collections.abc.Iterable[DashboardUsage]
@@ -152,6 +181,12 @@ def list_dashboards_usage_with_pagination(
152181
if page_offset is not unset:
153182
kwargs["page_offset"] = page_offset
154183

184+
if filter_edited_before is not unset:
185+
kwargs["filter_edited_before"] = filter_edited_before
186+
187+
if filter_viewed_before is not unset:
188+
kwargs["filter_viewed_before"] = filter_viewed_before
189+
155190
local_page_size = get_attribute_from_path(kwargs, "page_limit", 250)
156191
endpoint = self._list_dashboards_usage_endpoint
157192
set_attribute_from_path(kwargs, "page_limit", local_page_size, endpoint.params_map)

src/datadog_api_client/v2/model/dashboard_usage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __init__(self_, attributes: DashboardUsageAttributes, id: str, type: Dashboa
3838
"""
3939
A single dashboard usage record.
4040
41-
:param attributes: Usage statistics for a dashboard.
41+
:param attributes: Usage statistics for a dashboard. The ``viewer`` field and all view-count fields ( ``total_views`` , ``viewed_at`` , ``total_views_by_type`` ) are populated only when Real User Monitoring (RUM) is active for the org.
4242
:type attributes: DashboardUsageAttributes
4343
4444
:param id: The dashboard ID.

src/datadog_api_client/v2/model/dashboard_usage_attributes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __init__(
7474
**kwargs,
7575
):
7676
"""
77-
Usage statistics for a dashboard.
77+
Usage statistics for a dashboard. The ``viewer`` field and all view-count fields ( ``total_views`` , ``viewed_at`` , ``total_views_by_type`` ) are populated only when Real User Monitoring (RUM) is active for the org.
7878
7979
:param author: A user referenced from a dashboard usage record (author or viewer).
8080
:type author: DashboardUsageUser, none_type, optional
@@ -97,13 +97,13 @@ def __init__(
9797
:param title: The dashboard title.
9898
:type title: str, optional
9999
100-
:param total_views: The total number of times the dashboard has been viewed.
100+
:param total_views: Total view count for the dashboard. Counts only views captured by Real User Monitoring (RUM); ``0`` in orgs without RUM.
101101
:type total_views: int, optional
102102
103-
:param total_views_by_type: View counts keyed by view type. Possible keys are ``in_app`` , ``embed`` , ``public`` , ``shared`` , ``api`` , and ``unknown``.
103+
:param total_views_by_type: View counts keyed by view type ( ``in_app`` , ``embed`` , ``public`` , ``shared`` , ``api`` , ``unknown`` ). Counts only views captured by Real User Monitoring (RUM); empty in orgs without RUM.
104104
:type total_views_by_type: {str: (int,)}, none_type, optional
105105
106-
:param viewed_at: When the dashboard was most recently viewed.
106+
:param viewed_at: When the dashboard was most recently viewed. Populated only when Real User Monitoring (RUM) is active for the org; ``null`` in orgs without RUM.
107107
:type viewed_at: datetime, none_type, optional
108108
109109
:param viewer: A user referenced from a dashboard usage record (author or viewer).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-06-01T18:15:39.812Z

0 commit comments

Comments
 (0)