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 split graph widget to dashboard schema #1644

Merged
merged 6 commits into from
Sep 18, 2023
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.5",
"regenerated": "2023-09-14 14:35:30.424386",
"spec_repo_commit": "1d834ec1"
"regenerated": "2023-09-15 14:38:34.839281",
"spec_repo_commit": "dfa5ada6"
},
"v2": {
"apigentools_version": "1.6.5",
"regenerated": "2023-09-14 14:35:30.441566",
"spec_repo_commit": "1d834ec1"
"regenerated": "2023-09-15 14:38:34.866653",
"spec_repo_commit": "dfa5ada6"
}
}
}
175 changes: 170 additions & 5 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12058,6 +12058,170 @@ components:
items:
$ref: '#/components/schemas/SlackIntegrationChannel'
type: array
SplitConfig:
description: Encapsulates all user choices about how to split a graph.
properties:
limit:
description: Maximum number of graphs to display in the widget.
example: 24
format: int64
maximum: 100
minimum: 1
type: integer
sort:
$ref: '#/components/schemas/SplitSort'
split_dimensions:
description: The dimension(s) on which to split the graph
items:
$ref: '#/components/schemas/SplitDimension'
maxItems: 1
minItems: 1
type: array
static_splits:
description: Manual selection of tags making split graph widget static
items:
$ref: '#/components/schemas/SplitVectorEntry'
maxItems: 100
type: array
required:
- split_dimensions
- limit
- sort
type: object
SplitConfigSortCompute:
description: Defines the metric and aggregation used as the sort value.
properties:
aggregation:
description: The metric to use for sorting graphs.
example: sum
type: string
metric:
description: How to aggregate the sort metric for the purposes of ordering.
example: system.cpu.user
type: string
required:
- aggregation
- metric
type: object
SplitDimension:
description: The property by which the graph splits
example:
one_graph_per: service
properties:
one_graph_per:
description: The system interprets this attribute differently depending
on the data source of the query being split. For metrics, it's a tag.
For the events platform, it's an attribute or tag.
example: service
type: string
required:
- one_graph_per
type: object
SplitGraphSourceWidgetDefinition:
description: The original widget we are splitting on.
oneOf:
- $ref: '#/components/schemas/ChangeWidgetDefinition'
- $ref: '#/components/schemas/GeomapWidgetDefinition'
- $ref: '#/components/schemas/QueryValueWidgetDefinition'
- $ref: '#/components/schemas/ScatterPlotWidgetDefinition'
- $ref: '#/components/schemas/SunburstWidgetDefinition'
- $ref: '#/components/schemas/TableWidgetDefinition'
- $ref: '#/components/schemas/TimeseriesWidgetDefinition'
- $ref: '#/components/schemas/ToplistWidgetDefinition'
- $ref: '#/components/schemas/TreeMapWidgetDefinition'
SplitGraphVizSize:
description: Size of the individual graphs in the split.
enum:
- xs
- sm
- md
- lg
example: sm
type: string
x-enum-varnames:
- XS
- SM
- MD
- LG
SplitGraphWidgetDefinition:
description: 'The split graph widget allows you to create repeating units of
a graph - one for each value in a group (for example: one per service)

'
properties:
has_uniform_y_axes:
description: Normalize y axes across graphs
type: boolean
size:
$ref: '#/components/schemas/SplitGraphVizSize'
source_widget_definition:
$ref: '#/components/schemas/SplitGraphSourceWidgetDefinition'
split_config:
$ref: '#/components/schemas/SplitConfig'
time:
$ref: '#/components/schemas/WidgetTime'
title:
description: Title of your widget.
type: string
type:
$ref: '#/components/schemas/SplitGraphWidgetDefinitionType'
required:
- size
- type
- source_widget_definition
- split_config
type: object
SplitGraphWidgetDefinitionType:
default: split_group
description: Type of the split graph widget
enum:
- split_group
example: split_group
type: string
x-enum-varnames:
- SPLIT_GROUP
SplitSort:
description: Controls the order in which graphs appear in the split.
properties:
compute:
$ref: '#/components/schemas/SplitConfigSortCompute'
order:
$ref: '#/components/schemas/WidgetSort'
required:
- order
type: object
SplitVectorEntry:
description: The widget displays one graph for each entry in this parameter.
example:
- tag_key: demo
tag_values:
- env
items:
$ref: '#/components/schemas/SplitVectorEntryItem'
minItems: 1
type: array
SplitVectorEntryItem:
description: The split graph list contains a graph for each value of the split
dimension.
minLength: 1
properties:
tag_key:
description: The tag key.
example: demo
minLength: 1
type: string
tag_values:
description: The tag values.
example:
- env
items:
minLength: 1
type: string
type: array
required:
- tag_key
- tag_values
type: object
SuccessfulSignalUpdateResponse:
description: Updated signal data following a successfully performed update.
properties:
Expand Down Expand Up @@ -19540,30 +19704,31 @@ components:
- $ref: '#/components/schemas/EventStreamWidgetDefinition'
- $ref: '#/components/schemas/EventTimelineWidgetDefinition'
- $ref: '#/components/schemas/FreeTextWidgetDefinition'
- $ref: '#/components/schemas/FunnelWidgetDefinition'
- $ref: '#/components/schemas/GeomapWidgetDefinition'
- $ref: '#/components/schemas/GroupWidgetDefinition'
- $ref: '#/components/schemas/HeatMapWidgetDefinition'
- $ref: '#/components/schemas/HostMapWidgetDefinition'
- $ref: '#/components/schemas/IFrameWidgetDefinition'
- $ref: '#/components/schemas/ImageWidgetDefinition'
- $ref: '#/components/schemas/ListStreamWidgetDefinition'
- $ref: '#/components/schemas/LogStreamWidgetDefinition'
- $ref: '#/components/schemas/MonitorSummaryWidgetDefinition'
- $ref: '#/components/schemas/NoteWidgetDefinition'
- $ref: '#/components/schemas/QueryValueWidgetDefinition'
- $ref: '#/components/schemas/RunWorkflowWidgetDefinition'
- $ref: '#/components/schemas/ScatterPlotWidgetDefinition'
- $ref: '#/components/schemas/SLOWidgetDefinition'
- $ref: '#/components/schemas/SLOListWidgetDefinition'
- $ref: '#/components/schemas/SLOWidgetDefinition'
- $ref: '#/components/schemas/ScatterPlotWidgetDefinition'
- $ref: '#/components/schemas/ServiceMapWidgetDefinition'
- $ref: '#/components/schemas/ServiceSummaryWidgetDefinition'
- $ref: '#/components/schemas/SplitGraphWidgetDefinition'
- $ref: '#/components/schemas/SunburstWidgetDefinition'
- $ref: '#/components/schemas/TableWidgetDefinition'
- $ref: '#/components/schemas/TimeseriesWidgetDefinition'
- $ref: '#/components/schemas/ToplistWidgetDefinition'
- $ref: '#/components/schemas/TreeMapWidgetDefinition'
- $ref: '#/components/schemas/ListStreamWidgetDefinition'
- $ref: '#/components/schemas/FunnelWidgetDefinition'
- $ref: '#/components/schemas/TopologyMapWidgetDefinition'
- $ref: '#/components/schemas/TreeMapWidgetDefinition'
WidgetDisplayType:
description: Type of display to use for the request.
enum:
Expand Down
19 changes: 8 additions & 11 deletions .generator/src/generator/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,7 @@ def models(spec):
def find_non_primitive_type(schema):
if schema.get("enum"):
return True
sub_type = schema.get("type")
if sub_type == "array":
return find_non_primitive_type(schema["items"])
return sub_type not in PRIMITIVE_TYPES
return schema.get("type") not in PRIMITIVE_TYPES


def get_references_for_model(model, model_name):
Expand All @@ -255,13 +252,13 @@ def get_references_for_model(model, model_name):
result[name] = None
else:
items_name = formatter.get_name(definition.get("items"))
if items_name and (
find_non_primitive_type(definition["items"]) or formatter.is_list_model_whitelisted(items_name)
):
result[items_name] = None
elif name and definition["items"].get("type") not in PRIMITIVE_TYPES:
result[f"{name}Item"] = None

if items_name:
if formatter.is_list_model_whitelisted(items_name):
result[items_name] = None
elif definition["items"].get("type") == "array":
result[formatter.get_name(definition["items"]["items"])] = None
elif find_non_primitive_type(definition["items"]):
result[items_name] = None
elif definition.get("properties") and top_name:
result[top_name + formatter.camel_case(key)] = None
if model.get("additionalProperties"):
Expand Down
63 changes: 63 additions & 0 deletions docs/datadog_api_client.v1.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3452,6 +3452,69 @@ slo\_widget\_definition\_type
:members:
:show-inheritance:

split\_config
-------------

.. automodule:: datadog_api_client.v1.model.split_config
:members:
:show-inheritance:

split\_config\_sort\_compute
----------------------------

.. automodule:: datadog_api_client.v1.model.split_config_sort_compute
:members:
:show-inheritance:

split\_dimension
----------------

.. automodule:: datadog_api_client.v1.model.split_dimension
:members:
:show-inheritance:

split\_graph\_source\_widget\_definition
----------------------------------------

.. automodule:: datadog_api_client.v1.model.split_graph_source_widget_definition
:members:
:show-inheritance:

split\_graph\_viz\_size
-----------------------

.. automodule:: datadog_api_client.v1.model.split_graph_viz_size
:members:
:show-inheritance:

split\_graph\_widget\_definition
--------------------------------

.. automodule:: datadog_api_client.v1.model.split_graph_widget_definition
:members:
:show-inheritance:

split\_graph\_widget\_definition\_type
--------------------------------------

.. automodule:: datadog_api_client.v1.model.split_graph_widget_definition_type
:members:
:show-inheritance:

split\_sort
-----------

.. automodule:: datadog_api_client.v1.model.split_sort
:members:
:show-inheritance:

split\_vector\_entry\_item
--------------------------

.. automodule:: datadog_api_client.v1.model.split_vector_entry_item
:members:
:show-inheritance:

successful\_signal\_update\_response
------------------------------------

Expand Down
Loading