From 5658e9ceeee0d144119939c230f82f708768467d Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 3 Jan 2025 15:57:36 +0000 Subject: [PATCH] Regenerate client from commit 50c16e5f of spec repo --- .apigentools-info | 8 ++-- .generator/schemas/v2/openapi.yaml | 8 ++-- examples/v2/logs/ListLogs.rb | 18 +++++--- examples/v2/logs/ListLogsGet.rb | 2 +- examples/v2/logs/ListLogsGet_175182691.rb | 5 +++ examples/v2/logs/ListLogs_3400928236.rb | 23 ++++++++++ examples/v2/logs/ListLogs_534975433.rb | 29 +++++++++++++ features/v2/logs.feature | 53 ++++++++++++++++------- lib/datadog_api_client/v2/api/logs_api.rb | 16 +++---- 9 files changed, 124 insertions(+), 38 deletions(-) create mode 100644 examples/v2/logs/ListLogsGet_175182691.rb create mode 100644 examples/v2/logs/ListLogs_3400928236.rb create mode 100644 examples/v2/logs/ListLogs_534975433.rb diff --git a/.apigentools-info b/.apigentools-info index deaf58eb977..b5062ed338a 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-02 17:32:11.649371", - "spec_repo_commit": "733cf3ea" + "regenerated": "2025-01-03 15:57:09.265800", + "spec_repo_commit": "50c16e5f" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-02 17:32:11.666424", - "spec_repo_commit": "733cf3ea" + "regenerated": "2025-01-03 15:57:09.282748", + "spec_repo_commit": "50c16e5f" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 76195d0bb3d..5ffff4300a1 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -38621,7 +38621,7 @@ paths: [Results are paginated][1]. - Use this endpoint to see your latest logs. + Use this endpoint to search and filter your logs. **If you are considering archiving logs for your organization, @@ -38718,7 +38718,7 @@ paths: $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Get a list of logs + summary: Search logs (GET) tags: - Logs x-pagination: @@ -38737,7 +38737,7 @@ paths: [Results are paginated][1]. - Use this endpoint to build complex logs filtering and search. + Use this endpoint to search and filter your logs. **If you are considering archiving logs for your organization, @@ -38770,7 +38770,7 @@ paths: $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Search logs + summary: Search logs (POST) tags: - Logs x-codegen-request-body-name: body diff --git a/examples/v2/logs/ListLogs.rb b/examples/v2/logs/ListLogs.rb index df7aad3f858..9b703f998a8 100644 --- a/examples/v2/logs/ListLogs.rb +++ b/examples/v2/logs/ListLogs.rb @@ -1,21 +1,27 @@ -# Search logs returns "OK" response +# Search logs (POST) returns "OK" response require "datadog_api_client" api_instance = DatadogAPIClient::V2::LogsAPI.new body = DatadogAPIClient::V2::LogsListRequest.new({ filter: DatadogAPIClient::V2::LogsQueryFilter.new({ - query: "datadog-agent", + from: "now-15m", indexes: [ "main", + "web", ], - from: "2020-09-17T11:48:36+01:00", - to: "2020-09-17T12:48:36+01:00", + query: "service:web* AND @http.status_code:[200 TO 299]", + storage_tier: DatadogAPIClient::V2::LogsStorageTier::INDEXES, + to: "now", + }), + options: DatadogAPIClient::V2::LogsQueryOptions.new({ + timezone: "GMT", }), - sort: DatadogAPIClient::V2::LogsSort::TIMESTAMP_ASCENDING, page: DatadogAPIClient::V2::LogsListRequestPage.new({ - limit: 5, + cursor: "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", + limit: 25, }), + sort: DatadogAPIClient::V2::LogsSort::TIMESTAMP_ASCENDING, }) opts = { body: body, diff --git a/examples/v2/logs/ListLogsGet.rb b/examples/v2/logs/ListLogsGet.rb index 5abb898d0d2..6432c26b29c 100644 --- a/examples/v2/logs/ListLogsGet.rb +++ b/examples/v2/logs/ListLogsGet.rb @@ -1,4 +1,4 @@ -# Get a list of logs returns "OK" response +# Search logs (GET) returns "OK" response require "datadog_api_client" api_instance = DatadogAPIClient::V2::LogsAPI.new diff --git a/examples/v2/logs/ListLogsGet_175182691.rb b/examples/v2/logs/ListLogsGet_175182691.rb new file mode 100644 index 00000000000..642f83a4c41 --- /dev/null +++ b/examples/v2/logs/ListLogsGet_175182691.rb @@ -0,0 +1,5 @@ +# Search logs (GET) returns "OK" response with pagination + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::LogsAPI.new +api_instance.list_logs_get_with_pagination() { |item| puts item } diff --git a/examples/v2/logs/ListLogs_3400928236.rb b/examples/v2/logs/ListLogs_3400928236.rb new file mode 100644 index 00000000000..df7aad3f858 --- /dev/null +++ b/examples/v2/logs/ListLogs_3400928236.rb @@ -0,0 +1,23 @@ +# Search logs returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::LogsAPI.new + +body = DatadogAPIClient::V2::LogsListRequest.new({ + filter: DatadogAPIClient::V2::LogsQueryFilter.new({ + query: "datadog-agent", + indexes: [ + "main", + ], + from: "2020-09-17T11:48:36+01:00", + to: "2020-09-17T12:48:36+01:00", + }), + sort: DatadogAPIClient::V2::LogsSort::TIMESTAMP_ASCENDING, + page: DatadogAPIClient::V2::LogsListRequestPage.new({ + limit: 5, + }), +}) +opts = { + body: body, +} +p api_instance.list_logs(opts) diff --git a/examples/v2/logs/ListLogs_534975433.rb b/examples/v2/logs/ListLogs_534975433.rb new file mode 100644 index 00000000000..b37b2dec789 --- /dev/null +++ b/examples/v2/logs/ListLogs_534975433.rb @@ -0,0 +1,29 @@ +# Search logs (POST) returns "OK" response with pagination + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::LogsAPI.new + +body = DatadogAPIClient::V2::LogsListRequest.new({ + filter: DatadogAPIClient::V2::LogsQueryFilter.new({ + from: "now-15m", + indexes: [ + "main", + "web", + ], + query: "service:web* AND @http.status_code:[200 TO 299]", + storage_tier: DatadogAPIClient::V2::LogsStorageTier::INDEXES, + to: "now", + }), + options: DatadogAPIClient::V2::LogsQueryOptions.new({ + timezone: "GMT", + }), + page: DatadogAPIClient::V2::LogsListRequestPage.new({ + cursor: "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", + limit: 25, + }), + sort: DatadogAPIClient::V2::LogsSort::TIMESTAMP_ASCENDING, +}) +opts = { + body: body, +} +api_instance.list_logs_with_pagination(opts) { |item| puts item } diff --git a/features/v2/logs.feature b/features/v2/logs.feature index 7763729af5f..b7accd07dd9 100644 --- a/features/v2/logs.feature +++ b/features/v2/logs.feature @@ -43,20 +43,6 @@ Feature: Logs Then the response status is 200 OK And the response "meta.status" is equal to "done" - @generated @skip @team:DataDog/logs-app - Scenario: Get a list of logs returns "Bad Request" response - Given a valid "appKeyAuth" key in the system - And new "ListLogsGet" request - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/logs-app - Scenario: Get a list of logs returns "OK" response - Given a valid "appKeyAuth" key in the system - And new "ListLogsGet" request - When the request is sent - Then the response status is 200 OK - @replay-only @skip-validation @team:DataDog/logs-app @with-pagination Scenario: Get a list of logs returns "OK" response with pagination Given a valid "appKeyAuth" key in the system @@ -80,13 +66,50 @@ Feature: Logs And the response "data" has length 0 @generated @skip @team:DataDog/logs-app - Scenario: Search logs returns "Bad Request" response + Scenario: Search logs (GET) returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And new "ListLogsGet" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/logs-app + Scenario: Search logs (GET) returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "ListLogsGet" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/logs-app @with-pagination + Scenario: Search logs (GET) returns "OK" response with pagination + Given a valid "appKeyAuth" key in the system + And new "ListLogsGet" request + When the request with pagination is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/logs-app + Scenario: Search logs (POST) returns "Bad Request" response Given a valid "appKeyAuth" key in the system And new "ListLogs" request And body with value {"filter": {"from": "now-15m", "indexes": ["main", "web"], "query": "service:web* AND @http.status_code:[200 TO 299]", "storage_tier": "indexes", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"} When the request is sent Then the response status is 400 Bad Request + @generated @skip @team:DataDog/logs-app + Scenario: Search logs (POST) returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "ListLogs" request + And body with value {"filter": {"from": "now-15m", "indexes": ["main", "web"], "query": "service:web* AND @http.status_code:[200 TO 299]", "storage_tier": "indexes", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/logs-app @with-pagination + Scenario: Search logs (POST) returns "OK" response with pagination + Given a valid "appKeyAuth" key in the system + And new "ListLogs" request + And body with value {"filter": {"from": "now-15m", "indexes": ["main", "web"], "query": "service:web* AND @http.status_code:[200 TO 299]", "storage_tier": "indexes", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"} + When the request with pagination is sent + Then the response status is 200 OK + @team:DataDog/logs-app Scenario: Search logs returns "OK" response Given a valid "appKeyAuth" key in the system diff --git a/lib/datadog_api_client/v2/api/logs_api.rb b/lib/datadog_api_client/v2/api/logs_api.rb index 67ee5abc32e..1921d4c12eb 100644 --- a/lib/datadog_api_client/v2/api/logs_api.rb +++ b/lib/datadog_api_client/v2/api/logs_api.rb @@ -90,7 +90,7 @@ def aggregate_logs_with_http_info(body, opts = {}) return data, status_code, headers end - # Search logs. + # Search logs (POST). # # @see #list_logs_with_http_info def list_logs(opts = {}) @@ -98,12 +98,12 @@ def list_logs(opts = {}) data end - # Search logs. + # Search logs (POST). # # List endpoint returns logs that match a log search query. # [Results are paginated][1]. # - # Use this endpoint to build complex logs filtering and search. + # Use this endpoint to search and filter your logs. # # **If you are considering archiving logs for your organization, # consider use of the Datadog archive capabilities instead of the log list API. @@ -163,7 +163,7 @@ def list_logs_with_http_info(opts = {}) return data, status_code, headers end - # Search logs. + # Search logs (POST). # # Provide a paginated version of {#list_logs}, returning all items. # @@ -184,7 +184,7 @@ def list_logs_with_pagination(opts = {}) end end - # Get a list of logs. + # Search logs (GET). # # @see #list_logs_get_with_http_info def list_logs_get(opts = {}) @@ -192,12 +192,12 @@ def list_logs_get(opts = {}) data end - # Get a list of logs. + # Search logs (GET). # # List endpoint returns logs that match a log search query. # [Results are paginated][1]. # - # Use this endpoint to see your latest logs. + # Use this endpoint to search and filter your logs. # # **If you are considering archiving logs for your organization, # consider use of the Datadog archive capabilities instead of the log list API. @@ -281,7 +281,7 @@ def list_logs_get_with_http_info(opts = {}) return data, status_code, headers end - # Get a list of logs. + # Search logs (GET). # # Provide a paginated version of {#list_logs_get}, returning all items. #