Skip to content

Commit efba884

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 4fd1c189 of spec repo (#3196)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent ef0a885 commit efba884

12 files changed

Lines changed: 368 additions & 21 deletions

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-07-02 11:31:46.400598",
8-
"spec_repo_commit": "ab77d015"
7+
"regenerated": "2025-07-02 12:38:44.244057",
8+
"spec_repo_commit": "4fd1c189"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-07-02 11:31:46.418602",
13-
"spec_repo_commit": "ab77d015"
12+
"regenerated": "2025-07-02 12:38:44.260658",
13+
"spec_repo_commit": "4fd1c189"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 95 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33427,6 +33427,86 @@ paths:
3342733427
operator: OR
3342833428
permissions:
3342933429
- synthetics_write
33430+
/api/v1/synthetics/tests/search:
33431+
get:
33432+
description: Search for Synthetic tests and Test Suites.
33433+
operationId: SearchTests
33434+
parameters:
33435+
- description: If true, include the full configuration for each test in the
33436+
response.
33437+
in: query
33438+
name: include_full_config
33439+
required: false
33440+
schema:
33441+
type: boolean
33442+
- description: If true, returns suites instead of tests.
33443+
in: query
33444+
name: search_suites
33445+
required: false
33446+
schema:
33447+
type: boolean
33448+
- description: If true, return only facets instead of full test details.
33449+
in: query
33450+
name: facets_only
33451+
required: false
33452+
schema:
33453+
type: boolean
33454+
- description: The offset from which to start returning results.
33455+
in: query
33456+
name: start
33457+
required: false
33458+
schema:
33459+
default: 0
33460+
format: int64
33461+
type: integer
33462+
- description: The maximum number of results to return.
33463+
in: query
33464+
name: count
33465+
required: false
33466+
schema:
33467+
default: 50
33468+
format: int64
33469+
type: integer
33470+
- description: The sort order for the results (e.g., 'name,asc' or 'name,desc').
33471+
in: query
33472+
name: sort
33473+
required: false
33474+
schema:
33475+
default: name,asc
33476+
type: string
33477+
responses:
33478+
'200':
33479+
content:
33480+
application/json:
33481+
schema:
33482+
$ref: '#/components/schemas/SyntheticsListTestsResponse'
33483+
description: OK - Returns the list of Synthetic tests matching the search.
33484+
'403':
33485+
content:
33486+
application/json:
33487+
schema:
33488+
$ref: '#/components/schemas/APIErrorResponse'
33489+
description: Forbidden
33490+
'404':
33491+
content:
33492+
application/json:
33493+
schema:
33494+
$ref: '#/components/schemas/APIErrorResponse'
33495+
description: Not found
33496+
'429':
33497+
$ref: '#/components/responses/TooManyRequestsResponse'
33498+
security:
33499+
- apiKeyAuth: []
33500+
appKeyAuth: []
33501+
- AuthZ:
33502+
- synthetics_read
33503+
summary: Search Synthetic tests
33504+
tags:
33505+
- Synthetics
33506+
x-permission:
33507+
operator: OR
33508+
permissions:
33509+
- synthetics_read
3343033510
/api/v1/synthetics/tests/trigger:
3343133511
post:
3343233512
description: Trigger a set of Synthetic tests.
@@ -37222,13 +37302,21 @@ tags:
3722237302
name: Slack Integration
3722337303
- description: Take graph snapshots using the API.
3722437304
name: Snapshots
37225-
- description: "Datadog Synthetic Monitoring uses simulated user requests and browser
37226-
rendering to help you ensure uptime,\nidentify regional issues, and track your
37227-
application performance. Synthetic tests come in\ntwo different flavors, [API
37228-
tests](https://docs.datadoghq.com/synthetics/api_tests/?tab=httptest)\nand [browser
37229-
tests](https://docs.datadoghq.com/synthetics/browser_tests). You can use Datadog\u2019s
37230-
API to\nmanage both test types programmatically.\n\nFor more information, see
37231-
the [Synthetic Monitoring documentation](https://docs.datadoghq.com/synthetics/)."
37305+
- description: 'Datadog Synthetic Monitoring uses simulated user requests and browser
37306+
rendering to help you ensure uptime,
37307+
37308+
identify regional issues, and track your application performance. Synthetic tests
37309+
come in
37310+
37311+
two different flavors, [API tests](https://docs.datadoghq.com/synthetics/api_tests/?tab=httptest)
37312+
37313+
and [browser tests](https://docs.datadoghq.com/synthetics/browser_tests). You
37314+
can use Datadog''s API to
37315+
37316+
manage both test types programmatically.
37317+
37318+
37319+
For more information, see the [Synthetic Monitoring documentation](https://docs.datadoghq.com/synthetics/).'
3723237320
name: Synthetics
3723337321
- description: 'The tag endpoint allows you to assign tags to hosts,
3723437322

api/datadogV1/api_synthetics.go

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,6 +2062,154 @@ func (a *SyntheticsApi) PatchTest(ctx _context.Context, publicId string, body Sy
20622062
return localVarReturnValue, localVarHTTPResponse, nil
20632063
}
20642064

2065+
// SearchTestsOptionalParameters holds optional parameters for SearchTests.
2066+
type SearchTestsOptionalParameters struct {
2067+
IncludeFullConfig *bool
2068+
SearchSuites *bool
2069+
FacetsOnly *bool
2070+
Start *int64
2071+
Count *int64
2072+
Sort *string
2073+
}
2074+
2075+
// NewSearchTestsOptionalParameters creates an empty struct for parameters.
2076+
func NewSearchTestsOptionalParameters() *SearchTestsOptionalParameters {
2077+
this := SearchTestsOptionalParameters{}
2078+
return &this
2079+
}
2080+
2081+
// WithIncludeFullConfig sets the corresponding parameter name and returns the struct.
2082+
func (r *SearchTestsOptionalParameters) WithIncludeFullConfig(includeFullConfig bool) *SearchTestsOptionalParameters {
2083+
r.IncludeFullConfig = &includeFullConfig
2084+
return r
2085+
}
2086+
2087+
// WithSearchSuites sets the corresponding parameter name and returns the struct.
2088+
func (r *SearchTestsOptionalParameters) WithSearchSuites(searchSuites bool) *SearchTestsOptionalParameters {
2089+
r.SearchSuites = &searchSuites
2090+
return r
2091+
}
2092+
2093+
// WithFacetsOnly sets the corresponding parameter name and returns the struct.
2094+
func (r *SearchTestsOptionalParameters) WithFacetsOnly(facetsOnly bool) *SearchTestsOptionalParameters {
2095+
r.FacetsOnly = &facetsOnly
2096+
return r
2097+
}
2098+
2099+
// WithStart sets the corresponding parameter name and returns the struct.
2100+
func (r *SearchTestsOptionalParameters) WithStart(start int64) *SearchTestsOptionalParameters {
2101+
r.Start = &start
2102+
return r
2103+
}
2104+
2105+
// WithCount sets the corresponding parameter name and returns the struct.
2106+
func (r *SearchTestsOptionalParameters) WithCount(count int64) *SearchTestsOptionalParameters {
2107+
r.Count = &count
2108+
return r
2109+
}
2110+
2111+
// WithSort sets the corresponding parameter name and returns the struct.
2112+
func (r *SearchTestsOptionalParameters) WithSort(sort string) *SearchTestsOptionalParameters {
2113+
r.Sort = &sort
2114+
return r
2115+
}
2116+
2117+
// SearchTests Search Synthetic tests.
2118+
// Search for Synthetic tests and Test Suites.
2119+
func (a *SyntheticsApi) SearchTests(ctx _context.Context, o ...SearchTestsOptionalParameters) (SyntheticsListTestsResponse, *_nethttp.Response, error) {
2120+
var (
2121+
localVarHTTPMethod = _nethttp.MethodGet
2122+
localVarPostBody interface{}
2123+
localVarReturnValue SyntheticsListTestsResponse
2124+
optionalParams SearchTestsOptionalParameters
2125+
)
2126+
2127+
if len(o) > 1 {
2128+
return localVarReturnValue, nil, datadog.ReportError("only one argument of type SearchTestsOptionalParameters is allowed")
2129+
}
2130+
if len(o) == 1 {
2131+
optionalParams = o[0]
2132+
}
2133+
2134+
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v1.SyntheticsApi.SearchTests")
2135+
if err != nil {
2136+
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
2137+
}
2138+
2139+
localVarPath := localBasePath + "/api/v1/synthetics/tests/search"
2140+
2141+
localVarHeaderParams := make(map[string]string)
2142+
localVarQueryParams := _neturl.Values{}
2143+
localVarFormParams := _neturl.Values{}
2144+
if optionalParams.IncludeFullConfig != nil {
2145+
localVarQueryParams.Add("include_full_config", datadog.ParameterToString(*optionalParams.IncludeFullConfig, ""))
2146+
}
2147+
if optionalParams.SearchSuites != nil {
2148+
localVarQueryParams.Add("search_suites", datadog.ParameterToString(*optionalParams.SearchSuites, ""))
2149+
}
2150+
if optionalParams.FacetsOnly != nil {
2151+
localVarQueryParams.Add("facets_only", datadog.ParameterToString(*optionalParams.FacetsOnly, ""))
2152+
}
2153+
if optionalParams.Start != nil {
2154+
localVarQueryParams.Add("start", datadog.ParameterToString(*optionalParams.Start, ""))
2155+
}
2156+
if optionalParams.Count != nil {
2157+
localVarQueryParams.Add("count", datadog.ParameterToString(*optionalParams.Count, ""))
2158+
}
2159+
if optionalParams.Sort != nil {
2160+
localVarQueryParams.Add("sort", datadog.ParameterToString(*optionalParams.Sort, ""))
2161+
}
2162+
localVarHeaderParams["Accept"] = "application/json"
2163+
2164+
datadog.SetAuthKeys(
2165+
ctx,
2166+
&localVarHeaderParams,
2167+
[2]string{"apiKeyAuth", "DD-API-KEY"},
2168+
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
2169+
)
2170+
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
2171+
if err != nil {
2172+
return localVarReturnValue, nil, err
2173+
}
2174+
2175+
localVarHTTPResponse, err := a.Client.CallAPI(req)
2176+
if err != nil || localVarHTTPResponse == nil {
2177+
return localVarReturnValue, localVarHTTPResponse, err
2178+
}
2179+
2180+
localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
2181+
if err != nil {
2182+
return localVarReturnValue, localVarHTTPResponse, err
2183+
}
2184+
2185+
if localVarHTTPResponse.StatusCode >= 300 {
2186+
newErr := datadog.GenericOpenAPIError{
2187+
ErrorBody: localVarBody,
2188+
ErrorMessage: localVarHTTPResponse.Status,
2189+
}
2190+
if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 {
2191+
var v APIErrorResponse
2192+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2193+
if err != nil {
2194+
return localVarReturnValue, localVarHTTPResponse, newErr
2195+
}
2196+
newErr.ErrorModel = v
2197+
}
2198+
return localVarReturnValue, localVarHTTPResponse, newErr
2199+
}
2200+
2201+
err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2202+
if err != nil {
2203+
newErr := datadog.GenericOpenAPIError{
2204+
ErrorBody: localVarBody,
2205+
ErrorMessage: err.Error(),
2206+
}
2207+
return localVarReturnValue, localVarHTTPResponse, newErr
2208+
}
2209+
2210+
return localVarReturnValue, localVarHTTPResponse, nil
2211+
}
2212+
20652213
// TriggerCITests Trigger tests from CI/CD pipelines.
20662214
// Trigger a set of Synthetic tests for continuous integration.
20672215
func (a *SyntheticsApi) TriggerCITests(ctx _context.Context, body SyntheticsCITestBody) (SyntheticsTriggerCITestsResponse, *_nethttp.Response, error) {

api/datadogV1/doc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@
175175
// - [SyntheticsApi.ListLocations]
176176
// - [SyntheticsApi.ListTests]
177177
// - [SyntheticsApi.PatchTest]
178+
// - [SyntheticsApi.SearchTests]
178179
// - [SyntheticsApi.TriggerCITests]
179180
// - [SyntheticsApi.TriggerTests]
180181
// - [SyntheticsApi.UpdateAPITest]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Search Synthetic tests returns "OK - Returns the list of Synthetic tests matching the search." response
2+
3+
package main
4+
5+
import (
6+
"context"
7+
"encoding/json"
8+
"fmt"
9+
"os"
10+
11+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
12+
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
13+
)
14+
15+
func main() {
16+
ctx := datadog.NewDefaultContext(context.Background())
17+
configuration := datadog.NewConfiguration()
18+
apiClient := datadog.NewAPIClient(configuration)
19+
api := datadogV1.NewSyntheticsApi(apiClient)
20+
resp, r, err := api.SearchTests(ctx, *datadogV1.NewSearchTestsOptionalParameters())
21+
22+
if err != nil {
23+
fmt.Fprintf(os.Stderr, "Error when calling `SyntheticsApi.SearchTests`: %v\n", err)
24+
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25+
}
26+
27+
responseContent, _ := json.MarshalIndent(resp, "", " ")
28+
fmt.Fprintf(os.Stdout, "Response from `SyntheticsApi.SearchTests`:\n%s\n", responseContent)
29+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Search Synthetic tests with boolean query parameters
2+
3+
package main
4+
5+
import (
6+
"context"
7+
"encoding/json"
8+
"fmt"
9+
"os"
10+
11+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
12+
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
13+
)
14+
15+
func main() {
16+
ctx := datadog.NewDefaultContext(context.Background())
17+
configuration := datadog.NewConfiguration()
18+
apiClient := datadog.NewAPIClient(configuration)
19+
api := datadogV1.NewSyntheticsApi(apiClient)
20+
resp, r, err := api.SearchTests(ctx, *datadogV1.NewSearchTestsOptionalParameters().WithIncludeFullConfig(true).WithSearchSuites(true).WithFacetsOnly(true).WithStart(10).WithCount(5).WithSort("name,desc"))
21+
22+
if err != nil {
23+
fmt.Fprintf(os.Stderr, "Error when calling `SyntheticsApi.SearchTests`: %v\n", err)
24+
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25+
}
26+
27+
responseContent, _ := json.MarshalIndent(resp, "", " ")
28+
fmt.Fprintf(os.Stdout, "Response from `SyntheticsApi.SearchTests`:\n%s\n", responseContent)
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-07-01T15:52:56.329Z
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
interactions:
2+
- request:
3+
body: ''
4+
form: {}
5+
headers:
6+
Accept:
7+
- application/json
8+
id: 0
9+
method: GET
10+
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
11+
response:
12+
body: '{"tests":[],"total":0,"facets":[]}'
13+
code: 200
14+
duration: 0ms
15+
headers:
16+
Content-Type:
17+
- application/json
18+
status: 200 OK
19+
version: 2
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-12-09T11:18:22.632Z
1+
2025-07-01T15:52:56.929Z

0 commit comments

Comments
 (0)