From e3d813990e0dd0618acb7d27726f8b5b5a1abfc2 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 15 Oct 2026 13:44:00 +0000 Subject: [PATCH] Regenerate client from commit 87c4075 of spec repo --- .generator/schemas/v1/openapi.yaml | 2 + .../dashboards/CreateDashboard_2030704107.py | 78 ++++++++++++++++ ...formula_and_function_events_data_source.py | 5 +- .../test-runner-data/manifest.json | 7 ++ ...th-network-device-flows-formula-query.json | 65 +++++++++++++ .../test-server-data/v1/dashboards.json | 93 +++++++++++++++++++ tests/v1/features/dashboards.feature | 9 ++ 7 files changed, 258 insertions(+), 1 deletion(-) create mode 100644 examples/v1/dashboards/CreateDashboard_2030704107.py create mode 100644 tests/generated-test/test-runner-data/v1/dashboards/create-a-dashboard-with-network-device-flows-formula-query.json diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 3ec349c633..32d1be79c7 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -3496,6 +3496,7 @@ components: - logs - spans - network + - network_device_flows - rum - security_signals - profiles @@ -3514,6 +3515,7 @@ components: - LOGS - SPANS - NETWORK + - NETWORK_DEVICE_FLOWS - RUM - SECURITY_SIGNALS - PROFILES diff --git a/examples/v1/dashboards/CreateDashboard_2030704107.py b/examples/v1/dashboards/CreateDashboard_2030704107.py new file mode 100644 index 0000000000..5e6b9d639f --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_2030704107.py @@ -0,0 +1,78 @@ +""" +Create a dashboard with network device flows formula query +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v1.api.dashboards_api import DashboardsApi +from datadog_api_client.v1.model.dashboard import Dashboard +from datadog_api_client.v1.model.dashboard_layout_type import DashboardLayoutType +from datadog_api_client.v1.model.formula_and_function_event_aggregation import FormulaAndFunctionEventAggregation +from datadog_api_client.v1.model.formula_and_function_event_query_definition import ( + FormulaAndFunctionEventQueryDefinition, +) +from datadog_api_client.v1.model.formula_and_function_event_query_definition_compute import ( + FormulaAndFunctionEventQueryDefinitionCompute, +) +from datadog_api_client.v1.model.formula_and_function_event_query_definition_search import ( + FormulaAndFunctionEventQueryDefinitionSearch, +) +from datadog_api_client.v1.model.formula_and_function_event_query_group_by_fields import ( + FormulaAndFunctionEventQueryGroupByFields, +) +from datadog_api_client.v1.model.formula_and_function_events_data_source import FormulaAndFunctionEventsDataSource +from datadog_api_client.v1.model.formula_and_function_response_format import FormulaAndFunctionResponseFormat +from datadog_api_client.v1.model.timeseries_widget_definition import TimeseriesWidgetDefinition +from datadog_api_client.v1.model.timeseries_widget_definition_type import TimeseriesWidgetDefinitionType +from datadog_api_client.v1.model.timeseries_widget_request import TimeseriesWidgetRequest +from datadog_api_client.v1.model.widget import Widget +from datadog_api_client.v1.model.widget_layout import WidgetLayout + +body = Dashboard( + title="Example-Dashboard network device flows", + widgets=[ + Widget( + definition=TimeseriesWidgetDefinition( + type=TimeseriesWidgetDefinitionType.TIMESERIES, + requests=[ + TimeseriesWidgetRequest( + response_format=FormulaAndFunctionResponseFormat.TIMESERIES, + queries=[ + FormulaAndFunctionEventQueryDefinition( + data_source=FormulaAndFunctionEventsDataSource.NETWORK_DEVICE_FLOWS, + name="query1", + search=FormulaAndFunctionEventQueryDefinitionSearch( + query="", + ), + compute=FormulaAndFunctionEventQueryDefinitionCompute( + aggregation=FormulaAndFunctionEventAggregation.COUNT, + ), + group_by=FormulaAndFunctionEventQueryGroupByFields( + fields=[ + "@source.ip", + ], + limit=10, + ), + ), + ], + ), + ], + ), + layout=WidgetLayout( + x=0, + y=0, + width=4, + height=2, + ), + ), + ], + layout_type=DashboardLayoutType.ORDERED, +) + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +with ApiClient(configuration) as api_client: + api_instance = DashboardsApi(api_client) + response = api_instance.create_dashboard(body=body) + + print(response) diff --git a/src/datadog_api_client/v1/model/formula_and_function_events_data_source.py b/src/datadog_api_client/v1/model/formula_and_function_events_data_source.py index 7447c29f83..bd0b09d98e 100644 --- a/src/datadog_api_client/v1/model/formula_and_function_events_data_source.py +++ b/src/datadog_api_client/v1/model/formula_and_function_events_data_source.py @@ -16,7 +16,7 @@ class FormulaAndFunctionEventsDataSource(ModelSimple): """ Data source for event platform-based queries. - :param value: Must be one of ["logs", "spans", "network", "rum", "security_signals", "profiles", "audit", "events", "ci_tests", "ci_pipelines", "incident_analytics", "product_analytics", "on_call_events", "errors", "llm_observability"]. + :param value: Must be one of ["logs", "spans", "network", "network_device_flows", "rum", "security_signals", "profiles", "audit", "events", "ci_tests", "ci_pipelines", "incident_analytics", "product_analytics", "on_call_events", "errors", "llm_observability"]. :type value: str """ @@ -24,6 +24,7 @@ class FormulaAndFunctionEventsDataSource(ModelSimple): "logs", "spans", "network", + "network_device_flows", "rum", "security_signals", "profiles", @@ -40,6 +41,7 @@ class FormulaAndFunctionEventsDataSource(ModelSimple): LOGS: ClassVar["FormulaAndFunctionEventsDataSource"] SPANS: ClassVar["FormulaAndFunctionEventsDataSource"] NETWORK: ClassVar["FormulaAndFunctionEventsDataSource"] + NETWORK_DEVICE_FLOWS: ClassVar["FormulaAndFunctionEventsDataSource"] RUM: ClassVar["FormulaAndFunctionEventsDataSource"] SECURITY_SIGNALS: ClassVar["FormulaAndFunctionEventsDataSource"] PROFILES: ClassVar["FormulaAndFunctionEventsDataSource"] @@ -63,6 +65,7 @@ def openapi_types(_): FormulaAndFunctionEventsDataSource.LOGS = FormulaAndFunctionEventsDataSource("logs") FormulaAndFunctionEventsDataSource.SPANS = FormulaAndFunctionEventsDataSource("spans") FormulaAndFunctionEventsDataSource.NETWORK = FormulaAndFunctionEventsDataSource("network") +FormulaAndFunctionEventsDataSource.NETWORK_DEVICE_FLOWS = FormulaAndFunctionEventsDataSource("network_device_flows") FormulaAndFunctionEventsDataSource.RUM = FormulaAndFunctionEventsDataSource("rum") FormulaAndFunctionEventsDataSource.SECURITY_SIGNALS = FormulaAndFunctionEventsDataSource("security_signals") FormulaAndFunctionEventsDataSource.PROFILES = FormulaAndFunctionEventsDataSource("profiles") diff --git a/tests/generated-test/test-runner-data/manifest.json b/tests/generated-test/test-runner-data/manifest.json index 00ea7c4d01..26a5c0a691 100644 --- a/tests/generated-test/test-runner-data/manifest.json +++ b/tests/generated-test/test-runner-data/manifest.json @@ -119,6 +119,13 @@ "scenario": "Clients deserialize a dashboard with a empty time object", "version": "v1" }, + { + "feature": "Dashboards", + "feature_file": "../../v1/features/dashboards.feature", + "file": "v1/dashboards/create-a-dashboard-with-network-device-flows-formula-query.json", + "scenario": "Create a dashboard with network device flows formula query", + "version": "v1" + }, { "feature": "Dashboards", "feature_file": "../../v1/features/dashboards.feature", diff --git a/tests/generated-test/test-runner-data/v1/dashboards/create-a-dashboard-with-network-device-flows-formula-query.json b/tests/generated-test/test-runner-data/v1/dashboards/create-a-dashboard-with-network-device-flows-formula-query.json new file mode 100644 index 0000000000..e357292732 --- /dev/null +++ b/tests/generated-test/test-runner-data/v1/dashboards/create-a-dashboard-with-network-device-flows-formula-query.json @@ -0,0 +1,65 @@ +{ + "api": "Dashboards", + "expected_status": 200, + "feature": "Dashboards", + "id": "v1/Dashboards/Create a dashboard with network device flows formula query", + "operation_id": "CreateDashboard", + "request": { + "body": { + "schema": { + "format": null, + "ref": "Dashboard", + "type": "object" + }, + "source": "inline", + "value": { + "layout_type": "ordered", + "title": "{{ unique }} network device flows", + "widgets": [ + { + "definition": { + "requests": [ + { + "queries": [ + { + "compute": { + "aggregation": "count" + }, + "data_source": "network_device_flows", + "group_by": { + "fields": [ + "@source.ip" + ], + "limit": 10 + }, + "name": "query1", + "search": { + "query": "" + } + } + ], + "response_format": "timeseries" + } + ], + "type": "timeseries" + }, + "layout": { + "height": 2, + "width": 4, + "x": 0, + "y": 0 + } + } + ] + } + }, + "content_type": "application/json", + "method": "POST", + "pagination": false, + "parameters": [], + "path": "/api/v1/dashboard" + }, + "scenario": "Create a dashboard with network device flows formula query", + "schema_version": 1, + "version": "v1" +} diff --git a/tests/generated-test/test-server-data/v1/dashboards.json b/tests/generated-test/test-server-data/v1/dashboards.json index 71d8f9de27..7f8ed4b0cf 100644 --- a/tests/generated-test/test-server-data/v1/dashboards.json +++ b/tests/generated-test/test-server-data/v1/dashboards.json @@ -92,6 +92,99 @@ "scenario": "Clients deserialize a dashboard with a empty time object", "version": "v1" }, + { + "feature": "Dashboards", + "frozen_at": "2026-10-13T17:22:34.474Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "layout_type": "ordered", + "title": "Test-Create_a_dashboard_with_network_device_flows_formula_query-1791912154 network device flows", + "widgets": [ + { + "definition": { + "requests": [ + { + "queries": [ + { + "compute": { + "aggregation": "count" + }, + "data_source": "network_device_flows", + "group_by": { + "fields": [ + "@source.ip" + ], + "limit": 10 + }, + "name": "query1", + "search": { + "query": "" + } + } + ], + "response_format": "timeseries" + } + ], + "type": "timeseries" + }, + "layout": { + "height": 2, + "width": 4, + "x": 0, + "y": 0 + } + } + ] + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v1/dashboard", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"id\":\"3wt-6t8-i2d\",\"title\":\"Test-Create_a_dashboard_with_network_device_flows_formula_query-1791912154 network device flows\",\"description\":null,\"author_handle\":\"cassettexxxxxxxxxxxxx@datadoghq.com\",\"author_name\":\"David Tapiador del Dujo\",\"layout_type\":\"ordered\",\"url\":\"/dashboard/3wt-6t8-i2d/test-createadashboardwithnetworkdeviceflowsformulaquery-1791912154-network-devic\",\"template_variables\":null,\"widgets\":[{\"definition\":{\"requests\":[{\"queries\":[{\"compute\":{\"aggregation\":\"count\"},\"data_source\":\"network_device_flows\",\"group_by\":{\"fields\":[\"@source.ip\"],\"limit\":10},\"name\":\"query1\",\"search\":{\"query\":\"\"}}],\"response_format\":\"timeseries\"}],\"type\":\"timeseries\"},\"layout\":{\"height\":2,\"width\":4,\"x\":0,\"y\":0},\"id\":4350654696140889}],\"notify_list\":null,\"created_at\":\"2026-10-13T17:22:34.659735+00:00\",\"modified_at\":\"2026-10-13T17:22:34.659735+00:00\",\"experience_type\":\"default\",\"restricted_roles\":[]}" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v1/dashboard/3wt-6t8-i2d", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"deleted_dashboard_id\":\"3wt-6t8-i2d\"}" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Create a dashboard with network device flows formula query", + "version": "v1" + }, { "feature": "Dashboards", "frozen_at": "2024-11-15T19:32:26.867Z", diff --git a/tests/v1/features/dashboards.feature b/tests/v1/features/dashboards.feature index 680f0edda6..10d1ecf15b 100644 --- a/tests/v1/features/dashboards.feature +++ b/tests/v1/features/dashboards.feature @@ -17,6 +17,15 @@ Feature: Dashboards Then the response status is 200 OK And the response "widgets[0].definition.time" is equal to {} + @team:ddoghq/dashboards-backend + Scenario: Create a dashboard with network device flows formula query + Given new "CreateDashboard" request + And body with value {"title": "{{ unique }} network device flows", "widgets": [{"definition": {"type": "timeseries", "requests": [{"response_format": "timeseries", "queries": [{"data_source": "network_device_flows", "name": "query1", "search": {"query": ""}, "compute": {"aggregation": "count"}, "group_by": {"fields": ["@source.ip"], "limit": 10}}]}]}, "layout": {"x": 0, "y": 0, "width": 4, "height": 2}}], "layout_type": "ordered"} + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.requests[0].queries[0].data_source" is equal to "network_device_flows" + And the response "widgets[0].definition.requests[0].queries[0].group_by.fields[0]" is equal to "@source.ip" + @team:ddoghq/dashboards-backend Scenario: Create a distribution widget using a histogram request containing a formulas and functions APM Stats query Given new "CreateDashboard" request