Skip to content

Commit a504d66

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add endpoint to get Synthetics default locations (#1515)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 7e6d51c commit a504d66

File tree

9 files changed

+128
-4
lines changed

9 files changed

+128
-4
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": "2023-06-09 14:55:30.671867",
8-
"spec_repo_commit": "b6c7aa0b"
7+
"regenerated": "2023-06-12 13:40:14.946275",
8+
"spec_repo_commit": "2c47742f"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2023-06-09 14:55:30.684308",
13-
"spec_repo_commit": "b6c7aa0b"
12+
"regenerated": "2023-06-12 13:40:14.965716",
13+
"spec_repo_commit": "2c47742f"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13436,6 +13436,14 @@ components:
1343613436
description: URL attached to the metrics.
1343713437
type: string
1343813438
type: object
13439+
SyntheticsDefaultLocations:
13440+
description: List of Synthetics default locations settings.
13441+
example:
13442+
- aws:eu-west-3
13443+
items:
13444+
description: Name of the location.
13445+
type: string
13446+
type: array
1343913447
SyntheticsDeleteTestsPayload:
1344013448
description: 'A JSON list of the ID or IDs of the Synthetic tests that you want
1344113449

@@ -27640,6 +27648,27 @@ paths:
2764027648
tags:
2764127649
- Synthetics
2764227650
x-codegen-request-body-name: body
27651+
/api/v1/synthetics/settings/default_locations:
27652+
get:
27653+
description: Get the default locations settings.
27654+
operationId: GetSyntheticsDefaultLocations
27655+
responses:
27656+
'200':
27657+
content:
27658+
application/json:
27659+
schema:
27660+
$ref: '#/components/schemas/SyntheticsDefaultLocations'
27661+
description: OK
27662+
'429':
27663+
$ref: '#/components/responses/TooManyRequestsResponse'
27664+
security:
27665+
- apiKeyAuth: []
27666+
appKeyAuth: []
27667+
- AuthZ:
27668+
- synthetics_default_settings_read
27669+
summary: Get the default locations
27670+
tags:
27671+
- Synthetics
2764327672
/api/v1/synthetics/tests:
2764427673
get:
2764527674
description: Get the list of all Synthetic tests.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
Get the default locations returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v1.api.synthetics_api import SyntheticsApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = SyntheticsApi(api_client)
11+
response = api_instance.get_synthetics_default_locations()
12+
13+
print(response)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
Get the list of default locations returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v1.api.synthetics_api import SyntheticsApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = SyntheticsApi(api_client)
11+
response = api_instance.get_synthetics_default_locations()
12+
13+
print(response)

src/datadog_api_client/v1/api/synthetics_api.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,24 @@ def __init__(self, api_client=None):
508508
api_client=api_client,
509509
)
510510

511+
self._get_synthetics_default_locations_endpoint = _Endpoint(
512+
settings={
513+
"response_type": ([str],),
514+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
515+
"endpoint_path": "/api/v1/synthetics/settings/default_locations",
516+
"operation_id": "get_synthetics_default_locations",
517+
"http_method": "GET",
518+
"version": "v1",
519+
"servers": None,
520+
},
521+
params_map={},
522+
headers_map={
523+
"accept": ["application/json"],
524+
"content_type": [],
525+
},
526+
api_client=api_client,
527+
)
528+
511529
self._get_test_endpoint = _Endpoint(
512530
settings={
513531
"response_type": (SyntheticsTestDetails,),
@@ -1094,6 +1112,18 @@ def get_synthetics_ci_batch(
10941112

10951113
return self._get_synthetics_ci_batch_endpoint.call_with_http_info(**kwargs)
10961114

1115+
def get_synthetics_default_locations(
1116+
self,
1117+
) -> List[str]:
1118+
"""Get the default locations.
1119+
1120+
Get the default locations settings.
1121+
1122+
:rtype: [str]
1123+
"""
1124+
kwargs: Dict[str, Any] = {}
1125+
return self._get_synthetics_default_locations_endpoint.call_with_http_info(**kwargs)
1126+
10971127
def get_test(
10981128
self,
10991129
public_id: str,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2023-06-08T19:13:18.175Z
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
interactions:
2+
- request:
3+
body: null
4+
headers:
5+
accept:
6+
- application/json
7+
method: GET
8+
uri: https://api.datadoghq.com/api/v1/synthetics/settings/default_locations
9+
response:
10+
body:
11+
string: '["aws:af-south-1","aws:ap-east-1","aws:ap-northeast-1","aws:ap-northeast-2","aws:ap-northeast-3","aws:ap-south-1","aws:ap-southeast-1","aws:ap-southeast-2","aws:ap-southeast-3","aws:ca-central-1","aws:eu-central-1","aws:eu-north-1","aws:eu-south-1","aws:eu-west-1","aws:eu-west-2","aws:eu-west-3","aws:me-south-1","aws:sa-east-1","aws:us-east-1","aws:us-east-2","aws:us-west-1","aws:us-west-2","azure:eastus","pl:gcp-integrations-lab-527d63de5764c9fdad65fd1a5ac64a8e"]
12+
13+
'
14+
headers:
15+
content-type:
16+
- application/json
17+
status:
18+
code: 200
19+
message: OK
20+
version: 1

tests/v1/features/synthetics.feature

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,12 @@ Feature: Synthetics
522522
When the request is sent
523523
Then the response status is 200 OK
524524

525+
@generated @skip @team:DataDog/synthetics-app
526+
Scenario: Get the default locations returns "OK" response
527+
Given new "GetSyntheticsDefaultLocations" request
528+
When the request is sent
529+
Then the response status is 200 OK
530+
525531
@generated @skip @team:DataDog/synthetics-app
526532
Scenario: Get the list of all Synthetic tests returns "OK - Returns the list of all Synthetic tests." response
527533
Given new "ListTests" request
@@ -534,6 +540,12 @@ Feature: Synthetics
534540
When the request is sent
535541
Then the response status is 404 Synthetic Monitoring is not activated for the user.
536542

543+
@team:DataDog/synthetics-app
544+
Scenario: Get the list of default locations returns "OK" response
545+
Given new "GetSyntheticsDefaultLocations" request
546+
When the request is sent
547+
Then the response status is 200 OK
548+
537549
@generated @skip @team:DataDog/synthetics-app
538550
Scenario: Pause or start a test returns "- Synthetic Monitoring is not activated for the user" response
539551
Given new "UpdateTestPauseStatus" request

tests/v1/features/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,12 @@
10781078
"type": "idempotent"
10791079
}
10801080
},
1081+
"GetSyntheticsDefaultLocations": {
1082+
"tag": "Synthetics",
1083+
"undo": {
1084+
"type": "safe"
1085+
}
1086+
},
10811087
"ListTests": {
10821088
"tag": "Synthetics",
10831089
"undo": {

0 commit comments

Comments
 (0)