Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 70 additions & 2 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56843,6 +56843,40 @@ paths:
tags:
- DORA Metrics
x-codegen-request-body-name: body
/api/v2/dora/deployment/{deployment_id}:
delete:
description: Use this API endpoint to delete a deployment event.
operationId: DeleteDORADeployment
parameters:
- description: The ID of the deployment event to delete.
in: path
name: deployment_id
required: true
schema:
type: string
responses:
'202':
description: Accepted
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Bad Request
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
- appKeyAuth: []
summary: Delete a deployment event
tags:
- DORA Metrics
x-permission:
operator: OR
permissions:
- dora_metrics_write
/api/v2/dora/deployments:
post:
description: Use this API endpoint to get a list of deployment events.
Expand Down Expand Up @@ -56966,6 +57000,40 @@ paths:
tags:
- DORA Metrics
x-codegen-request-body-name: body
/api/v2/dora/failure/{failure_id}:
delete:
description: Use this API endpoint to delete a failure event.
operationId: DeleteDORAFailure
parameters:
- description: The ID of the failure event to delete.
in: path
name: failure_id
required: true
schema:
type: string
responses:
'202':
description: Accepted
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Bad Request
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
- appKeyAuth: []
summary: Delete a failure event
tags:
- DORA Metrics
x-permission:
operator: OR
permissions:
- dora_metrics_write
/api/v2/dora/failures:
post:
description: Use this API endpoint to get a list of failure events.
Expand Down Expand Up @@ -75655,8 +75723,8 @@ tags:
See the [Container Monitoring page](https://docs.datadoghq.com/containers/) for
more information.
name: Containers
- description: '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/)
- description: '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.


Expand Down
13 changes: 13 additions & 0 deletions examples/v2/dora-metrics/DeleteDORADeployment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
Delete a deployment event returns "Accepted" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.dora_metrics_api import DORAMetricsApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = DORAMetricsApi(api_client)
api_instance.delete_dora_deployment(
deployment_id="NO_VALUE",
)
13 changes: 13 additions & 0 deletions examples/v2/dora-metrics/DeleteDORAFailure.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
Delete a failure event returns "Accepted" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.dora_metrics_api import DORAMetricsApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = DORAMetricsApi(api_client)
api_instance.delete_dora_failure(
failure_id="NO_VALUE",
)
82 changes: 81 additions & 1 deletion src/datadog_api_client/v2/api/dora_metrics_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

class DORAMetricsApi:
"""
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.
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.

**Note** : DORA Metrics are not available in the US1-FED site.
"""
Expand Down Expand Up @@ -90,6 +90,52 @@ def __init__(self, api_client=None):
api_client=api_client,
)

self._delete_dora_deployment_endpoint = _Endpoint(
settings={
"response_type": None,
"auth": ["apiKeyAuth", "appKeyAuth"],
"endpoint_path": "/api/v2/dora/deployment/{deployment_id}",
"operation_id": "delete_dora_deployment",
"http_method": "DELETE",
"version": "v2",
},
params_map={
"deployment_id": {
"required": True,
"openapi_types": (str,),
"attribute": "deployment_id",
"location": "path",
},
},
headers_map={
"accept": ["*/*"],
},
api_client=api_client,
)

self._delete_dora_failure_endpoint = _Endpoint(
settings={
"response_type": None,
"auth": ["apiKeyAuth", "appKeyAuth"],
"endpoint_path": "/api/v2/dora/failure/{failure_id}",
"operation_id": "delete_dora_failure",
"http_method": "DELETE",
"version": "v2",
},
params_map={
"failure_id": {
"required": True,
"openapi_types": (str,),
"attribute": "failure_id",
"location": "path",
},
},
headers_map={
"accept": ["*/*"],
},
api_client=api_client,
)

self._get_dora_deployment_endpoint = _Endpoint(
settings={
"response_type": (DORAFetchResponse,),
Expand Down Expand Up @@ -243,6 +289,40 @@ def create_dora_incident(
warnings.warn("create_dora_incident is deprecated", DeprecationWarning, stacklevel=2)
return self._create_dora_incident_endpoint.call_with_http_info(**kwargs)

def delete_dora_deployment(
self,
deployment_id: str,
) -> None:
"""Delete a deployment event.

Use this API endpoint to delete a deployment event.

:param deployment_id: The ID of the deployment event to delete.
:type deployment_id: str
:rtype: None
"""
kwargs: Dict[str, Any] = {}
kwargs["deployment_id"] = deployment_id

return self._delete_dora_deployment_endpoint.call_with_http_info(**kwargs)

def delete_dora_failure(
self,
failure_id: str,
) -> None:
"""Delete a failure event.

Use this API endpoint to delete a failure event.

:param failure_id: The ID of the failure event to delete.
:type failure_id: str
:rtype: None
"""
kwargs: Dict[str, Any] = {}
kwargs["failure_id"] = failure_id

return self._delete_dora_failure_endpoint.call_with_http_info(**kwargs)

def get_dora_deployment(
self,
deployment_id: str,
Expand Down
35 changes: 33 additions & 2 deletions tests/v2/features/dora_metrics.feature
Original file line number Diff line number Diff line change
@@ -1,14 +1,45 @@
@endpoint(dora-metrics) @endpoint(dora-metrics-v2)
Feature: DORA Metrics
Search or send events for DORA Metrics to measure and improve your
software delivery performance. See the [DORA Metrics
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.
**Note**: DORA Metrics are not available in the US1-FED site.

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

@skip @team:DataDog/ci-app-backend
Scenario: Delete a deployment event returns "Accepted" response
Given new "DeleteDORADeployment" request
And a valid "appKeyAuth" key in the system
And request contains "deployment_id" parameter with value "NO_VALUE"
When the request is sent
Then the response status is 202 Accepted

@skip @team:DataDog/ci-app-backend
Scenario: Delete a deployment event returns "Bad Request" response
Given new "DeleteDORADeployment" request
And request contains "deployment_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@skip @team:DataDog/ci-app-backend
Scenario: Delete a failure event returns "Accepted" response
Given new "DeleteDORAFailure" request
And a valid "appKeyAuth" key in the system
And request contains "failure_id" parameter with value "NO_VALUE"
When the request is sent
Then the response status is 202 Accepted

@skip @team:DataDog/ci-app-backend
Scenario: Delete a failure event returns "Bad Request" response
Given new "DeleteDORAFailure" request
And a valid "appKeyAuth" key in the system
And request contains "failure_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/ci-app-backend
Scenario: Get a deployment event returns "Bad Request" response
Given new "GetDORADeployment" request
Expand Down
12 changes: 12 additions & 0 deletions tests/v2/features/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,12 @@
"type": "idempotent"
}
},
"DeleteDORADeployment": {
"tag": "DORA Metrics",
"undo": {
"type": "idempotent"
}
},
"ListDORADeployments": {
"tag": "DORA Metrics",
"undo": {
Expand All @@ -1082,6 +1088,12 @@
"type": "idempotent"
}
},
"DeleteDORAFailure": {
"tag": "DORA Metrics",
"undo": {
"type": "idempotent"
}
},
"ListDORAFailures": {
"tag": "DORA Metrics",
"undo": {
Expand Down