@@ -755,14 +755,18 @@ def processes():
755
755
def processes_from_namespace (namespace ):
756
756
# TODO: this endpoint is in draft at the moment
757
757
# see https://github.com/Open-EO/openeo-api/issues/310, https://github.com/Open-EO/openeo-api/pull/348
758
- # TODO: convention for user namespace? use '@' instead of "u:"
759
758
# TODO: unify with `/processes` endpoint?
759
+ # TODO #377 pagination?
760
+ _log .warning (f"Usage of non-standard endpoint `/processes/{ namespace } `" )
760
761
full = smart_bool (request .args .get ("full" , False ))
761
762
target_version = None
763
+ # TODO: convention for user namespace? use '@' instead of "u:"
762
764
if namespace .startswith ("u:" ) and backend_implementation .user_defined_processes :
763
765
user_id = namespace .partition ("u:" )[- 1 ]
764
- user_udps = [p for p in backend_implementation .user_defined_processes .get_for_user (user_id ) if p .public ]
765
- processes = [udp .to_api_dict (full = full , user = User (user_id = user_id )) for udp in user_udps ]
766
+ udp_listing = backend_implementation .user_defined_processes .list_for_user (user_id , public_only = True )
767
+ response = udp_listing .to_response_dict (
768
+ full = full , target_version = target_version , user = User (user_id = user_id )
769
+ )
766
770
elif ":" not in namespace :
767
771
process_registry = backend_implementation .processing .get_process_registry (
768
772
api_version = requested_api_version ()
@@ -777,7 +781,6 @@ def processes_from_namespace(namespace):
777
781
]
778
782
else :
779
783
raise OpenEOApiException ("Could not handle namespace {n!r}" .format (n = namespace ))
780
- # TODO: pagination links?
781
784
return jsonify (
782
785
{
783
786
"version" : target_version ,
@@ -1766,7 +1769,7 @@ def udp_get(process_graph_id: str, user: User):
1766
1769
def udp_list_for_user (user : User ):
1767
1770
pagination = PaginationRequest .from_request (request = flask .request )
1768
1771
udps = backend_implementation .user_defined_processes .list_for_user (user_id = user .user_id , pagination = pagination )
1769
- return jsonify (udps .to_response_dict ())
1772
+ return jsonify (udps .to_response_dict (full = False , user = user ))
1770
1773
1771
1774
@api_endpoint
1772
1775
@blueprint .route ('/process_graphs/<process_graph_id>' , methods = ['DELETE' ])
0 commit comments