Skip to content

Commit 8bb974b

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Mark v1 downtime endpoints as deprecated (#1818)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent afdc539 commit 8bb974b

File tree

3 files changed

+49
-25
lines changed

3 files changed

+49
-25
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": "2023-12-27 15:09:17.062005",
8-
"spec_repo_commit": "61dc4c3e"
7+
"regenerated": "2023-12-28 18:22:57.275767",
8+
"spec_repo_commit": "42c21a14"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2023-12-27 15:09:17.081944",
13-
"spec_repo_commit": "61dc4c3e"
12+
"regenerated": "2023-12-28 18:22:57.289365",
13+
"spec_repo_commit": "42c21a14"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22984,7 +22984,9 @@ paths:
2298422984
x-codegen-request-body-name: body
2298522985
/api/v1/downtime:
2298622986
get:
22987-
description: Get all scheduled downtimes.
22987+
deprecated: true
22988+
description: Get all scheduled downtimes. **Note:** This endpoint has been deprecated.
22989+
Please use v2 endpoints.
2298822990
operationId: ListDowntimes
2298922991
parameters:
2299022992
- description: Only return downtimes that are active when the request is made.
@@ -23025,7 +23027,9 @@ paths:
2302523027
tags:
2302623028
- Downtimes
2302723029
post:
23028-
description: Schedule a downtime.
23030+
deprecated: true
23031+
description: Schedule a downtime. **Note:** This endpoint has been deprecated.
23032+
Please use v2 endpoints.
2302923033
operationId: CreateDowntime
2303023034
requestBody:
2303123035
content:
@@ -23066,7 +23070,11 @@ paths:
2306623070
x-codegen-request-body-name: body
2306723071
/api/v1/downtime/cancel/by_scope:
2306823072
post:
23069-
description: Delete all downtimes that match the scope of `X`.
23073+
deprecated: true
23074+
description: Delete all downtimes that match the scope of `X`. **Note:** This
23075+
only interacts with Downtimes created using v1 endpoints. This endpoint has
23076+
been deprecated and will not be replaced. Please use v2 endpoints to find
23077+
and cancel downtimes.
2307023078
operationId: CancelDowntimesByScope
2307123079
requestBody:
2307223080
content:
@@ -23113,7 +23121,9 @@ paths:
2311323121
x-codegen-request-body-name: body
2311423122
/api/v1/downtime/{downtime_id}:
2311523123
delete:
23116-
description: Cancel a downtime.
23124+
deprecated: true
23125+
description: Cancel a downtime. **Note:** This endpoint has been deprecated.
23126+
Please use v2 endpoints.
2311723127
operationId: CancelDowntime
2311823128
parameters:
2311923129
- description: ID of the downtime to cancel.
@@ -23150,7 +23160,9 @@ paths:
2315023160
tags:
2315123161
- Downtimes
2315223162
get:
23153-
description: Get downtime detail by `downtime_id`.
23163+
deprecated: true
23164+
description: Get downtime detail by `downtime_id`. **Note:** This endpoint has
23165+
been deprecated. Please use v2 endpoints.
2315423166
operationId: GetDowntime
2315523167
parameters:
2315623168
- description: ID of the downtime to fetch.
@@ -23191,7 +23203,9 @@ paths:
2319123203
tags:
2319223204
- Downtimes
2319323205
put:
23194-
description: Update a single downtime by `downtime_id`.
23206+
deprecated: true
23207+
description: Update a single downtime by `downtime_id`. **Note:** This endpoint
23208+
has been deprecated. Please use v2 endpoints.
2319523209
operationId: UpdateDowntime
2319623210
parameters:
2319723211
- description: ID of the downtime to update.
@@ -27176,7 +27190,9 @@ paths:
2717627190
x-codegen-request-body-name: body
2717727191
/api/v1/monitor/{monitor_id}/downtimes:
2717827192
get:
27179-
description: Get all active downtimes for the specified monitor.
27193+
deprecated: true
27194+
description: Get all active v1 downtimes for the specified monitor. **Note:**
27195+
This endpoint has been deprecated. Please use v2 endpoints.
2718027196
operationId: ListMonitorDowntimes
2718127197
parameters:
2718227198
- description: The id of the monitor

src/datadog_api_client/v1/api/downtimes_api.py

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from __future__ import annotations
55

66
from typing import Any, Dict, List, Union
7+
import warnings
78

89
from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint
910
from datadog_api_client.configuration import Configuration
@@ -195,9 +196,9 @@ def cancel_downtime(
195196
self,
196197
downtime_id: int,
197198
) -> None:
198-
"""Cancel a downtime.
199+
"""Cancel a downtime. **Deprecated**.
199200
200-
Cancel a downtime.
201+
Cancel a downtime. **Note:** This endpoint has been deprecated. Please use v2 endpoints.
201202
202203
:param downtime_id: ID of the downtime to cancel.
203204
:type downtime_id: int
@@ -206,15 +207,16 @@ def cancel_downtime(
206207
kwargs: Dict[str, Any] = {}
207208
kwargs["downtime_id"] = downtime_id
208209

210+
warnings.warn("cancel_downtime is deprecated", DeprecationWarning, stacklevel=2)
209211
return self._cancel_downtime_endpoint.call_with_http_info(**kwargs)
210212

211213
def cancel_downtimes_by_scope(
212214
self,
213215
body: CancelDowntimesByScopeRequest,
214216
) -> CanceledDowntimesIds:
215-
"""Cancel downtimes by scope.
217+
"""Cancel downtimes by scope. **Deprecated**.
216218
217-
Delete all downtimes that match the scope of ``X``.
219+
Delete all downtimes that match the scope of ``X``. **Note:** This only interacts with Downtimes created using v1 endpoints. This endpoint has been deprecated and will not be replaced. Please use v2 endpoints to find and cancel downtimes.
218220
219221
:param body: Scope to cancel downtimes for.
220222
:type body: CancelDowntimesByScopeRequest
@@ -223,15 +225,16 @@ def cancel_downtimes_by_scope(
223225
kwargs: Dict[str, Any] = {}
224226
kwargs["body"] = body
225227

228+
warnings.warn("cancel_downtimes_by_scope is deprecated", DeprecationWarning, stacklevel=2)
226229
return self._cancel_downtimes_by_scope_endpoint.call_with_http_info(**kwargs)
227230

228231
def create_downtime(
229232
self,
230233
body: Downtime,
231234
) -> Downtime:
232-
"""Schedule a downtime.
235+
"""Schedule a downtime. **Deprecated**.
233236
234-
Schedule a downtime.
237+
Schedule a downtime. **Note:** This endpoint has been deprecated. Please use v2 endpoints.
235238
236239
:param body: Schedule a downtime request body.
237240
:type body: Downtime
@@ -240,15 +243,16 @@ def create_downtime(
240243
kwargs: Dict[str, Any] = {}
241244
kwargs["body"] = body
242245

246+
warnings.warn("create_downtime is deprecated", DeprecationWarning, stacklevel=2)
243247
return self._create_downtime_endpoint.call_with_http_info(**kwargs)
244248

245249
def get_downtime(
246250
self,
247251
downtime_id: int,
248252
) -> Downtime:
249-
"""Get a downtime.
253+
"""Get a downtime. **Deprecated**.
250254
251-
Get downtime detail by ``downtime_id``.
255+
Get downtime detail by ``downtime_id``. **Note:** This endpoint has been deprecated. Please use v2 endpoints.
252256
253257
:param downtime_id: ID of the downtime to fetch.
254258
:type downtime_id: int
@@ -257,6 +261,7 @@ def get_downtime(
257261
kwargs: Dict[str, Any] = {}
258262
kwargs["downtime_id"] = downtime_id
259263

264+
warnings.warn("get_downtime is deprecated", DeprecationWarning, stacklevel=2)
260265
return self._get_downtime_endpoint.call_with_http_info(**kwargs)
261266

262267
def list_downtimes(
@@ -265,9 +270,9 @@ def list_downtimes(
265270
current_only: Union[bool, UnsetType] = unset,
266271
with_creator: Union[bool, UnsetType] = unset,
267272
) -> List[Downtime]:
268-
"""Get all downtimes.
273+
"""Get all downtimes. **Deprecated**.
269274
270-
Get all scheduled downtimes.
275+
Get all scheduled downtimes. **Note:** This endpoint has been deprecated. Please use v2 endpoints.
271276
272277
:param current_only: Only return downtimes that are active when the request is made.
273278
:type current_only: bool, optional
@@ -282,15 +287,16 @@ def list_downtimes(
282287
if with_creator is not unset:
283288
kwargs["with_creator"] = with_creator
284289

290+
warnings.warn("list_downtimes is deprecated", DeprecationWarning, stacklevel=2)
285291
return self._list_downtimes_endpoint.call_with_http_info(**kwargs)
286292

287293
def list_monitor_downtimes(
288294
self,
289295
monitor_id: int,
290296
) -> List[Downtime]:
291-
"""Get active downtimes for a monitor.
297+
"""Get active downtimes for a monitor. **Deprecated**.
292298
293-
Get all active downtimes for the specified monitor.
299+
Get all active v1 downtimes for the specified monitor. **Note:** This endpoint has been deprecated. Please use v2 endpoints.
294300
295301
:param monitor_id: The id of the monitor
296302
:type monitor_id: int
@@ -299,16 +305,17 @@ def list_monitor_downtimes(
299305
kwargs: Dict[str, Any] = {}
300306
kwargs["monitor_id"] = monitor_id
301307

308+
warnings.warn("list_monitor_downtimes is deprecated", DeprecationWarning, stacklevel=2)
302309
return self._list_monitor_downtimes_endpoint.call_with_http_info(**kwargs)
303310

304311
def update_downtime(
305312
self,
306313
downtime_id: int,
307314
body: Downtime,
308315
) -> Downtime:
309-
"""Update a downtime.
316+
"""Update a downtime. **Deprecated**.
310317
311-
Update a single downtime by ``downtime_id``.
318+
Update a single downtime by ``downtime_id``. **Note:** This endpoint has been deprecated. Please use v2 endpoints.
312319
313320
:param downtime_id: ID of the downtime to update.
314321
:type downtime_id: int
@@ -321,4 +328,5 @@ def update_downtime(
321328

322329
kwargs["body"] = body
323330

331+
warnings.warn("update_downtime is deprecated", DeprecationWarning, stacklevel=2)
324332
return self._update_downtime_endpoint.call_with_http_info(**kwargs)

0 commit comments

Comments
 (0)