From 1ef19486228c7165017543e4c001b42aaf7e53e3 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 19 Sep 2025 15:02:20 +0000 Subject: [PATCH] Regenerate client from commit 45ffc19 of spec repo --- .generator/schemas/v1/openapi.yaml | 2 + ...-with-product-analytics-data-source.frozen | 1 + ...get-with-product-analytics-data-source.yml | 47 ++++++++++++++ .../dashboards/CreateDashboard_607525069.rb | 61 +++++++++++++++++++ features/v1/dashboards.feature | 9 +++ ...formula_and_function_events_data_source.rb | 1 + 6 files changed, 121 insertions(+) create mode 100644 cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-product-analytics-data-source.frozen create mode 100644 cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-product-analytics-data-source.yml create mode 100644 examples/v1/dashboards/CreateDashboard_607525069.rb diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index a1335722ca47..dc6c8110eef5 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -2875,6 +2875,7 @@ components: - ci_tests - ci_pipelines - incident_analytics + - product_analytics example: logs type: string x-enum-varnames: @@ -2889,6 +2890,7 @@ components: - CI_TESTS - CI_PIPELINES - INCIDENT_ANALYTICS + - PRODUCT_ANALYTICS FormulaAndFunctionMetricAggregation: description: The aggregation methods available for metrics queries. enum: diff --git a/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-product-analytics-data-source.frozen b/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-product-analytics-data-source.frozen new file mode 100644 index 000000000000..ccf84dbc10c7 --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-product-analytics-data-source.frozen @@ -0,0 +1 @@ +2025-09-18T18:51:17.951Z \ No newline at end of file diff --git a/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-product-analytics-data-source.yml b/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-product-analytics-data-source.yml new file mode 100644 index 000000000000..3d19d147cd4d --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-product-analytics-data-source.yml @@ -0,0 +1,47 @@ +http_interactions: +- recorded_at: Thu, 18 Sep 2025 18:51:17 GMT + request: + body: + encoding: UTF-8 + string: '{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_product_analytics_data_source-1758221477 + with product_analytics datasource","widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count"},"data_source":"product_analytics","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"test_level:test"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{},"title":"","type":"timeseries"}}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/dashboard + response: + body: + encoding: UTF-8 + string: '{"id":"zvr-td5-ppm","title":"Test-Create_a_new_timeseries_widget_with_product_analytics_data_source-1758221477 + with product_analytics datasource","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"ordered","url":"/dashboard/zvr-td5-ppm/test-createanewtimeserieswidgetwithproductanalyticsdatasource-1758221477-with-pr","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"},"data_source":"product_analytics","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"test_level:test"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{},"title":"","type":"timeseries"},"id":6058978575853641}],"notify_list":null,"created_at":"2025-09-18T18:51:18.107135+00:00","modified_at":"2025-09-18T18:51:18.107135+00:00","reflow_type":"auto","restricted_roles":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Thu, 18 Sep 2025 18:51:17 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/dashboard/zvr-td5-ppm + response: + body: + encoding: UTF-8 + string: '{"deleted_dashboard_id":"zvr-td5-ppm"} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v1/dashboards/CreateDashboard_607525069.rb b/examples/v1/dashboards/CreateDashboard_607525069.rb new file mode 100644 index 000000000000..326ef5713d9c --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_607525069.rb @@ -0,0 +1,61 @@ +# Create a new timeseries widget with product_analytics data source + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::DashboardsAPI.new + +body = DatadogAPIClient::V1::Dashboard.new({ + title: "Example-Dashboard with product_analytics datasource", + widgets: [ + DatadogAPIClient::V1::Widget.new({ + definition: DatadogAPIClient::V1::TimeseriesWidgetDefinition.new({ + title: "", + show_legend: true, + legend_layout: DatadogAPIClient::V1::TimeseriesWidgetLegendLayout::AUTO, + legend_columns: [ + DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::AVG, + DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::MIN, + DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::MAX, + DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::VALUE, + DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::SUM, + ], + time: DatadogAPIClient::V1::WidgetLegacyLiveSpan.new({}), + type: DatadogAPIClient::V1::TimeseriesWidgetDefinitionType::TIMESERIES, + requests: [ + DatadogAPIClient::V1::TimeseriesWidgetRequest.new({ + formulas: [ + DatadogAPIClient::V1::WidgetFormula.new({ + formula: "query1", + }), + ], + queries: [ + DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinition.new({ + data_source: DatadogAPIClient::V1::FormulaAndFunctionEventsDataSource::PRODUCT_ANALYTICS, + name: "query1", + search: DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinitionSearch.new({ + query: "test_level:test", + }), + indexes: [ + "*", + ], + compute: DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinitionCompute.new({ + aggregation: DatadogAPIClient::V1::FormulaAndFunctionEventAggregation::COUNT, + }), + group_by: [], + }), + ], + response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::TIMESERIES, + style: DatadogAPIClient::V1::WidgetRequestStyle.new({ + palette: "dog_classic", + line_type: DatadogAPIClient::V1::WidgetLineType::SOLID, + line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL, + }), + display_type: DatadogAPIClient::V1::WidgetDisplayType::LINE, + }), + ], + }), + }), + ], + layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED, + reflow_type: DatadogAPIClient::V1::DashboardReflowType::AUTO, +}) +p api_instance.create_dashboard(body) diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index f267082830d0..0d161522e954 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -950,6 +950,15 @@ Feature: Dashboards 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 + @team:DataDog/dashboards-backend + Scenario: Create a new timeseries widget with product_analytics data source + Given new "CreateDashboard" request + And body with value {"title":"{{ unique }} with product_analytics datasource","widgets":[{"definition":{"title":"","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"time":{},"type":"timeseries","requests":[{"formulas":[{"formula":"query1"}],"queries":[{"data_source":"product_analytics","name":"query1","search":{"query":"test_level:test"},"indexes":["*"],"compute":{"aggregation":"count"},"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.requests[0].queries[0].data_source" is equal to "product_analytics" + And the response "widgets[0].definition.requests[0].queries[0].search.query" is equal to "test_level:test" + @generated @skip @team:DataDog/reporting-and-sharing Scenario: Create a shared dashboard returns "Bad Request" response Given new "CreatePublicDashboard" request diff --git a/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb b/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb index a41c6958ae81..b72449f80968 100644 --- a/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb +++ b/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb @@ -32,5 +32,6 @@ class FormulaAndFunctionEventsDataSource CI_TESTS = "ci_tests".freeze CI_PIPELINES = "ci_pipelines".freeze INCIDENT_ANALYTICS = "incident_analytics".freeze + PRODUCT_ANALYTICS = "product_analytics".freeze end end