@@ -734,7 +734,7 @@ def list_collections(self) -> CollectionListingResponse:
734734 # TODO: add caching #383, but reset cache on auth change #254
735735 # TODO #677 add pagination support?
736736 data = self .get ("/collections" , expected_status = 200 ).json ()
737- return CollectionListingResponse (response_data = data )
737+ return CollectionListingResponse (response_data = data , connection = self )
738738
739739 def list_collection_ids (self ) -> List [str ]:
740740 """
@@ -776,7 +776,11 @@ def list_file_formats(self) -> dict:
776776 key = "file_formats" ,
777777 load = lambda : self .get ('/file_formats' , expected_status = 200 ).json ()
778778 )
779- return VisualDict ("file-formats" , data = formats )
779+ federation = self .capabilities ().ext_federation_backend_details ()
780+ return VisualDict ("file-formats" , data = formats , parameters = {
781+ 'missing' : formats .get ("federation:missing" , None ),
782+ 'federation' : federation
783+ })
780784
781785 def list_service_types (self ) -> dict :
782786 """
@@ -800,7 +804,8 @@ def list_udf_runtimes(self) -> dict:
800804 key = "udf_runtimes" ,
801805 load = lambda : self .get ('/udf_runtimes' , expected_status = 200 ).json ()
802806 )
803- return VisualDict ("udf-runtimes" , data = runtimes )
807+ federation = self .capabilities ().ext_federation_backend_details ()
808+ return VisualDict ("udf-runtimes" , data = runtimes , parameters = {'federation' : federation })
804809
805810 def list_services (self ) -> dict :
806811 """
@@ -810,7 +815,12 @@ def list_services(self) -> dict:
810815 """
811816 # TODO return parsed service objects
812817 services = self .get ('/services' , expected_status = 200 ).json ()["services" ]
813- return VisualList ("data-table" , data = services , parameters = {'columns' : 'services' })
818+ federation = self .capabilities ().ext_federation_backend_details ()
819+ return VisualList ("data-table" , data = services , parameters = {
820+ 'columns' : 'services' ,
821+ 'missing' : services .get ("federation:missing" , None ),
822+ 'federation' : federation
823+ })
814824
815825 def describe_collection (self , collection_id : str ) -> dict :
816826 """
@@ -827,7 +837,8 @@ def describe_collection(self, collection_id: str) -> dict:
827837 # TODO: duplication with `Connection.collection_metadata`: deprecate one or the other?
828838 # TODO: add caching #383
829839 data = self .get (f"/collections/{ collection_id } " , expected_status = 200 ).json ()
830- return VisualDict ("collection" , data = data )
840+ federation = self .capabilities ().ext_federation_backend_details ()
841+ return VisualDict ("collection" , data = data , parameters = {'federation' : federation })
831842
832843 def collection_items (
833844 self ,
@@ -865,11 +876,12 @@ def collection_items(
865876 if limit is not None and limit > 0 :
866877 params ['limit' ] = limit
867878
868- return paginate (self , url , params , lambda response , page : VisualDict ("items" , data = response , parameters = {'show-map' : True , 'heading' : 'Page {} - Items' .format (page )}))
879+ federation = self .capabilities ().ext_federation_backend_details ()
880+ return paginate (self , url , params , lambda response , page : VisualDict ("items" , data = response , parameters = {'show-map' : True , 'heading' : 'Page {} - Items' .format (page ), 'federation' : federation }))
869881
870882 def collection_metadata (self , name ) -> CollectionMetadata :
871883 # TODO: duplication with `Connection.describe_collection`: deprecate one or the other?
872- return CollectionMetadata (metadata = self .describe_collection (name ))
884+ return CollectionMetadata (metadata = self .describe_collection (name ), connection = self )
873885
874886 def list_processes (self , namespace : Optional [str ] = None ) -> ProcessListingResponse :
875887 """
@@ -891,7 +903,7 @@ def list_processes(self, namespace: Optional[str] = None) -> ProcessListingRespo
891903 )
892904 else :
893905 response = self .get ("/processes/" + namespace , expected_status = 200 ).json ()
894- return ProcessListingResponse (response_data = response )
906+ return ProcessListingResponse (response_data = response , connection = self )
895907
896908 def describe_process (self , id : str , namespace : Optional [str ] = None ) -> dict :
897909 """
@@ -904,9 +916,14 @@ def describe_process(self, id: str, namespace: Optional[str] = None) -> dict:
904916 """
905917
906918 processes = self .list_processes (namespace )
919+ federation = self .capabilities ().ext_federation_backend_details ()
907920 for process in processes :
908921 if process ["id" ] == id :
909- return VisualDict ("process" , data = process , parameters = {'show-graph' : True , 'provide-download' : False })
922+ return VisualDict ("process" , data = process , parameters = {
923+ 'show-graph' : True ,
924+ 'provide-download' : False ,
925+ 'federation' : federation
926+ })
910927
911928 raise OpenEoClientException ("Process does not exist." )
912929
@@ -933,7 +950,7 @@ def list_jobs(self, limit: Union[int, None] = 100) -> JobListingResponse:
933950 # TODO: Parse the result so that Job classes returned?
934951 # TODO: when pagination is enabled: how to expose link to next page?
935952 resp = self .get ("/jobs" , params = {"limit" : limit }, expected_status = 200 ).json ()
936- return JobListingResponse (response_data = resp )
953+ return JobListingResponse (response_data = resp , connection = self )
937954
938955 def assert_user_defined_process_support (self ):
939956 """
@@ -996,7 +1013,7 @@ def list_user_defined_processes(self) -> ProcessListingResponse:
9961013 # TODO #677 add pagination support?
9971014 self .assert_user_defined_process_support ()
9981015 data = self .get ("/process_graphs" , expected_status = 200 ).json ()
999- return ProcessListingResponse (response_data = data )
1016+ return ProcessListingResponse (response_data = data , connection = self )
10001017
10011018 def user_defined_process (self , user_defined_process_id : str ) -> RESTUserDefinedProcess :
10021019 """
@@ -1496,9 +1513,14 @@ def list_files(self) -> List[UserFile]:
14961513
14971514 :return: List of the user-uploaded files.
14981515 """
1499- files = self .get ('/files' , expected_status = 200 ).json ()['files' ]
1500- files = [UserFile .from_metadata (metadata = f , connection = self ) for f in files ]
1501- return VisualList ("data-table" , data = files , parameters = {'columns' : 'files' })
1516+ data = self .get ('/files' , expected_status = 200 ).json ()
1517+ files = [UserFile .from_metadata (metadata = f , connection = self ) for f in data .get ('files' , [])]
1518+ federation = self .capabilities ().ext_federation_backend_details ()
1519+ return VisualList ("data-table" , data = files , parameters = {
1520+ 'columns' : 'files' ,
1521+ 'missing' : data .get ('federation:missing' , None ),
1522+ 'federation' : federation ,
1523+ })
15021524
15031525 def get_file (
15041526 self , path : Union [str , PurePosixPath ], metadata : Optional [dict ] = None
0 commit comments