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
5 changes: 5 additions & 0 deletions examples/v2/dora-metrics/DeleteDORADeployment.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Delete a deployment event returns "Accepted" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::DORAMetricsAPI.new
p api_instance.delete_dora_deployment("NO_VALUE")
5 changes: 5 additions & 0 deletions examples/v2/dora-metrics/DeleteDORAFailure.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Delete a failure event returns "Accepted" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::DORAMetricsAPI.new
p api_instance.delete_dora_failure("NO_VALUE")
6 changes: 6 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1745,6 +1745,9 @@
"v2.CreateDORADeployment" => {
"body" => "DORADeploymentRequest",
},
"v2.DeleteDORADeployment" => {
"deployment_id" => "String",
},
"v2.ListDORADeployments" => {
"body" => "DORAListDeploymentsRequest",
},
Expand All @@ -1754,6 +1757,9 @@
"v2.CreateDORAFailure" => {
"body" => "DORAFailureRequest",
},
"v2.DeleteDORAFailure" => {
"failure_id" => "String",
},
"v2.ListDORAFailures" => {
"body" => "DORAListFailuresRequest",
},
Expand Down
35 changes: 33 additions & 2 deletions features/v2/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 features/v2/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
130 changes: 130 additions & 0 deletions lib/datadog_api_client/v2/api/dora_metrics_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,136 @@ def create_dora_incident_with_http_info(body, opts = {})
return data, status_code, headers
end

# Delete a deployment event.
#
# @see #delete_dora_deployment_with_http_info
def delete_dora_deployment(deployment_id, opts = {})
delete_dora_deployment_with_http_info(deployment_id, opts)
nil
end

# Delete a deployment event.
#
# Use this API endpoint to delete a deployment event.
#
# @param deployment_id [String] The ID of the deployment event to delete.
# @param opts [Hash] the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def delete_dora_deployment_with_http_info(deployment_id, opts = {})

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: DORAMetricsAPI.delete_dora_deployment ...'
end
# verify the required parameter 'deployment_id' is set
if @api_client.config.client_side_validation && deployment_id.nil?
fail ArgumentError, "Missing the required parameter 'deployment_id' when calling DORAMetricsAPI.delete_dora_deployment"
end
# resource path
local_var_path = '/api/v2/dora/deployment/{deployment_id}'.sub('{deployment_id}', CGI.escape(deployment_id.to_s).gsub('%2F', '/'))

# query parameters
query_params = opts[:query_params] || {}

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['*/*'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type]

# auth_names
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

new_options = opts.merge(
:operation => :delete_dora_deployment,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type,
:api_version => "V2"
)

data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: DORAMetricsAPI#delete_dora_deployment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# Delete a failure event.
#
# @see #delete_dora_failure_with_http_info
def delete_dora_failure(failure_id, opts = {})
delete_dora_failure_with_http_info(failure_id, opts)
nil
end

# Delete a failure event.
#
# Use this API endpoint to delete a failure event.
#
# @param failure_id [String] The ID of the failure event to delete.
# @param opts [Hash] the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def delete_dora_failure_with_http_info(failure_id, opts = {})

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: DORAMetricsAPI.delete_dora_failure ...'
end
# verify the required parameter 'failure_id' is set
if @api_client.config.client_side_validation && failure_id.nil?
fail ArgumentError, "Missing the required parameter 'failure_id' when calling DORAMetricsAPI.delete_dora_failure"
end
# resource path
local_var_path = '/api/v2/dora/failure/{failure_id}'.sub('{failure_id}', CGI.escape(failure_id.to_s).gsub('%2F', '/'))

# query parameters
query_params = opts[:query_params] || {}

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['*/*'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type]

# auth_names
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

new_options = opts.merge(
:operation => :delete_dora_failure,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type,
:api_version => "V2"
)

data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: DORAMetricsAPI#delete_dora_failure\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# Get a deployment event.
#
# @see #get_dora_deployment_with_http_info
Expand Down
Loading