Skip to content

Commit f8a8b90

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 3f0422a of spec repo
1 parent fa30bee commit f8a8b90

File tree

6 files changed

+216
-4
lines changed

6 files changed

+216
-4
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52524,6 +52524,39 @@ paths:
5252452524
permissions:
5252552525
- dora_metrics_read
5252652526
/api/v2/dora/deployments/{deployment_id}:
52527+
delete:
52528+
description: Use this API endpoint to delete a deployment event.
52529+
operationId: DeleteDORADeployment
52530+
parameters:
52531+
- description: The ID of the deployment event to delete.
52532+
in: path
52533+
name: deployment_id
52534+
required: true
52535+
schema:
52536+
type: string
52537+
responses:
52538+
'202':
52539+
description: Accepted
52540+
'400':
52541+
content:
52542+
application/json:
52543+
schema:
52544+
$ref: '#/components/schemas/JSONAPIErrorResponse'
52545+
description: Bad Request
52546+
'403':
52547+
$ref: '#/components/responses/NotAuthorizedResponse'
52548+
'429':
52549+
$ref: '#/components/responses/TooManyRequestsResponse'
52550+
security:
52551+
- apiKeyAuth: []
52552+
- appKeyAuth: []
52553+
summary: Delete a deployment event
52554+
tags:
52555+
- DORA Metrics
52556+
x-permission:
52557+
operator: OR
52558+
permissions:
52559+
- dora_metrics_write
5252752560
get:
5252852561
description: Use this API endpoint to get a deployment event.
5252952562
operationId: GetDORADeployment
@@ -52647,6 +52680,39 @@ paths:
5264752680
permissions:
5264852681
- dora_metrics_read
5264952682
/api/v2/dora/failures/{failure_id}:
52683+
delete:
52684+
description: Use this API endpoint to delete a failure event.
52685+
operationId: DeleteDORAFailure
52686+
parameters:
52687+
- description: The ID of the failure event to delete.
52688+
in: path
52689+
name: failure_id
52690+
required: true
52691+
schema:
52692+
type: string
52693+
responses:
52694+
'202':
52695+
description: Accepted
52696+
'400':
52697+
content:
52698+
application/json:
52699+
schema:
52700+
$ref: '#/components/schemas/JSONAPIErrorResponse'
52701+
description: Bad Request
52702+
'403':
52703+
$ref: '#/components/responses/NotAuthorizedResponse'
52704+
'429':
52705+
$ref: '#/components/responses/TooManyRequestsResponse'
52706+
security:
52707+
- apiKeyAuth: []
52708+
- appKeyAuth: []
52709+
summary: Delete a failure event
52710+
tags:
52711+
- DORA Metrics
52712+
x-permission:
52713+
operator: OR
52714+
permissions:
52715+
- dora_metrics_write
5265052716
get:
5265152717
description: Use this API endpoint to get a failure event.
5265252718
operationId: GetDORAFailure
@@ -70392,8 +70458,8 @@ tags:
7039270458
See the [Container Monitoring page](https://docs.datadoghq.com/containers/) for
7039370459
more information.
7039470460
name: Containers
70395-
- description: 'Search or send events for DORA Metrics to measure and improve your
70396-
software delivery performance. See the [DORA Metrics page](https://docs.datadoghq.com/dora_metrics/)
70461+
- description: 'Search, send or delete events for DORA Metrics to measure and improve
70462+
your software delivery performance. See the [DORA Metrics page](https://docs.datadoghq.com/dora_metrics/)
7039770463
for more information.
7039870464

7039970465

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="deployment_id",
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="failure_id",
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: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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
3+
Search, send or delete events for DORA Metrics to measure and improve your
44
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.
@@ -9,6 +9,34 @@ Feature: DORA Metrics
99
Given a valid "apiKeyAuth" key in the system
1010
And an instance of "DORAMetrics" API
1111

12+
@generated @skip @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 from "REPLACE.ME"
16+
When the request is sent
17+
Then the response status is 202 Accepted
18+
19+
@generated @skip @team:DataDog/ci-app-backend
20+
Scenario: Delete a deployment event returns "Bad Request" response
21+
Given new "DeleteDORADeployment" request
22+
And request contains "deployment_id" parameter from "REPLACE.ME"
23+
When the request is sent
24+
Then the response status is 400 Bad Request
25+
26+
@generated @skip @team:DataDog/ci-app-backend
27+
Scenario: Delete a failure event returns "Accepted" response
28+
Given new "DeleteDORAFailure" request
29+
And request contains "failure_id" parameter from "REPLACE.ME"
30+
When the request is sent
31+
Then the response status is 202 Accepted
32+
33+
@generated @skip @team:DataDog/ci-app-backend
34+
Scenario: Delete a failure event returns "Bad Request" response
35+
Given new "DeleteDORAFailure" request
36+
And request contains "failure_id" parameter from "REPLACE.ME"
37+
When the request is sent
38+
Then the response status is 400 Bad Request
39+
1240
@generated @skip @team:DataDog/ci-app-backend
1341
Scenario: Get a deployment event returns "Bad Request" response
1442
Given new "GetDORADeployment" request

tests/v2/features/undo.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,12 @@
955955
"type": "safe"
956956
}
957957
},
958+
"DeleteDORADeployment": {
959+
"tag": "DORA Metrics",
960+
"undo": {
961+
"type": "idempotent"
962+
}
963+
},
958964
"GetDORADeployment": {
959965
"tag": "DORA Metrics",
960966
"undo": {
@@ -973,6 +979,12 @@
973979
"type": "safe"
974980
}
975981
},
982+
"DeleteDORAFailure": {
983+
"tag": "DORA Metrics",
984+
"undo": {
985+
"type": "idempotent"
986+
}
987+
},
976988
"GetDORAFailure": {
977989
"tag": "DORA Metrics",
978990
"undo": {

0 commit comments

Comments
 (0)