diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 2e3684fae4..6502314012 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -24164,6 +24164,9 @@ components: additionalProperties: false description: Wrapper for live span properties: + hide_incomplete_cost_data: + description: Whether to hide incomplete cost data in the widget. + type: boolean live_span: $ref: '#/components/schemas/WidgetLiveSpan' type: object @@ -24364,6 +24367,9 @@ components: format: int64 minimum: 0 type: integer + hide_incomplete_cost_data: + description: Whether to hide incomplete cost data in the widget. + type: boolean to: description: End time in seconds since epoch. example: 1712083128 @@ -24388,6 +24394,9 @@ components: WidgetNewLiveSpan: description: Used for arbitrary live span times, such as 17 minutes or 6 hours. properties: + hide_incomplete_cost_data: + description: Whether to hide incomplete cost data in the widget. + type: boolean type: $ref: '#/components/schemas/WidgetNewLiveSpanType' unit: diff --git a/examples/v1/dashboards/CreateDashboard_3066042014.py b/examples/v1/dashboards/CreateDashboard_3066042014.py index c63dbcae6d..b449de3fd3 100644 --- a/examples/v1/dashboards/CreateDashboard_3066042014.py +++ b/examples/v1/dashboards/CreateDashboard_3066042014.py @@ -53,6 +53,7 @@ type=WidgetNewLiveSpanType.LIVE, unit=WidgetLiveSpanUnit.MINUTE, value=8, + hide_incomplete_cost_data=True, ), type=TimeseriesWidgetDefinitionType.TIMESERIES, requests=[ diff --git a/examples/v1/dashboards/CreateDashboard_3451918078.py b/examples/v1/dashboards/CreateDashboard_3451918078.py index ef7149e385..c7f4336650 100644 --- a/examples/v1/dashboards/CreateDashboard_3451918078.py +++ b/examples/v1/dashboards/CreateDashboard_3451918078.py @@ -52,6 +52,7 @@ type=WidgetNewFixedSpanType.FIXED, _from=1712080128, to=1712083128, + hide_incomplete_cost_data=True, ), type=TimeseriesWidgetDefinitionType.TIMESERIES, requests=[ diff --git a/examples/v1/dashboards/CreateDashboard_4262729673.py b/examples/v1/dashboards/CreateDashboard_4262729673.py index 47c0392235..70ea0a7ae5 100644 --- a/examples/v1/dashboards/CreateDashboard_4262729673.py +++ b/examples/v1/dashboards/CreateDashboard_4262729673.py @@ -50,6 +50,7 @@ ], time=WidgetLegacyLiveSpan( live_span=WidgetLiveSpan.PAST_FIVE_MINUTES, + hide_incomplete_cost_data=True, ), type=TimeseriesWidgetDefinitionType.TIMESERIES, requests=[ diff --git a/src/datadog_api_client/v1/model/widget_legacy_live_span.py b/src/datadog_api_client/v1/model/widget_legacy_live_span.py index 1cbaa9da04..7ee26811a7 100644 --- a/src/datadog_api_client/v1/model/widget_legacy_live_span.py +++ b/src/datadog_api_client/v1/model/widget_legacy_live_span.py @@ -27,20 +27,32 @@ def openapi_types(_): from datadog_api_client.v1.model.widget_live_span import WidgetLiveSpan return { + "hide_incomplete_cost_data": (bool,), "live_span": (WidgetLiveSpan,), } attribute_map = { + "hide_incomplete_cost_data": "hide_incomplete_cost_data", "live_span": "live_span", } - def __init__(self_, live_span: Union[WidgetLiveSpan, UnsetType] = unset, **kwargs): + def __init__( + self_, + hide_incomplete_cost_data: Union[bool, UnsetType] = unset, + live_span: Union[WidgetLiveSpan, UnsetType] = unset, + **kwargs, + ): """ Wrapper for live span + :param hide_incomplete_cost_data: Whether to hide incomplete cost data in the widget. + :type hide_incomplete_cost_data: bool, optional + :param live_span: The available timeframes depend on the widget you are using. :type live_span: WidgetLiveSpan, optional """ + if hide_incomplete_cost_data is not unset: + kwargs["hide_incomplete_cost_data"] = hide_incomplete_cost_data if live_span is not unset: kwargs["live_span"] = live_span super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/model/widget_new_fixed_span.py b/src/datadog_api_client/v1/model/widget_new_fixed_span.py index 60dad6a0ab..9e70e66d78 100644 --- a/src/datadog_api_client/v1/model/widget_new_fixed_span.py +++ b/src/datadog_api_client/v1/model/widget_new_fixed_span.py @@ -3,11 +3,13 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import TYPE_CHECKING +from typing import Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, cached_property, + unset, + UnsetType, ) @@ -31,29 +33,43 @@ def openapi_types(_): return { "_from": (int,), + "hide_incomplete_cost_data": (bool,), "to": (int,), "type": (WidgetNewFixedSpanType,), } attribute_map = { "_from": "from", + "hide_incomplete_cost_data": "hide_incomplete_cost_data", "to": "to", "type": "type", } - def __init__(self_, _from: int, to: int, type: WidgetNewFixedSpanType, **kwargs): + def __init__( + self_, + _from: int, + to: int, + type: WidgetNewFixedSpanType, + hide_incomplete_cost_data: Union[bool, UnsetType] = unset, + **kwargs, + ): """ Used for fixed span times, such as 'March 1 to March 7'. :param _from: Start time in seconds since epoch. :type _from: int + :param hide_incomplete_cost_data: Whether to hide incomplete cost data in the widget. + :type hide_incomplete_cost_data: bool, optional + :param to: End time in seconds since epoch. :type to: int :param type: Type "fixed" denotes a fixed span. :type type: WidgetNewFixedSpanType """ + if hide_incomplete_cost_data is not unset: + kwargs["hide_incomplete_cost_data"] = hide_incomplete_cost_data super().__init__(kwargs) self_._from = _from diff --git a/src/datadog_api_client/v1/model/widget_new_live_span.py b/src/datadog_api_client/v1/model/widget_new_live_span.py index 19614e033a..665aa07685 100644 --- a/src/datadog_api_client/v1/model/widget_new_live_span.py +++ b/src/datadog_api_client/v1/model/widget_new_live_span.py @@ -3,11 +3,13 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import TYPE_CHECKING +from typing import Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, cached_property, + unset, + UnsetType, ) @@ -29,21 +31,33 @@ def openapi_types(_): from datadog_api_client.v1.model.widget_live_span_unit import WidgetLiveSpanUnit return { + "hide_incomplete_cost_data": (bool,), "type": (WidgetNewLiveSpanType,), "unit": (WidgetLiveSpanUnit,), "value": (int,), } attribute_map = { + "hide_incomplete_cost_data": "hide_incomplete_cost_data", "type": "type", "unit": "unit", "value": "value", } - def __init__(self_, type: WidgetNewLiveSpanType, unit: WidgetLiveSpanUnit, value: int, **kwargs): + def __init__( + self_, + type: WidgetNewLiveSpanType, + unit: WidgetLiveSpanUnit, + value: int, + hide_incomplete_cost_data: Union[bool, UnsetType] = unset, + **kwargs, + ): """ Used for arbitrary live span times, such as 17 minutes or 6 hours. + :param hide_incomplete_cost_data: Whether to hide incomplete cost data in the widget. + :type hide_incomplete_cost_data: bool, optional + :param type: Type "live" denotes a live span in the new format. :type type: WidgetNewLiveSpanType @@ -53,6 +67,8 @@ def __init__(self_, type: WidgetNewLiveSpanType, unit: WidgetLiveSpanUnit, value :param value: Value of the time span. :type value: int """ + if hide_incomplete_cost_data is not unset: + kwargs["hide_incomplete_cost_data"] = hide_incomplete_cost_data super().__init__(kwargs) self_.type = type diff --git a/src/datadog_api_client/v1/model/widget_time.py b/src/datadog_api_client/v1/model/widget_time.py index 9f2fdd14a7..77370a9d62 100644 --- a/src/datadog_api_client/v1/model/widget_time.py +++ b/src/datadog_api_client/v1/model/widget_time.py @@ -15,6 +15,9 @@ def __init__(self, **kwargs): """ Time setting for the widget. + :param hide_incomplete_cost_data: Whether to hide incomplete cost data in the widget. + :type hide_incomplete_cost_data: bool, optional + :param live_span: The available timeframes depend on the widget you are using. :type live_span: WidgetLiveSpan, optional diff --git a/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_legacy_live_span_time_format.frozen b/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_legacy_live_span_time_format.frozen index c8e222ab20..6cbda14f17 100644 --- a/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_legacy_live_span_time_format.frozen +++ b/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_legacy_live_span_time_format.frozen @@ -1 +1 @@ -2024-11-15T19:33:02.539Z \ No newline at end of file +2025-08-26T19:47:58.449Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_legacy_live_span_time_format.yaml b/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_legacy_live_span_time_format.yaml index 2d5b58e3b0..cc5b177719 100644 --- a/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_legacy_live_span_time_format.yaml +++ b/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_legacy_live_span_time_format.yaml @@ -1,7 +1,7 @@ interactions: - request: - body: '{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1731699182 - with legacy live span time","widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"live_span":"5m"},"title":"","type":"timeseries"}}]}' + body: '{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1756237678 + with legacy live span time","widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"hide_incomplete_cost_data":true,"live_span":"5m"},"title":"","type":"timeseries"}}]}' headers: accept: - application/json @@ -11,10 +11,9 @@ interactions: uri: https://api.datadoghq.com/api/v1/dashboard response: body: - string: '{"id":"3zr-n9a-dfd","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1731699182 - with legacy live span time","description":null,"author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/3zr-n9a-dfd/test-createanewtimeserieswidgetwithlegacylivespantimeformat-1731699182-with-lega","is_read_only":false,"template_variables":null,"widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"live_span":"5m"},"title":"","type":"timeseries"},"id":5376392318113781}],"notify_list":null,"created_at":"2024-11-15T19:33:02.697929+00:00","modified_at":"2024-11-15T19:33:02.697929+00:00","reflow_type":"auto","restricted_roles":[]} - - ' + string: '{"id":"wek-eci-qnn","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1756237678 + with legacy live span time","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"ordered","url":"/dashboard/wek-eci-qnn/test-createanewtimeserieswidgetwithlegacylivespantimeformat-1756237678-with-lega","template_variables":null,"widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"hide_incomplete_cost_data":true,"live_span":"5m"},"title":"","type":"timeseries"},"id":3088384387119347}],"notify_list":null,"created_at":"2025-08-26T19:47:58.616519+00:00","modified_at":"2025-08-26T19:47:58.616519+00:00","reflow_type":"auto","restricted_roles":[]}' headers: content-type: - application/json @@ -27,10 +26,10 @@ interactions: accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/dashboard/3zr-n9a-dfd + uri: https://api.datadoghq.com/api/v1/dashboard/wek-eci-qnn response: body: - string: '{"deleted_dashboard_id":"3zr-n9a-dfd"} + string: '{"deleted_dashboard_id":"wek-eci-qnn"} ' headers: diff --git a/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_new_fixed_span_time_format.frozen b/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_new_fixed_span_time_format.frozen index 740efedb27..954a958843 100644 --- a/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_new_fixed_span_time_format.frozen +++ b/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_new_fixed_span_time_format.frozen @@ -1 +1 @@ -2024-11-15T19:33:02.942Z \ No newline at end of file +2025-08-26T19:47:58.908Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_new_fixed_span_time_format.yaml b/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_new_fixed_span_time_format.yaml index 2102c31ff9..ed5f167351 100644 --- a/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_new_fixed_span_time_format.yaml +++ b/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_new_fixed_span_time_format.yaml @@ -1,7 +1,7 @@ interactions: - request: - body: '{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_new_fixed_span_time_format-1731699182 - with new fixed span time","widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"from":1712080128,"to":1712083128,"type":"fixed"},"title":"","type":"timeseries"}}]}' + body: '{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_new_fixed_span_time_format-1756237678 + with new fixed span time","widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"from":1712080128,"hide_incomplete_cost_data":true,"to":1712083128,"type":"fixed"},"title":"","type":"timeseries"}}]}' headers: accept: - application/json @@ -11,10 +11,9 @@ interactions: uri: https://api.datadoghq.com/api/v1/dashboard response: body: - string: '{"id":"xfq-c2m-cqi","title":"Test-Create_a_new_timeseries_widget_with_new_fixed_span_time_format-1731699182 - with new fixed span time","description":null,"author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/xfq-c2m-cqi/test-createanewtimeserieswidgetwithnewfixedspantimeformat-1731699182-with-new-fi","is_read_only":false,"template_variables":null,"widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"from":1712080128,"to":1712083128,"type":"fixed"},"title":"","type":"timeseries"},"id":7353899445937131}],"notify_list":null,"created_at":"2024-11-15T19:33:03.107998+00:00","modified_at":"2024-11-15T19:33:03.107998+00:00","reflow_type":"auto","restricted_roles":[]} - - ' + string: '{"id":"43b-7uw-9hv","title":"Test-Create_a_new_timeseries_widget_with_new_fixed_span_time_format-1756237678 + with new fixed span time","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"ordered","url":"/dashboard/43b-7uw-9hv/test-createanewtimeserieswidgetwithnewfixedspantimeformat-1756237678-with-new-fi","template_variables":null,"widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"from":1712080128,"hide_incomplete_cost_data":true,"to":1712083128,"type":"fixed"},"title":"","type":"timeseries"},"id":7908755715912813}],"notify_list":null,"created_at":"2025-08-26T19:47:59.063106+00:00","modified_at":"2025-08-26T19:47:59.063106+00:00","reflow_type":"auto","restricted_roles":[]}' headers: content-type: - application/json @@ -27,10 +26,10 @@ interactions: accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/dashboard/xfq-c2m-cqi + uri: https://api.datadoghq.com/api/v1/dashboard/43b-7uw-9hv response: body: - string: '{"deleted_dashboard_id":"xfq-c2m-cqi"} + string: '{"deleted_dashboard_id":"43b-7uw-9hv"} ' headers: diff --git a/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_new_live_span_time_format.frozen b/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_new_live_span_time_format.frozen index b05fa906e0..b4d5164c57 100644 --- a/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_new_live_span_time_format.frozen +++ b/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_new_live_span_time_format.frozen @@ -1 +1 @@ -2024-11-15T19:33:03.421Z \ No newline at end of file +2025-08-26T19:47:59.336Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_new_live_span_time_format.yaml b/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_new_live_span_time_format.yaml index c776347ec1..d16bef0441 100644 --- a/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_new_live_span_time_format.yaml +++ b/tests/v1/cassettes/test_scenarios/test_create_a_new_timeseries_widget_with_new_live_span_time_format.yaml @@ -1,7 +1,7 @@ interactions: - request: - body: '{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_new_live_span_time_format-1731699183 - with new live span time","widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"type":"live","unit":"minute","value":8},"title":"","type":"timeseries"}}]}' + body: '{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_new_live_span_time_format-1756237679 + with new live span time","widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"hide_incomplete_cost_data":true,"type":"live","unit":"minute","value":8},"title":"","type":"timeseries"}}]}' headers: accept: - application/json @@ -11,10 +11,9 @@ interactions: uri: https://api.datadoghq.com/api/v1/dashboard response: body: - string: '{"id":"vtq-7wk-ezs","title":"Test-Create_a_new_timeseries_widget_with_new_live_span_time_format-1731699183 - with new live span time","description":null,"author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/vtq-7wk-ezs/test-createanewtimeserieswidgetwithnewlivespantimeformat-1731699183-with-new-liv","is_read_only":false,"template_variables":null,"widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"type":"live","unit":"minute","value":8},"title":"","type":"timeseries"},"id":5791200763250393}],"notify_list":null,"created_at":"2024-11-15T19:33:03.610036+00:00","modified_at":"2024-11-15T19:33:03.610036+00:00","reflow_type":"auto","restricted_roles":[]} - - ' + string: '{"id":"gwt-rfa-qem","title":"Test-Create_a_new_timeseries_widget_with_new_live_span_time_format-1756237679 + with new live span time","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"ordered","url":"/dashboard/gwt-rfa-qem/test-createanewtimeserieswidgetwithnewlivespantimeformat-1756237679-with-new-liv","template_variables":null,"widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"hide_incomplete_cost_data":true,"type":"live","unit":"minute","value":8},"title":"","type":"timeseries"},"id":6382558947547501}],"notify_list":null,"created_at":"2025-08-26T19:47:59.501406+00:00","modified_at":"2025-08-26T19:47:59.501406+00:00","reflow_type":"auto","restricted_roles":[]}' headers: content-type: - application/json @@ -27,10 +26,10 @@ interactions: accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/dashboard/vtq-7wk-ezs + uri: https://api.datadoghq.com/api/v1/dashboard/gwt-rfa-qem response: body: - string: '{"deleted_dashboard_id":"vtq-7wk-ezs"} + string: '{"deleted_dashboard_id":"gwt-rfa-qem"} ' headers: diff --git a/tests/v1/features/dashboards.feature b/tests/v1/features/dashboards.feature index 47794c745f..f267082830 100644 --- a/tests/v1/features/dashboards.feature +++ b/tests/v1/features/dashboards.feature @@ -922,30 +922,33 @@ Feature: Dashboards @team:DataDog/dashboards-backend Scenario: Create a new timeseries widget with legacy live span time format Given new "CreateDashboard" request - And body with value {"title":"{{ unique }} with legacy live span time","widgets":[{"definition":{"title":"","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"time":{"live_span": "5m"},"type":"timeseries","requests":[{"formulas":[{"formula":"query1"}],"queries":[{"data_source":"ci_pipelines","name":"query1","search":{"query":"ci_level:job"},"indexes":["*"],"compute":{"aggregation":"count", "metric": "@ci.queue_time"},"group_by":[]}],"response_format":"timeseries","style":{"palette":"dog_classic","line_type":"solid","line_width":"normal"},"display_type":"line"}]}}],"layout_type":"ordered","reflow_type":"auto"} + And body with value {"title":"{{ unique }} with legacy live span time","widgets":[{"definition":{"title":"","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"time":{"live_span": "5m", "hide_incomplete_cost_data": true},"type":"timeseries","requests":[{"formulas":[{"formula":"query1"}],"queries":[{"data_source":"ci_pipelines","name":"query1","search":{"query":"ci_level:job"},"indexes":["*"],"compute":{"aggregation":"count", "metric": "@ci.queue_time"},"group_by":[]}],"response_format":"timeseries","style":{"palette":"dog_classic","line_type":"solid","line_width":"normal"},"display_type":"line"}]}}],"layout_type":"ordered","reflow_type":"auto"} When the request is sent Then the response status is 200 OK And the response "widgets[0].definition.time.live_span" is equal to "5m" + And the response "widgets[0].definition.time.hide_incomplete_cost_data" is equal to true @team:DataDog/dashboards-backend Scenario: Create a new timeseries widget with new fixed span time format Given new "CreateDashboard" request - And body with value {"title":"{{ unique }} with new fixed span time","widgets":[{"definition":{"title":"","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"time":{"type": "fixed", "from": 1712080128, "to": 1712083128},"type":"timeseries","requests":[{"formulas":[{"formula":"query1"}],"queries":[{"data_source":"ci_pipelines","name":"query1","search":{"query":"ci_level:job"},"indexes":["*"],"compute":{"aggregation":"count", "metric": "@ci.queue_time"},"group_by":[]}],"response_format":"timeseries","style":{"palette":"dog_classic","line_type":"solid","line_width":"normal"},"display_type":"line"}]}}],"layout_type":"ordered","reflow_type":"auto"} + And body with value {"title":"{{ unique }} with new fixed span time","widgets":[{"definition":{"title":"","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"time":{"type": "fixed", "from": 1712080128, "to": 1712083128, "hide_incomplete_cost_data": true},"type":"timeseries","requests":[{"formulas":[{"formula":"query1"}],"queries":[{"data_source":"ci_pipelines","name":"query1","search":{"query":"ci_level:job"},"indexes":["*"],"compute":{"aggregation":"count", "metric": "@ci.queue_time"},"group_by":[]}],"response_format":"timeseries","style":{"palette":"dog_classic","line_type":"solid","line_width":"normal"},"display_type":"line"}]}}],"layout_type":"ordered","reflow_type":"auto"} When the request is sent Then the response status is 200 OK And the response "widgets[0].definition.time.type" is equal to "fixed" And the response "widgets[0].definition.time.from" is equal to 1712080128 And the response "widgets[0].definition.time.to" is equal to 1712083128 + And the response "widgets[0].definition.time.hide_incomplete_cost_data" is equal to true @team:DataDog/dashboards-backend Scenario: Create a new timeseries widget with new live span time format Given new "CreateDashboard" request - And body with value {"title":"{{ unique }} with new live span time","widgets":[{"definition":{"title":"","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"time":{"type": "live", "unit": "minute", "value": 8},"type":"timeseries","requests":[{"formulas":[{"formula":"query1"}],"queries":[{"data_source":"ci_pipelines","name":"query1","search":{"query":"ci_level:job"},"indexes":["*"],"compute":{"aggregation":"count", "metric": "@ci.queue_time"},"group_by":[]}],"response_format":"timeseries","style":{"palette":"dog_classic","line_type":"solid","line_width":"normal"},"display_type":"line"}]}}],"layout_type":"ordered","reflow_type":"auto"} + And body with value {"title":"{{ unique }} with new live span time","widgets":[{"definition":{"title":"","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"time":{"type": "live", "unit": "minute", "value": 8, "hide_incomplete_cost_data": true},"type":"timeseries","requests":[{"formulas":[{"formula":"query1"}],"queries":[{"data_source":"ci_pipelines","name":"query1","search":{"query":"ci_level:job"},"indexes":["*"],"compute":{"aggregation":"count", "metric": "@ci.queue_time"},"group_by":[]}],"response_format":"timeseries","style":{"palette":"dog_classic","line_type":"solid","line_width":"normal"},"display_type":"line"}]}}],"layout_type":"ordered","reflow_type":"auto"} When the request is sent Then the response status is 200 OK And the response "widgets[0].definition.time.type" is equal to "live" And the response "widgets[0].definition.time.unit" is equal to "minute" And the response "widgets[0].definition.time.value" is equal to 8 + And the response "widgets[0].definition.time.hide_incomplete_cost_data" is equal to true @generated @skip @team:DataDog/reporting-and-sharing Scenario: Create a shared dashboard returns "Bad Request" response