Skip to content

Commit faf01af

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 5780398 of spec repo
1 parent 2d19d28 commit faf01af

File tree

6 files changed

+222
-5
lines changed

6 files changed

+222
-5
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56815,6 +56815,40 @@ paths:
5681556815
tags:
5681656816
- DORA Metrics
5681756817
x-codegen-request-body-name: body
56818+
/api/v2/dora/deployment/{deployment_id}:
56819+
delete:
56820+
description: Use this API endpoint to delete a deployment event.
56821+
operationId: DeleteDORADeployment
56822+
parameters:
56823+
- description: The ID of the deployment event to delete.
56824+
in: path
56825+
name: deployment_id
56826+
required: true
56827+
schema:
56828+
type: string
56829+
responses:
56830+
'202':
56831+
description: Accepted
56832+
'400':
56833+
content:
56834+
application/json:
56835+
schema:
56836+
$ref: '#/components/schemas/JSONAPIErrorResponse'
56837+
description: Bad Request
56838+
'403':
56839+
$ref: '#/components/responses/NotAuthorizedResponse'
56840+
'429':
56841+
$ref: '#/components/responses/TooManyRequestsResponse'
56842+
security:
56843+
- apiKeyAuth: []
56844+
- appKeyAuth: []
56845+
summary: Delete a deployment event
56846+
tags:
56847+
- DORA Metrics
56848+
x-permission:
56849+
operator: OR
56850+
permissions:
56851+
- dora_metrics_write
5681856852
/api/v2/dora/deployments:
5681956853
post:
5682056854
description: Use this API endpoint to get a list of deployment events.
@@ -56938,6 +56972,40 @@ paths:
5693856972
tags:
5693956973
- DORA Metrics
5694056974
x-codegen-request-body-name: body
56975+
/api/v2/dora/failure/{failure_id}:
56976+
delete:
56977+
description: Use this API endpoint to delete a failure event.
56978+
operationId: DeleteDORAFailure
56979+
parameters:
56980+
- description: The ID of the failure event to delete.
56981+
in: path
56982+
name: failure_id
56983+
required: true
56984+
schema:
56985+
type: string
56986+
responses:
56987+
'202':
56988+
description: Accepted
56989+
'400':
56990+
content:
56991+
application/json:
56992+
schema:
56993+
$ref: '#/components/schemas/JSONAPIErrorResponse'
56994+
description: Bad Request
56995+
'403':
56996+
$ref: '#/components/responses/NotAuthorizedResponse'
56997+
'429':
56998+
$ref: '#/components/responses/TooManyRequestsResponse'
56999+
security:
57000+
- apiKeyAuth: []
57001+
- appKeyAuth: []
57002+
summary: Delete a failure event
57003+
tags:
57004+
- DORA Metrics
57005+
x-permission:
57006+
operator: OR
57007+
permissions:
57008+
- dora_metrics_write
5694157009
/api/v2/dora/failures:
5694257010
post:
5694357011
description: Use this API endpoint to get a list of failure events.
@@ -75627,8 +75695,8 @@ tags:
7562775695
See the [Container Monitoring page](https://docs.datadoghq.com/containers/) for
7562875696
more information.
7562975697
name: Containers
75630-
- description: 'Search or send events for DORA Metrics to measure and improve your
75631-
software delivery performance. See the [DORA Metrics page](https://docs.datadoghq.com/dora_metrics/)
75698+
- description: 'Search, send, or delete events for DORA Metrics to measure and improve
75699+
your software delivery performance. See the [DORA Metrics page](https://docs.datadoghq.com/dora_metrics/)
7563275700
for more information.
7563375701

7563475702

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="NO_VALUE",
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="NO_VALUE",
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/deployment/{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/failure/{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: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,45 @@
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+
@skip @team:DataDog/ci-app-backend
13+
Scenario: Delete a deployment event returns "Accepted" response
14+
Given new "DeleteDORADeployment" request
15+
And a valid "appKeyAuth" key in the system
16+
And request contains "deployment_id" parameter with value "NO_VALUE"
17+
When the request is sent
18+
Then the response status is 202 Accepted
19+
20+
@skip @team:DataDog/ci-app-backend
21+
Scenario: Delete a deployment event returns "Bad Request" response
22+
Given new "DeleteDORADeployment" request
23+
And request contains "deployment_id" parameter from "REPLACE.ME"
24+
When the request is sent
25+
Then the response status is 400 Bad Request
26+
27+
@skip @team:DataDog/ci-app-backend
28+
Scenario: Delete a failure event returns "Accepted" response
29+
Given new "DeleteDORAFailure" request
30+
And a valid "appKeyAuth" key in the system
31+
And request contains "failure_id" parameter with value "NO_VALUE"
32+
When the request is sent
33+
Then the response status is 202 Accepted
34+
35+
@skip @team:DataDog/ci-app-backend
36+
Scenario: Delete a failure event returns "Bad Request" response
37+
Given new "DeleteDORAFailure" request
38+
And a valid "appKeyAuth" key in the system
39+
And request contains "failure_id" parameter from "REPLACE.ME"
40+
When the request is sent
41+
Then the response status is 400 Bad Request
42+
1243
@generated @skip @team:DataDog/ci-app-backend
1344
Scenario: Get a deployment event returns "Bad Request" response
1445
Given new "GetDORADeployment" request

tests/v2/features/undo.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,12 @@
10641064
"type": "idempotent"
10651065
}
10661066
},
1067+
"DeleteDORADeployment": {
1068+
"tag": "DORA Metrics",
1069+
"undo": {
1070+
"type": "idempotent"
1071+
}
1072+
},
10671073
"ListDORADeployments": {
10681074
"tag": "DORA Metrics",
10691075
"undo": {
@@ -1082,6 +1088,12 @@
10821088
"type": "idempotent"
10831089
}
10841090
},
1091+
"DeleteDORAFailure": {
1092+
"tag": "DORA Metrics",
1093+
"undo": {
1094+
"type": "idempotent"
1095+
}
1096+
},
10851097
"ListDORAFailures": {
10861098
"tag": "DORA Metrics",
10871099
"undo": {

0 commit comments

Comments
 (0)