-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathBatchRowsQuery.java
More file actions
41 lines (37 loc) · 1.77 KB
/
BatchRowsQuery.java
File metadata and controls
41 lines (37 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Batch rows query returns "Successfully retrieved rows. Some or all requested rows were found.
// Response includes found
// rows in the included section." response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ReferenceTablesApi;
import com.datadog.api.client.v2.model.BatchRowsQueryDataType;
import com.datadog.api.client.v2.model.BatchRowsQueryRequest;
import com.datadog.api.client.v2.model.BatchRowsQueryRequestData;
import com.datadog.api.client.v2.model.BatchRowsQueryRequestDataAttributes;
import com.datadog.api.client.v2.model.BatchRowsQueryResponse;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
ReferenceTablesApi apiInstance = new ReferenceTablesApi(defaultClient);
BatchRowsQueryRequest body =
new BatchRowsQueryRequest()
.data(
new BatchRowsQueryRequestData()
.attributes(
new BatchRowsQueryRequestDataAttributes()
.rowIds(Arrays.asList("row_id_1", "row_id_2"))
.tableId("00000000-0000-0000-0000-000000000000"))
.type(BatchRowsQueryDataType.REFERENCE_TABLES_BATCH_ROWS_QUERY));
try {
BatchRowsQueryResponse result = apiInstance.batchRowsQuery(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ReferenceTablesApi#batchRowsQuery");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}