@@ -142,6 +142,10 @@ def __init__(self, name: str, loginInfo: OpalClient.LoginInfo, profile: str = "d
142142 self .rsession = None
143143 self .rsession_started = False
144144
145+ def get_name (self ):
146+ """Get the name of the connection."""
147+ return self .name
148+
145149 def check_user (self ) -> bool :
146150 """Check if the user can authenticate by trying to retrieve the current subject profile."""
147151 try :
@@ -169,6 +173,30 @@ def has_table(self, name: str) -> bool:
169173 response = self ._get (UriBuilder (["datasource" , parts [0 ], "table" , parts [1 ]]).build ()).send ()
170174 return response .code == 200
171175
176+ def list_table_variables (self , table ) -> list :
177+ tokens = table .split ("." )
178+ project_name = tokens [0 ]
179+ table_name = tokens [1 ]
180+ return (
181+ self
182+ ._get (UriBuilder (["datasource" , project_name , "table" , table_name , "variables" ]).build ())
183+ .fail_on_error ()
184+ .send ()
185+ .from_json ()
186+ )
187+
188+ def list_taxonomies (self ) -> list :
189+ return self ._get (UriBuilder (["system" , "conf" , "taxonomies" ]).build ()).fail_on_error ().send ().from_json ()
190+
191+ def search_variables (self , query ) -> list :
192+ return (
193+ self
194+ ._get (UriBuilder (["datasources" , "variables" , "_search" ]).query ("query" , query ).build ())
195+ .fail_on_error ()
196+ .send ()
197+ .from_json ()
198+ )
199+
172200 def list_resources (self ) -> list :
173201 response = self ._get ("/projects" ).fail_on_error ().send ()
174202 projects = response .from_json ()
0 commit comments