From cf464bd52928686599c4166e369ba1be521714aa Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Tue, 18 Apr 2023 17:43:29 +0000 Subject: [PATCH] Fix spans/logs custom metrics delete operation responses (#1751) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 +++---- .generator/schemas/v2/openapi.yaml | 4 ++-- README.md | 7 +++--- .../api/client/v2/api/LogsMetricsApi.java | 2 +- .../api/client/v2/api/SpansMetricsApi.java | 2 +- ...og_based_metric_returns_OK_response.freeze | 2 +- ..._log_based_metric_returns_OK_response.json | 23 +++++++++---------- ...an_based_metric_returns_OK_response.freeze | 2 +- ...span_based_metric_returns_OK_response.json | 23 +++++++++---------- .../api/client/v2/api/logs_metrics.feature | 2 +- .../api/client/v2/api/spans_metrics.feature | 2 +- 11 files changed, 38 insertions(+), 39 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index a9c8e57fbac..4d454da52e6 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2023-04-17 18:07:40.383745", - "spec_repo_commit": "25a92e6d" + "regenerated": "2023-04-18 17:35:07.748467", + "spec_repo_commit": "0c4beb36" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2023-04-17 18:07:40.396130", - "spec_repo_commit": "25a92e6d" + "regenerated": "2023-04-18 17:35:07.761090", + "spec_repo_commit": "0c4beb36" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f9461e78be2..2fc0f14e76a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -14564,7 +14564,7 @@ paths: parameters: - $ref: '#/components/parameters/SpansMetricIDParameter' responses: - '200': + '204': description: OK '403': $ref: '#/components/responses/NotAuthorizedResponse' @@ -18090,7 +18090,7 @@ paths: parameters: - $ref: '#/components/parameters/MetricID' responses: - '200': + '204': description: OK '403': $ref: '#/components/responses/NotAuthorizedResponse' diff --git a/README.md b/README.md index 9403a94759d..c84f50c4c15 100644 --- a/README.md +++ b/README.md @@ -208,9 +208,10 @@ public class ProxyExample { ### Using alternative artifacts Outside of the regular JAR file we also release 2 artifacts that can be useful for development, namely: - - `jar-with-dependencies`, which contains all the dependencies of the client in a single JAR - - `shaded-jar`, which includes and renames the core dependencies of the client, allowing you to use different versions of those - libraries in your project. + +- `jar-with-dependencies`, which contains all the dependencies of the client in a single JAR +- `shaded-jar`, which includes and renames the core dependencies of the client, allowing you to use different versions of those + libraries in your project. To use them in Maven, just add the `classifier` keyword in the dependency definition. For example: diff --git a/src/main/java/com/datadog/api/client/v2/api/LogsMetricsApi.java b/src/main/java/com/datadog/api/client/v2/api/LogsMetricsApi.java index b7fb500eb35..9bbb24b979f 100644 --- a/src/main/java/com/datadog/api/client/v2/api/LogsMetricsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/LogsMetricsApi.java @@ -217,7 +217,7 @@ public CompletableFuture deleteLogsMetricAsync(String metricId) { * * * - * + * * * * diff --git a/src/main/java/com/datadog/api/client/v2/api/SpansMetricsApi.java b/src/main/java/com/datadog/api/client/v2/api/SpansMetricsApi.java index 08d668b0f0c..666e55e8a24 100644 --- a/src/main/java/com/datadog/api/client/v2/api/SpansMetricsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/SpansMetricsApi.java @@ -218,7 +218,7 @@ public CompletableFuture deleteSpansMetricAsync(String metricId) { *
Response details
Status Code Description Response Headers
200 OK -
204 OK -
403 Not Authorized -
404 Not Found -
429 Too many requests -
* * - * + * * * * diff --git a/src/test/resources/cassettes/features/v2/Delete_a_log_based_metric_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Delete_a_log_based_metric_returns_OK_response.freeze index b4493545e6e..abcb7a7d514 100644 --- a/src/test/resources/cassettes/features/v2/Delete_a_log_based_metric_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Delete_a_log_based_metric_returns_OK_response.freeze @@ -1 +1 @@ -2022-05-12T09:52:23.762Z \ No newline at end of file +2023-04-18T17:27:11.097Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_a_log_based_metric_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_a_log_based_metric_returns_OK_response.json index 96037960d1b..4886804541c 100644 --- a/src/test/resources/cassettes/features/v2/Delete_a_log_based_metric_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_a_log_based_metric_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"compute\":{\"aggregation_type\":\"count\"},\"filter\":{\"query\":\"source:Test-Delete_a_log_based_metric_returns_OK_response-1652349143\"}},\"id\":\"Test-Delete_a_log_based_metric_returns_OK_response-1652349143\",\"type\":\"logs_metrics\"}}" + "json": "{\"data\":{\"attributes\":{\"compute\":{\"aggregation_type\":\"count\"},\"filter\":{\"query\":\"source:Test-Delete_a_log_based_metric_returns_OK_response-1681838831\"}},\"id\":\"Test-Delete_a_log_based_metric_returns_OK_response-1681838831\",\"type\":\"logs_metrics\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"attributes\":{\"filter\":{\"query\":\"source:Test-Delete_a_log_based_metric_returns_OK_response-1652349143\"},\"group_by\":[],\"compute\":{\"aggregation_type\":\"count\"}},\"type\":\"logs_metrics\",\"id\":\"Test_Delete_a_log_based_metric_returns_OK_response_1652349143\"}}", + "body": "{\"data\":{\"id\":\"Test_Delete_a_log_based_metric_returns_OK_response_1681838831\",\"attributes\":{\"filter\":{\"query\":\"source:Test-Delete_a_log_based_metric_returns_OK_response-1681838831\"},\"group_by\":[],\"compute\":{\"aggregation_type\":\"count\"}},\"type\":\"logs_metrics\"}}\n", "headers": { "Content-Type": [ "application/json" @@ -27,25 +27,24 @@ "timeToLive": { "unlimited": true }, - "id": "b9e06018-0894-969b-2f3c-d8898f7bf343" + "id": "756a0b40-9fbb-0365-1b2a-a8966134a09f" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/logs/config/metrics/Test_Delete_a_log_based_metric_returns_OK_response_1652349143", + "path": "/api/v2/logs/config/metrics/Test_Delete_a_log_based_metric_returns_OK_response_1681838831", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{}", "headers": { "Content-Type": [ - "application/json" + "text/html; charset=utf-8" ] }, - "statusCode": 200, - "reasonPhrase": "OK" + "statusCode": 204, + "reasonPhrase": "No Content" }, "times": { "remainingTimes": 1 @@ -53,18 +52,18 @@ "timeToLive": { "unlimited": true }, - "id": "64a7bae1-1f24-ed7c-a900-8e4705725a6b" + "id": "a668a5d7-ac44-f86e-1310-1356ffc7ba38" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/logs/config/metrics/Test_Delete_a_log_based_metric_returns_OK_response_1652349143", + "path": "/api/v2/logs/config/metrics/Test_Delete_a_log_based_metric_returns_OK_response_1681838831", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"errors\":[\"not_found(Metric with name 'Test_Delete_a_log_based_metric_returns_OK_response_1652349143' not found)\"]}", + "body": "{\"errors\":[\"not_found(Metric with name 'Test_Delete_a_log_based_metric_returns_OK_response_1681838831' not found)\"]}\n", "headers": { "Content-Type": [ "application/json" @@ -79,6 +78,6 @@ "timeToLive": { "unlimited": true }, - "id": "64a7bae1-1f24-ed7c-a900-8e4705725a6c" + "id": "a668a5d7-ac44-f86e-1310-1356ffc7ba39" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_a_span_based_metric_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Delete_a_span_based_metric_returns_OK_response.freeze index 34bf144f923..3923afecb48 100644 --- a/src/test/resources/cassettes/features/v2/Delete_a_span_based_metric_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Delete_a_span_based_metric_returns_OK_response.freeze @@ -1 +1 @@ -2023-03-28T14:55:25.279Z \ No newline at end of file +2023-04-18T17:28:08.946Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_a_span_based_metric_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_a_span_based_metric_returns_OK_response.json index c967718524b..f277bc9079f 100644 --- a/src/test/resources/cassettes/features/v2/Delete_a_span_based_metric_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_a_span_based_metric_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"compute\":{\"aggregation_type\":\"distribution\",\"include_percentiles\":false,\"path\":\"@duration\"},\"filter\":{\"query\":\"source:Test-Delete_a_span_based_metric_returns_OK_response-1680015325\"},\"group_by\":[{\"path\":\"resource_name\",\"tag_name\":\"resource_name\"}]},\"id\":\"Test-Delete_a_span_based_metric_returns_OK_response-1680015325\",\"type\":\"spans_metrics\"}}" + "json": "{\"data\":{\"attributes\":{\"compute\":{\"aggregation_type\":\"distribution\",\"include_percentiles\":false,\"path\":\"@duration\"},\"filter\":{\"query\":\"source:Test-Delete_a_span_based_metric_returns_OK_response-1681838888\"},\"group_by\":[{\"path\":\"resource_name\",\"tag_name\":\"resource_name\"}]},\"id\":\"Test-Delete_a_span_based_metric_returns_OK_response-1681838888\",\"type\":\"spans_metrics\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"Test_Delete_a_span_based_metric_returns_OK_response_1680015325\",\"attributes\":{\"filter\":{\"query\":\"source:Test-Delete_a_span_based_metric_returns_OK_response-1680015325\"},\"group_by\":[{\"path\":\"resource_name\",\"tag_name\":\"resource_name\"}],\"compute\":{\"aggregation_type\":\"distribution\",\"path\":\"@duration\",\"include_percentiles\":false}},\"type\":\"spans_metrics\"}}\n", + "body": "{\"data\":{\"id\":\"Test_Delete_a_span_based_metric_returns_OK_response_1681838888\",\"attributes\":{\"filter\":{\"query\":\"source:Test-Delete_a_span_based_metric_returns_OK_response-1681838888\"},\"group_by\":[{\"path\":\"resource_name\",\"tag_name\":\"resource_name\"}],\"compute\":{\"aggregation_type\":\"distribution\",\"path\":\"@duration\",\"include_percentiles\":false}},\"type\":\"spans_metrics\"}}\n", "headers": { "Content-Type": [ "application/json" @@ -27,25 +27,24 @@ "timeToLive": { "unlimited": true }, - "id": "3cbb3815-f6e0-7de4-b0ae-7bfa2b3acbbe" + "id": "a0db5bd1-6c23-5f55-945b-7e2ecec0ec45" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/apm/config/metrics/Test_Delete_a_span_based_metric_returns_OK_response_1680015325", + "path": "/api/v2/apm/config/metrics/Test_Delete_a_span_based_metric_returns_OK_response_1681838888", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{}\n", "headers": { "Content-Type": [ - "application/json" + "text/html; charset=utf-8" ] }, - "statusCode": 200, - "reasonPhrase": "OK" + "statusCode": 204, + "reasonPhrase": "No Content" }, "times": { "remainingTimes": 1 @@ -53,18 +52,18 @@ "timeToLive": { "unlimited": true }, - "id": "42dcd81b-5868-9091-5d89-cbab9977880d" + "id": "688ed938-a130-04c6-9b17-4871ce9ddaa8" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/apm/config/metrics/Test_Delete_a_span_based_metric_returns_OK_response_1680015325", + "path": "/api/v2/apm/config/metrics/Test_Delete_a_span_based_metric_returns_OK_response_1681838888", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"errors\":[\"not_found(Metric with name 'Test_Delete_a_span_based_metric_returns_OK_response_1680015325' not found)\"]}\n", + "body": "{\"errors\":[\"not_found(Metric with name 'Test_Delete_a_span_based_metric_returns_OK_response_1681838888' not found)\"]}\n", "headers": { "Content-Type": [ "application/json" @@ -79,6 +78,6 @@ "timeToLive": { "unlimited": true }, - "id": "42dcd81b-5868-9091-5d89-cbab9977880e" + "id": "688ed938-a130-04c6-9b17-4871ce9ddaa9" } ] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/logs_metrics.feature b/src/test/resources/com/datadog/api/client/v2/api/logs_metrics.feature index 89654c34afb..c2488458bc4 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/logs_metrics.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/logs_metrics.feature @@ -47,7 +47,7 @@ Feature: Logs Metrics And new "DeleteLogsMetric" request And request contains "metric_id" parameter from "logs_metric.data.id" When the request is sent - Then the response status is 200 OK + Then the response status is 204 OK @generated @skip @team:DataDog/logs-backend Scenario: Get a log-based metric returns "Not Found" response diff --git a/src/test/resources/com/datadog/api/client/v2/api/spans_metrics.feature b/src/test/resources/com/datadog/api/client/v2/api/spans_metrics.feature index c0b2e96f349..ef3394efdeb 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/spans_metrics.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/spans_metrics.feature @@ -46,7 +46,7 @@ Feature: Spans Metrics And new "DeleteSpansMetric" request And request contains "metric_id" parameter from "spans_metric.data.id" When the request is sent - Then the response status is 200 OK + Then the response status is 204 OK @generated @skip @team:DataDog/apm Scenario: Get a span-based metric returns "Not Found" response
Response details
Status Code Description Response Headers
200 OK -
204 OK -
403 Not Authorized -
404 Not Found -
429 Too many requests -