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
797 changes: 794 additions & 3 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/v2/report-schedules/CreateReportSchedule.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static void main(String[] args) {
new ReportScheduleTemplateVariable()
.name("env")
.values(Collections.singletonList("prod"))))
.timeframe("calendar_month")
.timeframe("1w")
.timezone("America/New_York")
.title("Weekly Infrastructure Report"))
.type(ReportScheduleType.SCHEDULE));
Expand Down
26 changes: 26 additions & 0 deletions examples/v2/report-schedules/DeleteReportSchedule.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Delete a report schedule returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ReportSchedulesApi;
import com.datadog.api.client.v2.model.ReportScheduleResponse;
import java.util.UUID;

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

try {
ReportScheduleResponse result =
apiInstance.deleteReportSchedule(UUID.fromString("11111111-2222-3333-4444-555555555555"));
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ReportSchedulesApi#deleteReportSchedule");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
26 changes: 26 additions & 0 deletions examples/v2/report-schedules/GetReportSchedule.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Get a report schedule returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ReportSchedulesApi;
import com.datadog.api.client.v2.model.ReportScheduleResponse;
import java.util.UUID;

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

try {
ReportScheduleResponse result =
apiInstance.getReportSchedule(UUID.fromString("11111111-2222-3333-4444-555555555555"));
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ReportSchedulesApi#getReportSchedule");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
27 changes: 27 additions & 0 deletions examples/v2/report-schedules/GetReportSchedulesForResource.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Get report schedules for a resource returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ReportSchedulesApi;
import com.datadog.api.client.v2.model.ReportScheduleListResponse;
import com.datadog.api.client.v2.model.ReportScheduleResourceType;

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

try {
ReportScheduleListResponse result =
apiInstance.getReportSchedulesForResource(
ReportScheduleResourceType.DASHBOARD, "abc-def-ghi");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ReportSchedulesApi#getReportSchedulesForResource");
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/report-schedules/ListReportSchedules.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// List report schedules returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ReportSchedulesApi;
import com.datadog.api.client.v2.model.ReportScheduleListResponse;

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

try {
ReportScheduleListResponse result = apiInstance.listReportSchedules();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ReportSchedulesApi#listReportSchedules");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
2 changes: 1 addition & 1 deletion examples/v2/report-schedules/PatchReportSchedule.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static void main(String[] args) {
new ReportScheduleTemplateVariable()
.name("env")
.values(Collections.singletonList("prod"))))
.timeframe("calendar_month")
.timeframe("1w")
.timezone("America/New_York")
.title("Weekly Infrastructure Report"))
.type(ReportScheduleType.SCHEDULE));
Expand Down
41 changes: 41 additions & 0 deletions examples/v2/report-schedules/ToggleReportSchedule.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Toggle a report schedule returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ReportSchedulesApi;
import com.datadog.api.client.v2.model.ReportScheduleResponse;
import com.datadog.api.client.v2.model.ReportScheduleStatus;
import com.datadog.api.client.v2.model.ReportScheduleToggleRequest;
import com.datadog.api.client.v2.model.ReportScheduleToggleRequestAttributes;
import com.datadog.api.client.v2.model.ReportScheduleToggleRequestData;
import com.datadog.api.client.v2.model.ReportScheduleType;
import java.util.UUID;

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

ReportScheduleToggleRequest body =
new ReportScheduleToggleRequest()
.data(
new ReportScheduleToggleRequestData()
.attributes(
new ReportScheduleToggleRequestAttributes()
.status(ReportScheduleStatus.ACTIVE))
.type(ReportScheduleType.SCHEDULE));

try {
ReportScheduleResponse result =
apiInstance.toggleReportSchedule(
UUID.fromString("11111111-2222-3333-4444-555555555555"), body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ReportSchedulesApi#toggleReportSchedule");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Loading
Loading