-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit 9ca8c274 of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Sep 8, 2022
1 parent
df4373d
commit 9838ab9
Showing
12 changed files
with
1,089 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
} |
Oops, something went wrong.