@@ -227,6 +227,8 @@ def __init__(
227227 # Store the backend type and version
228228 self ._backend_type = response .get ("backend" )
229229 self ._backend_version = response .get ("version" )
230+ self ._backend_api_server_build_info = response .get ("api_server_build_info" )
231+ self ._backend_product_build_info = response .get ("product_build_info" )
230232
231233 # Register the close method to be called at exit - irrespectively of
232234 # the user calling it or not...
@@ -303,6 +305,21 @@ def healthy(self) -> bool:
303305 except Exception : # pragma: no cover
304306 return False
305307
308+ def backend_info (self , indent = 0 ) -> str :
309+ """Get a string with the backend information.
310+
311+ Returns
312+ -------
313+ str
314+ String with the backend information.
315+ """
316+ return (
317+ f"{ ' ' * indent } Version: { self .backend_version } \n "
318+ f"{ ' ' * indent } Backend type: { self .backend_type .name } \n "
319+ f"{ ' ' * indent } Backend number: { self ._backend_product_build_info } \n "
320+ f"{ ' ' * indent } API server number: { self ._backend_api_server_build_info } "
321+ )
322+
306323 def __repr__ (self ) -> str :
307324 """Represent the client as a string."""
308325 lines = []
@@ -314,6 +331,8 @@ def __repr__(self) -> str:
314331 lines .append (" Connection: Healthy" )
315332 else :
316333 lines .append (" Connection: Unhealthy" ) # pragma: no cover
334+ lines .append (" Backend info:" )
335+ lines .append (self .backend_info (indent = 4 ))
317336 return "\n " .join (lines )
318337
319338 def close (self ):
0 commit comments