Skip to content

Commit 4b3756b

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 6de6059 of spec repo (#3622)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent a5e19a0 commit 4b3756b

14 files changed

Lines changed: 1018 additions & 13 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27293,7 +27293,7 @@ components:
2729327293
- attributes
2729427294
type: object
2729527295
DashboardUsageAttributes:
27296-
description: Usage statistics for a dashboard.
27296+
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.
2729727297
properties:
2729827298
author:
2729927299
$ref: "#/components/schemas/DashboardUsageUser"
@@ -27332,7 +27332,7 @@ components:
2733227332
example: My production overview
2733327333
type: string
2733427334
total_views:
27335-
description: The total number of times the dashboard has been viewed.
27335+
description: Total view count for the dashboard. Counts only views captured by Real User Monitoring (RUM); `0` in orgs without RUM.
2733627336
example: 42
2733727337
format: int64
2733827338
type: integer
@@ -27341,11 +27341,11 @@ components:
2734127341
description: View count for that view type.
2734227342
format: int64
2734327343
type: integer
27344-
description: View counts keyed by view type. Possible keys are `in_app`, `embed`, `public`, `shared`, `api`, and `unknown`.
27344+
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.
2734527345
nullable: true
2734627346
type: object
2734727347
viewed_at:
27348-
description: When the dashboard was most recently viewed.
27348+
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.
2734927349
example: "2026-05-01T14:22:10.000Z"
2735027350
format: date-time
2735127351
nullable: true
@@ -117452,7 +117452,7 @@ paths:
117452117452
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
117453117453
/api/v2/dashboards/usage:
117454117454
get:
117455-
description: Get paginated usage statistics for every dashboard in the caller's organization. Use `page[limit]` and `page[offset]` to walk the result set.
117455+
description: Get paginated usage statistics for every dashboard in the caller's organization. Use `page[limit]` and `page[offset]` to walk the result set. Use `filter[edited_before]` or `filter[viewed_before]` to narrow results by recency. View-count fields depend on Real User Monitoring (RUM) and are `null` or `0` in orgs without RUM.
117456117456
operationId: ListDashboardsUsage
117457117457
parameters:
117458117458
- description: Maximum number of dashboards to return per page. Server-side maximum is 500; values above 500 return a 400 Bad Request.
@@ -117472,6 +117472,20 @@ paths:
117472117472
format: int64
117473117473
minimum: 0
117474117474
type: integer
117475+
- description: Return only dashboards whose last edit (`edited_at`) is strictly before this ISO 8601 timestamp (`edited_at < value`; boundary matches are excluded). Must include a timezone offset (for example, `Z` or `+00:00`); naive timestamps return HTTP 400.
117476+
in: query
117477+
name: filter[edited_before]
117478+
required: false
117479+
schema:
117480+
example: "2025-04-26T00:00:00Z"
117481+
type: string
117482+
- description: Return only dashboards whose most recent view (`viewed_at`) is strictly before this ISO 8601 timestamp, including dashboards that have never been viewed. Must include a timezone offset; naive timestamps return HTTP 400. Orgs without Real User Monitoring (RUM) will see all dashboards returned by this filter.
117483+
in: query
117484+
name: filter[viewed_before]
117485+
required: false
117486+
schema:
117487+
example: "2025-04-26T00:00:00Z"
117488+
type: string
117475117489
responses:
117476117490
"200":
117477117491
content:
@@ -117553,7 +117567,7 @@ paths:
117553117567
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
117554117568
/api/v2/dashboards/{dashboard_id}/usage:
117555117569
get:
117556-
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.
117570+
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.
117557117571
operationId: GetDashboardUsage
117558117572
parameters:
117559117573
- description: The ID of the dashboard.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
8+
configuration = Configuration()
9+
configuration.unstable_operations["list_dashboards_usage"] = True
10+
with ApiClient(configuration) as api_client:
11+
api_instance = DashboardsApi(api_client)
12+
response = api_instance.list_dashboards_usage(
13+
filter_edited_before="2025-04-26T00:00:00Z",
14+
)
15+
16+
print(response)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
8+
configuration = Configuration()
9+
configuration.unstable_operations["list_dashboards_usage"] = True
10+
with ApiClient(configuration) as api_client:
11+
api_instance = DashboardsApi(api_client)
12+
response = api_instance.list_dashboards_usage(
13+
filter_viewed_before="2025-04-26T00:00:00Z",
14+
)
15+
16+
print(response)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
8+
configuration = Configuration()
9+
configuration.unstable_operations["list_dashboards_usage"] = True
10+
with ApiClient(configuration) as api_client:
11+
api_instance = DashboardsApi(api_client)
12+
response = api_instance.list_dashboards_usage(
13+
filter_edited_before="2025-04-26T00:00:00Z",
14+
filter_viewed_before="2025-04-26T00:00:00Z",
15+
)
16+
17+
print(response)

src/datadog_api_client/v2/api/dashboards_api.py

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ def __init__(self, api_client=None):
7878
"attribute": "page[offset]",
7979
"location": "query",
8080
},
81+
"filter_edited_before": {
82+
"openapi_types": (str,),
83+
"attribute": "filter[edited_before]",
84+
"location": "query",
85+
},
86+
"filter_viewed_before": {
87+
"openapi_types": (str,),
88+
"attribute": "filter[viewed_before]",
89+
"location": "query",
90+
},
8191
},
8292
headers_map={
8393
"accept": ["application/json"],
@@ -91,7 +101,7 @@ def get_dashboard_usage(
91101
) -> DashboardUsageResponse:
92102
"""Get usage stats for a dashboard.
93103
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.
104+
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.
95105
96106
:param dashboard_id: The ID of the dashboard.
97107
:type dashboard_id: str
@@ -107,15 +117,21 @@ def list_dashboards_usage(
107117
*,
108118
page_limit: Union[int, UnsetType] = unset,
109119
page_offset: Union[int, UnsetType] = unset,
120+
filter_edited_before: Union[str, UnsetType] = unset,
121+
filter_viewed_before: Union[str, UnsetType] = unset,
110122
) -> ListDashboardsUsageResponse:
111123
"""Get usage stats for all dashboards.
112124
113-
Get paginated usage statistics for every dashboard in the caller's organization. Use ``page[limit]`` and ``page[offset]`` to walk the result set.
125+
Get paginated usage statistics for every dashboard in the caller's organization. Use ``page[limit]`` and ``page[offset]`` to walk the result set. Use ``filter[edited_before]`` or ``filter[viewed_before]`` to narrow results by recency. View-count fields depend on Real User Monitoring (RUM) and are ``null`` or ``0`` in orgs without RUM.
114126
115127
:param page_limit: Maximum number of dashboards to return per page. Server-side maximum is 500; values above 500 return a 400 Bad Request.
116128
:type page_limit: int, optional
117129
:param page_offset: Zero-based offset into the result set.
118130
:type page_offset: int, optional
131+
:param filter_edited_before: Return only dashboards whose last edit ( ``edited_at`` ) is strictly before this ISO 8601 timestamp ( ``edited_at < value`` ; boundary matches are excluded). Must include a timezone offset (for example, ``Z`` or ``+00:00`` ); naive timestamps return HTTP 400.
132+
:type filter_edited_before: str, optional
133+
:param filter_viewed_before: Return only dashboards whose most recent view ( ``viewed_at`` ) is strictly before this ISO 8601 timestamp, including dashboards that have never been viewed. Must include a timezone offset; naive timestamps return HTTP 400. Orgs without Real User Monitoring (RUM) will see all dashboards returned by this filter.
134+
:type filter_viewed_before: str, optional
119135
:rtype: ListDashboardsUsageResponse
120136
"""
121137
kwargs: Dict[str, Any] = {}
@@ -125,13 +141,21 @@ def list_dashboards_usage(
125141
if page_offset is not unset:
126142
kwargs["page_offset"] = page_offset
127143

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

130152
def list_dashboards_usage_with_pagination(
131153
self,
132154
*,
133155
page_limit: Union[int, UnsetType] = unset,
134156
page_offset: Union[int, UnsetType] = unset,
157+
filter_edited_before: Union[str, UnsetType] = unset,
158+
filter_viewed_before: Union[str, UnsetType] = unset,
135159
) -> collections.abc.Iterable[DashboardUsage]:
136160
"""Get usage stats for all dashboards.
137161
@@ -141,6 +165,10 @@ def list_dashboards_usage_with_pagination(
141165
:type page_limit: int, optional
142166
:param page_offset: Zero-based offset into the result set.
143167
:type page_offset: int, optional
168+
:param filter_edited_before: Return only dashboards whose last edit ( ``edited_at`` ) is strictly before this ISO 8601 timestamp ( ``edited_at < value`` ; boundary matches are excluded). Must include a timezone offset (for example, ``Z`` or ``+00:00`` ); naive timestamps return HTTP 400.
169+
:type filter_edited_before: str, optional
170+
:param filter_viewed_before: Return only dashboards whose most recent view ( ``viewed_at`` ) is strictly before this ISO 8601 timestamp, including dashboards that have never been viewed. Must include a timezone offset; naive timestamps return HTTP 400. Orgs without Real User Monitoring (RUM) will see all dashboards returned by this filter.
171+
:type filter_viewed_before: str, optional
144172
145173
:return: A generator of paginated results.
146174
:rtype: collections.abc.Iterable[DashboardUsage]
@@ -152,6 +180,12 @@ def list_dashboards_usage_with_pagination(
152180
if page_offset is not unset:
153181
kwargs["page_offset"] = page_offset
154182

183+
if filter_edited_before is not unset:
184+
kwargs["filter_edited_before"] = filter_edited_before
185+
186+
if filter_viewed_before is not unset:
187+
kwargs["filter_viewed_before"] = filter_viewed_before
188+
155189
local_page_size = get_attribute_from_path(kwargs, "page_limit", 250)
156190
endpoint = self._list_dashboards_usage_endpoint
157191
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)