From 918a6b93568b7eb260e47163701df6f69500db3f Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 2 Jul 2025 12:40:49 +0000 Subject: [PATCH] Regenerate client from commit 4fd1c189 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 102 ++++++- examples/v1/synthetics/SearchTests.java | 25 ++ .../v1/synthetics/SearchTests_195957771.java | 33 +++ .../api/client/v1/api/SyntheticsApi.java | 254 ++++++++++++++++++ ...tests_with_boolean_query_parameters.freeze | 1 + ...c_tests_with_boolean_query_parameters.json | 48 ++++ ...Synthetic_tests_returns_OK_response.freeze | 2 +- ...r_Synthetic_tests_returns_OK_response.json | 18 +- .../api/client/v1/api/synthetics.feature | 26 +- .../com/datadog/api/client/v1/api/undo.json | 6 + 11 files changed, 501 insertions(+), 22 deletions(-) create mode 100644 examples/v1/synthetics/SearchTests.java create mode 100644 examples/v1/synthetics/SearchTests_195957771.java create mode 100644 src/test/resources/cassettes/features/v1/Search_Synthetic_tests_with_boolean_query_parameters.freeze create mode 100644 src/test/resources/cassettes/features/v1/Search_Synthetic_tests_with_boolean_query_parameters.json diff --git a/.apigentools-info b/.apigentools-info index 0e94662c1bd..d59afcdecc6 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-07-02 11:31:44.639746", - "spec_repo_commit": "ab77d015" + "regenerated": "2025-07-02 12:38:48.456088", + "spec_repo_commit": "4fd1c189" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-07-02 11:31:44.658036", - "spec_repo_commit": "ab77d015" + "regenerated": "2025-07-02 12:38:48.476474", + "spec_repo_commit": "4fd1c189" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index f6fdf8cd2dc..4edeb85f407 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -33427,6 +33427,86 @@ paths: operator: OR permissions: - synthetics_write + /api/v1/synthetics/tests/search: + get: + description: Search for Synthetic tests and Test Suites. + operationId: SearchTests + parameters: + - description: If true, include the full configuration for each test in the + response. + in: query + name: include_full_config + required: false + schema: + type: boolean + - description: If true, returns suites instead of tests. + in: query + name: search_suites + required: false + schema: + type: boolean + - description: If true, return only facets instead of full test details. + in: query + name: facets_only + required: false + schema: + type: boolean + - description: The offset from which to start returning results. + in: query + name: start + required: false + schema: + default: 0 + format: int64 + type: integer + - description: The maximum number of results to return. + in: query + name: count + required: false + schema: + default: 50 + format: int64 + type: integer + - description: The sort order for the results (e.g., 'name,asc' or 'name,desc'). + in: query + name: sort + required: false + schema: + default: name,asc + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsListTestsResponse' + description: OK - Returns the list of Synthetic tests matching the search. + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: Search Synthetic tests + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read /api/v1/synthetics/tests/trigger: post: description: Trigger a set of Synthetic tests. @@ -37222,13 +37302,21 @@ tags: name: Slack Integration - description: Take graph snapshots using the API. name: Snapshots -- description: "Datadog Synthetic Monitoring uses simulated user requests and browser - rendering to help you ensure uptime,\nidentify regional issues, and track your - application performance. Synthetic tests come in\ntwo different flavors, [API - tests](https://docs.datadoghq.com/synthetics/api_tests/?tab=httptest)\nand [browser - tests](https://docs.datadoghq.com/synthetics/browser_tests). You can use Datadog\u2019s - API to\nmanage both test types programmatically.\n\nFor more information, see - the [Synthetic Monitoring documentation](https://docs.datadoghq.com/synthetics/)." +- description: 'Datadog Synthetic Monitoring uses simulated user requests and browser + rendering to help you ensure uptime, + + identify regional issues, and track your application performance. Synthetic tests + come in + + two different flavors, [API tests](https://docs.datadoghq.com/synthetics/api_tests/?tab=httptest) + + and [browser tests](https://docs.datadoghq.com/synthetics/browser_tests). You + can use Datadog''s API to + + manage both test types programmatically. + + + For more information, see the [Synthetic Monitoring documentation](https://docs.datadoghq.com/synthetics/).' name: Synthetics - description: 'The tag endpoint allows you to assign tags to hosts, diff --git a/examples/v1/synthetics/SearchTests.java b/examples/v1/synthetics/SearchTests.java new file mode 100644 index 00000000000..1e8f30136de --- /dev/null +++ b/examples/v1/synthetics/SearchTests.java @@ -0,0 +1,25 @@ +// Search Synthetic tests returns "OK - Returns the list of Synthetic tests matching the search." +// response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v1.api.SyntheticsApi; +import com.datadog.api.client.v1.model.SyntheticsListTestsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SyntheticsApi apiInstance = new SyntheticsApi(defaultClient); + + try { + SyntheticsListTestsResponse result = apiInstance.searchTests(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SyntheticsApi#searchTests"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v1/synthetics/SearchTests_195957771.java b/examples/v1/synthetics/SearchTests_195957771.java new file mode 100644 index 00000000000..b2cbaf7f2f6 --- /dev/null +++ b/examples/v1/synthetics/SearchTests_195957771.java @@ -0,0 +1,33 @@ +// Search Synthetic tests with boolean query parameters + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v1.api.SyntheticsApi; +import com.datadog.api.client.v1.api.SyntheticsApi.SearchTestsOptionalParameters; +import com.datadog.api.client.v1.model.SyntheticsListTestsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SyntheticsApi apiInstance = new SyntheticsApi(defaultClient); + + try { + SyntheticsListTestsResponse result = + apiInstance.searchTests( + new SearchTestsOptionalParameters() + .includeFullConfig(true) + .searchSuites(true) + .facetsOnly(true) + .start(10L) + .count(5L) + .sort("name,desc")); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SyntheticsApi#searchTests"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v1/api/SyntheticsApi.java b/src/main/java/com/datadog/api/client/v1/api/SyntheticsApi.java index 93c9848e2a6..a0c4808a25f 100644 --- a/src/main/java/com/datadog/api/client/v1/api/SyntheticsApi.java +++ b/src/main/java/com/datadog/api/client/v1/api/SyntheticsApi.java @@ -3916,6 +3916,260 @@ public CompletableFuture> patchTestWithHttpIn new GenericType() {}); } + /** Manage optional parameters to searchTests. */ + public static class SearchTestsOptionalParameters { + private Boolean includeFullConfig; + private Boolean searchSuites; + private Boolean facetsOnly; + private Long start; + private Long count; + private String sort; + + /** + * Set includeFullConfig. + * + * @param includeFullConfig If true, include the full configuration for each test in the + * response. (optional) + * @return SearchTestsOptionalParameters + */ + public SearchTestsOptionalParameters includeFullConfig(Boolean includeFullConfig) { + this.includeFullConfig = includeFullConfig; + return this; + } + + /** + * Set searchSuites. + * + * @param searchSuites If true, returns suites instead of tests. (optional) + * @return SearchTestsOptionalParameters + */ + public SearchTestsOptionalParameters searchSuites(Boolean searchSuites) { + this.searchSuites = searchSuites; + return this; + } + + /** + * Set facetsOnly. + * + * @param facetsOnly If true, return only facets instead of full test details. (optional) + * @return SearchTestsOptionalParameters + */ + public SearchTestsOptionalParameters facetsOnly(Boolean facetsOnly) { + this.facetsOnly = facetsOnly; + return this; + } + + /** + * Set start. + * + * @param start The offset from which to start returning results. (optional, default to 0) + * @return SearchTestsOptionalParameters + */ + public SearchTestsOptionalParameters start(Long start) { + this.start = start; + return this; + } + + /** + * Set count. + * + * @param count The maximum number of results to return. (optional, default to 50) + * @return SearchTestsOptionalParameters + */ + public SearchTestsOptionalParameters count(Long count) { + this.count = count; + return this; + } + + /** + * Set sort. + * + * @param sort The sort order for the results (e.g., 'name,asc' or 'name,desc'). (optional, + * default to "name,asc") + * @return SearchTestsOptionalParameters + */ + public SearchTestsOptionalParameters sort(String sort) { + this.sort = sort; + return this; + } + } + + /** + * Search Synthetic tests. + * + *

See {@link #searchTestsWithHttpInfo}. + * + * @return SyntheticsListTestsResponse + * @throws ApiException if fails to make API call + */ + public SyntheticsListTestsResponse searchTests() throws ApiException { + return searchTestsWithHttpInfo(new SearchTestsOptionalParameters()).getData(); + } + + /** + * Search Synthetic tests. + * + *

See {@link #searchTestsWithHttpInfoAsync}. + * + * @return CompletableFuture<SyntheticsListTestsResponse> + */ + public CompletableFuture searchTestsAsync() { + return searchTestsWithHttpInfoAsync(new SearchTestsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Search Synthetic tests. + * + *

See {@link #searchTestsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return SyntheticsListTestsResponse + * @throws ApiException if fails to make API call + */ + public SyntheticsListTestsResponse searchTests(SearchTestsOptionalParameters parameters) + throws ApiException { + return searchTestsWithHttpInfo(parameters).getData(); + } + + /** + * Search Synthetic tests. + * + *

See {@link #searchTestsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<SyntheticsListTestsResponse> + */ + public CompletableFuture searchTestsAsync( + SearchTestsOptionalParameters parameters) { + return searchTestsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Search for Synthetic tests and Test Suites. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<SyntheticsListTestsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK - Returns the list of Synthetic tests matching the search. -
403 Forbidden -
404 Not found -
429 Too many requests -
+ */ + public ApiResponse searchTestsWithHttpInfo( + SearchTestsOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + Boolean includeFullConfig = parameters.includeFullConfig; + Boolean searchSuites = parameters.searchSuites; + Boolean facetsOnly = parameters.facetsOnly; + Long start = parameters.start; + Long count = parameters.count; + String sort = parameters.sort; + // create path and map variables + String localVarPath = "/api/v1/synthetics/tests/search"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "include_full_config", includeFullConfig)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "search_suites", searchSuites)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "facets_only", facetsOnly)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "count", count)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v1.SyntheticsApi.searchTests", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Search Synthetic tests. + * + *

See {@link #searchTestsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<SyntheticsListTestsResponse>> + */ + public CompletableFuture> searchTestsWithHttpInfoAsync( + SearchTestsOptionalParameters parameters) { + Object localVarPostBody = null; + Boolean includeFullConfig = parameters.includeFullConfig; + Boolean searchSuites = parameters.searchSuites; + Boolean facetsOnly = parameters.facetsOnly; + Long start = parameters.start; + Long count = parameters.count; + String sort = parameters.sort; + // create path and map variables + String localVarPath = "/api/v1/synthetics/tests/search"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "include_full_config", includeFullConfig)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "search_suites", searchSuites)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "facets_only", facetsOnly)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "count", count)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v1.SyntheticsApi.searchTests", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Trigger tests from CI/CD pipelines. * diff --git a/src/test/resources/cassettes/features/v1/Search_Synthetic_tests_with_boolean_query_parameters.freeze b/src/test/resources/cassettes/features/v1/Search_Synthetic_tests_with_boolean_query_parameters.freeze new file mode 100644 index 00000000000..0e385540a56 --- /dev/null +++ b/src/test/resources/cassettes/features/v1/Search_Synthetic_tests_with_boolean_query_parameters.freeze @@ -0,0 +1 @@ +2025-07-01T15:52:56.329Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Search_Synthetic_tests_with_boolean_query_parameters.json b/src/test/resources/cassettes/features/v1/Search_Synthetic_tests_with_boolean_query_parameters.json new file mode 100644 index 00000000000..2e18ef00b87 --- /dev/null +++ b/src/test/resources/cassettes/features/v1/Search_Synthetic_tests_with_boolean_query_parameters.json @@ -0,0 +1,48 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v1/synthetics/tests/search", + "queryStringParameters": { + "include_full_config": [ + "true" + ], + "search_suites": [ + "true" + ], + "facets_only": [ + "true" + ], + "start": [ + "10" + ], + "count": [ + "5" + ], + "sort": [ + "name,desc" + ] + }, + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"tests\":[],\"total\":0,\"facets\":[]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1e11963d-2717-30b4-9395-3ca218c6dc16" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Trigger_Synthetic_tests_returns_OK_response.freeze b/src/test/resources/cassettes/features/v1/Trigger_Synthetic_tests_returns_OK_response.freeze index f8d959f63b0..180c55be4c8 100644 --- a/src/test/resources/cassettes/features/v1/Trigger_Synthetic_tests_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v1/Trigger_Synthetic_tests_returns_OK_response.freeze @@ -1 +1 @@ -2024-12-09T11:18:22.632Z \ No newline at end of file +2025-07-01T15:52:56.929Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Trigger_Synthetic_tests_returns_OK_response.json b/src/test/resources/cassettes/features/v1/Trigger_Synthetic_tests_returns_OK_response.json index d94c02f8d59..9d99a105fcc 100644 --- a/src/test/resources/cassettes/features/v1/Trigger_Synthetic_tests_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v1/Trigger_Synthetic_tests_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"config\":{\"assertions\":[{\"operator\":\"is\",\"property\":\"{{ PROPERTY }}\",\"target\":\"text/html\",\"type\":\"header\"},{\"operator\":\"lessThan\",\"target\":2000,\"timingsScope\":\"withoutDNS\",\"type\":\"responseTime\"},{\"operator\":\"validatesJSONPath\",\"target\":{\"jsonPath\":\"topKey\",\"operator\":\"isNot\",\"targetValue\":\"0\"},\"type\":\"body\"},{\"operator\":\"validatesJSONPath\",\"target\":{\"elementsOperator\":\"atLeastOneElementMatches\",\"jsonPath\":\"topKey\",\"operator\":\"isNot\",\"targetValue\":\"0\"},\"type\":\"body\"},{\"operator\":\"validatesJSONSchema\",\"target\":{\"jsonSchema\":\"{\\\"type\\\": \\\"object\\\", \\\"properties\\\":{\\\"slideshow\\\":{\\\"type\\\":\\\"object\\\"}}}\",\"metaSchema\":\"draft-07\"},\"type\":\"body\"},{\"operator\":\"validatesXPath\",\"target\":{\"operator\":\"contains\",\"targetValue\":\"0\",\"xPath\":\"target-xpath\"},\"type\":\"body\"},{\"operator\":\"md5\",\"target\":\"a\",\"type\":\"bodyHash\"},{\"code\":\"const hello = 'world';\",\"type\":\"javascript\"}],\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"request\":{\"basicAuth\":{\"accessTokenUrl\":\"https://datadog-token.com\",\"audience\":\"audience\",\"clientId\":\"client-id\",\"clientSecret\":\"client-secret\",\"resource\":\"resource\",\"scope\":\"yoyo\",\"tokenApiAuthentication\":\"header\",\"type\":\"oauth-client\"},\"certificate\":{\"cert\":{\"content\":\"cert-content\",\"filename\":\"cert-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"},\"key\":{\"content\":\"key-content\",\"filename\":\"key-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"}},\"headers\":{\"unique\":\"testtriggersynthetictestsreturnsokresponse1733743102\"},\"method\":\"GET\",\"persistCookies\":true,\"proxy\":{\"headers\":{},\"url\":\"https://datadoghq.com\"},\"timeout\":10,\"url\":\"https://datadoghq.com\"},\"variablesFromScript\":\"dd.variable.set(\\\"FOO\\\", \\\"foo\\\")\"},\"locations\":[\"aws:us-east-2\"],\"message\":\"BDD test payload: synthetics_api_http_test_payload.json\",\"name\":\"Test-Trigger_Synthetic_tests_returns_OK_response-1733743102\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"follow_redirects\":true,\"httpVersion\":\"http2\",\"min_failure_duration\":10,\"min_location_failed\":1,\"monitor_name\":\"Test-Trigger_Synthetic_tests_returns_OK_response-1733743102\",\"monitor_priority\":5,\"retry\":{\"count\":3,\"interval\":10},\"tick_every\":60},\"subtype\":\"http\",\"tags\":[\"testing:api\"],\"type\":\"api\"}" + "json": "{\"config\":{\"assertions\":[{\"operator\":\"is\",\"property\":\"{{ PROPERTY }}\",\"target\":\"text/html\",\"type\":\"header\"},{\"operator\":\"lessThan\",\"target\":2000,\"timingsScope\":\"withoutDNS\",\"type\":\"responseTime\"},{\"operator\":\"validatesJSONPath\",\"target\":{\"jsonPath\":\"topKey\",\"operator\":\"isNot\",\"targetValue\":\"0\"},\"type\":\"body\"},{\"operator\":\"validatesJSONPath\",\"target\":{\"elementsOperator\":\"atLeastOneElementMatches\",\"jsonPath\":\"topKey\",\"operator\":\"isNot\",\"targetValue\":\"0\"},\"type\":\"body\"},{\"operator\":\"validatesJSONSchema\",\"target\":{\"jsonSchema\":\"{\\\"type\\\": \\\"object\\\", \\\"properties\\\":{\\\"slideshow\\\":{\\\"type\\\":\\\"object\\\"}}}\",\"metaSchema\":\"draft-07\"},\"type\":\"body\"},{\"operator\":\"validatesXPath\",\"target\":{\"operator\":\"contains\",\"targetValue\":\"0\",\"xPath\":\"target-xpath\"},\"type\":\"body\"},{\"operator\":\"md5\",\"target\":\"a\",\"type\":\"bodyHash\"},{\"code\":\"const hello = 'world';\",\"type\":\"javascript\"}],\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"request\":{\"basicAuth\":{\"accessTokenUrl\":\"https://datadog-token.com\",\"audience\":\"audience\",\"clientId\":\"client-id\",\"clientSecret\":\"client-secret\",\"resource\":\"resource\",\"scope\":\"yoyo\",\"tokenApiAuthentication\":\"header\",\"type\":\"oauth-client\"},\"certificate\":{\"cert\":{\"content\":\"cert-content\",\"filename\":\"cert-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"},\"key\":{\"content\":\"key-content\",\"filename\":\"key-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"}},\"headers\":{\"unique\":\"testtriggersynthetictestsreturnsokresponse1751385176\"},\"method\":\"GET\",\"persistCookies\":true,\"proxy\":{\"headers\":{},\"url\":\"https://datadoghq.com\"},\"timeout\":10,\"url\":\"https://datadoghq.com\"},\"variablesFromScript\":\"dd.variable.set(\\\"FOO\\\", \\\"foo\\\")\"},\"locations\":[\"aws:us-east-2\"],\"message\":\"BDD test payload: synthetics_api_http_test_payload.json\",\"name\":\"Test-Trigger_Synthetic_tests_returns_OK_response-1751385176\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"follow_redirects\":true,\"httpVersion\":\"http2\",\"min_failure_duration\":10,\"min_location_failed\":1,\"monitor_name\":\"Test-Trigger_Synthetic_tests_returns_OK_response-1751385176\",\"monitor_priority\":5,\"retry\":{\"count\":3,\"interval\":10},\"tick_every\":60},\"subtype\":\"http\",\"tags\":[\"testing:api\"],\"type\":\"api\"}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"public_id\":\"qcp-t22-5fm\",\"name\":\"Test-Trigger_Synthetic_tests_returns_OK_response-1733743102\",\"status\":\"live\",\"type\":\"api\",\"subtype\":\"http\",\"tags\":[\"testing:api\"],\"created_at\":\"2024-12-09T11:18:23.202027+00:00\",\"modified_at\":\"2024-12-09T11:18:23.202027+00:00\",\"config\":{\"assertions\":[{\"operator\":\"is\",\"property\":\"{{ PROPERTY }}\",\"target\":\"text/html\",\"type\":\"header\"},{\"operator\":\"lessThan\",\"target\":2000,\"timingsScope\":\"withoutDNS\",\"type\":\"responseTime\"},{\"operator\":\"validatesJSONPath\",\"target\":{\"jsonPath\":\"topKey\",\"operator\":\"isNot\",\"targetValue\":\"0\"},\"type\":\"body\"},{\"operator\":\"validatesJSONPath\",\"target\":{\"elementsOperator\":\"atLeastOneElementMatches\",\"jsonPath\":\"topKey\",\"operator\":\"isNot\",\"targetValue\":\"0\"},\"type\":\"body\"},{\"operator\":\"validatesJSONSchema\",\"target\":{\"jsonSchema\":\"{\\\"type\\\": \\\"object\\\", \\\"properties\\\":{\\\"slideshow\\\":{\\\"type\\\":\\\"object\\\"}}}\",\"metaSchema\":\"draft-07\"},\"type\":\"body\"},{\"operator\":\"validatesXPath\",\"target\":{\"operator\":\"contains\",\"targetValue\":\"0\",\"xPath\":\"target-xpath\"},\"type\":\"body\"},{\"operator\":\"md5\",\"target\":\"a\",\"type\":\"bodyHash\"},{\"code\":\"const hello = 'world';\",\"type\":\"javascript\"}],\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"request\":{\"basicAuth\":{\"accessTokenUrl\":\"https://datadog-token.com\",\"audience\":\"audience\",\"clientId\":\"client-id\",\"clientSecret\":\"client-secret\",\"resource\":\"resource\",\"scope\":\"yoyo\",\"tokenApiAuthentication\":\"header\",\"type\":\"oauth-client\"},\"certificate\":{\"cert\":{\"filename\":\"cert-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"},\"key\":{\"filename\":\"key-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"}},\"headers\":{\"unique\":\"testtriggersynthetictestsreturnsokresponse1733743102\"},\"method\":\"GET\",\"persistCookies\":true,\"proxy\":{\"headers\":{},\"url\":\"https://datadoghq.com\"},\"timeout\":10,\"url\":\"https://datadoghq.com\"},\"variablesFromScript\":\"dd.variable.set(\\\"FOO\\\", \\\"foo\\\")\"},\"message\":\"BDD test payload: synthetics_api_http_test_payload.json\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"follow_redirects\":true,\"httpVersion\":\"http2\",\"min_failure_duration\":10,\"min_location_failed\":1,\"monitor_name\":\"Test-Trigger_Synthetic_tests_returns_OK_response-1733743102\",\"monitor_priority\":5,\"retry\":{\"count\":3,\"interval\":10},\"tick_every\":60},\"locations\":[\"aws:us-east-2\"],\"created_by\":{\"name\":null,\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\"},\"deleted_at\":null,\"monitor_id\":159881062,\"org_id\":321813,\"modified_by\":{\"name\":null,\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\"}}", + "body": "{\"public_id\":\"tau-wah-m7h\",\"name\":\"Test-Trigger_Synthetic_tests_returns_OK_response-1751385176\",\"status\":\"live\",\"type\":\"api\",\"subtype\":\"http\",\"tags\":[\"testing:api\"],\"created_at\":\"2025-07-01T15:52:57.254092+00:00\",\"modified_at\":\"2025-07-01T15:52:57.254092+00:00\",\"config\":{\"assertions\":[{\"operator\":\"is\",\"property\":\"{{ PROPERTY }}\",\"target\":\"text/html\",\"type\":\"header\"},{\"operator\":\"lessThan\",\"target\":2000,\"timingsScope\":\"withoutDNS\",\"type\":\"responseTime\"},{\"operator\":\"validatesJSONPath\",\"target\":{\"jsonPath\":\"topKey\",\"operator\":\"isNot\",\"targetValue\":\"0\"},\"type\":\"body\"},{\"operator\":\"validatesJSONPath\",\"target\":{\"elementsOperator\":\"atLeastOneElementMatches\",\"jsonPath\":\"topKey\",\"operator\":\"isNot\",\"targetValue\":\"0\"},\"type\":\"body\"},{\"operator\":\"validatesJSONSchema\",\"target\":{\"jsonSchema\":\"{\\\"type\\\": \\\"object\\\", \\\"properties\\\":{\\\"slideshow\\\":{\\\"type\\\":\\\"object\\\"}}}\",\"metaSchema\":\"draft-07\"},\"type\":\"body\"},{\"operator\":\"validatesXPath\",\"target\":{\"operator\":\"contains\",\"targetValue\":\"0\",\"xPath\":\"target-xpath\"},\"type\":\"body\"},{\"operator\":\"md5\",\"target\":\"a\",\"type\":\"bodyHash\"},{\"code\":\"const hello = 'world';\",\"type\":\"javascript\"}],\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"request\":{\"basicAuth\":{\"accessTokenUrl\":\"https://datadog-token.com\",\"audience\":\"audience\",\"clientId\":\"client-id\",\"clientSecret\":\"client-secret\",\"resource\":\"resource\",\"scope\":\"yoyo\",\"tokenApiAuthentication\":\"header\",\"type\":\"oauth-client\"},\"certificate\":{\"cert\":{\"filename\":\"cert-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"},\"key\":{\"filename\":\"key-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"}},\"headers\":{\"unique\":\"testtriggersynthetictestsreturnsokresponse1751385176\"},\"method\":\"GET\",\"persistCookies\":true,\"proxy\":{\"headers\":{},\"url\":\"https://datadoghq.com\"},\"timeout\":10,\"url\":\"https://datadoghq.com\"},\"variablesFromScript\":\"dd.variable.set(\\\"FOO\\\", \\\"foo\\\")\"},\"message\":\"BDD test payload: synthetics_api_http_test_payload.json\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"follow_redirects\":true,\"httpVersion\":\"http2\",\"min_failure_duration\":10,\"min_location_failed\":1,\"monitor_name\":\"Test-Trigger_Synthetic_tests_returns_OK_response-1751385176\",\"monitor_priority\":5,\"retry\":{\"count\":3,\"interval\":10},\"tick_every\":60},\"locations\":[\"aws:us-east-2\"],\"created_by\":{\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"email\":\"team-intg-tools-libs-spam@datadoghq.com\"},\"deleted_at\":null,\"monitor_id\":176652841,\"org_id\":321813,\"modified_by\":{\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"email\":\"team-intg-tools-libs-spam@datadoghq.com\"}}", "headers": { "Content-Type": [ "application/json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "fc3ede55-77d7-01d5-c9c1-a671d6987c62" + "id": "b2c6f804-8972-1fd0-f752-cf666c21cd4f" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"tests\":[{\"public_id\":\"qcp-t22-5fm\"}]}" + "json": "{\"tests\":[{\"public_id\":\"tau-wah-m7h\"}]}" }, "headers": {}, "method": "POST", @@ -42,7 +42,7 @@ "secure": true }, "httpResponse": { - "body": "{\"triggered_check_ids\":[\"qcp-t22-5fm\"],\"results\":[{\"public_id\":\"qcp-t22-5fm\",\"location\":30005,\"result_id\":\"8474340998000589087\"}],\"locations\":[{\"id\":30005,\"name\":\"aws:us-east-2\",\"display_name\":\"Ohio (AWS)\",\"region\":\"Americas\",\"is_active\":true,\"is_public\":true,\"metadata\":null}],\"batch_id\":null}\n", + "body": "{\"triggered_check_ids\":[\"tau-wah-m7h\"],\"results\":[{\"public_id\":\"tau-wah-m7h\",\"location\":30005,\"result_id\":\"6667089110128797476\"}],\"locations\":[{\"id\":30005,\"name\":\"aws:us-east-2\",\"display_name\":\"Ohio (AWS)\",\"region\":\"Americas\",\"is_active\":true,\"is_public\":true,\"metadata\":null}],\"batch_id\":null}\n", "headers": { "Content-Type": [ "application/json" @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "9dc40802-aa15-4b56-8c76-995ba418a4a6" + "id": "4dc1a7d1-a7da-7ae9-ea65-45e8cb973e37" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"public_ids\":[\"qcp-t22-5fm\"]}" + "json": "{\"public_ids\":[\"tau-wah-m7h\"]}" }, "headers": {}, "method": "POST", @@ -72,7 +72,7 @@ "secure": true }, "httpResponse": { - "body": "{\"deleted_tests\":[{\"public_id\":\"qcp-t22-5fm\",\"deleted_at\":\"2024-12-09T11:18:24.733378+00:00\"}]}\n", + "body": "{\"deleted_tests\":[{\"public_id\":\"tau-wah-m7h\",\"deleted_at\":\"2025-07-01T15:52:58.035839+00:00\"}]}\n", "headers": { "Content-Type": [ "application/json" @@ -87,6 +87,6 @@ "timeToLive": { "unlimited": true }, - "id": "7e5452a1-b277-cf79-9938-af843152e216" + "id": "2a8aa440-6975-3997-a6a3-b2fe30205f1a" } ] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v1/api/synthetics.feature b/src/test/resources/com/datadog/api/client/v1/api/synthetics.feature index 8ac89dcd26e..45dcf7ceada 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/synthetics.feature +++ b/src/test/resources/com/datadog/api/client/v1/api/synthetics.feature @@ -6,7 +6,7 @@ Feature: Synthetics flavors, [API tests](https://docs.datadoghq.com/synthetics/api_tests/?tab=httptest) and [browser tests](https://docs.datadoghq.com/synthetics/browser_tests). You - can use Datadog’s API to manage both test types programmatically. For + can use Datadog's API to manage both test types programmatically. For more information, see the [Synthetic Monitoring documentation](https://docs.datadoghq.com/synthetics/). @@ -790,6 +790,30 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK - Returns a boolean indicating if the update was successful. + @generated @skip @team:DataDog/synthetics-ct + Scenario: Search Synthetic tests returns "Not found" response + Given new "SearchTests" request + When the request is sent + Then the response status is 404 Not found + + @generated @skip @team:DataDog/synthetics-ct + Scenario: Search Synthetic tests returns "OK - Returns the list of Synthetic tests matching the search." response + Given new "SearchTests" request + When the request is sent + Then the response status is 200 OK - Returns the list of Synthetic tests matching the search. + + @team:DataDog/synthetics-ct + Scenario: Search Synthetic tests with boolean query parameters + Given new "SearchTests" request + And request contains "include_full_config" parameter with value true + And request contains "search_suites" parameter with value true + And request contains "facets_only" parameter with value true + And request contains "start" parameter with value 10 + And request contains "count" parameter with value 5 + And request contains "sort" parameter with value "name,desc" + When the request is sent + Then the response status is 200 OK - Returns the list of Synthetic tests matching the search. + @generated @skip @team:DataDog/synthetics-ct Scenario: Trigger Synthetic tests returns "Bad Request" response Given new "TriggerTests" request diff --git a/src/test/resources/com/datadog/api/client/v1/api/undo.json b/src/test/resources/com/datadog/api/client/v1/api/undo.json index f2bfacfa486..341ebe6c4ee 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v1/api/undo.json @@ -1227,6 +1227,12 @@ "type": "idempotent" } }, + "SearchTests": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, "TriggerTests": { "tag": "Synthetics", "undo": {