@@ -140,6 +140,10 @@ async def accept_request(self, connection_id: str, my_endpoint: str = None):
140
140
# TODO create proper error classes
141
141
raise Exception ("The connection is not in the request state" )
142
142
143
+ async def get_remote_endpoints (self , connection_id : str ):
144
+ response = await self .admin_GET (f"/connections/{ connection_id } /endpoints" )
145
+ return response
146
+
143
147
async def establish_inbound (self , connection_id : str , router_conn_id : str ):
144
148
response = await self .admin_POST (
145
149
f"/connections/{ connection_id } /establish-inbound/{ router_conn_id } "
@@ -211,3 +215,22 @@ async def is_active(self, connection_id):
211
215
logger .error (f"Connection { connection_id } not active" )
212
216
raise Exception ("Connection must be active to send a credential" )
213
217
return
218
+
219
+ async def get_connection_metadata (self , connection_id : str , key : str = None ):
220
+ if key :
221
+ response = await self .admin_GET (
222
+ f"/connections/{ connection_id } /metadata?key={ key } "
223
+ )
224
+ else :
225
+ response = await self .admin_GET (f"/connections/{ connection_id } /metadata" )
226
+ return response
227
+
228
+ async def set_connection_metadata (self , connection_id : str , metadata : dict = None ):
229
+ if metadata :
230
+ metadata = {"metadata" : metadata }
231
+ response = await self .admin_POST (
232
+ f"/connections/{ connection_id } /metadata" , data = metadata
233
+ )
234
+ else :
235
+ response = await self .admin_POST (f"/connections/{ connection_id } /metadata" )
236
+ return response
0 commit comments