Skip to content
Open
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
441 changes: 441 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions examples/v2/synthetics/CreateSyntheticsSuite.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Synthetics: Create a test suite returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.SyntheticsApi;
import com.datadog.api.client.v2.model.SuiteCreateEdit;
import com.datadog.api.client.v2.model.SuiteCreateEditRequest;
import com.datadog.api.client.v2.model.SyntheticsSuite;
import com.datadog.api.client.v2.model.SyntheticsSuiteOptions;
import com.datadog.api.client.v2.model.SyntheticsSuiteOptionsAlerting;
import com.datadog.api.client.v2.model.SyntheticsSuiteResponse;
import com.datadog.api.client.v2.model.SyntheticsSuiteTest;
import com.datadog.api.client.v2.model.SyntheticsSuiteTestAlertingCriticality;
import com.datadog.api.client.v2.model.SyntheticsSuiteType;
import java.util.Collections;

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

SuiteCreateEditRequest body =
new SuiteCreateEditRequest()
.data(
new SuiteCreateEdit()
.attributes(
new SyntheticsSuite()
.message("Notification message")
.name("Example suite name")
.options(
new SyntheticsSuiteOptions()
.alerting(new SyntheticsSuiteOptionsAlerting()))
.tags(Collections.singletonList("env:production"))
.tests(
Collections.singletonList(
new SyntheticsSuiteTest()
.alertingCriticality(
SyntheticsSuiteTestAlertingCriticality.CRITICAL)
.publicId("")))
.type(SyntheticsSuiteType.SUITE))
.type(SyntheticsSuiteType.SUITE));

try {
SyntheticsSuiteResponse result = apiInstance.createSyntheticsSuite(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SyntheticsApi#createSyntheticsSuite");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
38 changes: 38 additions & 0 deletions examples/v2/synthetics/DeleteSyntheticsSuites.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Synthetics: Bulk delete suites returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.SyntheticsApi;
import com.datadog.api.client.v2.model.DeletedSuitesRequestDelete;
import com.datadog.api.client.v2.model.DeletedSuitesRequestDeleteAttributes;
import com.datadog.api.client.v2.model.DeletedSuitesRequestDeleteRequest;
import com.datadog.api.client.v2.model.DeletedSuitesRequestType;
import com.datadog.api.client.v2.model.DeletedSuitesResponse;
import java.util.Collections;

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

DeletedSuitesRequestDeleteRequest body =
new DeletedSuitesRequestDeleteRequest()
.data(
new DeletedSuitesRequestDelete()
.attributes(
new DeletedSuitesRequestDeleteAttributes()
.publicIds(Collections.singletonList("")))
.type(DeletedSuitesRequestType.DELETE_SUITES_REQUEST));

try {
DeletedSuitesResponse result = apiInstance.deleteSyntheticsSuites(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SyntheticsApi#deleteSyntheticsSuites");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
54 changes: 54 additions & 0 deletions examples/v2/synthetics/EditSyntheticsSuite.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Synthetics: edit a test suite returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.SyntheticsApi;
import com.datadog.api.client.v2.model.SuiteCreateEdit;
import com.datadog.api.client.v2.model.SuiteCreateEditRequest;
import com.datadog.api.client.v2.model.SyntheticsSuite;
import com.datadog.api.client.v2.model.SyntheticsSuiteOptions;
import com.datadog.api.client.v2.model.SyntheticsSuiteOptionsAlerting;
import com.datadog.api.client.v2.model.SyntheticsSuiteResponse;
import com.datadog.api.client.v2.model.SyntheticsSuiteTest;
import com.datadog.api.client.v2.model.SyntheticsSuiteTestAlertingCriticality;
import com.datadog.api.client.v2.model.SyntheticsSuiteType;
import java.util.Collections;

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

SuiteCreateEditRequest body =
new SuiteCreateEditRequest()
.data(
new SuiteCreateEdit()
.attributes(
new SyntheticsSuite()
.message("Notification message")
.name("Example suite name")
.options(
new SyntheticsSuiteOptions()
.alerting(new SyntheticsSuiteOptionsAlerting()))
.tags(Collections.singletonList("env:production"))
.tests(
Collections.singletonList(
new SyntheticsSuiteTest()
.alertingCriticality(
SyntheticsSuiteTestAlertingCriticality.CRITICAL)
.publicId("")))
.type(SyntheticsSuiteType.SUITE))
.type(SyntheticsSuiteType.SUITE));

try {
SyntheticsSuiteResponse result = apiInstance.editSyntheticsSuite("public_id", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SyntheticsApi#editSyntheticsSuite");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
24 changes: 24 additions & 0 deletions examples/v2/synthetics/GetSyntheticsSuite.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Synthetics: Get a suite returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.SyntheticsApi;
import com.datadog.api.client.v2.model.SyntheticsSuiteResponse;

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

try {
SyntheticsSuiteResponse result = apiInstance.getSyntheticsSuite("public_id");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SyntheticsApi#getSyntheticsSuite");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
24 changes: 24 additions & 0 deletions examples/v2/synthetics/SearchSuites.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Search Synthetics suites returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.SyntheticsApi;
import com.datadog.api.client.v2.model.SyntheticsSuiteSearchResponse;

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

try {
SyntheticsSuiteSearchResponse result = apiInstance.searchSuites();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SyntheticsApi#searchSuites");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Loading
Loading