Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.4",
"regenerated": "2023-06-09 14:55:30.022772",
"spec_repo_commit": "b6c7aa0b"
"regenerated": "2023-06-12 13:39:58.689827",
"spec_repo_commit": "2c47742f"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2023-06-09 14:55:30.037081",
"spec_repo_commit": "b6c7aa0b"
"regenerated": "2023-06-12 13:39:58.704985",
"spec_repo_commit": "2c47742f"
}
}
}
29 changes: 29 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13436,6 +13436,14 @@ components:
description: URL attached to the metrics.
type: string
type: object
SyntheticsDefaultLocations:
description: List of Synthetics default locations settings.
example:
- aws:eu-west-3
items:
description: Name of the location.
type: string
type: array
SyntheticsDeleteTestsPayload:
description: 'A JSON list of the ID or IDs of the Synthetic tests that you want

Expand Down Expand Up @@ -27640,6 +27648,27 @@ paths:
tags:
- Synthetics
x-codegen-request-body-name: body
/api/v1/synthetics/settings/default_locations:
get:
description: Get the default locations settings.
operationId: GetSyntheticsDefaultLocations
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/SyntheticsDefaultLocations'
description: OK
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- synthetics_default_settings_read
summary: Get the default locations
tags:
- Synthetics
/api/v1/synthetics/tests:
get:
description: Get the list of all Synthetic tests.
Expand Down
24 changes: 24 additions & 0 deletions examples/v1/synthetics/GetSyntheticsDefaultLocations.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Get the default locations returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.SyntheticsApi;
import java.util.List;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
SyntheticsApi apiInstance = new SyntheticsApi(defaultClient);

try {
List<String> result = apiInstance.getSyntheticsDefaultLocations();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SyntheticsApi#getSyntheticsDefaultLocations");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Get the list of default locations returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.SyntheticsApi;
import java.util.List;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
SyntheticsApi apiInstance = new SyntheticsApi(defaultClient);

try {
List<String> result = apiInstance.getSyntheticsDefaultLocations();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SyntheticsApi#getSyntheticsDefaultLocations");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
109 changes: 109 additions & 0 deletions src/main/java/com/datadog/api/client/v1/api/SyntheticsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -2643,6 +2643,115 @@ public ApiResponse<SyntheticsBatchDetails> getSyntheticsCIBatchWithHttpInfo(Stri
new GenericType<SyntheticsBatchDetails>() {});
}

/**
* Get the default locations.
*
* <p>See {@link #getSyntheticsDefaultLocationsWithHttpInfo}.
*
* @return List&lt;String&gt;
* @throws ApiException if fails to make API call
*/
public List<String> getSyntheticsDefaultLocations() throws ApiException {
return getSyntheticsDefaultLocationsWithHttpInfo().getData();
}

/**
* Get the default locations.
*
* <p>See {@link #getSyntheticsDefaultLocationsWithHttpInfoAsync}.
*
* @return CompletableFuture&lt;List&lt;String&gt;&gt;
*/
public CompletableFuture<List<String>> getSyntheticsDefaultLocationsAsync() {
return getSyntheticsDefaultLocationsWithHttpInfoAsync()
.thenApply(
response -> {
return response.getData();
});
}

/**
* Get the default locations settings.
*
* @return ApiResponse&lt;List&lt;String&gt;&gt;
* @throws ApiException if fails to make API call
* @http.response.details
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* </table>
*/
public ApiResponse<List<String>> getSyntheticsDefaultLocationsWithHttpInfo() throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v1/synthetics/settings/default_locations";

Map<String, String> localVarHeaderParams = new HashMap<String, String>();

Invocation.Builder builder =
apiClient.createBuilder(
"v1.SyntheticsApi.getSyntheticsDefaultLocations",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"});
return apiClient.invokeAPI(
"GET",
builder,
localVarHeaderParams,
new String[] {},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<List<String>>() {});
}

/**
* Get the default locations.
*
* <p>See {@link #getSyntheticsDefaultLocationsWithHttpInfo}.
*
* @return CompletableFuture&lt;ApiResponse&lt;List&lt;String&gt;&gt;&gt;
*/
public CompletableFuture<ApiResponse<List<String>>>
getSyntheticsDefaultLocationsWithHttpInfoAsync() {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v1/synthetics/settings/default_locations";

Map<String, String> localVarHeaderParams = new HashMap<String, String>();

Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v1.SyntheticsApi.getSyntheticsDefaultLocations",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<List<String>>> result = new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
return apiClient.invokeAPIAsync(
"GET",
builder,
localVarHeaderParams,
new String[] {},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<List<String>>() {});
}

/**
* Get a test configuration.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2023-06-08T19:13:18.175Z
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[
{
"httpRequest": {
"headers": {},
"method": "GET",
"path": "/api/v1/synthetics/settings/default_locations",
"keepAlive": false,
"secure": true
},
"httpResponse": {
"body": "[\"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\"]\n",
"headers": {
"Content-Type": [
"application/json"
]
},
"statusCode": 200,
"reasonPhrase": "OK"
},
"times": {
"remainingTimes": 1
},
"timeToLive": {
"unlimited": true
},
"id": "b9dc107e-6281-4944-ce79-b8f4922edb4b"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,12 @@ Feature: Synthetics
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/synthetics-app
Scenario: Get the default locations returns "OK" response
Given new "GetSyntheticsDefaultLocations" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/synthetics-app
Scenario: Get the list of all Synthetic tests returns "OK - Returns the list of all Synthetic tests." response
Given new "ListTests" request
Expand All @@ -534,6 +540,12 @@ Feature: Synthetics
When the request is sent
Then the response status is 404 Synthetic Monitoring is not activated for the user.

@team:DataDog/synthetics-app
Scenario: Get the list of default locations returns "OK" response
Given new "GetSyntheticsDefaultLocations" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/synthetics-app
Scenario: Pause or start a test returns "- Synthetic Monitoring is not activated for the user" response
Given new "UpdateTestPauseStatus" request
Expand Down
6 changes: 6 additions & 0 deletions src/test/resources/com/datadog/api/client/v1/api/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,12 @@
"type": "idempotent"
}
},
"GetSyntheticsDefaultLocations": {
"tag": "Synthetics",
"undo": {
"type": "safe"
}
},
"ListTests": {
"tag": "Synthetics",
"undo": {
Expand Down