-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add event_stream fields to dashboard list stream widget (#1329)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
- Loading branch information
1 parent
5c7c5e1
commit c8fec1b
Showing
8 changed files
with
129 additions
and
5 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,53 @@ | ||
""" | ||
Create a new dashboard with event_stream list_stream widget | ||
""" | ||
|
||
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.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_response_format import ListStreamResponseFormat | ||
from datadog_api_client.v1.model.list_stream_source import ListStreamSource | ||
from datadog_api_client.v1.model.list_stream_widget_definition import ListStreamWidgetDefinition | ||
from datadog_api_client.v1.model.list_stream_widget_definition_type import ListStreamWidgetDefinitionType | ||
from datadog_api_client.v1.model.list_stream_widget_request import ListStreamWidgetRequest | ||
from datadog_api_client.v1.model.widget import Widget | ||
from datadog_api_client.v1.model.widget_event_size import WidgetEventSize | ||
|
||
body = Dashboard( | ||
layout_type=DashboardLayoutType.ORDERED, | ||
title="Example-Create_a_new_dashboard_with_event_stream_list_stream_widget with list_stream widget", | ||
widgets=[ | ||
Widget( | ||
definition=ListStreamWidgetDefinition( | ||
type=ListStreamWidgetDefinitionType.LIST_STREAM, | ||
requests=[ | ||
ListStreamWidgetRequest( | ||
columns=[ | ||
ListStreamColumn( | ||
width=ListStreamColumnWidth.AUTO, | ||
field="timestamp", | ||
), | ||
], | ||
query=ListStreamQuery( | ||
data_source=ListStreamSource.EVENT_STREAM, | ||
query_string="", | ||
event_size=WidgetEventSize.LARGE, | ||
), | ||
response_format=ListStreamResponseFormat.EVENT_LIST, | ||
), | ||
], | ||
), | ||
), | ||
], | ||
) | ||
|
||
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
1 change: 1 addition & 0 deletions
1
...es/test_scenarios/test_create_a_new_dashboard_with_event_stream_list_stream_widget.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-02-08T16:18:06.266Z |
42 changes: 42 additions & 0 deletions
42
...ttes/test_scenarios/test_create_a_new_dashboard_with_event_stream_list_stream_widget.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,42 @@ | ||
interactions: | ||
- request: | ||
body: '{"layout_type":"ordered","title":"Test-Create_a_new_dashboard_with_event_stream_list_stream_widget-1675873086 | ||
with list_stream widget","widgets":[{"definition":{"requests":[{"columns":[{"field":"timestamp","width":"auto"}],"query":{"data_source":"event_stream","event_size":"l","query_string":""},"response_format":"event_list"}],"type":"list_stream"}}]}' | ||
headers: | ||
accept: | ||
- application/json | ||
content-type: | ||
- application/json | ||
method: POST | ||
uri: https://api.datadoghq.com/api/v1/dashboard | ||
response: | ||
body: | ||
string: '{"notify_list":null,"description":null,"restricted_roles":[],"author_name":null,"template_variables":null,"is_read_only":false,"id":"zmh-rud-g4b","title":"Test-Create_a_new_dashboard_with_event_stream_list_stream_widget-1675873086 | ||
with list_stream widget","url":"/dashboard/zmh-rud-g4b/test-createanewdashboardwitheventstreamliststreamwidget-1675873086-with-liststre","created_at":"2023-02-08T16:18:06.512655+00:00","modified_at":"2023-02-08T16:18:06.512655+00:00","author_handle":"frog@datadoghq.com","widgets":[{"definition":{"requests":[{"query":{"query_string":"","data_source":"event_stream","event_size":"l"},"response_format":"event_list","columns":[{"field":"timestamp","width":"auto"}]}],"type":"list_stream"},"id":3303593204363469}],"layout_type":"ordered"} | ||
' | ||
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/zmh-rud-g4b | ||
response: | ||
body: | ||
string: '{"deleted_dashboard_id":"zmh-rud-g4b"} | ||
' | ||
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