-
Notifications
You must be signed in to change notification settings - Fork 38
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 b987a775 of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Jun 21, 2023
1 parent
cdbd4d2
commit 0392477
Showing
9 changed files
with
190 additions
and
14 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,98 @@ | ||
""" | ||
Create a geomap widget using an event_list request | ||
""" | ||
|
||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v1.api.dashboards_api import DashboardsApi | ||
from datadog_api_client.v1.model.dashboard import Dashboard | ||
from datadog_api_client.v1.model.dashboard_layout_type import DashboardLayoutType | ||
from datadog_api_client.v1.model.dashboard_reflow_type import DashboardReflowType | ||
from datadog_api_client.v1.model.formula_and_function_response_format import FormulaAndFunctionResponseFormat | ||
from datadog_api_client.v1.model.geomap_widget_definition import GeomapWidgetDefinition | ||
from datadog_api_client.v1.model.geomap_widget_definition_style import GeomapWidgetDefinitionStyle | ||
from datadog_api_client.v1.model.geomap_widget_definition_type import GeomapWidgetDefinitionType | ||
from datadog_api_client.v1.model.geomap_widget_definition_view import GeomapWidgetDefinitionView | ||
from datadog_api_client.v1.model.geomap_widget_request import GeomapWidgetRequest | ||
from datadog_api_client.v1.model.list_stream_column import ListStreamColumn | ||
from datadog_api_client.v1.model.list_stream_column_width import ListStreamColumnWidth | ||
from datadog_api_client.v1.model.list_stream_query import ListStreamQuery | ||
from datadog_api_client.v1.model.list_stream_source import ListStreamSource | ||
from datadog_api_client.v1.model.widget import Widget | ||
from datadog_api_client.v1.model.widget_layout import WidgetLayout | ||
from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign | ||
|
||
body = Dashboard( | ||
title="Example-Dashboard", | ||
description="Example-Dashboard", | ||
widgets=[ | ||
Widget( | ||
definition=GeomapWidgetDefinition( | ||
title="", | ||
title_size="16", | ||
title_align=WidgetTextAlign.LEFT, | ||
type=GeomapWidgetDefinitionType.GEOMAP, | ||
requests=[ | ||
GeomapWidgetRequest( | ||
response_format=FormulaAndFunctionResponseFormat.EVENT_LIST, | ||
query=ListStreamQuery( | ||
data_source=ListStreamSource.LOGS_STREAM, | ||
query_string="", | ||
indexes=[], | ||
), | ||
columns=[ | ||
ListStreamColumn( | ||
field="@network.client.geoip.location.latitude", | ||
width=ListStreamColumnWidth.AUTO, | ||
), | ||
ListStreamColumn( | ||
field="@network.client.geoip.location.longitude", | ||
width=ListStreamColumnWidth.AUTO, | ||
), | ||
ListStreamColumn( | ||
field="@network.client.geoip.country.iso_code", | ||
width=ListStreamColumnWidth.AUTO, | ||
), | ||
ListStreamColumn( | ||
field="@network.client.geoip.subdivision.name", | ||
width=ListStreamColumnWidth.AUTO, | ||
), | ||
ListStreamColumn( | ||
field="classic", | ||
width=ListStreamColumnWidth.AUTO, | ||
), | ||
ListStreamColumn( | ||
field="", | ||
width=ListStreamColumnWidth.AUTO, | ||
), | ||
], | ||
), | ||
], | ||
style=GeomapWidgetDefinitionStyle( | ||
palette="hostmap_blues", | ||
palette_flip=False, | ||
), | ||
view=GeomapWidgetDefinitionView( | ||
focus="WORLD", | ||
), | ||
), | ||
layout=WidgetLayout( | ||
x=0, | ||
y=0, | ||
width=12, | ||
height=6, | ||
), | ||
), | ||
], | ||
template_variables=[], | ||
layout_type=DashboardLayoutType.ORDERED, | ||
notify_list=[], | ||
reflow_type=DashboardReflowType.FIXED, | ||
tags=[], | ||
) | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = DashboardsApi(api_client) | ||
response = api_instance.create_dashboard(body=body) | ||
|
||
print(response) |
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
1 change: 1 addition & 0 deletions
1
...1/cassettes/test_scenarios/test_create_a_geomap_widget_using_an_event_list_request.frozen
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 @@ | ||
2023-06-21T19:29:03.584Z |
40 changes: 40 additions & 0 deletions
40
.../v1/cassettes/test_scenarios/test_create_a_geomap_widget_using_an_event_list_request.yaml
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,40 @@ | ||
interactions: | ||
- request: | ||
body: '{"description":"Test-Create_a_geomap_widget_using_an_event_list_request-1687375743","layout_type":"ordered","notify_list":[],"reflow_type":"fixed","tags":[],"template_variables":[],"title":"Test-Create_a_geomap_widget_using_an_event_list_request-1687375743","widgets":[{"definition":{"requests":[{"columns":[{"field":"@network.client.geoip.location.latitude","width":"auto"},{"field":"@network.client.geoip.location.longitude","width":"auto"},{"field":"@network.client.geoip.country.iso_code","width":"auto"},{"field":"@network.client.geoip.subdivision.name","width":"auto"},{"field":"classic","width":"auto"},{"field":"","width":"auto"}],"query":{"data_source":"logs_stream","indexes":[],"query_string":""},"response_format":"event_list"}],"style":{"palette":"hostmap_blues","palette_flip":false},"title":"","title_align":"left","title_size":"16","type":"geomap","view":{"focus":"WORLD"}},"layout":{"height":6,"width":12,"x":0,"y":0}}]}' | ||
headers: | ||
accept: | ||
- application/json | ||
content-type: | ||
- application/json | ||
method: POST | ||
uri: https://api.datadoghq.com/api/v1/dashboard | ||
response: | ||
body: | ||
string: '{"id":"cn7-qfm-s9w","title":"Test-Create_a_geomap_widget_using_an_event_list_request-1687375743","description":"Test-Create_a_geomap_widget_using_an_event_list_request-1687375743","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/cn7-qfm-s9w/test-createageomapwidgetusinganeventlistrequest-1687375743","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"requests":[{"columns":[{"field":"@network.client.geoip.location.latitude","width":"auto"},{"field":"@network.client.geoip.location.longitude","width":"auto"},{"field":"@network.client.geoip.country.iso_code","width":"auto"},{"field":"@network.client.geoip.subdivision.name","width":"auto"},{"field":"classic","width":"auto"},{"field":"","width":"auto"}],"query":{"data_source":"logs_stream","indexes":[],"query_string":""},"response_format":"event_list"}],"style":{"palette":"hostmap_blues","palette_flip":false},"title":"","title_align":"left","title_size":"16","type":"geomap","view":{"focus":"WORLD"}},"layout":{"height":6,"width":12,"x":0,"y":0},"id":8506811379916619}],"notify_list":[],"created_at":"2023-06-21T19:29:03.801081+00:00","modified_at":"2023-06-21T19:29:03.801081+00:00","reflow_type":"fixed","tags":[],"restricted_roles":[]} | ||
|
||
' | ||
headers: | ||
content-type: | ||
- application/json | ||
status: | ||
code: 200 | ||
message: OK | ||
- request: | ||
body: null | ||
headers: | ||
accept: | ||
- application/json | ||
method: DELETE | ||
uri: https://api.datadoghq.com/api/v1/dashboard/cn7-qfm-s9w | ||
response: | ||
body: | ||
string: '{"deleted_dashboard_id":"cn7-qfm-s9w"} | ||
|
||
' | ||
headers: | ||
content-type: | ||
- application/json | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
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