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
892 changes: 891 additions & 1 deletion .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions examples/v2/actions-datastores/BulkWriteDatastoreItems.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Bulk write datastore items returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ActionsDatastoresApi;
import com.datadog.api.client.v2.model.BulkPutAppsDatastoreItemsRequest;
import com.datadog.api.client.v2.model.BulkPutAppsDatastoreItemsRequestData;
import com.datadog.api.client.v2.model.BulkPutAppsDatastoreItemsRequestDataAttributes;
import com.datadog.api.client.v2.model.DatastoreItemsDataType;
import com.datadog.api.client.v2.model.PutAppsDatastoreItemResponseArray;
import java.util.Arrays;
import java.util.Map;

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

// there is a valid "datastore" in the system
String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID");

BulkPutAppsDatastoreItemsRequest body =
new BulkPutAppsDatastoreItemsRequest()
.data(
new BulkPutAppsDatastoreItemsRequestData()
.attributes(
new BulkPutAppsDatastoreItemsRequestDataAttributes()
.values(
Arrays.asList(
Map.ofEntries(
Map.entry("id", "cust_3141"),
Map.entry("name", "Johnathan")),
Map.ofEntries(
Map.entry("id", "cust_3142"), Map.entry("name", "Mary")))))
.type(DatastoreItemsDataType.ITEMS));

try {
PutAppsDatastoreItemResponseArray result =
apiInstance.bulkWriteDatastoreItems(DATASTORE_DATA_ID, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ActionsDatastoresApi#bulkWriteDatastoreItems");
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/actions-datastores/CreateDatastore.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Create datastore returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ActionsDatastoresApi;
import com.datadog.api.client.v2.model.CreateAppsDatastoreRequest;
import com.datadog.api.client.v2.model.CreateAppsDatastoreRequestData;
import com.datadog.api.client.v2.model.CreateAppsDatastoreRequestDataAttributes;
import com.datadog.api.client.v2.model.CreateAppsDatastoreResponse;
import com.datadog.api.client.v2.model.DatastoreDataType;

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

CreateAppsDatastoreRequest body =
new CreateAppsDatastoreRequest()
.data(
new CreateAppsDatastoreRequestData()
.attributes(
new CreateAppsDatastoreRequestDataAttributes()
.name("datastore-name")
.primaryColumnName("primaryKey"))
.type(DatastoreDataType.DATASTORES));

try {
CreateAppsDatastoreResponse result = apiInstance.createDatastore(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ActionsDatastoresApi#createDatastore");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
25 changes: 25 additions & 0 deletions examples/v2/actions-datastores/DeleteDatastore.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Delete datastore returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ActionsDatastoresApi;

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

// there is a valid "datastore" in the system
String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID");

try {
apiInstance.deleteDatastore(DATASTORE_DATA_ID);
} catch (ApiException e) {
System.err.println("Exception when calling ActionsDatastoresApi#deleteDatastore");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
40 changes: 40 additions & 0 deletions examples/v2/actions-datastores/DeleteDatastoreItem.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Delete datastore item returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ActionsDatastoresApi;
import com.datadog.api.client.v2.model.DatastoreItemsDataType;
import com.datadog.api.client.v2.model.DeleteAppsDatastoreItemRequest;
import com.datadog.api.client.v2.model.DeleteAppsDatastoreItemRequestData;
import com.datadog.api.client.v2.model.DeleteAppsDatastoreItemRequestDataAttributes;
import com.datadog.api.client.v2.model.DeleteAppsDatastoreItemResponse;

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

// there is a valid "datastore" in the system
String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID");

DeleteAppsDatastoreItemRequest body =
new DeleteAppsDatastoreItemRequest()
.data(
new DeleteAppsDatastoreItemRequestData()
.attributes(
new DeleteAppsDatastoreItemRequestDataAttributes().itemKey("test-key"))
.type(DatastoreItemsDataType.ITEMS));

try {
DeleteAppsDatastoreItemResponse result =
apiInstance.deleteDatastoreItem(DATASTORE_DATA_ID, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ActionsDatastoresApi#deleteDatastoreItem");
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/actions-datastores/GetDatastore.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Get datastore returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ActionsDatastoresApi;
import com.datadog.api.client.v2.model.Datastore;

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

// there is a valid "datastore" in the system
String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID");

try {
Datastore result = apiInstance.getDatastore(DATASTORE_DATA_ID);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ActionsDatastoresApi#getDatastore");
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/actions-datastores/ListDatastoreItems.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// List datastore items returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ActionsDatastoresApi;
import com.datadog.api.client.v2.model.ItemApiPayloadArray;

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

// there is a valid "datastore" in the system
String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID");

try {
ItemApiPayloadArray result = apiInstance.listDatastoreItems(DATASTORE_DATA_ID);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ActionsDatastoresApi#listDatastoreItems");
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/actions-datastores/ListDatastores.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// List datastores returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ActionsDatastoresApi;
import com.datadog.api.client.v2.model.DatastoreArray;

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

try {
DatastoreArray result = apiInstance.listDatastores();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ActionsDatastoresApi#listDatastores");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
39 changes: 39 additions & 0 deletions examples/v2/actions-datastores/UpdateDatastore.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Update datastore returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ActionsDatastoresApi;
import com.datadog.api.client.v2.model.Datastore;
import com.datadog.api.client.v2.model.DatastoreDataType;
import com.datadog.api.client.v2.model.UpdateAppsDatastoreRequest;
import com.datadog.api.client.v2.model.UpdateAppsDatastoreRequestData;
import com.datadog.api.client.v2.model.UpdateAppsDatastoreRequestDataAttributes;

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

// there is a valid "datastore" in the system
String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID");

UpdateAppsDatastoreRequest body =
new UpdateAppsDatastoreRequest()
.data(
new UpdateAppsDatastoreRequestData()
.attributes(new UpdateAppsDatastoreRequestDataAttributes().name("updated name"))
.type(DatastoreDataType.DATASTORES)
.id(DATASTORE_DATA_ID));

try {
Datastore result = apiInstance.updateDatastore(DATASTORE_DATA_ID, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ActionsDatastoresApi#updateDatastore");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
43 changes: 43 additions & 0 deletions examples/v2/actions-datastores/UpdateDatastoreItem.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Update datastore item returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ActionsDatastoresApi;
import com.datadog.api.client.v2.model.ItemApiPayload;
import com.datadog.api.client.v2.model.UpdateAppsDatastoreItemRequest;
import com.datadog.api.client.v2.model.UpdateAppsDatastoreItemRequestData;
import com.datadog.api.client.v2.model.UpdateAppsDatastoreItemRequestDataAttributes;
import com.datadog.api.client.v2.model.UpdateAppsDatastoreItemRequestDataAttributesItemChanges;
import com.datadog.api.client.v2.model.UpdateAppsDatastoreItemRequestDataType;

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

// there is a valid "datastore" in the system
String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID");

UpdateAppsDatastoreItemRequest body =
new UpdateAppsDatastoreItemRequest()
.data(
new UpdateAppsDatastoreItemRequestData()
.attributes(
new UpdateAppsDatastoreItemRequestDataAttributes()
.itemChanges(
new UpdateAppsDatastoreItemRequestDataAttributesItemChanges())
.itemKey("test-key"))
.type(UpdateAppsDatastoreItemRequestDataType.ITEMS));

try {
ItemApiPayload result = apiInstance.updateDatastoreItem(DATASTORE_DATA_ID, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ActionsDatastoresApi#updateDatastoreItem");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Loading