Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-09-30 13:56:52.203086",
"spec_repo_commit": "eb66b1cf"
"regenerated": "2024-09-30 14:37:35.409603",
"spec_repo_commit": "60bc9127"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-09-30 13:56:52.217359",
"spec_repo_commit": "eb66b1cf"
"regenerated": "2024-09-30 14:37:35.426476",
"spec_repo_commit": "60bc9127"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2024-09-24T19:19:31.807Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions examples/v1/dashboards/CreateDashboard_1433408735.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Clients deserialize a dashboard with a empty time object

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::DashboardsAPI.new

body = DatadogAPIClient::V1::Dashboard.new({
title: "Example-Dashboard",
widgets: [
DatadogAPIClient::V1::Widget.new({
definition: DatadogAPIClient::V1::TimeseriesWidgetDefinition.new({
title: "Example Cloud Cost Query",
title_size: "16",
title_align: DatadogAPIClient::V1::WidgetTextAlign::LEFT,
type: DatadogAPIClient::V1::TimeseriesWidgetDefinitionType::TIMESERIES,
requests: [
DatadogAPIClient::V1::TimeseriesWidgetRequest.new({
formulas: [
DatadogAPIClient::V1::WidgetFormula.new({
formula: "query1",
}),
],
queries: [
DatadogAPIClient::V1::FormulaAndFunctionCloudCostQueryDefinition.new({
data_source: DatadogAPIClient::V1::FormulaAndFunctionCloudCostDataSource::CLOUD_COST,
name: "query1",
query: "sum:aws.cost.amortized{*} by {aws_product}.rollup(sum, monthly)",
}),
],
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::BARS,
}),
],
time: DatadogAPIClient::V1::WidgetLegacyLiveSpan.new({}),
}),
}),
],
layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED,
})
p api_instance.create_dashboard(body)
8 changes: 8 additions & 0 deletions features/v1/dashboards.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ Feature: Dashboards
And a valid "appKeyAuth" key in the system
And an instance of "Dashboards" API

@replay-only @team:DataDog/dashboards-backend
Scenario: Clients deserialize a dashboard with a empty time object
Given new "CreateDashboard" request
And body with value { "title": "{{ unique }}", "widgets": [ { "definition": { "title": "Example Cloud Cost Query", "title_size": "16", "title_align": "left", "type": "timeseries", "requests": [ { "formulas": [ { "formula": "query1" } ], "queries": [ { "data_source": "cloud_cost", "name": "query1", "query": "sum:aws.cost.amortized{*} by {aws_product}.rollup(sum, monthly)" } ], "response_format": "timeseries", "style": { "palette": "dog_classic", "line_type": "solid", "line_width": "normal" }, "display_type": "bars" } ], "time": {} } } ], "layout_type": "ordered" }
When the request is sent
Then the response status is 200 OK
And the response "widgets[0].definition.time" is equal to {}

@team:DataDog/dashboards-backend
Scenario: Create a distribution widget using a histogram request containing a formulas and functions APM Stats query
Given new "CreateDashboard" request
Expand Down