Skip to content

Commit d9d66c3

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Synthetics add pagination params to get all tests endpoint (#1271)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 4929277 commit d9d66c3

File tree

5 files changed

+46
-10
lines changed

5 files changed

+46
-10
lines changed

.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.4",
7-
"regenerated": "2022-12-16 13:15:00.627302",
8-
"spec_repo_commit": "ea9a41e2"
7+
"regenerated": "2022-12-19 08:43:51.366804",
8+
"spec_repo_commit": "69a446d0"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2022-12-16 13:15:00.641494",
13-
"spec_repo_commit": "ea9a41e2"
12+
"regenerated": "2022-12-19 08:43:51.380018",
13+
"spec_repo_commit": "69a446d0"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25965,6 +25965,18 @@ paths:
2596525965
get:
2596625966
description: Get the list of all Synthetic tests.
2596725967
operationId: ListTests
25968+
parameters:
25969+
- description: Used for pagination. The number of tests returned in the page.
25970+
in: query
25971+
name: page_size
25972+
schema:
25973+
type: string
25974+
- description: Used for pagination. Which page you want to retrieve. Starts
25975+
at zero.
25976+
in: query
25977+
name: page_number
25978+
schema:
25979+
type: string
2596825980
responses:
2596925981
'200':
2597025982
content:
@@ -25991,7 +26003,7 @@ paths:
2599126003
appKeyAuth: []
2599226004
- AuthZ:
2599326005
- synthetics_read
25994-
summary: Get the list of all tests
26006+
summary: Get the list of all Synthetic tests
2599526007
tags:
2599626008
- Synthetics
2599726009
/api/v1/synthetics/tests/api:

examples/v1/synthetics/ListTests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Get the list of all tests returns "OK - Returns the list of all Synthetic tests." response
2+
Get the list of all Synthetic tests returns "OK - Returns the list of all Synthetic tests." response
33
"""
44

55
from datadog_api_client import ApiClient, Configuration

src/datadog_api_client/v1/api/synthetics_api.py

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,18 @@ def __init__(self, api_client=None):
578578
"version": "v1",
579579
"servers": None,
580580
},
581-
params_map={},
581+
params_map={
582+
"page_size": {
583+
"openapi_types": (str,),
584+
"attribute": "page_size",
585+
"location": "query",
586+
},
587+
"page_number": {
588+
"openapi_types": (str,),
589+
"attribute": "page_number",
590+
"location": "query",
591+
},
592+
},
582593
headers_map={
583594
"accept": ["application/json"],
584595
"content_type": [],
@@ -1126,14 +1137,27 @@ def list_locations(
11261137

11271138
def list_tests(
11281139
self,
1140+
*,
1141+
page_size: Union[str, UnsetType] = unset,
1142+
page_number: Union[str, UnsetType] = unset,
11291143
) -> SyntheticsListTestsResponse:
1130-
"""Get the list of all tests.
1144+
"""Get the list of all Synthetic tests.
11311145
11321146
Get the list of all Synthetic tests.
11331147
1148+
:param page_size: Used for pagination. The number of tests returned in the page.
1149+
:type page_size: str, optional
1150+
:param page_number: Used for pagination. Which page you want to retrieve. Starts at zero.
1151+
:type page_number: str, optional
11341152
:rtype: SyntheticsListTestsResponse
11351153
"""
11361154
kwargs: Dict[str, Any] = {}
1155+
if page_size is not unset:
1156+
kwargs["page_size"] = page_size
1157+
1158+
if page_number is not unset:
1159+
kwargs["page_number"] = page_number
1160+
11371161
return self._list_tests_endpoint.call_with_http_info(**kwargs)
11381162

11391163
def trigger_ci_tests(

tests/v1/features/synthetics.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,13 +506,13 @@ Feature: Synthetics
506506
Then the response status is 200 OK
507507

508508
@generated @skip @team:DataDog/synthetics-app
509-
Scenario: Get the list of all tests returns "OK - Returns the list of all Synthetic tests." response
509+
Scenario: Get the list of all Synthetic tests returns "OK - Returns the list of all Synthetic tests." response
510510
Given new "ListTests" request
511511
When the request is sent
512512
Then the response status is 200 OK - Returns the list of all Synthetic tests.
513513

514514
@generated @skip @team:DataDog/synthetics-app
515-
Scenario: Get the list of all tests returns "Synthetics is not activated for the user." response
515+
Scenario: Get the list of all Synthetic tests returns "Synthetics is not activated for the user." response
516516
Given new "ListTests" request
517517
When the request is sent
518518
Then the response status is 404 Synthetics is not activated for the user.

0 commit comments

Comments
 (0)