From 2ed6d0da4fbe405e4b746e950adc42b9af00a3e5 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 19 Sep 2025 09:48:48 +0000 Subject: [PATCH] Regenerate client from commit 3584508 of spec repo --- .generator/schemas/v2/openapi.yaml | 72 +++++++++- .../v2/dora-metrics/DeleteDORADeployment.rb | 5 + examples/v2/dora-metrics/DeleteDORAFailure.rb | 5 + features/scenarios_model_mapping.rb | 6 + features/v2/dora_metrics.feature | 35 ++++- features/v2/undo.json | 12 ++ .../v2/api/dora_metrics_api.rb | 130 ++++++++++++++++++ 7 files changed, 261 insertions(+), 4 deletions(-) create mode 100644 examples/v2/dora-metrics/DeleteDORADeployment.rb create mode 100644 examples/v2/dora-metrics/DeleteDORAFailure.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5f50db2f7a57..d3d603bec261 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -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. @@ -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. @@ -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. diff --git a/examples/v2/dora-metrics/DeleteDORADeployment.rb b/examples/v2/dora-metrics/DeleteDORADeployment.rb new file mode 100644 index 000000000000..0e43817413ed --- /dev/null +++ b/examples/v2/dora-metrics/DeleteDORADeployment.rb @@ -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") diff --git a/examples/v2/dora-metrics/DeleteDORAFailure.rb b/examples/v2/dora-metrics/DeleteDORAFailure.rb new file mode 100644 index 000000000000..17c01411d4a3 --- /dev/null +++ b/examples/v2/dora-metrics/DeleteDORAFailure.rb @@ -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") diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index fa53ec24c1e2..8dfadba604a9 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1745,6 +1745,9 @@ "v2.CreateDORADeployment" => { "body" => "DORADeploymentRequest", }, + "v2.DeleteDORADeployment" => { + "deployment_id" => "String", + }, "v2.ListDORADeployments" => { "body" => "DORAListDeploymentsRequest", }, @@ -1754,6 +1757,9 @@ "v2.CreateDORAFailure" => { "body" => "DORAFailureRequest", }, + "v2.DeleteDORAFailure" => { + "failure_id" => "String", + }, "v2.ListDORAFailures" => { "body" => "DORAListFailuresRequest", }, diff --git a/features/v2/dora_metrics.feature b/features/v2/dora_metrics.feature index acc8230e3616..e34092056ca5 100644 --- a/features/v2/dora_metrics.feature +++ b/features/v2/dora_metrics.feature @@ -1,7 +1,7 @@ @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. @@ -9,6 +9,37 @@ Feature: DORA Metrics 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 diff --git a/features/v2/undo.json b/features/v2/undo.json index 7f8336d494c4..d864e99bb626 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1064,6 +1064,12 @@ "type": "idempotent" } }, + "DeleteDORADeployment": { + "tag": "DORA Metrics", + "undo": { + "type": "idempotent" + } + }, "ListDORADeployments": { "tag": "DORA Metrics", "undo": { @@ -1082,6 +1088,12 @@ "type": "idempotent" } }, + "DeleteDORAFailure": { + "tag": "DORA Metrics", + "undo": { + "type": "idempotent" + } + }, "ListDORAFailures": { "tag": "DORA Metrics", "undo": { diff --git a/lib/datadog_api_client/v2/api/dora_metrics_api.rb b/lib/datadog_api_client/v2/api/dora_metrics_api.rb index ae5379e946e4..f160fe988ba7 100644 --- a/lib/datadog_api_client/v2/api/dora_metrics_api.rb +++ b/lib/datadog_api_client/v2/api/dora_metrics_api.rb @@ -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