diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml
index ed984a56d0e..87a6ec93802 100644
--- a/.generator/schemas/v2/openapi.yaml
+++ b/.generator/schemas/v2/openapi.yaml
@@ -30970,6 +30970,257 @@ components:
example: 1722439510282
format: int64
type: integer
+ DdsqlTabularQueryColumn:
+ description: A single column of a DDSQL tabular query result.
+ properties:
+ name:
+ description: Name of the column as projected by the SQL statement.
+ example: service
+ type: string
+ type:
+ description: |-
+ DDSQL data type of the column's values, for example `VARCHAR`, `BIGINT`,
+ `DECIMAL`, `BOOLEAN`, `TIMESTAMP`, `JSON`, or an array variant such as
+ `VARCHAR[]`. See the
+ [DDSQL data-types reference](https://docs.datadoghq.com/ddsql_reference/#data-types)
+ for the full, up-to-date list.
+ example: VARCHAR
+ type: string
+ values:
+ description: |-
+ Column values in row order. The element type matches the column's `type`;
+ for example a `VARCHAR` column carries strings, a `TIMESTAMP` column carries
+ Unix-millisecond integers. `null` is allowed for missing values.
+ example:
+ - web-store
+ - checkout
+ items: {}
+ type: array
+ required:
+ - name
+ - type
+ - values
+ type: object
+ DdsqlTabularQueryColumns:
+ description: |-
+ Column-major result set. Each element carries one column's name, type, and values,
+ with one value per row of the result. Set when `state` is `completed`.
+ items:
+ $ref: "#/components/schemas/DdsqlTabularQueryColumn"
+ type: array
+ DdsqlTabularQueryFetchRequest:
+ description: Wrapper for a DDSQL tabular query fetch request.
+ properties:
+ data:
+ $ref: "#/components/schemas/DdsqlTabularQueryFetchRequestData"
+ required:
+ - data
+ type: object
+ DdsqlTabularQueryFetchRequestAttributes:
+ description: Attributes describing which previously submitted DDSQL query to fetch.
+ properties:
+ query_id:
+ description: |-
+ Opaque token returned by an earlier execute or fetch response that carried
+ `state: running`. Identifies the query to poll for results.
+ example: "eyJxdWVyeSI6ICJTRUxFQ1QgKiBGUk9NIGxvZ3MifQ=="
+ type: string
+ required:
+ - query_id
+ type: object
+ DdsqlTabularQueryFetchRequestData:
+ description: JSON:API resource object for a DDSQL tabular query fetch request.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/DdsqlTabularQueryFetchRequestAttributes"
+ type:
+ $ref: "#/components/schemas/DdsqlTabularQueryFetchRequestType"
+ required:
+ - type
+ - attributes
+ type: object
+ DdsqlTabularQueryFetchRequestType:
+ default: ddsql_query_fetch_request
+ description: JSON:API resource type for a DDSQL tabular query fetch request.
+ enum:
+ - ddsql_query_fetch_request
+ example: ddsql_query_fetch_request
+ type: string
+ x-enum-varnames:
+ - DDSQL_QUERY_FETCH_REQUEST
+ DdsqlTabularQueryRequest:
+ description: Wrapper for a DDSQL tabular query execution request.
+ properties:
+ data:
+ $ref: "#/components/schemas/DdsqlTabularQueryRequestData"
+ required:
+ - data
+ type: object
+ DdsqlTabularQueryRequestAttributes:
+ description: Attributes describing the DDSQL query to execute.
+ properties:
+ query:
+ description: |-
+ The DDSQL statement to execute. DDSQL is Datadog's SQL dialect, which is a subset
+ of PostgreSQL, scoped to Datadog data sources.
+ example: "SELECT cloud_provider, count(*) FROM dd.hosts group by cloud_provider"
+ type: string
+ row_limit:
+ description: |-
+ Cap on the number of rows returned. Defaults to 5,000 when omitted. Must be
+ between 1 and 10,000 inclusive; values outside this range are rejected with 400.
+ example: 1000
+ format: int64
+ maximum: 10000
+ minimum: 1
+ type: integer
+ time:
+ $ref: "#/components/schemas/DdsqlTabularQueryTimeWindow"
+ required:
+ - query
+ - time
+ type: object
+ DdsqlTabularQueryRequestData:
+ description: JSON:API resource object for a DDSQL tabular query execution request.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/DdsqlTabularQueryRequestAttributes"
+ type:
+ $ref: "#/components/schemas/DdsqlTabularQueryRequestType"
+ required:
+ - type
+ - attributes
+ type: object
+ DdsqlTabularQueryRequestType:
+ default: ddsql_query_request
+ description: JSON:API resource type for a DDSQL tabular query request.
+ enum:
+ - ddsql_query_request
+ example: ddsql_query_request
+ type: string
+ x-enum-varnames:
+ - DDSQL_QUERY_REQUEST
+ DdsqlTabularQueryResponse:
+ description: |-
+ Response envelope for both the execute and fetch DDSQL tabular query endpoints.
+ Carries the JSON:API primary resource and a top-level `meta` block with
+ request-scoped observability handles.
+ properties:
+ data:
+ $ref: "#/components/schemas/DdsqlTabularQueryResponseData"
+ meta:
+ $ref: "#/components/schemas/DdsqlTabularQueryResponseMeta"
+ required:
+ - data
+ - meta
+ type: object
+ DdsqlTabularQueryResponseAttributes:
+ description: |-
+ Attributes of a DDSQL tabular query response. `query_id` is set when
+ `state` is `running`; `columns` is set when `state` is `completed`.
+ properties:
+ columns:
+ $ref: "#/components/schemas/DdsqlTabularQueryColumns"
+ query_id:
+ description: |-
+ Opaque token to pass to the fetch endpoint to poll for results.
+ Set when `state` is `running` and absent when `state` is `completed`.
+ example: "eyJxdWVyeSI6ICJTRUxFQ1QgKiBGUk9NIGxvZ3MifQ=="
+ type: string
+ state:
+ $ref: "#/components/schemas/DdsqlTabularQueryState"
+ warnings:
+ $ref: "#/components/schemas/DdsqlTabularQueryWarnings"
+ required:
+ - state
+ type: object
+ DdsqlTabularQueryResponseData:
+ description: JSON:API resource object for a DDSQL tabular query response.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/DdsqlTabularQueryResponseAttributes"
+ id:
+ description: Stable identifier for the query response resource.
+ example: "00000000-0000-0000-0000-000000000000"
+ type: string
+ type:
+ $ref: "#/components/schemas/DdsqlTabularQueryResponseType"
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ DdsqlTabularQueryResponseMeta:
+ description: |-
+ Top-level JSON:API meta block accompanying every DDSQL tabular query response.
+ Carries standard observability handles for client-side correlation.
+ properties:
+ elapsed:
+ description: Server-side time spent serving this request, in milliseconds.
+ example: 87
+ format: int64
+ type: integer
+ request_id:
+ description: |-
+ Echo of the `DD-Request-ID` header assigned by Datadog's edge to this request,
+ for support correlation.
+ example: "req-7f3e7d2c-1a0b-4d3e-9b2a-3c4d5e6f7082"
+ type: string
+ required:
+ - elapsed
+ - request_id
+ type: object
+ DdsqlTabularQueryResponseType:
+ default: ddsql_query_response
+ description: JSON:API resource type for a DDSQL tabular query response.
+ enum:
+ - ddsql_query_response
+ example: ddsql_query_response
+ type: string
+ x-enum-varnames:
+ - DDSQL_QUERY_RESPONSE
+ DdsqlTabularQueryState:
+ description: |-
+ Lifecycle state of a DDSQL tabular query response.
+ `running` means the query is still executing and the client should poll
+ the fetch endpoint with the returned `query_id`. `completed` means the
+ result set is inlined in `columns` and no further polling is required.
+ enum:
+ - running
+ - completed
+ example: completed
+ type: string
+ x-enum-varnames:
+ - RUNNING
+ - COMPLETED
+ DdsqlTabularQueryTimeWindow:
+ description: |-
+ Time window scoping the underlying data sources, expressed in Unix milliseconds
+ since the epoch. Inclusive on `from_timestamp`, exclusive on `to_timestamp`.
+ Results from static tables (for example, `dd.hosts`) are not affected by the
+ time window, but the field must still be provided.
+ properties:
+ from_timestamp:
+ description: Start of the query window (inclusive), in Unix milliseconds since the epoch.
+ example: 1736942400000
+ format: int64
+ type: integer
+ to_timestamp:
+ description: End of the query window (exclusive), in Unix milliseconds since the epoch.
+ example: 1736946000000
+ format: int64
+ type: integer
+ required:
+ - from_timestamp
+ - to_timestamp
+ type: object
+ DdsqlTabularQueryWarnings:
+ description: Non-fatal messages emitted by the query engine while serving this response.
+ items:
+ description: A single non-fatal warning message.
+ example: "Query result was truncated at the configured row_limit."
+ type: string
+ type: array
DefaultRulesetsPerLanguageData:
description: The primary data object in the default rulesets per language response.
properties:
@@ -133778,6 +134029,231 @@ paths:
x-unstable: |-
**Note: Data Access is in preview. If you have any feedback,
contact [Datadog support](https://docs.datadoghq.com/help/).**
+ /api/v2/ddsql/query/tabular:
+ post:
+ description: |-
+ Submit a DDSQL statement and return either a `running` state with an opaque `query_id`
+ for the client to poll, or a `completed` state with the column-major result set inlined
+ when the query finishes quickly enough to be served synchronously.
+ operationId: ExecuteDdsqlTabularQuery
+ requestBody:
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ query: "SELECT cloud_provider, count(*) FROM dd.hosts group by cloud_provider"
+ row_limit: 1000
+ time:
+ from_timestamp: 1736942400000
+ to_timestamp: 1736946000000
+ type: ddsql_query_request
+ schema:
+ $ref: "#/components/schemas/DdsqlTabularQueryRequest"
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ completed:
+ summary: Query finished synchronously
+ value:
+ data:
+ attributes:
+ columns:
+ - name: service
+ type: VARCHAR
+ values:
+ - web-store
+ - checkout
+ - name: count
+ type: BIGINT
+ values:
+ - 1024
+ - 512
+ state: completed
+ id: "00000000-0000-0000-0000-000000000000"
+ type: ddsql_query_response
+ meta:
+ elapsed: 318
+ request_id: "req-7f3e7d2c-1a0b-4d3e-9b2a-3c4d5e6f7081"
+ default:
+ summary: Query finished synchronously
+ value:
+ data:
+ attributes:
+ columns:
+ - name: service
+ type: VARCHAR
+ values:
+ - web-store
+ - checkout
+ - name: count
+ type: BIGINT
+ values:
+ - 1024
+ - 512
+ state: completed
+ id: "00000000-0000-0000-0000-000000000000"
+ type: ddsql_query_response
+ meta:
+ elapsed: 318
+ request_id: "req-7f3e7d2c-1a0b-4d3e-9b2a-3c4d5e6f7081"
+ running:
+ summary: Query still executing
+ value:
+ data:
+ attributes:
+ query_id: "eyJxdWVyeSI6ICJTRUxFQ1QgKiBGUk9NIGxvZ3MifQ=="
+ state: running
+ id: "00000000-0000-0000-0000-000000000000"
+ type: ddsql_query_response
+ meta:
+ elapsed: 42
+ request_id: "req-7f3e7d2c-1a0b-4d3e-9b2a-3c4d5e6f7081"
+ schema:
+ $ref: "#/components/schemas/DdsqlTabularQueryResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Internal Server Error
+ summary: Execute a tabular DDSQL query
+ tags:
+ - DDSQL
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
+ /api/v2/ddsql/query/tabular/fetch:
+ post:
+ description: |-
+ Poll a previously submitted DDSQL query for results. Pass the opaque `query_id` returned
+ by a prior `ExecuteDdsqlTabularQuery` (or by a prior `FetchDdsqlTabularQuery` that
+ returned `state: running`) and the server returns either a `running` state to poll again
+ or a `completed` state with the column-major result set inlined.
+ operationId: FetchDdsqlTabularQuery
+ requestBody:
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ query_id: "eyJxdWVyeSI6ICJTRUxFQ1QgKiBGUk9NIGxvZ3MifQ=="
+ type: ddsql_query_fetch_request
+ schema:
+ $ref: "#/components/schemas/DdsqlTabularQueryFetchRequest"
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ completed:
+ summary: Query finished
+ value:
+ data:
+ attributes:
+ columns:
+ - name: service
+ type: VARCHAR
+ values:
+ - web-store
+ - checkout
+ - name: count
+ type: BIGINT
+ values:
+ - 1024
+ - 512
+ state: completed
+ id: "00000000-0000-0000-0000-000000000000"
+ type: ddsql_query_response
+ meta:
+ elapsed: 87
+ request_id: "req-7f3e7d2c-1a0b-4d3e-9b2a-3c4d5e6f7082"
+ default:
+ summary: Query finished
+ value:
+ data:
+ attributes:
+ columns:
+ - name: service
+ type: VARCHAR
+ values:
+ - web-store
+ - checkout
+ - name: count
+ type: BIGINT
+ values:
+ - 1024
+ - 512
+ state: completed
+ id: "00000000-0000-0000-0000-000000000000"
+ type: ddsql_query_response
+ meta:
+ elapsed: 87
+ request_id: "req-7f3e7d2c-1a0b-4d3e-9b2a-3c4d5e6f7082"
+ running:
+ summary: Query still executing
+ value:
+ data:
+ attributes:
+ query_id: "eyJxdWVyeSI6ICJTRUxFQ1QgKiBGUk9NIGxvZ3MifQ=="
+ state: running
+ id: "00000000-0000-0000-0000-000000000000"
+ type: ddsql_query_response
+ meta:
+ elapsed: 12
+ request_id: "req-7f3e7d2c-1a0b-4d3e-9b2a-3c4d5e6f7082"
+ schema:
+ $ref: "#/components/schemas/DdsqlTabularQueryResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Bad Request
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Forbidden
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Internal Server Error
+ summary: Fetch the result of a DDSQL query
+ tags:
+ - DDSQL
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/deletion/data/{product}:
post:
description: Creates a data deletion request by providing a query and a timeframe targeting the proper data.
@@ -201794,6 +202270,12 @@ tags:
Programmatic management of a customer's Datadog organization. Use this API to perform
self-service organization lifecycle actions such as disabling the authenticated org.
name: Customer Org
+ - description: |-
+ Execute DDSQL queries against the Datadog data catalog and poll for their results.
+ Queries are dispatched asynchronously: the initial request may return a `running` state with
+ a `query_id`, and clients poll the fetch endpoint until the response transitions to
+ `completed` with a column-major result set.
+ name: DDSQL
- description: |-
Search, send, or delete events for DORA Metrics to measure and improve your software delivery performance. See the [DORA Metrics page](https://docs.datadoghq.com/dora_metrics/) for more information.
diff --git a/examples/v2/ddsql/ExecuteDdsqlTabularQuery.java b/examples/v2/ddsql/ExecuteDdsqlTabularQuery.java
new file mode 100644
index 00000000000..0a3081f4b96
--- /dev/null
+++ b/examples/v2/ddsql/ExecuteDdsqlTabularQuery.java
@@ -0,0 +1,46 @@
+// Execute a tabular DDSQL query returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.DdsqlApi;
+import com.datadog.api.client.v2.model.DdsqlTabularQueryRequest;
+import com.datadog.api.client.v2.model.DdsqlTabularQueryRequestAttributes;
+import com.datadog.api.client.v2.model.DdsqlTabularQueryRequestData;
+import com.datadog.api.client.v2.model.DdsqlTabularQueryRequestType;
+import com.datadog.api.client.v2.model.DdsqlTabularQueryResponse;
+import com.datadog.api.client.v2.model.DdsqlTabularQueryTimeWindow;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.executeDdsqlTabularQuery", true);
+ DdsqlApi apiInstance = new DdsqlApi(defaultClient);
+
+ DdsqlTabularQueryRequest body =
+ new DdsqlTabularQueryRequest()
+ .data(
+ new DdsqlTabularQueryRequestData()
+ .attributes(
+ new DdsqlTabularQueryRequestAttributes()
+ .query(
+ "SELECT cloud_provider, count(*) FROM dd.hosts group by"
+ + " cloud_provider")
+ .rowLimit(1000L)
+ .time(
+ new DdsqlTabularQueryTimeWindow()
+ .fromTimestamp(1736942400000L)
+ .toTimestamp(1736946000000L)))
+ .type(DdsqlTabularQueryRequestType.DDSQL_QUERY_REQUEST));
+
+ try {
+ DdsqlTabularQueryResponse result = apiInstance.executeDdsqlTabularQuery(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling DdsqlApi#executeDdsqlTabularQuery");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/ddsql/FetchDdsqlTabularQuery.java b/examples/v2/ddsql/FetchDdsqlTabularQuery.java
new file mode 100644
index 00000000000..9e4c904dbc2
--- /dev/null
+++ b/examples/v2/ddsql/FetchDdsqlTabularQuery.java
@@ -0,0 +1,38 @@
+// Fetch the result of a DDSQL query returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.DdsqlApi;
+import com.datadog.api.client.v2.model.DdsqlTabularQueryFetchRequest;
+import com.datadog.api.client.v2.model.DdsqlTabularQueryFetchRequestAttributes;
+import com.datadog.api.client.v2.model.DdsqlTabularQueryFetchRequestData;
+import com.datadog.api.client.v2.model.DdsqlTabularQueryFetchRequestType;
+import com.datadog.api.client.v2.model.DdsqlTabularQueryResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.fetchDdsqlTabularQuery", true);
+ DdsqlApi apiInstance = new DdsqlApi(defaultClient);
+
+ DdsqlTabularQueryFetchRequest body =
+ new DdsqlTabularQueryFetchRequest()
+ .data(
+ new DdsqlTabularQueryFetchRequestData()
+ .attributes(
+ new DdsqlTabularQueryFetchRequestAttributes()
+ .queryId("eyJxdWVyeSI6ICJTRUxFQ1QgKiBGUk9NIGxvZ3MifQ=="))
+ .type(DdsqlTabularQueryFetchRequestType.DDSQL_QUERY_FETCH_REQUEST));
+
+ try {
+ DdsqlTabularQueryResponse result = apiInstance.fetchDdsqlTabularQuery(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling DdsqlApi#fetchDdsqlTabularQuery");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java
index dacb988dec6..ecd6eaa113b 100644
--- a/src/main/java/com/datadog/api/client/ApiClient.java
+++ b/src/main/java/com/datadog/api/client/ApiClient.java
@@ -1039,6 +1039,8 @@ public class ApiClient {
put("v2.getAllDatasets", false);
put("v2.getDataset", false);
put("v2.updateDataset", false);
+ put("v2.executeDdsqlTabularQuery", false);
+ put("v2.fetchDdsqlTabularQuery", false);
put("v2.cancelDataDeletionRequest", false);
put("v2.createDataDeletionRequest", false);
put("v2.getDataDeletionRequests", false);
diff --git a/src/main/java/com/datadog/api/client/v2/api/DdsqlApi.java b/src/main/java/com/datadog/api/client/v2/api/DdsqlApi.java
new file mode 100644
index 00000000000..9c5cd2e2348
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/api/DdsqlApi.java
@@ -0,0 +1,355 @@
+package com.datadog.api.client.v2.api;
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.ApiResponse;
+import com.datadog.api.client.Pair;
+import com.datadog.api.client.v2.model.DdsqlTabularQueryFetchRequest;
+import com.datadog.api.client.v2.model.DdsqlTabularQueryRequest;
+import com.datadog.api.client.v2.model.DdsqlTabularQueryResponse;
+import jakarta.ws.rs.client.Invocation;
+import jakarta.ws.rs.core.GenericType;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class DdsqlApi {
+ private ApiClient apiClient;
+
+ public DdsqlApi() {
+ this(ApiClient.getDefaultApiClient());
+ }
+
+ public DdsqlApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Get the API client.
+ *
+ * @return API client
+ */
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ /**
+ * Set the API client.
+ *
+ * @param apiClient an instance of API client
+ */
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Execute a tabular DDSQL query.
+ *
+ *
See {@link #executeDdsqlTabularQueryWithHttpInfo}.
+ *
+ * @param body (required)
+ * @return DdsqlTabularQueryResponse
+ * @throws ApiException if fails to make API call
+ */
+ public DdsqlTabularQueryResponse executeDdsqlTabularQuery(DdsqlTabularQueryRequest body)
+ throws ApiException {
+ return executeDdsqlTabularQueryWithHttpInfo(body).getData();
+ }
+
+ /**
+ * Execute a tabular DDSQL query.
+ *
+ *
See {@link #executeDdsqlTabularQueryWithHttpInfoAsync}.
+ *
+ * @param body (required)
+ * @return CompletableFuture<DdsqlTabularQueryResponse>
+ */
+ public CompletableFuture executeDdsqlTabularQueryAsync(
+ DdsqlTabularQueryRequest body) {
+ return executeDdsqlTabularQueryWithHttpInfoAsync(body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Submit a DDSQL statement and return either a running state with an opaque
+ * query_id for the client to poll, or a completed state with the column-major
+ * result set inlined when the query finishes quickly enough to be served synchronously.
+ *
+ * @param body (required)
+ * @return ApiResponse<DdsqlTabularQueryResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ *
Response details
+ *
Status Code
Description
Response Headers
+ *
200
OK
-
+ *
400
Bad Request
-
+ *
403
Forbidden
-
+ *
429
Too many requests
-
+ *
500
Internal Server Error
-
+ *
+ */
+ public ApiResponse executeDdsqlTabularQueryWithHttpInfo(
+ DdsqlTabularQueryRequest body) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "executeDdsqlTabularQuery";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling executeDdsqlTabularQuery");
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/ddsql/query/tabular";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.DdsqlApi.executeDdsqlTabularQuery",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Execute a tabular DDSQL query.
+ *
+ *
See {@link #executeDdsqlTabularQueryWithHttpInfo}.
+ *
+ * @param body (required)
+ * @return CompletableFuture<ApiResponse<DdsqlTabularQueryResponse>>
+ */
+ public CompletableFuture>
+ executeDdsqlTabularQueryWithHttpInfoAsync(DdsqlTabularQueryRequest body) {
+ // Check if unstable operation is enabled
+ String operationId = "executeDdsqlTabularQuery";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'body' when calling executeDdsqlTabularQuery"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/ddsql/query/tabular";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.DdsqlApi.executeDdsqlTabularQuery",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Fetch the result of a DDSQL query.
+ *
+ *
See {@link #fetchDdsqlTabularQueryWithHttpInfo}.
+ *
+ * @param body (required)
+ * @return DdsqlTabularQueryResponse
+ * @throws ApiException if fails to make API call
+ */
+ public DdsqlTabularQueryResponse fetchDdsqlTabularQuery(DdsqlTabularQueryFetchRequest body)
+ throws ApiException {
+ return fetchDdsqlTabularQueryWithHttpInfo(body).getData();
+ }
+
+ /**
+ * Fetch the result of a DDSQL query.
+ *
+ *
See {@link #fetchDdsqlTabularQueryWithHttpInfoAsync}.
+ *
+ * @param body (required)
+ * @return CompletableFuture<DdsqlTabularQueryResponse>
+ */
+ public CompletableFuture fetchDdsqlTabularQueryAsync(
+ DdsqlTabularQueryFetchRequest body) {
+ return fetchDdsqlTabularQueryWithHttpInfoAsync(body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Poll a previously submitted DDSQL query for results. Pass the opaque query_id
+ * returned by a prior ExecuteDdsqlTabularQuery (or by a prior
+ * FetchDdsqlTabularQuery that returned state: running) and the server returns
+ * either a running state to poll again or a completed state with the
+ * column-major result set inlined.
+ *
+ * @param body (required)
+ * @return ApiResponse<DdsqlTabularQueryResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ *
Response details
+ *
Status Code
Description
Response Headers
+ *
200
OK
-
+ *
400
Bad Request
-
+ *
403
Forbidden
-
+ *
429
Too many requests
-
+ *
500
Internal Server Error
-
+ *
+ */
+ public ApiResponse fetchDdsqlTabularQueryWithHttpInfo(
+ DdsqlTabularQueryFetchRequest body) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "fetchDdsqlTabularQuery";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling fetchDdsqlTabularQuery");
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/ddsql/query/tabular/fetch";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.DdsqlApi.fetchDdsqlTabularQuery",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Fetch the result of a DDSQL query.
+ *
+ *
See {@link #fetchDdsqlTabularQueryWithHttpInfo}.
+ *
+ * @param body (required)
+ * @return CompletableFuture<ApiResponse<DdsqlTabularQueryResponse>>
+ */
+ public CompletableFuture>
+ fetchDdsqlTabularQueryWithHttpInfoAsync(DdsqlTabularQueryFetchRequest body) {
+ // Check if unstable operation is enabled
+ String operationId = "fetchDdsqlTabularQuery";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'body' when calling fetchDdsqlTabularQuery"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/ddsql/query/tabular/fetch";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.DdsqlApi.fetchDdsqlTabularQuery",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/DdsqlTabularQueryColumn.java b/src/main/java/com/datadog/api/client/v2/model/DdsqlTabularQueryColumn.java
new file mode 100644
index 00000000000..3c509ab5747
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/DdsqlTabularQueryColumn.java
@@ -0,0 +1,214 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/** A single column of a DDSQL tabular query result. */
+@JsonPropertyOrder({
+ DdsqlTabularQueryColumn.JSON_PROPERTY_NAME,
+ DdsqlTabularQueryColumn.JSON_PROPERTY_TYPE,
+ DdsqlTabularQueryColumn.JSON_PROPERTY_VALUES
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class DdsqlTabularQueryColumn {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_NAME = "name";
+ private String name;
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ private String type;
+
+ public static final String JSON_PROPERTY_VALUES = "values";
+ private List