Skip to content

Commit 08bae7f

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add monitor draft status field (#2566)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 082dc9f commit 08bae7f

17 files changed

+157
-30
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-06-04 12:51:42.024933",
8-
"spec_repo_commit": "35a63137"
7+
"regenerated": "2025-06-04 17:40:37.993718",
8+
"spec_repo_commit": "38b3c05a"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-04 12:51:42.039930",
13-
"spec_repo_commit": "35a63137"
12+
"regenerated": "2025-06-04 17:40:38.008535",
13+
"spec_repo_commit": "38b3c05a"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6742,6 +6742,8 @@ components:
67426742
nullable: true
67436743
readOnly: true
67446744
type: string
6745+
draft_status:
6746+
$ref: '#/components/schemas/MonitorDraftStatus'
67456747
id:
67466748
description: ID of this monitor.
67476749
format: int64
@@ -6834,6 +6836,28 @@ components:
68346836
- FIREFOX_LAPTOP_LARGE
68356837
- FIREFOX_TABLET
68366838
- FIREFOX_MOBILE_SMALL
6839+
MonitorDraftStatus:
6840+
default: published
6841+
description: 'Indicates whether the monitor is in a draft or published state.
6842+
6843+
6844+
`draft`: The monitor appears as Draft and does not send notifications.
6845+
6846+
`published`: The monitor is active and evaluates conditions and notify as
6847+
configured.
6848+
6849+
6850+
This field is in preview. The draft value is only available to customers with
6851+
the feature enabled.
6852+
6853+
'
6854+
enum:
6855+
- draft
6856+
- published
6857+
type: string
6858+
x-enum-varnames:
6859+
- DRAFT
6860+
- PUBLISHED
68376861
MonitorFormulaAndFunctionCostAggregator:
68386862
description: Aggregation methods for metric queries.
68396863
enum:
@@ -7917,6 +7941,8 @@ components:
79177941
nullable: true
79187942
readOnly: true
79197943
type: string
7944+
draft_status:
7945+
$ref: '#/components/schemas/MonitorDraftStatus'
79207946
id:
79217947
description: ID of this monitor.
79227948
format: int64

docs/datadog_api_client.v1.model.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,6 +2041,13 @@ datadog\_api\_client.v1.model.monitor\_device\_id module
20412041
:members:
20422042
:show-inheritance:
20432043

2044+
datadog\_api\_client.v1.model.monitor\_draft\_status module
2045+
-----------------------------------------------------------
2046+
2047+
.. automodule:: datadog_api_client.v1.model.monitor_draft_status
2048+
:members:
2049+
:show-inheritance:
2050+
20442051
datadog\_api\_client.v1.model.monitor\_formula\_and\_function\_cost\_aggregator module
20452052
--------------------------------------------------------------------------------------
20462053

examples/v1/monitors/CreateMonitor_1539578087.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from datadog_api_client import ApiClient, Configuration
66
from datadog_api_client.v1.api.monitors_api import MonitorsApi
77
from datadog_api_client.v1.model.monitor import Monitor
8+
from datadog_api_client.v1.model.monitor_draft_status import MonitorDraftStatus
89
from datadog_api_client.v1.model.monitor_options import MonitorOptions
910
from datadog_api_client.v1.model.monitor_options_custom_schedule import MonitorOptionsCustomSchedule
1011
from datadog_api_client.v1.model.monitor_options_custom_schedule_recurrence import (
@@ -45,6 +46,7 @@
4546
),
4647
),
4748
type=MonitorType.QUERY_ALERT,
49+
draft_status=MonitorDraftStatus.PUBLISHED,
4850
)
4951

5052
configuration = Configuration()

examples/v1/monitors/CreateMonitor_440013737.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from datadog_api_client import ApiClient, Configuration
66
from datadog_api_client.v1.api.monitors_api import MonitorsApi
77
from datadog_api_client.v1.model.monitor import Monitor
8+
from datadog_api_client.v1.model.monitor_draft_status import MonitorDraftStatus
89
from datadog_api_client.v1.model.monitor_options import MonitorOptions
910
from datadog_api_client.v1.model.monitor_thresholds import MonitorThresholds
1011
from datadog_api_client.v1.model.monitor_type import MonitorType
@@ -24,6 +25,7 @@
2425
critical=1.0,
2526
),
2627
),
28+
draft_status=MonitorDraftStatus.DRAFT,
2729
)
2830

2931
configuration = Configuration()

src/datadog_api_client/v1/model/monitor.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
if TYPE_CHECKING:
1919
from datadog_api_client.v1.model.creator import Creator
20+
from datadog_api_client.v1.model.monitor_draft_status import MonitorDraftStatus
2021
from datadog_api_client.v1.model.matching_downtime import MatchingDowntime
2122
from datadog_api_client.v1.model.monitor_options import MonitorOptions
2223
from datadog_api_client.v1.model.monitor_overall_states import MonitorOverallStates
@@ -28,6 +29,7 @@ class Monitor(ModelNormal):
2829
@cached_property
2930
def openapi_types(_):
3031
from datadog_api_client.v1.model.creator import Creator
32+
from datadog_api_client.v1.model.monitor_draft_status import MonitorDraftStatus
3133
from datadog_api_client.v1.model.matching_downtime import MatchingDowntime
3234
from datadog_api_client.v1.model.monitor_options import MonitorOptions
3335
from datadog_api_client.v1.model.monitor_overall_states import MonitorOverallStates
@@ -38,6 +40,7 @@ def openapi_types(_):
3840
"created": (datetime,),
3941
"creator": (Creator,),
4042
"deleted": (datetime, none_type),
43+
"draft_status": (MonitorDraftStatus,),
4144
"id": (int,),
4245
"matching_downtimes": ([MatchingDowntime],),
4346
"message": (str,),
@@ -58,6 +61,7 @@ def openapi_types(_):
5861
"created": "created",
5962
"creator": "creator",
6063
"deleted": "deleted",
64+
"draft_status": "draft_status",
6165
"id": "id",
6266
"matching_downtimes": "matching_downtimes",
6367
"message": "message",
@@ -91,6 +95,7 @@ def __init__(
9195
created: Union[datetime, UnsetType] = unset,
9296
creator: Union[Creator, UnsetType] = unset,
9397
deleted: Union[datetime, none_type, UnsetType] = unset,
98+
draft_status: Union[MonitorDraftStatus, UnsetType] = unset,
9499
id: Union[int, UnsetType] = unset,
95100
matching_downtimes: Union[List[MatchingDowntime], UnsetType] = unset,
96101
message: Union[str, UnsetType] = unset,
@@ -117,6 +122,14 @@ def __init__(
117122
:param deleted: Whether or not the monitor is deleted. (Always ``null`` )
118123
:type deleted: datetime, none_type, optional
119124
125+
:param draft_status: Indicates whether the monitor is in a draft or published state.
126+
127+
``draft`` : The monitor appears as Draft and does not send notifications.
128+
``published`` : The monitor is active and evaluates conditions and notify as configured.
129+
130+
This field is in preview. The draft value is only available to customers with the feature enabled.
131+
:type draft_status: MonitorDraftStatus, optional
132+
120133
:param id: ID of this monitor.
121134
:type id: int, optional
122135
@@ -165,6 +178,8 @@ def __init__(
165178
kwargs["creator"] = creator
166179
if deleted is not unset:
167180
kwargs["deleted"] = deleted
181+
if draft_status is not unset:
182+
kwargs["draft_status"] = draft_status
168183
if id is not unset:
169184
kwargs["id"] = id
170185
if matching_downtimes is not unset:
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class MonitorDraftStatus(ModelSimple):
16+
"""
17+
Indicates whether the monitor is in a draft or published state.
18+
19+
`draft`: The monitor appears as Draft and does not send notifications.
20+
`published`: The monitor is active and evaluates conditions and notify as configured.
21+
22+
This field is in preview. The draft value is only available to customers with the feature enabled.
23+
24+
25+
:param value: If omitted defaults to "published". Must be one of ["draft", "published"].
26+
:type value: str
27+
"""
28+
29+
allowed_values = {
30+
"draft",
31+
"published",
32+
}
33+
DRAFT: ClassVar["MonitorDraftStatus"]
34+
PUBLISHED: ClassVar["MonitorDraftStatus"]
35+
36+
@cached_property
37+
def openapi_types(_):
38+
return {
39+
"value": (str,),
40+
}
41+
42+
43+
MonitorDraftStatus.DRAFT = MonitorDraftStatus("draft")
44+
MonitorDraftStatus.PUBLISHED = MonitorDraftStatus("published")

src/datadog_api_client/v1/model/monitor_update_request.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
if TYPE_CHECKING:
1919
from datadog_api_client.v1.model.creator import Creator
20+
from datadog_api_client.v1.model.monitor_draft_status import MonitorDraftStatus
2021
from datadog_api_client.v1.model.monitor_options import MonitorOptions
2122
from datadog_api_client.v1.model.monitor_overall_states import MonitorOverallStates
2223
from datadog_api_client.v1.model.monitor_state import MonitorState
@@ -27,6 +28,7 @@ class MonitorUpdateRequest(ModelNormal):
2728
@cached_property
2829
def openapi_types(_):
2930
from datadog_api_client.v1.model.creator import Creator
31+
from datadog_api_client.v1.model.monitor_draft_status import MonitorDraftStatus
3032
from datadog_api_client.v1.model.monitor_options import MonitorOptions
3133
from datadog_api_client.v1.model.monitor_overall_states import MonitorOverallStates
3234
from datadog_api_client.v1.model.monitor_state import MonitorState
@@ -36,6 +38,7 @@ def openapi_types(_):
3638
"created": (datetime,),
3739
"creator": (Creator,),
3840
"deleted": (datetime, none_type),
41+
"draft_status": (MonitorDraftStatus,),
3942
"id": (int,),
4043
"message": (str,),
4144
"modified": (datetime,),
@@ -55,6 +58,7 @@ def openapi_types(_):
5558
"created": "created",
5659
"creator": "creator",
5760
"deleted": "deleted",
61+
"draft_status": "draft_status",
5862
"id": "id",
5963
"message": "message",
6064
"modified": "modified",
@@ -85,6 +89,7 @@ def __init__(
8589
created: Union[datetime, UnsetType] = unset,
8690
creator: Union[Creator, UnsetType] = unset,
8791
deleted: Union[datetime, none_type, UnsetType] = unset,
92+
draft_status: Union[MonitorDraftStatus, UnsetType] = unset,
8893
id: Union[int, UnsetType] = unset,
8994
message: Union[str, UnsetType] = unset,
9095
modified: Union[datetime, UnsetType] = unset,
@@ -112,6 +117,14 @@ def __init__(
112117
:param deleted: Whether or not the monitor is deleted. (Always ``null`` )
113118
:type deleted: datetime, none_type, optional
114119
120+
:param draft_status: Indicates whether the monitor is in a draft or published state.
121+
122+
``draft`` : The monitor appears as Draft and does not send notifications.
123+
``published`` : The monitor is active and evaluates conditions and notify as configured.
124+
125+
This field is in preview. The draft value is only available to customers with the feature enabled.
126+
:type draft_status: MonitorDraftStatus, optional
127+
115128
:param id: ID of this monitor.
116129
:type id: int, optional
117130
@@ -157,6 +170,8 @@ def __init__(
157170
kwargs["creator"] = creator
158171
if deleted is not unset:
159172
kwargs["deleted"] = deleted
173+
if draft_status is not unset:
174+
kwargs["draft_status"] = draft_status
160175
if id is not unset:
161176
kwargs["id"] = id
162177
if message is not unset:

src/datadog_api_client/v1/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@
323323
from datadog_api_client.v1.model.metrics_query_unit import MetricsQueryUnit
324324
from datadog_api_client.v1.model.monitor import Monitor
325325
from datadog_api_client.v1.model.monitor_device_id import MonitorDeviceID
326+
from datadog_api_client.v1.model.monitor_draft_status import MonitorDraftStatus
326327
from datadog_api_client.v1.model.monitor_formula_and_function_cost_aggregator import (
327328
MonitorFormulaAndFunctionCostAggregator,
328329
)
@@ -1376,6 +1377,7 @@
13761377
"MetricsQueryUnit",
13771378
"Monitor",
13781379
"MonitorDeviceID",
1380+
"MonitorDraftStatus",
13791381
"MonitorFormulaAndFunctionCostAggregator",
13801382
"MonitorFormulaAndFunctionCostDataSource",
13811383
"MonitorFormulaAndFunctionCostQueryDefinition",
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2023-11-09T17:58:50.774Z
1+
2025-05-14T22:28:29.992Z

0 commit comments

Comments
 (0)