You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Internal] Update Jobs GetRun API to support paginated responses for jobs and ForEach tasks (#819)
## What changes are proposed in this pull request?
Introduces extension for jobs get_run call that paginates tasks and
iterations arrays in the response and returns aggregated response to the
caller. This change is necessary to prepare for jobs API 2.2 release
that serves paginated response. Pagination is over once the
next_page_token is absent from the response. The pagination logic is not
exposed to the customer.
## How is this tested?
Unit tests and manual test
This method fetches the details of a run identified by `run_id`. If the run has multiple pages of tasks or iterations,
16
+
it will paginate through all pages and aggregate the results.
17
+
:param run_id: int
18
+
The canonical identifier of the run for which to retrieve the metadata. This field is required.
19
+
:param include_history: bool (optional)
20
+
Whether to include the repair history in the response.
21
+
:param include_resolved_values: bool (optional)
22
+
Whether to include resolved parameter values in the response.
23
+
:param page_token: str (optional)
24
+
To list the next page or the previous page of job tasks, set this field to the value of the
25
+
`next_page_token` or `prev_page_token` returned in the GetJob response.
26
+
:returns: :class:`Run`
27
+
"""
28
+
run=super().get_run(run_id,
29
+
include_history=include_history,
30
+
include_resolved_values=include_resolved_values,
31
+
page_token=page_token)
32
+
33
+
# When querying a Job run, a page token is returned when there are more than 100 tasks. No iterations are defined for a Job run. Therefore, the next page in the response only includes the next page of tasks.
34
+
# When querying a ForEach task run, a page token is returned when there are more than 100 iterations. Only a single task is returned, corresponding to the ForEach task itself. Therefore, the client only reads the iterations from the next page and not the tasks.
0 commit comments