|
62 | 62 | from openeo_driver.users.auth import HttpAuthHandler |
63 | 63 | from openeo_driver.util.geometry import BoundingBox, reproject_geometry |
64 | 64 | from openeo_driver.util.logging import FlaskRequestCorrelationIdLogging, ExtraLoggingFilter |
| 65 | +from openeo_driver.util.pagination import PaginationRequest |
65 | 66 | from openeo_driver.utils import EvalEnv, smart_bool, generate_unique_id, filter_supported_kwargs |
66 | 67 |
|
67 | 68 | _log = logging.getLogger(__name__) |
@@ -937,7 +938,8 @@ def list_jobs(user: User): |
937 | 938 | # TODO: openEO API currently prescribes no pagination by default (unset limit) |
938 | 939 | # This is however not very scalable, so we might want to set a default limit here. |
939 | 940 | # Also see https://github.com/Open-EO/openeo-api/issues/550 |
940 | | - limit = flask.request.args.get("limit", type=int) |
| 941 | + # TODO #377 migrate this to `PaginationRequest` |
| 942 | + limit = flask.request.args.get("limit", default=None, type=int) |
941 | 943 | request_parameters = flask.request.args |
942 | 944 |
|
943 | 945 | # TODO #332 settle on receiving just `JobListing` here and eliminate other options/code paths. |
@@ -1762,8 +1764,8 @@ def udp_get(process_graph_id: str, user: User): |
1762 | 1764 | @blueprint.route('/process_graphs', methods=['GET']) |
1763 | 1765 | @auth_handler.requires_bearer_auth |
1764 | 1766 | def udp_list_for_user(user: User): |
1765 | | - # TODO #377 pagination support |
1766 | | - udps = backend_implementation.user_defined_processes.list_for_user(user_id=user.user_id) |
| 1767 | + pagination = PaginationRequest.from_request(request=flask.request) |
| 1768 | + udps = backend_implementation.user_defined_processes.list_for_user(user_id=user.user_id, pagination=pagination) |
1767 | 1769 | return jsonify(udps.to_response_dict()) |
1768 | 1770 |
|
1769 | 1771 | @api_endpoint |
|
0 commit comments