Skip to content

Commit 5fbd6ab

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Allow cursor base pagination to query extra page until collection is empty in Ruby and Golang (#3597)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 82e2a82 commit 5fbd6ab

File tree

16 files changed

+846
-0
lines changed
  • cassettes/v2
    • Audit_2643932488
      • Get-a-list-of-Audit-Logs-events-returns-OK-response-with-pagination_2211735272
      • Search-Audit-Logs-events-returns-OK-response-with-pagination_4162694404
    • Container-Images_3138752210/Get-all-Container-Images-returns-OK-response-with-pagination_3961638493
    • Containers_24604017/Get-All-Containers-returns-OK-response-with-pagination_386015098
    • Events_3416228
      • Get-a-list-of-events-returns-OK-response-with-pagination_1548928428
      • Search-events-returns-OK-response-with-pagination_1698208896
    • Logs_1370058150
      • Get-a-list-of-logs-returns-OK-response-with-pagination_812925550
      • Search-logs-returns-OK-response-with-pagination_2666035826
    • Metrics_2046978582/Get-a-list-of-metrics-returns-Success-response-with-pagination_2424757361
    • Processes_3747476154/Get-all-processes-returns-OK-response-with-pagination_1970790563
    • RUM_2896677143
      • Get-a-list-of-RUM-events-returns-OK-response-with-pagination_3873778216
      • Search-RUM-events-returns-OK-response-with-pagination_2020559724
    • Security-Monitoring_1187227211
      • Get-a-list-of-security-signals-returns-OK-response-with-pagination_1673592626
      • Get-a-quick-list-of-security-signals-returns-OK-response-with-pagination_611957259
    • Spans_3419372246
      • Get-a-list-of-spans-returns-OK-response-with-pagination_1380293026
      • Search-spans-returns-OK-response-with-pagination_1510282302

16 files changed

+846
-0
lines changed

cassettes/v2/Audit_2643932488/Get-a-list-of-Audit-Logs-events-returns-OK-response-with-pagination_2211735272/recording.har

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,58 @@
107107
},
108108
"startedDateTime": "2022-04-13T09:30:16.056Z",
109109
"time": 485
110+
},
111+
{
112+
"_id": "ce9bbfa2c6907d157c4d36d38aa65d46",
113+
"_order": 0,
114+
"cache": {},
115+
"request": {
116+
"bodySize": 0,
117+
"cookies": [],
118+
"headers": [
119+
{
120+
"_fromType": "array",
121+
"name": "accept",
122+
"value": "application/json"
123+
}
124+
],
125+
"headersSize": -1,
126+
"httpVersion": "HTTP/1.1",
127+
"method": "GET",
128+
"queryString": [
129+
{
130+
"name": "page[limit]",
131+
"value": "2"
132+
},
133+
{
134+
"name": "page[cursor]",
135+
"value": "eyJhZnRlciI6IkFRQUFBWUFpUWhuWTNRM3VVUUFBQUFCQldVRnBVV2h3YmtGQlEwczJhSGMyTWtoNGNtOTNRVUUifQ"
136+
}
137+
],
138+
"url": "https://api.datadoghq.com/api/v2/audit/events?page%5Blimit%5D=2&page%5Bcursor%5D=eyJhZnRlciI6IkFRQUFBWUFpUWhuWTNRM3VVUUFBQUFCQldVRnBVV2h3YmtGQlEwczJhSGMyTWtoNGNtOTNRVUUifQ"
139+
},
140+
"response": {
141+
"bodySize": 11,
142+
"content": {
143+
"mimeType": "application/json",
144+
"size": 11,
145+
"text": "{\"data\":[]}"
146+
},
147+
"cookies": [],
148+
"headers": [
149+
{
150+
"name": "content-type",
151+
"value": "application/json"
152+
}
153+
],
154+
"headersSize": -1,
155+
"httpVersion": "HTTP/1.1",
156+
"redirectURL": "",
157+
"status": 200,
158+
"statusText": "OK"
159+
},
160+
"startedDateTime": "2022-04-13T09:30:17.000Z",
161+
"time": 0
110162
}
111163
],
112164
"pages": [],

cassettes/v2/Audit_2643932488/Search-Audit-Logs-events-returns-OK-response-with-pagination_4162694404/recording.har

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,59 @@
112112
},
113113
"startedDateTime": "2022-04-13T09:36:13.772Z",
114114
"time": 519
115+
},
116+
{
117+
"_id": "cf7178e11618cd79a1c8ba5c142d4049",
118+
"_order": 0,
119+
"cache": {},
120+
"request": {
121+
"bodySize": 209,
122+
"cookies": [],
123+
"headers": [
124+
{
125+
"_fromType": "array",
126+
"name": "accept",
127+
"value": "application/json"
128+
},
129+
{
130+
"_fromType": "array",
131+
"name": "content-type",
132+
"value": "application/json"
133+
}
134+
],
135+
"headersSize": -1,
136+
"httpVersion": "HTTP/1.1",
137+
"method": "POST",
138+
"postData": {
139+
"mimeType": "application/json",
140+
"params": [],
141+
"text": "{\"filter\":{\"from\":\"now-15m\",\"to\":\"now\"},\"options\":{\"timezone\":\"GMT\"},\"page\":{\"cursor\":\"eyJhZnRlciI6IkFRQUFBWUFpT2hnV2pkb1otUUFBQUFCQldVRnBUMmgzVFVGQlJHSkxUR1pvU1U1MFRrOW5RVUUifQ\",\"limit\":2},\"sort\":\"timestamp\"}"
142+
},
143+
"queryString": [],
144+
"url": "https://api.datadoghq.com/api/v2/audit/events/search"
145+
},
146+
"response": {
147+
"bodySize": 11,
148+
"content": {
149+
"mimeType": "application/json",
150+
"size": 11,
151+
"text": "{\"data\":[]}"
152+
},
153+
"cookies": [],
154+
"headers": [
155+
{
156+
"name": "content-type",
157+
"value": "application/json"
158+
}
159+
],
160+
"headersSize": -1,
161+
"httpVersion": "HTTP/1.1",
162+
"redirectURL": "",
163+
"status": 200,
164+
"statusText": "OK"
165+
},
166+
"startedDateTime": "2022-04-13T09:30:17.000Z",
167+
"time": 0
115168
}
116169
],
117170
"pages": [],

cassettes/v2/Container-Images_3138752210/Get-all-Container-Images-returns-OK-response-with-pagination_3961638493/recording.har

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,58 @@
107107
},
108108
"startedDateTime": "2023-10-11T11:13:14.501Z",
109109
"time": 1443
110+
},
111+
{
112+
"_id": "13fd9d6d7fd65d494fbc3e5ef46cc6af",
113+
"_order": 0,
114+
"cache": {},
115+
"request": {
116+
"bodySize": 0,
117+
"cookies": [],
118+
"headers": [
119+
{
120+
"_fromType": "array",
121+
"name": "accept",
122+
"value": "application/json"
123+
}
124+
],
125+
"headersSize": -1,
126+
"httpVersion": "HTTP/1.1",
127+
"method": "GET",
128+
"queryString": [
129+
{
130+
"name": "page[size]",
131+
"value": "2"
132+
},
133+
{
134+
"name": "page[cursor]",
135+
"value": "bmFtZTowMTM5MTA3MzM1MTIuZGtyLmVjci51cy1lYXN0LTEuYW1hem9uYXdzLmNvbS9hcmdvfGlkOjAxMzkxMDczMzUxMi5ka3IuZWNyLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tL2FyZ29Ac2hhMjU2OmZmMTUxZWYyNDZkN2I0ZDZiOGZlMzE5MjNiMjk4ZDg0ZThmMjA2MzI3MDFiYmI2ZWQ5N2ZjYzU4YTAxNTBmODA="
136+
}
137+
],
138+
"url": "https://api.datadoghq.com/api/v2/container_images?page%5Bsize%5D=2&page%5Bcursor%5D=bmFtZTowMTM5MTA3MzM1MTIuZGtyLmVjci51cy1lYXN0LTEuYW1hem9uYXdzLmNvbS9hcmdvfGlkOjAxMzkxMDczMzUxMi5ka3IuZWNyLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tL2FyZ29Ac2hhMjU2OmZmMTUxZWYyNDZkN2I0ZDZiOGZlMzE5MjNiMjk4ZDg0ZThmMjA2MzI3MDFiYmI2ZWQ5N2ZjYzU4YTAxNTBmODA%3D"
139+
},
140+
"response": {
141+
"bodySize": 11,
142+
"content": {
143+
"mimeType": "application/json",
144+
"size": 11,
145+
"text": "{\"data\":[]}"
146+
},
147+
"cookies": [],
148+
"headers": [
149+
{
150+
"name": "content-type",
151+
"value": "application/json"
152+
}
153+
],
154+
"headersSize": -1,
155+
"httpVersion": "HTTP/1.1",
156+
"redirectURL": "",
157+
"status": 200,
158+
"statusText": "OK"
159+
},
160+
"startedDateTime": "2022-04-13T09:30:17.000Z",
161+
"time": 0
110162
}
111163
],
112164
"pages": [],

cassettes/v2/Containers_24604017/Get-All-Containers-returns-OK-response-with-pagination_386015098/recording.har

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,58 @@
107107
},
108108
"startedDateTime": "2023-10-16T16:01:59.655Z",
109109
"time": 1127
110+
},
111+
{
112+
"_id": "f831b6fe7b0502df371dd39587b281eb",
113+
"_order": 0,
114+
"cache": {},
115+
"request": {
116+
"bodySize": 0,
117+
"cookies": [],
118+
"headers": [
119+
{
120+
"_fromType": "array",
121+
"name": "accept",
122+
"value": "application/json"
123+
}
124+
],
125+
"headersSize": -1,
126+
"httpVersion": "HTTP/1.1",
127+
"method": "GET",
128+
"queryString": [
129+
{
130+
"name": "page[size]",
131+
"value": "2"
132+
},
133+
{
134+
"name": "page[cursor]",
135+
"value": "c3RhcnRlZDoxNjk3MTE4NDExMDAwLjAwMDAwMHxpZC5yYXc6ODY4OWY2ODUtZTQ0MS00ODJjLTYwNDMtNWQ5ZA=="
136+
}
137+
],
138+
"url": "https://api.datadoghq.com/api/v2/containers?page%5Bsize%5D=2&page%5Bcursor%5D=c3RhcnRlZDoxNjk3MTE4NDExMDAwLjAwMDAwMHxpZC5yYXc6ODY4OWY2ODUtZTQ0MS00ODJjLTYwNDMtNWQ5ZA%3D%3D"
139+
},
140+
"response": {
141+
"bodySize": 11,
142+
"content": {
143+
"mimeType": "application/json",
144+
"size": 11,
145+
"text": "{\"data\":[]}"
146+
},
147+
"cookies": [],
148+
"headers": [
149+
{
150+
"name": "content-type",
151+
"value": "application/json"
152+
}
153+
],
154+
"headersSize": -1,
155+
"httpVersion": "HTTP/1.1",
156+
"redirectURL": "",
157+
"status": 200,
158+
"statusText": "OK"
159+
},
160+
"startedDateTime": "2022-04-13T09:30:17.000Z",
161+
"time": 0
110162
}
111163
],
112164
"pages": [],

cassettes/v2/Events_3416228/Get-a-list-of-events-returns-OK-response-with-pagination_1548928428/recording.har

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,66 @@
121121
},
122122
"startedDateTime": "2022-06-20T17:08:51.771Z",
123123
"time": 469
124+
},
125+
{
126+
"_id": "e1005bf4c1ece6fc6953baa50c3b1890",
127+
"_order": 0,
128+
"cache": {},
129+
"request": {
130+
"bodySize": 0,
131+
"cookies": [],
132+
"headers": [
133+
{
134+
"_fromType": "array",
135+
"name": "accept",
136+
"value": "application/json"
137+
}
138+
],
139+
"headersSize": -1,
140+
"httpVersion": "HTTP/1.1",
141+
"method": "GET",
142+
"queryString": [
143+
{
144+
"name": "filter[from]",
145+
"value": "now-15m"
146+
},
147+
{
148+
"name": "filter[to]",
149+
"value": "now"
150+
},
151+
{
152+
"name": "page[limit]",
153+
"value": "2"
154+
},
155+
{
156+
"name": "page[cursor]",
157+
"value": "eyJhZnRlciI6IkFnQUFBWUdDRlRXSTJoUnZQZ0FBQUFBQUFBQVlBQUFBQUVGWlIwTkdWRmRKUVVGRVVqbERWbEZ5ZEdoZlMxOXJRZ0FBQUNRQUFBQUFNREU0TVRneU1UVXRNelU0T0MwME1EZGhMV0V5TURndE1qUmxZekE5TmpVMVptTmkifQ"
158+
}
159+
],
160+
"url": "https://api.datadoghq.com/api/v2/events?filter%5Bfrom%5D=now-15m&filter%5Bto%5D=now&page%5Blimit%5D=2&page%5Bcursor%5D=eyJhZnRlciI6IkFnQUFBWUdDRlRXSTJoUnZQZ0FBQUFBQUFBQVlBQUFBQUVGWlIwTkdWRmRKUVVGRVVqbERWbEZ5ZEdoZlMxOXJRZ0FBQUNRQUFBQUFNREU0TVRneU1UVXRNelU0T0MwME1EZGhMV0V5TURndE1qUmxZekE1TmpVMVptTmkifQ"
161+
},
162+
"response": {
163+
"bodySize": 11,
164+
"content": {
165+
"mimeType": "application/json",
166+
"size": 11,
167+
"text": "{\"data\":[]}"
168+
},
169+
"cookies": [],
170+
"headers": [
171+
{
172+
"name": "content-type",
173+
"value": "application/json"
174+
}
175+
],
176+
"headersSize": -1,
177+
"httpVersion": "HTTP/1.1",
178+
"redirectURL": "",
179+
"status": 200,
180+
"statusText": "OK"
181+
},
182+
"startedDateTime": "2022-04-13T09:30:17.000Z",
183+
"time": 0
124184
}
125185
],
126186
"pages": [],

cassettes/v2/Events_3416228/Search-events-returns-OK-response-with-pagination_1698208896/recording.har

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,59 @@
112112
},
113113
"startedDateTime": "2022-06-20T17:08:54.078Z",
114114
"time": 476
115+
},
116+
{
117+
"_id": "8b63f338f236581f38095d0fd8e3dd17",
118+
"_order": 0,
119+
"cache": {},
120+
"request": {
121+
"bodySize": 301,
122+
"cookies": [],
123+
"headers": [
124+
{
125+
"_fromType": "array",
126+
"name": "accept",
127+
"value": "application/json"
128+
},
129+
{
130+
"_fromType": "array",
131+
"name": "content-type",
132+
"value": "application/json"
133+
}
134+
],
135+
"headersSize": -1,
136+
"httpVersion": "HTTP/1.1",
137+
"method": "POST",
138+
"postData": {
139+
"mimeType": "application/json",
140+
"params": [],
141+
"text": "{\"filter\":{\"from\":\"now-15m\",\"to\":\"now\"},\"options\":{\"timezone\":\"GMT\"},\"page\":{\"cursor\":\"eyJhZnRlciI6IkFnQUFBWUdDRlhBZ0lWRnZQZ0FBQUFBQUFBQVlBQUFBQUVGWlIwTkdXRUZuUVVGQmVGaEhkVTlPZUY5MU9FWmpTd0FBQUNRQUFBQUFNREU0TVRneU1UVXROekF5TUMwMFpXTTJMV0l3WVdJdFpEVTFZbU0zTlRZMlpUUTMifQ\",\"limit\":2},\"sort\":\"timestamp\"}"
142+
},
143+
"queryString": [],
144+
"url": "https://api.datadoghq.com/api/v2/events/search"
145+
},
146+
"response": {
147+
"bodySize": 11,
148+
"content": {
149+
"mimeType": "application/json",
150+
"size": 11,
151+
"text": "{\"data\":[]}"
152+
},
153+
"cookies": [],
154+
"headers": [
155+
{
156+
"name": "content-type",
157+
"value": "application/json"
158+
}
159+
],
160+
"headersSize": -1,
161+
"httpVersion": "HTTP/1.1",
162+
"redirectURL": "",
163+
"status": 200,
164+
"statusText": "OK"
165+
},
166+
"startedDateTime": "2022-04-13T09:30:17.000Z",
167+
"time": 0
115168
}
116169
],
117170
"pages": [],

0 commit comments

Comments
 (0)