Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TopologyMapWidget to dashboard schema #1487

Merged
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.4",
"regenerated": "2022-09-09 15:07:30.419474",
"spec_repo_commit": "0bdea812"
"regenerated": "2022-09-12 15:21:58.844978",
"spec_repo_commit": "dcd92077"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2022-09-09 15:07:30.431613",
"spec_repo_commit": "0bdea812"
"regenerated": "2022-09-12 15:21:58.858643",
"spec_repo_commit": "dcd92077"
}
}
}
86 changes: 86 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13380,6 +13380,91 @@ components:
style:
$ref: '#/components/schemas/WidgetRequestStyle'
type: object
TopologyMapWidgetDefinition:
description: This widget displays a topology of nodes and edges for different
data sources. It replaces the service map widget.
properties:
custom_links:
description: List of custom links.
items:
$ref: '#/components/schemas/WidgetCustomLink'
type: array
requests:
description: One or more Topology requests.
items:
$ref: '#/components/schemas/TopologyRequest'
minItems: 1
type: array
title:
description: Title of your widget.
type: string
title_align:
$ref: '#/components/schemas/WidgetTextAlign'
title_size:
description: Size of the title.
type: string
type:
$ref: '#/components/schemas/TopologyMapWidgetDefinitionType'
required:
- type
- requests
type: object
TopologyMapWidgetDefinitionType:
default: topology_map
description: Type of the topology map widget.
enum:
- topology_map
example: topology_map
type: string
x-enum-varnames:
- TOPOLOGY_MAP
TopologyQuery:
description: Query to service-based topology data sources like the service map
or data streams.
properties:
data_source:
$ref: '#/components/schemas/TopologyQueryDataSource'
filters:
description: Your environment and primary tag (or * if enabled for your
account).
example:
- env:prod
- az:us-east
items:
description: Environment or primary tag, generally in a key:value format
type: string
minItems: 1
type: array
service:
description: Name of the service
example: myService
type: string
type: object
TopologyQueryDataSource:
description: Name of the data source
enum:
- data_streams
- service_map
type: string
x-enum-varnames:
- DATA_STREAMS
- SERVICE_MAP
TopologyRequest:
description: Request that will return nodes and edges to be used by topology
map.
properties:
query:
$ref: '#/components/schemas/TopologyQuery'
request_type:
$ref: '#/components/schemas/TopologyRequestType'
type: object
TopologyRequestType:
description: Widget request type.
enum:
- topology
type: string
x-enum-varnames:
- TOPOLOGY
TreeMapColorBy:
default: user
deprecated: true
Expand Down Expand Up @@ -16916,6 +17001,7 @@ components:
- $ref: '#/components/schemas/TreeMapWidgetDefinition'
- $ref: '#/components/schemas/ListStreamWidgetDefinition'
- $ref: '#/components/schemas/FunnelWidgetDefinition'
- $ref: '#/components/schemas/TopologyMapWidgetDefinition'
type: object
WidgetDisplayType:
description: Type of display to use for the request.
Expand Down
67 changes: 67 additions & 0 deletions examples/v1/dashboards/CreateDashboard_2652180930.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Create a new dashboard with topology_map widget

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.DashboardsApi;
import com.datadog.api.client.v1.model.Dashboard;
import com.datadog.api.client.v1.model.DashboardLayoutType;
import com.datadog.api.client.v1.model.TopologyMapWidgetDefinition;
import com.datadog.api.client.v1.model.TopologyMapWidgetDefinitionType;
import com.datadog.api.client.v1.model.TopologyQuery;
import com.datadog.api.client.v1.model.TopologyQueryDataSource;
import com.datadog.api.client.v1.model.TopologyRequest;
import com.datadog.api.client.v1.model.TopologyRequestType;
import com.datadog.api.client.v1.model.Widget;
import com.datadog.api.client.v1.model.WidgetDefinition;
import com.datadog.api.client.v1.model.WidgetLayout;
import com.datadog.api.client.v1.model.WidgetTextAlign;
import java.util.Arrays;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
DashboardsApi apiInstance = new DashboardsApi(defaultClient);

Dashboard body =
new Dashboard()
.title("Example-Create_a_new_dashboard_with_topology_map_widget")
.description("")
.widgets(
Collections.singletonList(
new Widget()
.layout(new WidgetLayout().x(0L).y(0L).width(47L).height(15L))
.definition(
new WidgetDefinition(
new TopologyMapWidgetDefinition()
.title("")
.titleSize("16")
.titleAlign(WidgetTextAlign.LEFT)
.type(TopologyMapWidgetDefinitionType.TOPOLOGY_MAP)
.requests(
Collections.singletonList(
new TopologyRequest()
.requestType(TopologyRequestType.TOPOLOGY)
.query(
new TopologyQuery()
.dataSource(
TopologyQueryDataSource.SERVICE_MAP)
.service("")
.filters(
Arrays.asList(
"env:none", "environment:*")))))))))
.layoutType(DashboardLayoutType.FREE)
.isReadOnly(false);

try {
Dashboard result = apiInstance.createDashboard(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DashboardsApi#createDashboard");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Loading