Skip to content
Closed
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": "2023-12-18 13:46:55.405175",
"spec_repo_commit": "f363f7b4"
"regenerated": "2023-12-20 17:24:13.304704",
"spec_repo_commit": "0b5e5217"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2023-12-18 13:46:55.420378",
"spec_repo_commit": "f363f7b4"
"regenerated": "2023-12-20 17:24:13.318683",
"spec_repo_commit": "0b5e5217"
}
}
}
8 changes: 8 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1758,10 +1758,17 @@ components:
q:
description: Widget query.
type: string
queries:
description: List of queries that can be returned directly or used in formulas.
items:
$ref: '#/components/schemas/FormulaAndFunctionQueryDefinition'
type: array
query:
$ref: '#/components/schemas/DistributionWidgetHistogramRequestQuery'
request_type:
$ref: '#/components/schemas/DistributionWidgetHistogramRequestType'
response_format:
$ref: '#/components/schemas/FormulaAndFunctionResponseFormat'
rum_query:
$ref: '#/components/schemas/LogQueryDefinition'
security_query:
Expand Down Expand Up @@ -12741,6 +12748,7 @@ components:
description: The original widget we are splitting on.
oneOf:
- $ref: '#/components/schemas/ChangeWidgetDefinition'
- $ref: '#/components/schemas/DistributionWidgetDefinition'
- $ref: '#/components/schemas/GeomapWidgetDefinition'
- $ref: '#/components/schemas/QueryValueWidgetDefinition'
- $ref: '#/components/schemas/ScatterPlotWidgetDefinition'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2023-12-20T16:36:08.156Z

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

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023-09-14T14:04:40.364Z
2023-12-20T16:36:07.022Z

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

75 changes: 75 additions & 0 deletions examples/v1/dashboards/CreateDashboard_2888440510.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Create a new dashboard with split graph widget from distribution widget

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

body = DatadogAPIClient::V1::Dashboard.new({
title: "Example-Dashboard",
description: "",
widgets: [
DatadogAPIClient::V1::Widget.new({
layout: DatadogAPIClient::V1::WidgetLayout.new({
x: 0,
y: 0,
width: 12,
height: 8,
}),
definition: DatadogAPIClient::V1::SplitGraphWidgetDefinition.new({
title: "",
type: DatadogAPIClient::V1::SplitGraphWidgetDefinitionType::SPLIT_GROUP,
source_widget_definition: DatadogAPIClient::V1::DistributionWidgetDefinition.new({
title: "",
title_size: "16",
title_align: DatadogAPIClient::V1::WidgetTextAlign::LEFT,
type: DatadogAPIClient::V1::DistributionWidgetDefinitionType::DISTRIBUTION,
requests: [
DatadogAPIClient::V1::DistributionWidgetRequest.new({
response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::SCALAR,
queries: [
DatadogAPIClient::V1::FormulaAndFunctionMetricQueryDefinition.new({
data_source: DatadogAPIClient::V1::FormulaAndFunctionMetricDataSource::METRICS,
name: "query1",
query: "avg:system.cpu.user{*} by {service}",
aggregator: DatadogAPIClient::V1::FormulaAndFunctionMetricAggregation::AVG,
}),
],
}),
],
xaxis: DatadogAPIClient::V1::DistributionWidgetXAxis.new({
scale: "linear",
include_zero: true,
min: "auto",
max: "auto",
}),
yaxis: DatadogAPIClient::V1::DistributionWidgetYAxis.new({
scale: "linear",
include_zero: true,
min: "auto",
max: "auto",
}),
}),
split_config: DatadogAPIClient::V1::SplitConfig.new({
split_dimensions: [
DatadogAPIClient::V1::SplitDimension.new({
one_graph_per: "service",
}),
],
limit: 6,
sort: DatadogAPIClient::V1::SplitSort.new({
compute: DatadogAPIClient::V1::SplitConfigSortCompute.new({
aggregation: "sum",
metric: "system.cpu.user",
}),
order: DatadogAPIClient::V1::WidgetSort::DESCENDING,
}),
}),
size: DatadogAPIClient::V1::SplitGraphVizSize::MD,
}),
}),
],
template_variables: [],
layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED,
is_read_only: false,
notify_list: [],
})
p api_instance.create_dashboard(body)
27 changes: 27 additions & 0 deletions features/v1/dashboards.feature
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,33 @@ Feature: Dashboards
And the response "widgets[0].definition.size" is equal to "md"
And the response "widgets[0].definition.has_uniform_y_axes" is equal to true

@team:DataDog/dashboards-backend
Scenario: Create a new dashboard with split graph widget from distribution widget
Given new "CreateDashboard" request
And body from file "dashboards_json_payload/split_graph_widget_distribution.json"
When the request is sent
Then the response status is 200 OK
And the response "widgets[0].definition.type" is equal to "split_group"
And the response "widgets[0].definition.source_widget_definition.type" is equal to "distribution"
And the response "widgets[0].definition.source_widget_definition.requests[0].response_format" is equal to "scalar"
And the response "widgets[0].definition.source_widget_definition.requests[0].queries[0].data_source" is equal to "metrics"
And the response "widgets[0].definition.source_widget_definition.requests[0].queries[0].aggregator" is equal to "avg"
And the response "widgets[0].definition.source_widget_definition.requests[0].queries[0].query" is equal to "avg:system.cpu.user{*} by {service}"
And the response "widgets[0].definition.source_widget_definition.xaxis.scale" is equal to "linear"
And the response "widgets[0].definition.source_widget_definition.xaxis.include_zero" is equal to true
And the response "widgets[0].definition.source_widget_definition.xaxis.min" is equal to "auto"
And the response "widgets[0].definition.source_widget_definition.xaxis.max" is equal to "auto"
And the response "widgets[0].definition.source_widget_definition.yaxis.scale" is equal to "linear"
And the response "widgets[0].definition.source_widget_definition.yaxis.include_zero" is equal to true
And the response "widgets[0].definition.source_widget_definition.yaxis.min" is equal to "auto"
And the response "widgets[0].definition.source_widget_definition.yaxis.max" is equal to "auto"
And the response "widgets[0].definition.split_config.split_dimensions[0].one_graph_per" is equal to "service"
And the response "widgets[0].definition.split_config.limit" is equal to 6
And the response "widgets[0].definition.split_config.sort.compute.aggregation" is equal to "sum"
And the response "widgets[0].definition.split_config.sort.compute.metric" is equal to "system.cpu.user"
And the response "widgets[0].definition.split_config.sort.order" is equal to "desc"
And the response "widgets[0].definition.size" is equal to "md"

@team:DataDog/dashboards-backend
Scenario: Create a new dashboard with sunburst widget and metrics data
Given new "CreateDashboard" request
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"title":"{{ unique }}",
"description":"",
"widgets":[
{
"layout":{
"x":0,
"y":0,
"width":12,
"height":8
},
"definition":{
"title": "",
"type": "split_group",
"source_widget_definition": {
"title": "",
"title_size": "16",
"title_align": "left",
"type": "distribution",
"requests": [
{
"response_format": "scalar",
"queries": [
{
"data_source": "metrics",
"name": "query1",
"query": "avg:system.cpu.user{*} by {service}",
"aggregator": "avg"
}
]
}
],
"xaxis": {"scale": "linear", "include_zero": true, "min": "auto", "max": "auto"},
"yaxis": {"scale": "linear", "include_zero": true, "min": "auto", "max": "auto"}
},
"split_config": {
"split_dimensions":[{"one_graph_per": "service"}],
"limit": 6,
"sort": {"compute": {"aggregation": "sum", "metric": "system.cpu.user"}, "order": "desc"}
},
"size": "md"
}
}
],
"template_variables":[],
"layout_type":"ordered",
"is_read_only":false,
"notify_list":[]
}
Loading