From ccc03fcd8627cc8892b2ac018c3797e9b7ad5db8 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 3 Sep 2026 16:45:35 +0000 Subject: [PATCH] Regenerate client from commit d6db0c6 of spec repo --- .generator/schemas/v2/openapi.yaml | 18 +++++++++ examples/v2/ddsql/ExecuteDdsqlTabularQuery.rb | 19 +++++++++ examples/v2/ddsql/FetchDdsqlTabularQuery.rb | 14 +++++++ features/v2/ddsql.feature | 40 +++++++++++++++++++ features/v2/undo.json | 12 ++++++ lib/datadog_api_client/v2/api/ddsql_api.rb | 4 +- 6 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 examples/v2/ddsql/ExecuteDdsqlTabularQuery.rb create mode 100644 examples/v2/ddsql/FetchDdsqlTabularQuery.rb create mode 100644 features/v2/ddsql.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 324b65c3ebd7..0ab42d97a285 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -145929,9 +145929,18 @@ paths: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - timeseries_query summary: Execute a tabular DDSQL query tags: - DDSQL + "x-permission": + operator: OR + permissions: + - timeseries_query /api/v2/ddsql/query/tabular/fetch: post: description: |- @@ -146037,9 +146046,18 @@ paths: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - timeseries_query summary: Fetch the result of a DDSQL query tags: - DDSQL + "x-permission": + operator: OR + permissions: + - timeseries_query /api/v2/deletion/data/{product}: post: description: Creates a data deletion request by providing a query and a timeframe targeting the proper data. diff --git a/examples/v2/ddsql/ExecuteDdsqlTabularQuery.rb b/examples/v2/ddsql/ExecuteDdsqlTabularQuery.rb new file mode 100644 index 000000000000..1a0fca1b579a --- /dev/null +++ b/examples/v2/ddsql/ExecuteDdsqlTabularQuery.rb @@ -0,0 +1,19 @@ +# Execute a tabular DDSQL query returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::DDSQLAPI.new + +body = DatadogAPIClient::V2::DdsqlTabularQueryRequest.new({ + data: DatadogAPIClient::V2::DdsqlTabularQueryRequestData.new({ + attributes: DatadogAPIClient::V2::DdsqlTabularQueryRequestAttributes.new({ + query: "SELECT cloud_provider, count(*) FROM dd.hosts group by cloud_provider", + row_limit: 1000, + time: DatadogAPIClient::V2::DdsqlTabularQueryTimeWindow.new({ + from_timestamp: 1736942400000, + to_timestamp: 1736946000000, + }), + }), + type: DatadogAPIClient::V2::DdsqlTabularQueryRequestType::DDSQL_QUERY_REQUEST, + }), +}) +p api_instance.execute_ddsql_tabular_query(body) diff --git a/examples/v2/ddsql/FetchDdsqlTabularQuery.rb b/examples/v2/ddsql/FetchDdsqlTabularQuery.rb new file mode 100644 index 000000000000..3109c3eb373a --- /dev/null +++ b/examples/v2/ddsql/FetchDdsqlTabularQuery.rb @@ -0,0 +1,14 @@ +# Fetch the result of a DDSQL query returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::DDSQLAPI.new + +body = DatadogAPIClient::V2::DdsqlTabularQueryFetchRequest.new({ + data: DatadogAPIClient::V2::DdsqlTabularQueryFetchRequestData.new({ + attributes: DatadogAPIClient::V2::DdsqlTabularQueryFetchRequestAttributes.new({ + query_id: "eyJxdWVyeSI6ICJTRUxFQ1QgKiBGUk9NIGxvZ3MifQ==", + }), + type: DatadogAPIClient::V2::DdsqlTabularQueryFetchRequestType::DDSQL_QUERY_FETCH_REQUEST, + }), +}) +p api_instance.fetch_ddsql_tabular_query(body) diff --git a/features/v2/ddsql.feature b/features/v2/ddsql.feature new file mode 100644 index 000000000000..f10a549e5701 --- /dev/null +++ b/features/v2/ddsql.feature @@ -0,0 +1,40 @@ +@endpoint(ddsql) @endpoint(ddsql-v2) +Feature: DDSQL + 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. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "DDSQL" API + + @generated @skip @team:DataDog/query-apis + Scenario: Execute a tabular DDSQL query returns "Bad Request" response + Given new "ExecuteDdsqlTabularQuery" request + And body with 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"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/query-apis + Scenario: Execute a tabular DDSQL query returns "OK" response + Given new "ExecuteDdsqlTabularQuery" request + And body with 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"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/query-apis + Scenario: Fetch the result of a DDSQL query returns "Bad Request" response + Given new "FetchDdsqlTabularQuery" request + And body with value {"data": {"attributes": {"query_id": "eyJxdWVyeSI6ICJTRUxFQ1QgKiBGUk9NIGxvZ3MifQ=="}, "type": "ddsql_query_fetch_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/query-apis + Scenario: Fetch the result of a DDSQL query returns "OK" response + Given new "FetchDdsqlTabularQuery" request + And body with value {"data": {"attributes": {"query_id": "eyJxdWVyeSI6ICJTRUxFQ1QgKiBGUk9NIGxvZ3MifQ=="}, "type": "ddsql_query_fetch_request"}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 383d0fec6e5d..d4b64e7a4d51 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2284,6 +2284,18 @@ "type": "idempotent" } }, + "ExecuteDdsqlTabularQuery": { + "tag": "DDSQL", + "undo": { + "type": "idempotent" + } + }, + "FetchDdsqlTabularQuery": { + "tag": "DDSQL", + "undo": { + "type": "safe" + } + }, "CreateDataDeletionRequest": { "tag": "Data Deletion", "undo": { diff --git a/lib/datadog_api_client/v2/api/ddsql_api.rb b/lib/datadog_api_client/v2/api/ddsql_api.rb index 990ca327857d..fa1fc11ce73a 100644 --- a/lib/datadog_api_client/v2/api/ddsql_api.rb +++ b/lib/datadog_api_client/v2/api/ddsql_api.rb @@ -72,7 +72,7 @@ def execute_ddsql_tabular_query_with_http_info(body, opts = {}) return_type = opts[:debug_return_type] || 'DdsqlTabularQueryResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :execute_ddsql_tabular_query, @@ -142,7 +142,7 @@ def fetch_ddsql_tabular_query_with_http_info(body, opts = {}) return_type = opts[:debug_return_type] || 'DdsqlTabularQueryResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :fetch_ddsql_tabular_query,