Skip to content

Commit 6fb2a70

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 9fe2b3b of spec repo
1 parent cc042b6 commit 6fb2a70

File tree

6 files changed

+215
-5
lines changed

6 files changed

+215
-5
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54509,6 +54509,39 @@ paths:
5450954509
permissions:
5451054510
- dora_metrics_read
5451154511
/api/v2/dora/deployments/{deployment_id}:
54512+
delete:
54513+
description: Use this API endpoint to delete a deployment event.
54514+
operationId: DeleteDORADeployment
54515+
parameters:
54516+
- description: The ID of the deployment event to delete.
54517+
in: path
54518+
name: deployment_id
54519+
required: true
54520+
schema:
54521+
type: string
54522+
responses:
54523+
'202':
54524+
description: Accepted
54525+
'400':
54526+
content:
54527+
application/json:
54528+
schema:
54529+
$ref: '#/components/schemas/JSONAPIErrorResponse'
54530+
description: Bad Request
54531+
'403':
54532+
$ref: '#/components/responses/NotAuthorizedResponse'
54533+
'429':
54534+
$ref: '#/components/responses/TooManyRequestsResponse'
54535+
security:
54536+
- apiKeyAuth: []
54537+
- appKeyAuth: []
54538+
summary: Delete a deployment event
54539+
tags:
54540+
- DORA Metrics
54541+
x-permission:
54542+
operator: OR
54543+
permissions:
54544+
- dora_metrics_write
5451254545
get:
5451354546
description: Use this API endpoint to get a deployment event.
5451454547
operationId: GetDORADeployment
@@ -54632,6 +54665,39 @@ paths:
5463254665
permissions:
5463354666
- dora_metrics_read
5463454667
/api/v2/dora/failures/{failure_id}:
54668+
delete:
54669+
description: Use this API endpoint to delete a failure event.
54670+
operationId: DeleteDORAFailure
54671+
parameters:
54672+
- description: The ID of the failure event to delete.
54673+
in: path
54674+
name: failure_id
54675+
required: true
54676+
schema:
54677+
type: string
54678+
responses:
54679+
'202':
54680+
description: Accepted
54681+
'400':
54682+
content:
54683+
application/json:
54684+
schema:
54685+
$ref: '#/components/schemas/JSONAPIErrorResponse'
54686+
description: Bad Request
54687+
'403':
54688+
$ref: '#/components/responses/NotAuthorizedResponse'
54689+
'429':
54690+
$ref: '#/components/responses/TooManyRequestsResponse'
54691+
security:
54692+
- apiKeyAuth: []
54693+
- appKeyAuth: []
54694+
summary: Delete a failure event
54695+
tags:
54696+
- DORA Metrics
54697+
x-permission:
54698+
operator: OR
54699+
permissions:
54700+
- dora_metrics_write
5463554701
get:
5463654702
description: Use this API endpoint to get a failure event.
5463754703
operationId: GetDORAFailure
@@ -72976,8 +73042,8 @@ tags:
7297673042
See the [Container Monitoring page](https://docs.datadoghq.com/containers/) for
7297773043
more information.
7297873044
name: Containers
72979-
- description: 'Search or send events for DORA Metrics to measure and improve your
72980-
software delivery performance. See the [DORA Metrics page](https://docs.datadoghq.com/dora_metrics/)
73045+
- description: 'Search, send, or delete events for DORA Metrics to measure and improve
73046+
your software delivery performance. See the [DORA Metrics page](https://docs.datadoghq.com/dora_metrics/)
7298173047
for more information.
7298273048

7298373049

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
Delete a deployment event returns "Accepted" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.dora_metrics_api import DORAMetricsApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = DORAMetricsApi(api_client)
11+
api_instance.delete_dora_deployment(
12+
deployment_id="{unique_lower}",
13+
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
Delete a failure event returns "Accepted" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.dora_metrics_api import DORAMetricsApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = DORAMetricsApi(api_client)
11+
api_instance.delete_dora_failure(
12+
failure_id="{unique_lower}",
13+
)

src/datadog_api_client/v2/api/dora_metrics_api.py

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
class DORAMetricsApi:
2222
"""
23-
Search or send events for DORA Metrics to measure and improve your software delivery performance. See the `DORA Metrics page <https://docs.datadoghq.com/dora_metrics/>`_ for more information.
23+
Search, send, or delete events for DORA Metrics to measure and improve your software delivery performance. See the `DORA Metrics page <https://docs.datadoghq.com/dora_metrics/>`_ for more information.
2424
2525
**Note** : DORA Metrics are not available in the US1-FED site.
2626
"""
@@ -90,6 +90,52 @@ def __init__(self, api_client=None):
9090
api_client=api_client,
9191
)
9292

93+
self._delete_dora_deployment_endpoint = _Endpoint(
94+
settings={
95+
"response_type": None,
96+
"auth": ["apiKeyAuth", "appKeyAuth"],
97+
"endpoint_path": "/api/v2/dora/deployments/{deployment_id}",
98+
"operation_id": "delete_dora_deployment",
99+
"http_method": "DELETE",
100+
"version": "v2",
101+
},
102+
params_map={
103+
"deployment_id": {
104+
"required": True,
105+
"openapi_types": (str,),
106+
"attribute": "deployment_id",
107+
"location": "path",
108+
},
109+
},
110+
headers_map={
111+
"accept": ["*/*"],
112+
},
113+
api_client=api_client,
114+
)
115+
116+
self._delete_dora_failure_endpoint = _Endpoint(
117+
settings={
118+
"response_type": None,
119+
"auth": ["apiKeyAuth", "appKeyAuth"],
120+
"endpoint_path": "/api/v2/dora/failures/{failure_id}",
121+
"operation_id": "delete_dora_failure",
122+
"http_method": "DELETE",
123+
"version": "v2",
124+
},
125+
params_map={
126+
"failure_id": {
127+
"required": True,
128+
"openapi_types": (str,),
129+
"attribute": "failure_id",
130+
"location": "path",
131+
},
132+
},
133+
headers_map={
134+
"accept": ["*/*"],
135+
},
136+
api_client=api_client,
137+
)
138+
93139
self._get_dora_deployment_endpoint = _Endpoint(
94140
settings={
95141
"response_type": (DORAFetchResponse,),
@@ -243,6 +289,40 @@ def create_dora_incident(
243289
warnings.warn("create_dora_incident is deprecated", DeprecationWarning, stacklevel=2)
244290
return self._create_dora_incident_endpoint.call_with_http_info(**kwargs)
245291

292+
def delete_dora_deployment(
293+
self,
294+
deployment_id: str,
295+
) -> None:
296+
"""Delete a deployment event.
297+
298+
Use this API endpoint to delete a deployment event.
299+
300+
:param deployment_id: The ID of the deployment event to delete.
301+
:type deployment_id: str
302+
:rtype: None
303+
"""
304+
kwargs: Dict[str, Any] = {}
305+
kwargs["deployment_id"] = deployment_id
306+
307+
return self._delete_dora_deployment_endpoint.call_with_http_info(**kwargs)
308+
309+
def delete_dora_failure(
310+
self,
311+
failure_id: str,
312+
) -> None:
313+
"""Delete a failure event.
314+
315+
Use this API endpoint to delete a failure event.
316+
317+
:param failure_id: The ID of the failure event to delete.
318+
:type failure_id: str
319+
:rtype: None
320+
"""
321+
kwargs: Dict[str, Any] = {}
322+
kwargs["failure_id"] = failure_id
323+
324+
return self._delete_dora_failure_endpoint.call_with_http_info(**kwargs)
325+
246326
def get_dora_deployment(
247327
self,
248328
deployment_id: str,

tests/v2/features/dora_metrics.feature

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,40 @@
11
@endpoint(dora-metrics) @endpoint(dora-metrics-v2)
22
Feature: DORA Metrics
3-
Search or send events for DORA Metrics to measure and improve your
4-
software delivery performance. See the [DORA Metrics
3+
Search, send, or delete events for DORA Metrics to measure and improve
4+
your software delivery performance. See the [DORA Metrics
55
page](https://docs.datadoghq.com/dora_metrics/) for more information.
66
**Note**: DORA Metrics are not available in the US1-FED site.
77

88
Background:
99
Given a valid "apiKeyAuth" key in the system
1010
And an instance of "DORAMetrics" API
1111

12+
@team:DataDog/ci-app-backend
13+
Scenario: Delete a deployment event returns "Accepted" response
14+
Given new "DeleteDORADeployment" request
15+
And request contains "deployment_id" parameter with value "{unique_lower}"
16+
When the request is sent
17+
Then the response status is 202 Accepted
18+
19+
@team:DataDog/ci-app-backend
20+
Scenario: Delete a deployment event returns "Bad Request" response
21+
Given new "DeleteDORADeployment" request
22+
When the request is sent
23+
Then the response status is 400 Bad Request
24+
25+
@team:DataDog/ci-app-backend
26+
Scenario: Delete a failure event returns "Accepted" response
27+
Given new "DeleteDORAFailure" request
28+
And request contains "failure_id" parameter with value "{unique_lower}"
29+
When the request is sent
30+
Then the response status is 202 Accepted
31+
32+
@team:DataDog/ci-app-backend
33+
Scenario: Delete a failure event returns "Bad Request" response
34+
Given new "DeleteDORAFailure" request
35+
When the request is sent
36+
Then the response status is 400 Bad Request
37+
1238
@generated @skip @team:DataDog/ci-app-backend
1339
Scenario: Get a deployment event returns "Bad Request" response
1440
Given new "GetDORADeployment" request

tests/v2/features/undo.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,12 @@
10161016
"type": "safe"
10171017
}
10181018
},
1019+
"DeleteDORADeployment": {
1020+
"tag": "DORA Metrics",
1021+
"undo": {
1022+
"type": "idempotent"
1023+
}
1024+
},
10191025
"GetDORADeployment": {
10201026
"tag": "DORA Metrics",
10211027
"undo": {
@@ -1034,6 +1040,12 @@
10341040
"type": "safe"
10351041
}
10361042
},
1043+
"DeleteDORAFailure": {
1044+
"tag": "DORA Metrics",
1045+
"undo": {
1046+
"type": "idempotent"
1047+
}
1048+
},
10371049
"GetDORAFailure": {
10381050
"tag": "DORA Metrics",
10391051
"undo": {

0 commit comments

Comments
 (0)