-
Notifications
You must be signed in to change notification settings - Fork 43
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
[DO NOT MERGE] Bruce.tu/fix stacked widget display legend required 2 #2187
Open
api-clients-generation-pipeline
wants to merge
1
commit into
master
Choose a base branch
from
datadog-api-spec/generated/3159
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 new dashboard with a toplist widget with stacked type and no legend specified | ||
""" | ||
|
||
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.formula_and_function_metric_aggregation import FormulaAndFunctionMetricAggregation | ||
from datadog_api_client.v1.model.formula_and_function_metric_data_source import FormulaAndFunctionMetricDataSource | ||
from datadog_api_client.v1.model.formula_and_function_metric_query_definition import ( | ||
FormulaAndFunctionMetricQueryDefinition, | ||
) | ||
from datadog_api_client.v1.model.formula_and_function_response_format import FormulaAndFunctionResponseFormat | ||
from datadog_api_client.v1.model.group_type import GroupType | ||
from datadog_api_client.v1.model.toplist_widget_definition import ToplistWidgetDefinition | ||
from datadog_api_client.v1.model.toplist_widget_definition_type import ToplistWidgetDefinitionType | ||
from datadog_api_client.v1.model.toplist_widget_request import ToplistWidgetRequest | ||
from datadog_api_client.v1.model.toplist_widget_scaling import ToplistWidgetScaling | ||
from datadog_api_client.v1.model.toplist_widget_stacked import ToplistWidgetStacked | ||
from datadog_api_client.v1.model.toplist_widget_stacked_type import ToplistWidgetStackedType | ||
from datadog_api_client.v1.model.toplist_widget_style import ToplistWidgetStyle | ||
from datadog_api_client.v1.model.widget import Widget | ||
from datadog_api_client.v1.model.widget_formula import WidgetFormula | ||
from datadog_api_client.v1.model.widget_group_sort import WidgetGroupSort | ||
from datadog_api_client.v1.model.widget_layout import WidgetLayout | ||
from datadog_api_client.v1.model.widget_legacy_live_span import WidgetLegacyLiveSpan | ||
from datadog_api_client.v1.model.widget_sort import WidgetSort | ||
from datadog_api_client.v1.model.widget_sort_by import WidgetSortBy | ||
from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign | ||
|
||
body = Dashboard( | ||
title="Example-Dashboard", | ||
description="", | ||
widgets=[ | ||
Widget( | ||
layout=WidgetLayout( | ||
x=0, | ||
y=0, | ||
width=47, | ||
height=15, | ||
), | ||
definition=ToplistWidgetDefinition( | ||
title="", | ||
title_size="16", | ||
title_align=WidgetTextAlign.LEFT, | ||
time=WidgetLegacyLiveSpan(), | ||
style=ToplistWidgetStyle( | ||
display=ToplistWidgetStacked( | ||
type=ToplistWidgetStackedType.STACKED, | ||
), | ||
scaling=ToplistWidgetScaling.RELATIVE, | ||
palette="dog_classic", | ||
), | ||
type=ToplistWidgetDefinitionType.TOPLIST, | ||
requests=[ | ||
ToplistWidgetRequest( | ||
queries=[ | ||
FormulaAndFunctionMetricQueryDefinition( | ||
data_source=FormulaAndFunctionMetricDataSource.METRICS, | ||
name="query1", | ||
query="avg:system.cpu.user{*} by {service}", | ||
aggregator=FormulaAndFunctionMetricAggregation.AVG, | ||
), | ||
], | ||
formulas=[ | ||
WidgetFormula( | ||
formula="query1", | ||
), | ||
], | ||
sort=WidgetSortBy( | ||
count=10, | ||
order_by=[ | ||
WidgetGroupSort( | ||
type=GroupType.GROUP, | ||
name="service", | ||
order=WidgetSort.ASCENDING, | ||
), | ||
], | ||
), | ||
response_format=FormulaAndFunctionResponseFormat.SCALAR, | ||
), | ||
], | ||
), | ||
), | ||
], | ||
template_variables=[], | ||
layout_type=DashboardLayoutType.FREE, | ||
is_read_only=False, | ||
notify_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
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
72 changes: 0 additions & 72 deletions
72
src/datadog_api_client/v2/model/security_monitoring_reference_table.py
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Code Quality Violation
first parameter of a class function should be self (...read more)
In a class method (that is not a class method nor a static method), the first argument must be
self
by convention.Learn More