From fe4d9f17fea6d6a13d3c881fd56a9e8ecf000103 Mon Sep 17 00:00:00 2001 From: David Tapiador Date: Mon, 9 Mar 2026 10:25:06 +0100 Subject: [PATCH 1/2] trigger extra response with cursor pagination until response is empty --- .generator/src/generator/templates/api.j2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.generator/src/generator/templates/api.j2 b/.generator/src/generator/templates/api.j2 index a36f6f84a848..c843976d9bdf 100644 --- a/.generator/src/generator/templates/api.j2 +++ b/.generator/src/generator/templates/api.j2 @@ -238,9 +238,15 @@ module {{ module_name }}::{{ version|upper }} while true do response = {{ operation.operationId|snake_case }}({% for name, parameter in operation|parameters if parameter.required %}{{ name|attribute_name }}, {% endfor %}opts) @api_client.get_attribute_from_path(response, "{{ pagination.resultsPath|default('')|attribute_path }}").each { |item| yield(item) } + {%- if pagination.cursorParam %} + if @api_client.get_attribute_from_path(response, "{{ pagination.resultsPath|default('')|attribute_path }}").length == 0 + break + end + {%- else %} if @api_client.get_attribute_from_path(response, "{{ pagination.resultsPath|default('')|attribute_path }}").length < page_size break end + {%- endif %} {%- if pagination.pageOffsetParam %} @api_client.set_attribute_from_path(api_version, {{ get_container(operation, pagination.pageOffsetParam, True) }}, @api_client.get_attribute_from_path({{ get_container(operation, pagination.pageOffsetParam) }}, 0) + page_size) {%- endif %} From bdaed55877760beceb3d0e71d44d58bf6954cc06 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 9 Mar 2026 11:28:38 +0000 Subject: [PATCH 2/2] Regenerate client from commit 59795a1 of spec repo --- .generator/schemas/v2/openapi.yaml | 23 ++++++++---------- ...ts-returns-OK-response-with-pagination.yml | 18 ++++++++++++++ ...ts-returns-OK-response-with-pagination.yml | 22 +++++++++++++++++ ...es-returns-OK-response-with-pagination.yml | 18 ++++++++++++++ ...rs-returns-OK-response-with-pagination.yml | 18 ++++++++++++++ ...ts-returns-OK-response-with-pagination.yml | 18 ++++++++++++++ ...ts-returns-OK-response-with-pagination.yml | 22 +++++++++++++++++ ...gs-returns-OK-response-with-pagination.yml | 18 ++++++++++++++ ...gs-returns-OK-response-with-pagination.yml | 22 +++++++++++++++++ ...turns-Success-response-with-pagination.yml | 18 ++++++++++++++ ...es-returns-OK-response-with-pagination.yml | 18 ++++++++++++++ ...ts-returns-OK-response-with-pagination.yml | 18 ++++++++++++++ ...ts-returns-OK-response-with-pagination.yml | 22 +++++++++++++++++ ...ls-returns-OK-response-with-pagination.yml | 23 ++++++++++++++++++ ...ls-returns-OK-response-with-pagination.yml | 18 ++++++++++++++ ...ns-returns-OK-response-with-pagination.yml | 18 ++++++++++++++ ...ns-returns-OK-response-with-pagination.yml | 22 +++++++++++++++++ lib/datadog_api_client/configuration.rb | 24 ++++++++----------- lib/datadog_api_client/v2/api/audit_api.rb | 4 ++-- .../v2/api/ci_visibility_pipelines_api.rb | 4 ++-- .../v2/api/ci_visibility_tests_api.rb | 4 ++-- .../v2/api/container_images_api.rb | 2 +- .../v2/api/containers_api.rb | 2 +- lib/datadog_api_client/v2/api/events_api.rb | 4 ++-- lib/datadog_api_client/v2/api/logs_api.rb | 4 ++-- lib/datadog_api_client/v2/api/metrics_api.rb | 2 +- .../v2/api/processes_api.rb | 2 +- lib/datadog_api_client/v2/api/rum_api.rb | 4 ++-- .../v2/api/security_monitoring_api.rb | 10 ++++---- lib/datadog_api_client/v2/api/spans_api.rb | 4 ++-- .../v2/api/test_optimization_api.rb | 2 +- 31 files changed, 357 insertions(+), 51 deletions(-) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3c804abe224e..cd8210f5a292 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -95571,21 +95571,18 @@ paths: security: - apiKeyAuth: [] servers: - - url: https://{subdomain}.{site} + - url: https://{site} variables: site: - default: datadoghq.com - description: The regional site for customers. + default: browser-intake-datadoghq.com + description: The intake domain for the regional site. enum: - - datadoghq.com - - us3.datadoghq.com - - us5.datadoghq.com - - ap1.datadoghq.com - - ap2.datadoghq.com - - datadoghq.eu - subdomain: - default: browser-intake - description: The subdomain where the API is deployed. + - browser-intake-datadoghq.com + - browser-intake-us3-datadoghq.com + - browser-intake-us5-datadoghq.com + - browser-intake-ap1-datadoghq.com + - browser-intake-ap2-datadoghq.com + - browser-intake-datadoghq.eu - url: '{protocol}://{name}' variables: name: @@ -95600,7 +95597,7 @@ paths: default: datadoghq.com description: Any Datadog deployment. subdomain: - default: browser-intake + default: api description: The subdomain where the API is deployed. summary: Send server-side events tags: diff --git a/cassettes/features/v2/audit/Get-a-list-of-Audit-Logs-events-returns-OK-response-with-pagination.yml b/cassettes/features/v2/audit/Get-a-list-of-Audit-Logs-events-returns-OK-response-with-pagination.yml index 532ece89a8cd..ca3387c4e128 100644 --- a/cassettes/features/v2/audit/Get-a-list-of-Audit-Logs-events-returns-OK-response-with-pagination.yml +++ b/cassettes/features/v2/audit/Get-a-list-of-Audit-Logs-events-returns-OK-response-with-pagination.yml @@ -38,4 +38,22 @@ http_interactions: status: code: 200 message: OK +- recorded_at: Wed, 13 Apr 2022 09:30:15 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/audit/events?page%5Blimit%5D=2&page%5Bcursor%5D=eyJhZnRlciI6IkFRQUFBWUFpUWhuWTNRM3VVUUFBQUFCQldVRnBVV2h3YmtGQlEwczJhSGMyTWtoNGNtOTNRVUUifQ + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/audit/Search-Audit-Logs-events-returns-OK-response-with-pagination.yml b/cassettes/features/v2/audit/Search-Audit-Logs-events-returns-OK-response-with-pagination.yml index 3c9d9d56bca9..51716bccbc7a 100644 --- a/cassettes/features/v2/audit/Search-Audit-Logs-events-returns-OK-response-with-pagination.yml +++ b/cassettes/features/v2/audit/Search-Audit-Logs-events-returns-OK-response-with-pagination.yml @@ -54,4 +54,26 @@ http_interactions: status: code: 200 message: OK +- recorded_at: Wed, 13 Apr 2022 09:36:13 GMT + request: + body: + encoding: UTF-8 + string: '{"filter":{"from":"now-15m","to":"now"},"options":{"timezone":"GMT"},"page":{"cursor":"eyJhZnRlciI6IkFRQUFBWUFpT2hnV2pkb1otUUFBQUFCQldVRnBUMmgzVFVGQlJHSkxUR1pvU1U1MFRrOW5RVUUifQ","limit":2},"sort":"timestamp"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/audit/events/search + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/container_images/Get-all-Container-Images-returns-OK-response-with-pagination.yml b/cassettes/features/v2/container_images/Get-all-Container-Images-returns-OK-response-with-pagination.yml index baac7f7b7aa4..cbaffab1a7d2 100644 --- a/cassettes/features/v2/container_images/Get-all-Container-Images-returns-OK-response-with-pagination.yml +++ b/cassettes/features/v2/container_images/Get-all-Container-Images-returns-OK-response-with-pagination.yml @@ -63,4 +63,22 @@ http_interactions: status: code: 200 message: OK +- recorded_at: Wed, 11 Oct 2023 11:13:13 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/container_images?page%5Bsize%5D=2&page%5Bcursor%5D=bmFtZTowMTM5MTA3MzM1MTIuZGtyLmVjci51cy1lYXN0LTEuYW1hem9uYXdzLmNvbS9hcmdvfGlkOjAxMzkxMDczMzUxMi5ka3IuZWNyLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tL2FyZ29Ac2hhMjU2OmZmMTUxZWYyNDZkN2I0ZDZiOGZlMzE5MjNiMjk4ZDg0ZThmMjA2MzI3MDFiYmI2ZWQ5N2ZjYzU4YTAxNTBmODA%3D + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/containers/Get-All-Containers-returns-OK-response-with-pagination.yml b/cassettes/features/v2/containers/Get-All-Containers-returns-OK-response-with-pagination.yml index c293ca1d1371..16aae9f37707 100644 --- a/cassettes/features/v2/containers/Get-All-Containers-returns-OK-response-with-pagination.yml +++ b/cassettes/features/v2/containers/Get-All-Containers-returns-OK-response-with-pagination.yml @@ -45,4 +45,22 @@ http_interactions: status: code: 200 message: OK +- recorded_at: Mon, 16 Oct 2023 16:01:59 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/containers?page%5Bsize%5D=2&page%5Bcursor%5D=c3RhcnRlZDoxNjk3MTE4NDExMDAwLjAwMDAwMHxpZC5yYXc6ODY4OWY2ODUtZTQ0MS00ODJjLTYwNDMtNWQ5ZA%3D%3D + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/events/Get-a-list-of-events-returns-OK-response-with-pagination.yml b/cassettes/features/v2/events/Get-a-list-of-events-returns-OK-response-with-pagination.yml index a9fd56cfd6bf..913d1c790513 100644 --- a/cassettes/features/v2/events/Get-a-list-of-events-returns-OK-response-with-pagination.yml +++ b/cassettes/features/v2/events/Get-a-list-of-events-returns-OK-response-with-pagination.yml @@ -48,4 +48,22 @@ http_interactions: status: code: 200 message: OK +- recorded_at: Mon, 20 Jun 2022 17:08:51 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/events?filter%5Bfrom%5D=now-15m&filter%5Bto%5D=now&page%5Blimit%5D=2&page%5Bcursor%5D=eyJhZnRlciI6IkFnQUFBWUdDRlRXSTJoUnZQZ0FBQUFBQUFBQVlBQUFBQUVGWlIwTkdWRmRKUVVGRVVqbERWbEZ5ZEdoZlMxOXJRZ0FBQUNRQUFBQUFNREU0TVRneU1UVXRNelU0T0MwME1EZGhMV0V5TURndE1qUmxZekE1TmpVMVptTmkifQ + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/events/Search-events-returns-OK-response-with-pagination.yml b/cassettes/features/v2/events/Search-events-returns-OK-response-with-pagination.yml index 4265c66581cc..8202117101b0 100644 --- a/cassettes/features/v2/events/Search-events-returns-OK-response-with-pagination.yml +++ b/cassettes/features/v2/events/Search-events-returns-OK-response-with-pagination.yml @@ -56,4 +56,26 @@ http_interactions: status: code: 200 message: OK +- recorded_at: Mon, 20 Jun 2022 17:08:53 GMT + request: + body: + encoding: UTF-8 + string: '{"filter":{"from":"now-15m","to":"now"},"options":{"timezone":"GMT"},"page":{"cursor":"eyJhZnRlciI6IkFnQUFBWUdDRlhBZ0lWRnZQZ0FBQUFBQUFBQVlBQUFBQUVGWlIwTkdXRUZuUVVGQmVGaEhkVTlPZUY5MU9FWmpTd0FBQUNRQUFBQUFNREU0TVRneU1UVXROekF5TUMwMFpXTTJMV0l3WVdJdFpEVTFZbU0zTlRZMlpUUTMifQ","limit":2},"sort":"timestamp"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/events/search + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs/Get-a-list-of-logs-returns-OK-response-with-pagination.yml b/cassettes/features/v2/logs/Get-a-list-of-logs-returns-OK-response-with-pagination.yml index 388605419564..1aacd4fb1f5c 100644 --- a/cassettes/features/v2/logs/Get-a-list-of-logs-returns-OK-response-with-pagination.yml +++ b/cassettes/features/v2/logs/Get-a-list-of-logs-returns-OK-response-with-pagination.yml @@ -38,4 +38,22 @@ http_interactions: status: code: 200 message: OK +- recorded_at: Tue, 12 Apr 2022 09:52:05 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/logs/events?page%5Blimit%5D=2&page%5Bcursor%5D=eyJhZnRlciI6IkFRQUFBWUFkTDlKNG1jT2g2QUFBQUFCQldVRmtUQzFPUzBGQlFucExkREpLZFZOYVlrTjNRVUkifQ + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs/Search-logs-returns-OK-response-with-pagination.yml b/cassettes/features/v2/logs/Search-logs-returns-OK-response-with-pagination.yml index 4438d790432b..fc97b3b2986e 100644 --- a/cassettes/features/v2/logs/Search-logs-returns-OK-response-with-pagination.yml +++ b/cassettes/features/v2/logs/Search-logs-returns-OK-response-with-pagination.yml @@ -46,4 +46,26 @@ http_interactions: status: code: 200 message: OK +- recorded_at: Mon, 11 Apr 2022 16:44:42 GMT + request: + body: + encoding: UTF-8 + string: '{"filter":{"from":"now-15m","indexes":["main"],"to":"now"},"options":{"timezone":"GMT"},"page":{"cursor":"eyJhZnRlciI6IkFRQUFBWUFaZGJvSzdkR3dPUUFBQUFCQldVRmFaR0p5TVVGQlEwczRPRU4zWW1aMVVESlJRVVEifQ","limit":2},"sort":"timestamp"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/events/search + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/Get-a-list-of-metrics-returns-Success-response-with-pagination.yml b/cassettes/features/v2/metrics/Get-a-list-of-metrics-returns-Success-response-with-pagination.yml index 7bf07523a37f..02838edd1a96 100644 --- a/cassettes/features/v2/metrics/Get-a-list-of-metrics-returns-Success-response-with-pagination.yml +++ b/cassettes/features/v2/metrics/Get-a-list-of-metrics-returns-Success-response-with-pagination.yml @@ -39,4 +39,22 @@ http_interactions: status: code: 200 message: OK +- recorded_at: Fri, 06 Dec 2024 19:12:25 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/metrics?page%5Bsize%5D=2&page%5Bcursor%5D=6354566d64454633525642695631597759323173616d4d784f5768614d6d52355748704265455a7561453154526b704554315a4f616c5577566b685862456f305455646e6557517a526e6c5752555642526d787355314e756233686c617a56575656526b52465273516c6456526c5a74557a427756574a73525546425155464251554642526c705464316455566b354a5658706e4e574d7863465669565852465657316b576b354962464a566257733156564642516b5a7561453154526b704554315a4f616c5577566b685862456f305455646e6557517a526e6c57525556425155453950546f365a474630595752765a79356c63335270625746305a57526664584e685a32557563336c756447686c64476c6a6379356863476c666447567a644639796457357a4c4445754d44417a4e6a4d795a5373774e673d3d + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/processes/Get-all-processes-returns-OK-response-with-pagination.yml b/cassettes/features/v2/processes/Get-all-processes-returns-OK-response-with-pagination.yml index c5b235b35ce7..ed3cdf3a93d4 100644 --- a/cassettes/features/v2/processes/Get-all-processes-returns-OK-response-with-pagination.yml +++ b/cassettes/features/v2/processes/Get-all-processes-returns-OK-response-with-pagination.yml @@ -36,4 +36,22 @@ http_interactions: status: code: 200 message: OK +- recorded_at: Mon, 11 Apr 2022 15:53:14 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/processes?page%5Blimit%5D=2&page%5Bcursor%5D=78ece26c7701000015e90400ecda56b600e21f012357ad716ee71ca9 + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/rum/Get-a-list-of-RUM-events-returns-OK-response-with-pagination.yml b/cassettes/features/v2/rum/Get-a-list-of-RUM-events-returns-OK-response-with-pagination.yml index b056583b7911..ac5dee8ce414 100644 --- a/cassettes/features/v2/rum/Get-a-list-of-RUM-events-returns-OK-response-with-pagination.yml +++ b/cassettes/features/v2/rum/Get-a-list-of-RUM-events-returns-OK-response-with-pagination.yml @@ -56,4 +56,22 @@ http_interactions: status: code: 200 message: OK +- recorded_at: Tue, 12 Apr 2022 10:04:40 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/rum/events?page%5Blimit%5D=2&page%5Bcursor%5D=eyJhZnRlciI6IkFRQUFBWUFkTzNLYXN2VDNLd0FBQUFCQldVRmtUek5UVFVGQlFrOXRiRkZaY3kwNGFVcDNRVWMifQ + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/rum/Search-RUM-events-returns-OK-response-with-pagination.yml b/cassettes/features/v2/rum/Search-RUM-events-returns-OK-response-with-pagination.yml index 2cf8a55363bc..699b1293b853 100644 --- a/cassettes/features/v2/rum/Search-RUM-events-returns-OK-response-with-pagination.yml +++ b/cassettes/features/v2/rum/Search-RUM-events-returns-OK-response-with-pagination.yml @@ -64,4 +64,26 @@ http_interactions: status: code: 200 message: OK +- recorded_at: Tue, 12 Apr 2022 12:55:55 GMT + request: + body: + encoding: UTF-8 + string: '{"filter":{"from":"now-15m","query":"@type:session AND @session.type:user","to":"now"},"options":{"time_offset":0,"timezone":"GMT"},"page":{"cursor":"eyJhZnRlciI6IkFRQUFBWUFkTzNLYXN2VDNLd0FBQUFCQldVRmtUek5UVFVGQlFrOXRiRkZaY3kwNGFVcDNRVWMifQ","limit":2},"sort":"timestamp"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/rum/events/search + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Get-a-list-of-security-signals-returns-OK-response-with-pagination.yml b/cassettes/features/v2/security_monitoring/Get-a-list-of-security-signals-returns-OK-response-with-pagination.yml index f7a00efb865f..d2e2fac02c87 100644 --- a/cassettes/features/v2/security_monitoring/Get-a-list-of-security-signals-returns-OK-response-with-pagination.yml +++ b/cassettes/features/v2/security_monitoring/Get-a-list-of-security-signals-returns-OK-response-with-pagination.yml @@ -122,4 +122,27 @@ http_interactions: status: code: 200 message: OK +- recorded_at: Wed, 13 Apr 2022 11:32:57 GMT + request: + body: + encoding: UTF-8 + string: '{"filter":{"from":"2022-04-13T11:17:57.080Z","query":"security:attack + status:high","to":"2022-04-13T11:32:57.080Z"},"page":{"cursor":"eyJhZnRlciI6IkFRQUFBWUFlRGFHZENMd21QZ0FBQUFCQldVRmxSR0ZIWkVGQlJFa3lkakpuYjFCSmF6Um5RVUUifQ","limit":2},"sort":"timestamp"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security_monitoring/signals/search + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Get-a-quick-list-of-security-signals-returns-OK-response-with-pagination.yml b/cassettes/features/v2/security_monitoring/Get-a-quick-list-of-security-signals-returns-OK-response-with-pagination.yml index 0b573b1acfc8..4b982b22f775 100644 --- a/cassettes/features/v2/security_monitoring/Get-a-quick-list-of-security-signals-returns-OK-response-with-pagination.yml +++ b/cassettes/features/v2/security_monitoring/Get-a-quick-list-of-security-signals-returns-OK-response-with-pagination.yml @@ -112,4 +112,22 @@ http_interactions: status: code: 200 message: OK +- recorded_at: Tue, 12 Apr 2022 15:49:41 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security_monitoring/signals?page%5Blimit%5D=2&page%5Bcursor%5D=eyJhZnRlciI6IkFRQUFBWUFlRGFHZENMd21QZ0FBQUFCQldVRmxSR0ZIWkVGQlJFa3lkakpuYjFCSmF6Um5RVUUifQ + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/spans/Get-a-list-of-spans-returns-OK-response-with-pagination.yml b/cassettes/features/v2/spans/Get-a-list-of-spans-returns-OK-response-with-pagination.yml index 3e8620b2f990..d8d53eee7bfe 100644 --- a/cassettes/features/v2/spans/Get-a-list-of-spans-returns-OK-response-with-pagination.yml +++ b/cassettes/features/v2/spans/Get-a-list-of-spans-returns-OK-response-with-pagination.yml @@ -35,4 +35,22 @@ http_interactions: status: code: 200 message: OK +- recorded_at: Thu, 29 Jun 2023 10:47:31 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/spans/events?page%5Blimit%5D=2&page%5Bcursor%5D=eyJhZnRlciI6IkFnQUFBWWtHdzRwa083amdBZ0FBQUFBQUFBQVlBQUFBQUVGWmEwZDNOVmRSUVVGQ01sbFRNV3N3WTNGdGVsQndad0FBQUNRQUFBQUFNREU0T1RBMll6TXRPR0UyTkMwMFpETmlMV0ZqWm1NdFlUaGxaR1kxTW1ZeE1Ua3kiLCJ2YWx1ZXMiOlsiMjAyMy0wNi0yOVQxMDo0NzowNS41NzJaIiwxMDAxOTcxNzE0XX0%3D + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/spans/Search-spans-returns-OK-response-with-pagination.yml b/cassettes/features/v2/spans/Search-spans-returns-OK-response-with-pagination.yml index fdf3e08b03c6..bf47bb96a5d0 100644 --- a/cassettes/features/v2/spans/Search-spans-returns-OK-response-with-pagination.yml +++ b/cassettes/features/v2/spans/Search-spans-returns-OK-response-with-pagination.yml @@ -46,4 +46,26 @@ http_interactions: status: code: 200 message: OK +- recorded_at: Thu, 29 Jun 2023 10:52:06 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"filter":{"from":"now-15m","query":"service:python*","to":"now"},"options":{"timezone":"GMT"},"page":{"cursor":"eyJhZnRlciI6IkFnQUFBWWtHdXF2UUQ0YzdlUUFBQUFBQUFBQVlBQUFBQUVGWmEwZDFjbVpSUVVGRWMzZDVaVUZYYVZOblFWRmxOUUFBQUNRQUFBQUFNREU0T1RBMll6QXROVEZrT0MwME5EYzVMV0ZsT0RndE56WXdZbVl4TldRM016QXkiLCJ2YWx1ZXMiOlsiMjAyMy0wNi0yOVQxMDozNzoyNC4zMDRaIiwyNjA1MjA4MjVdfQ==","limit":2},"sort":"timestamp"},"type":"search_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/spans/events/search + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK recorded_with: VCR 6.0.0 diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index c8229bb03ecf..46d9a0926831 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -984,24 +984,20 @@ def operation_server_settings ], "v2.submit_product_analytics_event": [ { - url: +"https://{subdomain}.{site}", + url: +"https://{site}", description: "No description provided", variables: { site: { - description: "The regional site for customers.", - default_value: "datadoghq.com", + description: "The intake domain for the regional site.", + default_value: "browser-intake-datadoghq.com", enum_values: [ - "datadoghq.com", - "us3.datadoghq.com", - "us5.datadoghq.com", - "ap1.datadoghq.com", - "ap2.datadoghq.com", - "datadoghq.eu" + "browser-intake-datadoghq.com", + "browser-intake-us3-datadoghq.com", + "browser-intake-us5-datadoghq.com", + "browser-intake-ap1-datadoghq.com", + "browser-intake-ap2-datadoghq.com", + "browser-intake-datadoghq.eu" ] - }, - subdomain: { - description: "The subdomain where the API is deployed.", - default_value: "browser-intake", } } }, @@ -1029,7 +1025,7 @@ def operation_server_settings }, subdomain: { description: "The subdomain where the API is deployed.", - default_value: "browser-intake", + default_value: "api", } } } diff --git a/lib/datadog_api_client/v2/api/audit_api.rb b/lib/datadog_api_client/v2/api/audit_api.rb index a385b2a2c204..0e45ffc915f4 100644 --- a/lib/datadog_api_client/v2/api/audit_api.rb +++ b/lib/datadog_api_client/v2/api/audit_api.rb @@ -121,7 +121,7 @@ def list_audit_logs_with_pagination(opts = {}) while true do response = list_audit_logs(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "page_cursor", String, @api_client.get_attribute_from_path(response, "meta.page.after")) @@ -210,7 +210,7 @@ def search_audit_logs_with_pagination(opts = {}) while true do response = search_audit_logs(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "body.page.cursor", AuditLogsSearchEventsRequest, @api_client.get_attribute_from_path(response, "meta.page.after")) diff --git a/lib/datadog_api_client/v2/api/ci_visibility_pipelines_api.rb b/lib/datadog_api_client/v2/api/ci_visibility_pipelines_api.rb index ac6533866b60..0030b374886d 100644 --- a/lib/datadog_api_client/v2/api/ci_visibility_pipelines_api.rb +++ b/lib/datadog_api_client/v2/api/ci_visibility_pipelines_api.rb @@ -258,7 +258,7 @@ def list_ci_app_pipeline_events_with_pagination(opts = {}) while true do response = list_ci_app_pipeline_events(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "page_cursor", String, @api_client.get_attribute_from_path(response, "meta.page.after")) @@ -345,7 +345,7 @@ def search_ci_app_pipeline_events_with_pagination(opts = {}) while true do response = search_ci_app_pipeline_events(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "body.page.cursor", CIAppPipelineEventsRequest, @api_client.get_attribute_from_path(response, "meta.page.after")) diff --git a/lib/datadog_api_client/v2/api/ci_visibility_tests_api.rb b/lib/datadog_api_client/v2/api/ci_visibility_tests_api.rb index ade5c2bf4df6..c0720ba830a1 100644 --- a/lib/datadog_api_client/v2/api/ci_visibility_tests_api.rb +++ b/lib/datadog_api_client/v2/api/ci_visibility_tests_api.rb @@ -186,7 +186,7 @@ def list_ci_app_test_events_with_pagination(opts = {}) while true do response = list_ci_app_test_events(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "page_cursor", String, @api_client.get_attribute_from_path(response, "meta.page.after")) @@ -273,7 +273,7 @@ def search_ci_app_test_events_with_pagination(opts = {}) while true do response = search_ci_app_test_events(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "body.page.cursor", CIAppTestEventsRequest, @api_client.get_attribute_from_path(response, "meta.page.after")) diff --git a/lib/datadog_api_client/v2/api/container_images_api.rb b/lib/datadog_api_client/v2/api/container_images_api.rb index 371e98fe4e2b..f6a4b656d5d2 100644 --- a/lib/datadog_api_client/v2/api/container_images_api.rb +++ b/lib/datadog_api_client/v2/api/container_images_api.rb @@ -114,7 +114,7 @@ def list_container_images_with_pagination(opts = {}) while true do response = list_container_images(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "page_cursor", String, @api_client.get_attribute_from_path(response, "meta.pagination.next_cursor")) diff --git a/lib/datadog_api_client/v2/api/containers_api.rb b/lib/datadog_api_client/v2/api/containers_api.rb index afec6c91fcc7..fdde014b80ec 100644 --- a/lib/datadog_api_client/v2/api/containers_api.rb +++ b/lib/datadog_api_client/v2/api/containers_api.rb @@ -113,7 +113,7 @@ def list_containers_with_pagination(opts = {}) while true do response = list_containers(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "page_cursor", String, @api_client.get_attribute_from_path(response, "meta.pagination.next_cursor")) diff --git a/lib/datadog_api_client/v2/api/events_api.rb b/lib/datadog_api_client/v2/api/events_api.rb index 083fc9452b80..f87fde1a6527 100644 --- a/lib/datadog_api_client/v2/api/events_api.rb +++ b/lib/datadog_api_client/v2/api/events_api.rb @@ -259,7 +259,7 @@ def list_events_with_pagination(opts = {}) while true do response = list_events(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "page_cursor", String, @api_client.get_attribute_from_path(response, "meta.page.after")) @@ -346,7 +346,7 @@ def search_events_with_pagination(opts = {}) while true do response = search_events(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "body.page.cursor", EventsListRequest, @api_client.get_attribute_from_path(response, "meta.page.after")) diff --git a/lib/datadog_api_client/v2/api/logs_api.rb b/lib/datadog_api_client/v2/api/logs_api.rb index 1921d4c12eb5..1a3fd91fa940 100644 --- a/lib/datadog_api_client/v2/api/logs_api.rb +++ b/lib/datadog_api_client/v2/api/logs_api.rb @@ -177,7 +177,7 @@ def list_logs_with_pagination(opts = {}) while true do response = list_logs(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "body.page.cursor", LogsListRequest, @api_client.get_attribute_from_path(response, "meta.page.after")) @@ -295,7 +295,7 @@ def list_logs_get_with_pagination(opts = {}) while true do response = list_logs_get(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "page_cursor", String, @api_client.get_attribute_from_path(response, "meta.page.after")) diff --git a/lib/datadog_api_client/v2/api/metrics_api.rb b/lib/datadog_api_client/v2/api/metrics_api.rb index bb22337dbcee..12bcdca5a387 100644 --- a/lib/datadog_api_client/v2/api/metrics_api.rb +++ b/lib/datadog_api_client/v2/api/metrics_api.rb @@ -772,7 +772,7 @@ def list_tag_configurations_with_pagination(opts = {}) while true do response = list_tag_configurations(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "page_cursor", String, @api_client.get_attribute_from_path(response, "meta.pagination.next_cursor")) diff --git a/lib/datadog_api_client/v2/api/processes_api.rb b/lib/datadog_api_client/v2/api/processes_api.rb index 9e47cc16327d..50687ee5d408 100644 --- a/lib/datadog_api_client/v2/api/processes_api.rb +++ b/lib/datadog_api_client/v2/api/processes_api.rb @@ -115,7 +115,7 @@ def list_processes_with_pagination(opts = {}) while true do response = list_processes(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "page_cursor", String, @api_client.get_attribute_from_path(response, "meta.page.after")) diff --git a/lib/datadog_api_client/v2/api/rum_api.rb b/lib/datadog_api_client/v2/api/rum_api.rb index 9f69daa806d1..bd3c413cab66 100644 --- a/lib/datadog_api_client/v2/api/rum_api.rb +++ b/lib/datadog_api_client/v2/api/rum_api.rb @@ -445,7 +445,7 @@ def list_rum_events_with_pagination(opts = {}) while true do response = list_rum_events(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "page_cursor", String, @api_client.get_attribute_from_path(response, "meta.page.after")) @@ -538,7 +538,7 @@ def search_rum_events_with_pagination(body, opts = {}) while true do response = search_rum_events(body, opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, body, "page.cursor", RUMQueryPageOptions, @api_client.get_attribute_from_path(response, "meta.page.after")) diff --git a/lib/datadog_api_client/v2/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index 01aa43835f9c..c185ce633926 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -3940,7 +3940,7 @@ def list_findings_with_pagination(opts = {}) while true do response = list_findings(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "page_cursor", String, @api_client.get_attribute_from_path(response, "meta.page.cursor")) @@ -4306,7 +4306,7 @@ def list_security_findings_with_pagination(opts = {}) while true do response = list_security_findings(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "page_cursor", String, @api_client.get_attribute_from_path(response, "meta.page.after")) @@ -4627,7 +4627,7 @@ def list_security_monitoring_signals_with_pagination(opts = {}) while true do response = list_security_monitoring_signals(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "page_cursor", String, @api_client.get_attribute_from_path(response, "meta.page.after")) @@ -5569,7 +5569,7 @@ def search_security_findings_with_pagination(body, opts = {}) while true do response = search_security_findings(body, opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, body, "data.attributes.page.cursor", SecurityFindingsSearchRequestData, @api_client.get_attribute_from_path(response, "meta.page.after")) @@ -5724,7 +5724,7 @@ def search_security_monitoring_signals_with_pagination(opts = {}) while true do response = search_security_monitoring_signals(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "body.page.cursor", SecurityMonitoringSignalListRequest, @api_client.get_attribute_from_path(response, "meta.page.after")) diff --git a/lib/datadog_api_client/v2/api/spans_api.rb b/lib/datadog_api_client/v2/api/spans_api.rb index 3e22e6a9833a..f59b206863c9 100644 --- a/lib/datadog_api_client/v2/api/spans_api.rb +++ b/lib/datadog_api_client/v2/api/spans_api.rb @@ -178,7 +178,7 @@ def list_spans_with_pagination(body, opts = {}) while true do response = list_spans(body, opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, body, "data.attributes.page.cursor", SpansListRequestData, @api_client.get_attribute_from_path(response, "meta.page.after")) @@ -284,7 +284,7 @@ def list_spans_get_with_pagination(opts = {}) while true do response = list_spans_get(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "page_cursor", String, @api_client.get_attribute_from_path(response, "meta.page.after")) diff --git a/lib/datadog_api_client/v2/api/test_optimization_api.rb b/lib/datadog_api_client/v2/api/test_optimization_api.rb index 1432e5421449..9894d4d304ce 100644 --- a/lib/datadog_api_client/v2/api/test_optimization_api.rb +++ b/lib/datadog_api_client/v2/api/test_optimization_api.rb @@ -119,7 +119,7 @@ def search_flaky_tests_with_pagination(opts = {}) while true do response = search_flaky_tests(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size + if @api_client.get_attribute_from_path(response, "data").length == 0 break end @api_client.set_attribute_from_path(api_version, opts, "body.data.attributes.page.cursor", FlakyTestsSearchRequest, @api_client.get_attribute_from_path(response, "meta.pagination.next_page"))