From 132296376257ed1ae36dcc3c737791ff5247e818 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 20 Feb 2026 00:15:27 +0000 Subject: [PATCH] Regenerate client from commit aaac81a of spec repo --- .generator/schemas/v1/openapi.yaml | 63 ++++++++++++++++++ docs/datadog_api_client.v1.model.rst | 7 ++ .../model/notebook_create_data_attributes.py | 10 +++ .../v1/model/notebook_template_variable.py | 65 +++++++++++++++++++ .../model/notebook_update_data_attributes.py | 10 +++ .../notebooks_response_data_attributes.py | 10 +++ src/datadog_api_client/v1/models/__init__.py | 2 + tests/v1/features/notebooks.feature | 8 +-- 8 files changed, 171 insertions(+), 4 deletions(-) create mode 100644 src/datadog_api_client/v1/model/notebook_template_variable.py diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index ac0bc1b08e..5454eb52a8 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -10354,6 +10354,16 @@ components: type: string status: $ref: '#/components/schemas/NotebookStatus' + template_variables: + description: List of template variables for this notebook. + example: + - available_values: [] + default: '*' + name: host + prefix: host + items: + $ref: '#/components/schemas/NotebookTemplateVariable' + type: array time: $ref: '#/components/schemas/NotebookGlobalTime' required: @@ -10657,6 +10667,39 @@ components: type: string x-enum-varnames: - PUBLISHED + NotebookTemplateVariable: + description: Template variable for a notebook. + properties: + available_values: + description: The list of values that the template variable drop-down is + limited to. + example: + - my-host + - host1 + - host2 + items: + description: Template variable value. + type: string + nullable: true + type: array + default: + description: The default value for the template variable. + example: '*' + nullable: true + type: string + name: + description: The name of the variable. + example: host + type: string + prefix: + description: The tag prefix associated with the variable. Only tags with + this prefix appear in the variable drop-down. + example: host + nullable: true + type: string + required: + - name + type: object NotebookTimeseriesCellAttributes: description: The attributes of a notebook `timeseries` cell. properties: @@ -10760,6 +10803,16 @@ components: type: string status: $ref: '#/components/schemas/NotebookStatus' + template_variables: + description: List of template variables for this notebook. + example: + - available_values: [] + default: '*' + name: host + prefix: host + items: + $ref: '#/components/schemas/NotebookTemplateVariable' + type: array time: $ref: '#/components/schemas/NotebookGlobalTime' required: @@ -10836,6 +10889,16 @@ components: type: string status: $ref: '#/components/schemas/NotebookStatus' + template_variables: + description: List of template variables for this notebook. + example: + - available_values: [] + default: '*' + name: host + prefix: host + items: + $ref: '#/components/schemas/NotebookTemplateVariable' + type: array time: $ref: '#/components/schemas/NotebookGlobalTime' required: diff --git a/docs/datadog_api_client.v1.model.rst b/docs/datadog_api_client.v1.model.rst index b20c86c2ba..b1fd71d234 100644 --- a/docs/datadog_api_client.v1.model.rst +++ b/docs/datadog_api_client.v1.model.rst @@ -2909,6 +2909,13 @@ datadog\_api\_client.v1.model.notebook\_status module :members: :show-inheritance: +datadog\_api\_client.v1.model.notebook\_template\_variable module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.notebook_template_variable + :members: + :show-inheritance: + datadog\_api\_client.v1.model.notebook\_timeseries\_cell\_attributes module --------------------------------------------------------------------------- diff --git a/src/datadog_api_client/v1/model/notebook_create_data_attributes.py b/src/datadog_api_client/v1/model/notebook_create_data_attributes.py index c96f99ff7c..288b2861e3 100644 --- a/src/datadog_api_client/v1/model/notebook_create_data_attributes.py +++ b/src/datadog_api_client/v1/model/notebook_create_data_attributes.py @@ -17,6 +17,7 @@ from datadog_api_client.v1.model.notebook_cell_create_request import NotebookCellCreateRequest from datadog_api_client.v1.model.notebook_metadata import NotebookMetadata from datadog_api_client.v1.model.notebook_status import NotebookStatus + from datadog_api_client.v1.model.notebook_template_variable import NotebookTemplateVariable from datadog_api_client.v1.model.notebook_global_time import NotebookGlobalTime from datadog_api_client.v1.model.notebook_relative_time import NotebookRelativeTime from datadog_api_client.v1.model.notebook_absolute_time import NotebookAbsoluteTime @@ -35,6 +36,7 @@ def openapi_types(_): from datadog_api_client.v1.model.notebook_cell_create_request import NotebookCellCreateRequest from datadog_api_client.v1.model.notebook_metadata import NotebookMetadata from datadog_api_client.v1.model.notebook_status import NotebookStatus + from datadog_api_client.v1.model.notebook_template_variable import NotebookTemplateVariable from datadog_api_client.v1.model.notebook_global_time import NotebookGlobalTime return { @@ -42,6 +44,7 @@ def openapi_types(_): "metadata": (NotebookMetadata,), "name": (str,), "status": (NotebookStatus,), + "template_variables": ([NotebookTemplateVariable],), "time": (NotebookGlobalTime,), } @@ -50,6 +53,7 @@ def openapi_types(_): "metadata": "metadata", "name": "name", "status": "status", + "template_variables": "template_variables", "time": "time", } @@ -60,6 +64,7 @@ def __init__( time: Union[NotebookGlobalTime, NotebookRelativeTime, NotebookAbsoluteTime], metadata: Union[NotebookMetadata, UnsetType] = unset, status: Union[NotebookStatus, UnsetType] = unset, + template_variables: Union[List[NotebookTemplateVariable], UnsetType] = unset, **kwargs, ): """ @@ -77,6 +82,9 @@ def __init__( :param status: Publication status of the notebook. For now, always "published". :type status: NotebookStatus, optional + :param template_variables: List of template variables for this notebook. + :type template_variables: [NotebookTemplateVariable], optional + :param time: Notebook global timeframe. :type time: NotebookGlobalTime """ @@ -84,6 +92,8 @@ def __init__( kwargs["metadata"] = metadata if status is not unset: kwargs["status"] = status + if template_variables is not unset: + kwargs["template_variables"] = template_variables super().__init__(kwargs) self_.cells = cells diff --git a/src/datadog_api_client/v1/model/notebook_template_variable.py b/src/datadog_api_client/v1/model/notebook_template_variable.py new file mode 100644 index 0000000000..8258829681 --- /dev/null +++ b/src/datadog_api_client/v1/model/notebook_template_variable.py @@ -0,0 +1,65 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +class NotebookTemplateVariable(ModelNormal): + @cached_property + def openapi_types(_): + return { + "available_values": ([str], none_type), + "default": (str, none_type), + "name": (str,), + "prefix": (str, none_type), + } + + attribute_map = { + "available_values": "available_values", + "default": "default", + "name": "name", + "prefix": "prefix", + } + + def __init__( + self_, + name: str, + available_values: Union[List[str], none_type, UnsetType] = unset, + default: Union[str, none_type, UnsetType] = unset, + prefix: Union[str, none_type, UnsetType] = unset, + **kwargs, + ): + """ + Template variable for a notebook. + + :param available_values: The list of values that the template variable drop-down is limited to. + :type available_values: [str], none_type, optional + + :param default: The default value for the template variable. + :type default: str, none_type, optional + + :param name: The name of the variable. + :type name: str + + :param prefix: The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down. + :type prefix: str, none_type, optional + """ + if available_values is not unset: + kwargs["available_values"] = available_values + if default is not unset: + kwargs["default"] = default + if prefix is not unset: + kwargs["prefix"] = prefix + super().__init__(kwargs) + + self_.name = name diff --git a/src/datadog_api_client/v1/model/notebook_update_data_attributes.py b/src/datadog_api_client/v1/model/notebook_update_data_attributes.py index 159153f3f1..b295590c82 100644 --- a/src/datadog_api_client/v1/model/notebook_update_data_attributes.py +++ b/src/datadog_api_client/v1/model/notebook_update_data_attributes.py @@ -17,6 +17,7 @@ from datadog_api_client.v1.model.notebook_update_cell import NotebookUpdateCell from datadog_api_client.v1.model.notebook_metadata import NotebookMetadata from datadog_api_client.v1.model.notebook_status import NotebookStatus + from datadog_api_client.v1.model.notebook_template_variable import NotebookTemplateVariable from datadog_api_client.v1.model.notebook_global_time import NotebookGlobalTime from datadog_api_client.v1.model.notebook_cell_create_request import NotebookCellCreateRequest from datadog_api_client.v1.model.notebook_cell_update_request import NotebookCellUpdateRequest @@ -37,6 +38,7 @@ def openapi_types(_): from datadog_api_client.v1.model.notebook_update_cell import NotebookUpdateCell from datadog_api_client.v1.model.notebook_metadata import NotebookMetadata from datadog_api_client.v1.model.notebook_status import NotebookStatus + from datadog_api_client.v1.model.notebook_template_variable import NotebookTemplateVariable from datadog_api_client.v1.model.notebook_global_time import NotebookGlobalTime return { @@ -44,6 +46,7 @@ def openapi_types(_): "metadata": (NotebookMetadata,), "name": (str,), "status": (NotebookStatus,), + "template_variables": ([NotebookTemplateVariable],), "time": (NotebookGlobalTime,), } @@ -52,6 +55,7 @@ def openapi_types(_): "metadata": "metadata", "name": "name", "status": "status", + "template_variables": "template_variables", "time": "time", } @@ -62,6 +66,7 @@ def __init__( time: Union[NotebookGlobalTime, NotebookRelativeTime, NotebookAbsoluteTime], metadata: Union[NotebookMetadata, UnsetType] = unset, status: Union[NotebookStatus, UnsetType] = unset, + template_variables: Union[List[NotebookTemplateVariable], UnsetType] = unset, **kwargs, ): """ @@ -79,6 +84,9 @@ def __init__( :param status: Publication status of the notebook. For now, always "published". :type status: NotebookStatus, optional + :param template_variables: List of template variables for this notebook. + :type template_variables: [NotebookTemplateVariable], optional + :param time: Notebook global timeframe. :type time: NotebookGlobalTime """ @@ -86,6 +94,8 @@ def __init__( kwargs["metadata"] = metadata if status is not unset: kwargs["status"] = status + if template_variables is not unset: + kwargs["template_variables"] = template_variables super().__init__(kwargs) self_.cells = cells diff --git a/src/datadog_api_client/v1/model/notebooks_response_data_attributes.py b/src/datadog_api_client/v1/model/notebooks_response_data_attributes.py index 1dcc9753ef..bc04ddb779 100644 --- a/src/datadog_api_client/v1/model/notebooks_response_data_attributes.py +++ b/src/datadog_api_client/v1/model/notebooks_response_data_attributes.py @@ -19,6 +19,7 @@ from datadog_api_client.v1.model.notebook_cell_response import NotebookCellResponse from datadog_api_client.v1.model.notebook_metadata import NotebookMetadata from datadog_api_client.v1.model.notebook_status import NotebookStatus + from datadog_api_client.v1.model.notebook_template_variable import NotebookTemplateVariable from datadog_api_client.v1.model.notebook_global_time import NotebookGlobalTime from datadog_api_client.v1.model.notebook_relative_time import NotebookRelativeTime from datadog_api_client.v1.model.notebook_absolute_time import NotebookAbsoluteTime @@ -38,6 +39,7 @@ def openapi_types(_): from datadog_api_client.v1.model.notebook_cell_response import NotebookCellResponse from datadog_api_client.v1.model.notebook_metadata import NotebookMetadata from datadog_api_client.v1.model.notebook_status import NotebookStatus + from datadog_api_client.v1.model.notebook_template_variable import NotebookTemplateVariable from datadog_api_client.v1.model.notebook_global_time import NotebookGlobalTime return { @@ -48,6 +50,7 @@ def openapi_types(_): "modified": (datetime,), "name": (str,), "status": (NotebookStatus,), + "template_variables": ([NotebookTemplateVariable],), "time": (NotebookGlobalTime,), } @@ -59,6 +62,7 @@ def openapi_types(_): "modified": "modified", "name": "name", "status": "status", + "template_variables": "template_variables", "time": "time", } read_only_vars = { @@ -75,6 +79,7 @@ def __init__( metadata: Union[NotebookMetadata, UnsetType] = unset, modified: Union[datetime, UnsetType] = unset, status: Union[NotebookStatus, UnsetType] = unset, + template_variables: Union[List[NotebookTemplateVariable], UnsetType] = unset, time: Union[NotebookGlobalTime, NotebookRelativeTime, NotebookAbsoluteTime, UnsetType] = unset, **kwargs, ): @@ -102,6 +107,9 @@ def __init__( :param status: Publication status of the notebook. For now, always "published". :type status: NotebookStatus, optional + :param template_variables: List of template variables for this notebook. + :type template_variables: [NotebookTemplateVariable], optional + :param time: Notebook global timeframe. :type time: NotebookGlobalTime, optional """ @@ -117,6 +125,8 @@ def __init__( kwargs["modified"] = modified if status is not unset: kwargs["status"] = status + if template_variables is not unset: + kwargs["template_variables"] = template_variables if time is not unset: kwargs["time"] = time super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index 1710446bfc..53f86032f6 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -485,6 +485,7 @@ from datadog_api_client.v1.model.notebook_response_data_attributes import NotebookResponseDataAttributes from datadog_api_client.v1.model.notebook_split_by import NotebookSplitBy from datadog_api_client.v1.model.notebook_status import NotebookStatus +from datadog_api_client.v1.model.notebook_template_variable import NotebookTemplateVariable from datadog_api_client.v1.model.notebook_timeseries_cell_attributes import NotebookTimeseriesCellAttributes from datadog_api_client.v1.model.notebook_toplist_cell_attributes import NotebookToplistCellAttributes from datadog_api_client.v1.model.notebook_update_cell import NotebookUpdateCell @@ -1566,6 +1567,7 @@ "NotebookResponseDataAttributes", "NotebookSplitBy", "NotebookStatus", + "NotebookTemplateVariable", "NotebookTimeseriesCellAttributes", "NotebookToplistCellAttributes", "NotebookUpdateCell", diff --git a/tests/v1/features/notebooks.feature b/tests/v1/features/notebooks.feature index 3ff8343c9b..6c361af0d6 100644 --- a/tests/v1/features/notebooks.feature +++ b/tests/v1/features/notebooks.feature @@ -13,7 +13,7 @@ Feature: Notebooks @generated @skip @team:DataDog/notebooks Scenario: Create a notebook returns "Bad Request" response Given new "CreateNotebook" request - And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "time": {"live_span": "1h"}}, "type": "notebooks"}} + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "template_variables": [{"available_values": [], "default": "*", "name": "host", "prefix": "host"}], "time": {"live_span": "1h"}}, "type": "notebooks"}} When the request is sent Then the response status is 400 Bad Request @@ -98,7 +98,7 @@ Feature: Notebooks Scenario: Update a notebook returns "Bad Request" response Given new "UpdateNotebook" request And request contains "notebook_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "time": {"live_span": "1h"}}, "type": "notebooks"}} + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "template_variables": [{"available_values": [], "default": "*", "name": "host", "prefix": "host"}], "time": {"live_span": "1h"}}, "type": "notebooks"}} When the request is sent Then the response status is 400 Bad Request @@ -106,7 +106,7 @@ Feature: Notebooks Scenario: Update a notebook returns "Conflict" response Given new "UpdateNotebook" request And request contains "notebook_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "time": {"live_span": "1h"}}, "type": "notebooks"}} + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "template_variables": [{"available_values": [], "default": "*", "name": "host", "prefix": "host"}], "time": {"live_span": "1h"}}, "type": "notebooks"}} When the request is sent Then the response status is 409 Conflict @@ -114,7 +114,7 @@ Feature: Notebooks Scenario: Update a notebook returns "Not Found" response Given new "UpdateNotebook" request And request contains "notebook_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "time": {"live_span": "1h"}}, "type": "notebooks"}} + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "template_variables": [{"available_values": [], "default": "*", "name": "host", "prefix": "host"}], "time": {"live_span": "1h"}}, "type": "notebooks"}} When the request is sent Then the response status is 404 Not Found