Skip to content
Open
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
20 changes: 16 additions & 4 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18843,7 +18843,7 @@ components:
$ref: "#/components/schemas/WidgetCustomLink"
type: array
requests:
description: One or more Topology requests.
description: One Topology request.
items:
$ref: "#/components/schemas/TopologyRequest"
minItems: 1
Expand Down Expand Up @@ -18872,10 +18872,14 @@ components:
x-enum-varnames:
- TOPOLOGY_MAP
TopologyQuery:
description: A topology data source query.
oneOf:
- $ref: "#/components/schemas/TopologyQueryDataStreamsOrServiceMap"
TopologyQueryDataStreamsOrServiceMap:
description: Query to service-based topology data sources like the service map or data streams.
properties:
data_source:
$ref: "#/components/schemas/TopologyQueryDataSource"
$ref: "#/components/schemas/TopologyQueryDataStreamsOrServiceMapDataSource"
filters:
description: Your environment and primary tag (or * if enabled for your account).
example: ["env:prod", "az:us-east"]
Expand All @@ -18884,16 +18888,24 @@ components:
type: string
minItems: 1
type: array
query_string:
description: A search string for filtering services, used in `data_streams` queries only. When set, this replaces the `service` field
example: "service:myservice"
type: string
service:
description: Name of the service
example: myService
example: myservice
type: string
required:
- data_source
- filters
type: object
TopologyQueryDataSource:
TopologyQueryDataStreamsOrServiceMapDataSource:
description: Name of the data source
enum:
- data_streams
- service_map
example: data_streams
type: string
x-enum-varnames:
- DATA_STREAMS
Expand Down
4 changes: 1 addition & 3 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56896,7 +56896,7 @@ components:
$ref: "#/components/schemas/SecurityMonitoringCriticalAsset"
type: object
SecurityMonitoringCriticalAssetSeverity:
description: Severity associated with this critical asset. Either an explicit severity can be set, or the severity can be increased or decreased, or the severity can be left unchanged (no-op).
description: Severity associated with this critical asset. Either an explicit severity can be set, or the severity can be increased or decreased.
enum:
- info
- low
Expand All @@ -56905,7 +56905,6 @@ components:
- critical
- increase
- decrease
- no-op
example: increase
type: string
x-enum-varnames:
Expand All @@ -56916,7 +56915,6 @@ components:
- CRITICAL
- INCREASE
- DECREASE
- NO_OP
SecurityMonitoringCriticalAssetType:
default: critical_assets
description: The type of the resource. The value should always be `critical_assets`.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-03-20T18:16:51.929Z

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

4 changes: 2 additions & 2 deletions examples/v1/dashboards/CreateDashboard_2652180930.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
requests: [
DatadogAPIClient::V1::TopologyRequest.new({
request_type: DatadogAPIClient::V1::TopologyRequestType::TOPOLOGY,
query: DatadogAPIClient::V1::TopologyQuery.new({
data_source: DatadogAPIClient::V1::TopologyQueryDataSource::SERVICE_MAP,
query: DatadogAPIClient::V1::TopologyQueryDataStreamsOrServiceMap.new({
data_source: DatadogAPIClient::V1::TopologyQueryDataStreamsOrServiceMapDataSource::SERVICE_MAP,
service: "",
filters: [
"env:none",
Expand Down
42 changes: 42 additions & 0 deletions examples/v1/dashboards/CreateDashboard_2815497946.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Create a new dashboard with topology_map data_streams 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: 47,
height: 15,
}),
definition: DatadogAPIClient::V1::TopologyMapWidgetDefinition.new({
title: "",
title_size: "16",
title_align: DatadogAPIClient::V1::WidgetTextAlign::LEFT,
type: DatadogAPIClient::V1::TopologyMapWidgetDefinitionType::TOPOLOGY_MAP,
requests: [
DatadogAPIClient::V1::TopologyRequest.new({
request_type: DatadogAPIClient::V1::TopologyRequestType::TOPOLOGY,
query: DatadogAPIClient::V1::TopologyQueryDataStreamsOrServiceMap.new({
data_source: DatadogAPIClient::V1::TopologyQueryDataStreamsOrServiceMapDataSource::DATA_STREAMS,
service: "",
filters: [
"env:prod",
],
query_string: "service:myservice",
}),
}),
],
}),
}),
],
template_variables: [],
layout_type: DatadogAPIClient::V1::DashboardLayoutType::FREE,
notify_list: [],
})
p api_instance.create_dashboard(body)
13 changes: 13 additions & 0 deletions features/v1/dashboards.feature
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,19 @@ Feature: Dashboards
And the response "widgets[0].definition.requests[0].sort.order_by[0].type" is equal to "formula"
And the response "widgets[0].definition.requests[0].sort.order_by[0].index" is equal to 0

@team:DataDog/dashboards-backend
Scenario: Create a new dashboard with topology_map data_streams widget
Given new "CreateDashboard" request
And body from file "dashboards_json_payload/topology_map_widget_data_streams.json"
When the request is sent
Then the response status is 200 OK
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"

@team:DataDog/dashboards-backend
Scenario: Create a new dashboard with topology_map widget
Given new "CreateDashboard" request
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"title": "{{ unique }}",
"description": "",
"widgets": [
{
"layout": {
"x": 0,
"y": 0,
"width": 47,
"height": 15
},
"definition": {
"title": "",
"title_size": "16",
"title_align": "left",
"type": "topology_map",
"requests": [
{
"request_type": "topology",
"query": {
"data_source": "data_streams",
"service": "",
"filters": ["env:prod"],
"query_string": "service:myservice"
}
}
]
}
}
],
"template_variables": [],
"layout_type": "free",
"notify_list": []
}
3 changes: 2 additions & 1 deletion lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,8 @@ def overrides
"v1.topology_map_widget_definition" => "TopologyMapWidgetDefinition",
"v1.topology_map_widget_definition_type" => "TopologyMapWidgetDefinitionType",
"v1.topology_query" => "TopologyQuery",
"v1.topology_query_data_source" => "TopologyQueryDataSource",
"v1.topology_query_data_streams_or_service_map" => "TopologyQueryDataStreamsOrServiceMap",
"v1.topology_query_data_streams_or_service_map_data_source" => "TopologyQueryDataStreamsOrServiceMapDataSource",
"v1.topology_request" => "TopologyRequest",
"v1.topology_request_type" => "TopologyRequestType",
"v1.tree_map_color_by" => "TreeMapColorBy",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TopologyMapWidgetDefinition
# List of custom links.
attr_accessor :custom_links

# One or more Topology requests.
# One Topology request.
attr_reader :requests

# Title of your widget.
Expand Down
Loading
Loading