caterva2.client.Client.get_roots#

Client.get_roots()#

Retrieves the list of available roots.

Returns:

Dictionary mapping available root names to their details: - name: the root name - http: the HTTP endpoint - subscribed: whether it is subscribed or not.

Return type:

dict

Examples

>>> import caterva2 as cat2
>>> client = cat2.Client('https://demo.caterva2.net')
>>> roots_dict = client.get_roots()
>>> sorted(roots_dict.keys())
['@public', 'b2tests', 'example', 'h5example', 'h5lung_j2k', 'h5numbers_j2k']
>>> client.subscribe('b2tests')
'Ok'
>>> roots_dict['b2tests']
{'name': 'b2tests', 'http': 'localhost:8014', 'subscribed': True}