diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 47f01897fd..fb04040228 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -23219,17 +23219,17 @@ components: minItems: 1 type: array query_string: - description: A search string for filtering services. When set, this replaces the `service` field. + description: A search string for filtering services. Replaces the deprecated `service` field. example: "service:myservice" type: string service: - description: (deprecated) Name of the service. Leave this empty and use query_string instead. + deprecated: true + description: (deprecated) Name of the service. Use `query_string` instead. example: myservice type: string required: - data_source - filters - - service type: object TopologyQueryDataStreamsDataSource: description: Name of the data source. diff --git a/examples/v1/dashboards/CreateDashboard_2815497946.py b/examples/v1/dashboards/CreateDashboard_2815497946.py index dc6fafd2e6..384b08a805 100644 --- a/examples/v1/dashboards/CreateDashboard_2815497946.py +++ b/examples/v1/dashboards/CreateDashboard_2815497946.py @@ -40,7 +40,6 @@ request_type=TopologyRequestType.TOPOLOGY, query=TopologyQueryDataStreams( data_source=TopologyQueryDataStreamsDataSource.DATA_STREAMS, - service="", filters=[ "env:prod", ], diff --git a/src/datadog_api_client/v1/model/topology_query_data_streams.py b/src/datadog_api_client/v1/model/topology_query_data_streams.py index 88c367572a..530ae7987b 100644 --- a/src/datadog_api_client/v1/model/topology_query_data_streams.py +++ b/src/datadog_api_client/v1/model/topology_query_data_streams.py @@ -52,8 +52,8 @@ def __init__( self_, data_source: TopologyQueryDataStreamsDataSource, filters: List[str], - service: str, query_string: Union[str, UnsetType] = unset, + service: Union[str, UnsetType] = unset, **kwargs, ): """ @@ -65,16 +65,17 @@ def __init__( :param filters: Your environment and primary tag (or * if enabled for your account). :type filters: [str] - :param query_string: A search string for filtering services. When set, this replaces the ``service`` field. + :param query_string: A search string for filtering services. Replaces the deprecated ``service`` field. :type query_string: str, optional - :param service: (deprecated) Name of the service. Leave this empty and use query_string instead. - :type service: str + :param service: (deprecated) Name of the service. Use ``query_string`` instead. **Deprecated**. + :type service: str, optional """ if query_string is not unset: kwargs["query_string"] = query_string + if service is not unset: + kwargs["service"] = service super().__init__(kwargs) self_.data_source = data_source self_.filters = filters - self_.service = service diff --git a/tests/generated-test/test-runner-data/v1/dashboards/create-a-new-dashboard-with-topology-map-data-streams-widget.json b/tests/generated-test/test-runner-data/v1/dashboards/create-a-new-dashboard-with-topology-map-data-streams-widget.json index a714c8d0ba..318f3c3e0f 100644 --- a/tests/generated-test/test-runner-data/v1/dashboards/create-a-new-dashboard-with-topology-map-data-streams-widget.json +++ b/tests/generated-test/test-runner-data/v1/dashboards/create-a-new-dashboard-with-topology-map-data-streams-widget.json @@ -28,8 +28,7 @@ "filters": [ "env:prod" ], - "query_string": "service:myservice", - "service": "" + "query_string": "service:myservice" }, "request_type": "topology" } diff --git a/tests/generated-test/test-server-data/v1/dashboards.json b/tests/generated-test/test-server-data/v1/dashboards.json index 49729f2b37..037833ffa2 100644 --- a/tests/generated-test/test-server-data/v1/dashboards.json +++ b/tests/generated-test/test-server-data/v1/dashboards.json @@ -10665,8 +10665,7 @@ "filters": [ "env:prod" ], - "query_string": "service:myservice", - "service": "" + "query_string": "service:myservice" }, "request_type": "topology" } @@ -10694,7 +10693,7 @@ "response": { "body": { "encoding": "text", - "value": "{\"id\":\"whr-253-7we\",\"title\":\"Test-Create_a_new_dashboard_with_topology_map_data_streams_widget-1774030611\",\"description\":\"\",\"author_handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"author_name\":\"CI Account\",\"layout_type\":\"free\",\"url\":\"/dashboard/whr-253-7we/test-createanewdashboardwithtopologymapdatastreamswidget-1774030611\",\"template_variables\":[],\"widgets\":[{\"definition\":{\"requests\":[{\"query\":{\"data_source\":\"data_streams\",\"filters\":[\"env:prod\"],\"query_string\":\"service:myservice\",\"service\":\"\"},\"request_type\":\"topology\"}],\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"topology_map\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0},\"id\":1843670487553482}],\"notify_list\":[],\"created_at\":\"2026-03-20T18:16:52.209473+00:00\",\"modified_at\":\"2026-03-20T18:16:52.209473+00:00\",\"restricted_roles\":[]}" + "value": "{\"id\":\"whr-253-7we\",\"title\":\"Test-Create_a_new_dashboard_with_topology_map_data_streams_widget-1774030611\",\"description\":\"\",\"author_handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"author_name\":\"CI Account\",\"layout_type\":\"free\",\"url\":\"/dashboard/whr-253-7we/test-createanewdashboardwithtopologymapdatastreamswidget-1774030611\",\"template_variables\":[],\"widgets\":[{\"definition\":{\"requests\":[{\"query\":{\"data_source\":\"data_streams\",\"filters\":[\"env:prod\"],\"query_string\":\"service:myservice\"},\"request_type\":\"topology\"}],\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"topology_map\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0},\"id\":1843670487553482}],\"notify_list\":[],\"created_at\":\"2026-03-20T18:16:52.209473+00:00\",\"modified_at\":\"2026-03-20T18:16:52.209473+00:00\",\"restricted_roles\":[]}" }, "headers": { "content-type": "application/json" diff --git a/tests/v1/features/dashboards.feature b/tests/v1/features/dashboards.feature index 22ebf82dcf..de0a6198e0 100644 --- a/tests/v1/features/dashboards.feature +++ b/tests/v1/features/dashboards.feature @@ -1258,7 +1258,6 @@ Feature: Dashboards And the response "widgets[0].definition.type" is equal to "topology_map" And the response "widgets[0].definition.requests[0].request_type" is equal to "topology" And the response "widgets[0].definition.requests[0].query.data_source" is equal to "data_streams" - And the response "widgets[0].definition.requests[0].query.service" is equal to "" And the response "widgets[0].definition.requests[0].query.filters" is equal to ["env:prod"] And the response "widgets[0].definition.requests[0].query.query_string" is equal to "service:myservice" diff --git a/tests/v1/features/dashboards_json_payload/topology_map_widget_data_streams.json b/tests/v1/features/dashboards_json_payload/topology_map_widget_data_streams.json index f454b974e6..12f81b348a 100644 --- a/tests/v1/features/dashboards_json_payload/topology_map_widget_data_streams.json +++ b/tests/v1/features/dashboards_json_payload/topology_map_widget_data_streams.json @@ -19,7 +19,6 @@ "request_type": "topology", "query": { "data_source": "data_streams", - "service": "", "filters": ["env:prod"], "query_string": "service:myservice" }