Skip to content

Commit ecc37a9

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add text field in synthetics search endpoint (#2561)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent f118346 commit ecc37a9

File tree

7 files changed

+37
-8
lines changed

7 files changed

+37
-8
lines changed

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "bd643af",
3-
"generated": "2025-07-22 16:42:26.466"
2+
"spec_repo_commit": "04d09cb",
3+
"generated": "2025-07-23 09:22:10.627"
44
}

.generator/schemas/v1/openapi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33827,6 +33827,12 @@ paths:
3382733827
description: Search for Synthetic tests and Test Suites.
3382833828
operationId: SearchTests
3382933829
parameters:
33830+
- description: The search query.
33831+
in: query
33832+
name: text
33833+
required: false
33834+
schema:
33835+
type: string
3383033836
- description: If true, include the full configuration for each test in the
3383133837
response.
3383233838
in: query
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2025-07-01T15:52:56.329Z"
1+
"2025-07-22T14:56:49.377Z"

cassettes/v1/Synthetics_2658572017/Search-Synthetic-tests-with-boolean-query-parameters_258209479/recording.har

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"entries": [
1010
{
11-
"_id": "1e11963d271730b493953ca218c6dc16",
11+
"_id": "681b743111c5f9b94b35628f267b43d1",
1212
"_order": 0,
1313
"cache": {},
1414
"request": {
@@ -21,10 +21,14 @@
2121
"value": "application/json"
2222
}
2323
],
24-
"headersSize": 610,
24+
"headersSize": 627,
2525
"httpVersion": "HTTP/1.1",
2626
"method": "GET",
2727
"queryString": [
28+
{
29+
"name": "text",
30+
"value": "tag:value"
31+
},
2832
{
2933
"name": "include_full_config",
3034
"value": "true"
@@ -50,7 +54,7 @@
5054
"value": "name,desc"
5155
}
5256
],
53-
"url": "https://api.datadoghq.com/api/v1/synthetics/tests/search?include_full_config=true&search_suites=true&facets_only=true&start=10&count=5&sort=name%2Cdesc"
57+
"url": "https://api.datadoghq.com/api/v1/synthetics/tests/search?text=tag%3Avalue&include_full_config=true&search_suites=true&facets_only=true&start=10&count=5&sort=name%2Cdesc"
5458
},
5559
"response": {
5660
"bodySize": 35,
@@ -72,8 +76,8 @@
7276
"status": 200,
7377
"statusText": "OK"
7478
},
75-
"startedDateTime": "2025-07-01T15:52:56.562Z",
76-
"time": 315
79+
"startedDateTime": "2025-07-22T14:56:49.384Z",
80+
"time": 143
7781
}
7882
],
7983
"pages": [],

features/v1/synthetics.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,7 @@ Feature: Synthetics
806806
@team:DataDog/synthetics-ct
807807
Scenario: Search Synthetic tests with boolean query parameters
808808
Given new "SearchTests" request
809+
And request contains "text" parameter with value "tag:value"
809810
And request contains "include_full_config" parameter with value true
810811
And request contains "search_suites" parameter with value true
811812
And request contains "facets_only" parameter with value true

private/bdd_runner/src/support/scenarios_model_mapping.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,6 +2112,10 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
21122112
operationResponseType: "SyntheticsMobileTest",
21132113
},
21142114
"SyntheticsApi.V1.SearchTests": {
2115+
text: {
2116+
type: "string",
2117+
format: "",
2118+
},
21152119
includeFullConfig: {
21162120
type: "boolean",
21172121
format: "",

services/synthetics/src/v1/SyntheticsApi.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,7 @@ export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory {
13501350
}
13511351

13521352
public async searchTests(
1353+
text?: string,
13531354
includeFullConfig?: boolean,
13541355
searchSuites?: boolean,
13551356
facetsOnly?: boolean,
@@ -1382,6 +1383,13 @@ export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory {
13821383
}
13831384

13841385
// Query Params
1386+
if (text !== undefined) {
1387+
requestContext.setQueryParam(
1388+
"text",
1389+
serialize(text, TypingInfo, "string", ""),
1390+
"",
1391+
);
1392+
}
13851393
if (includeFullConfig !== undefined) {
13861394
requestContext.setQueryParam(
13871395
"include_full_config",
@@ -4072,6 +4080,11 @@ export interface SyntheticsApiPatchTestRequest {
40724080
}
40734081

40744082
export interface SyntheticsApiSearchTestsRequest {
4083+
/**
4084+
* The search query.
4085+
* @type string
4086+
*/
4087+
text?: string;
40754088
/**
40764089
* If true, include the full configuration for each test in the response.
40774090
* @type boolean
@@ -4809,6 +4822,7 @@ export class SyntheticsApi {
48094822
options?: Configuration,
48104823
): Promise<SyntheticsListTestsResponse> {
48114824
const requestContextPromise = this.requestFactory.searchTests(
4825+
param.text,
48124826
param.includeFullConfig,
48134827
param.searchSuites,
48144828
param.facetsOnly,

0 commit comments

Comments
 (0)