Bootstrap Routes

Bootstrap Routes

Error Classes


source

Bootstrap_RetrievalError

 Bootstrap_RetrievalError (status, response, domo_instance, parent_class,
                           function_name)

base exception

Bootstrap_RetrievalError(
    status=400,
    response="fail",
    domo_instance="test",
    parent_class=123,
    function_name="foo",
)
__main__.Bootstrap_RetrievalError('🛑  Bootstrap_RetrievalError 🛑 - function: 123.foo || status 400 || fail at test')

Get Bootstrap

The base API requires DomoFullAuth flow to query and retrieve data


source

get_bootstrap

 get_bootstrap (auth:domolibrary.client.DomoAuth.DomoFullAuth,
                debug_api:bool=False, session:httpx.AsyncClient=None,
                parent_class=None, debug_num_stacks_to_drop=1)

get bootstrap data

Type Default Details
auth DomoFullAuth # only works with DomoFullAuth authentication, do not use TokenAuth
debug_api bool False
session AsyncClient None
parent_class NoneType None
debug_num_stacks_to_drop int 1
Returns ResponseGetData

sample implementation of get_boostrap

The bootstrap API requires dmda.DomoFUllAuth. Passing Token Auth will throw an error

# eval: false

# import domolibrary.client.DomoAuth as dmda

auth = dmda.DomoTokenAuth(
    domo_instance=os.environ['DOMO_INSTANCE'],
    domo_access_token=os.environ["DOMO_ACCESS_TOKEN"],
)

try:
    await get_bootstrap(auth=auth, debug_api=False)

except InvalidAuthTypeError as e:
    print(e)
🛑  InvalidAuthTypeError 🛑 - function: get_bootstrap || This API rquires DomoFullAuth at domo-community
full_auth = dmda.DomoFullAuth(
    domo_instance=os.environ['DOMO_INSTANCE'],
    domo_password=os.environ["DOMO_PASSWORD"],
    domo_username=os.environ["DOMO_USERNAME"],
)

res = await get_bootstrap(auth=full_auth, debug_api=False)
res.response.keys()
dict_keys(['notifierConfig', 'currentUser', 'data'])

Get Customer


source

get_bootstrap_customerid

 get_bootstrap_customerid (auth:domolibrary.client.DomoAuth.DomoFullAuth,
                           session:httpx.AsyncClient=None,
                           debug_api:bool=False, return_raw:bool=False,
                           debug_num_stacks_to_drop=2,
                           parent_class:str=None)

retrieves the domo_instance customer id

Type Default Details
auth DomoFullAuth this function requires the DomoFullAuth object to authenticate the bootstrap
session AsyncClient None optional parameter to improve same instance query performance
debug_api bool False pass True to see the parameters sent to the Domo API
return_raw bool False pass True to return the raw API response
debug_num_stacks_to_drop int 2 number frames to drop off the stacktrace. retrieved from res.traceback_details
parent_class str None Optional parent class that calls the route function
Returns ResponseGetData

sample implementation of get_customer_id

full_auth = dmda.DomoFullAuth(
    domo_instance=os.environ['DOMO_INSTANCE'],
    domo_password=os.environ["DOMO_PASSWORD"],
    domo_username=os.environ["DOMO_USERNAME"],
)

await get_bootstrap_customerid(auth=full_auth, debug_api=False, return_raw=False)
ResponseGetData(status=200, response='mmmm-0012-0200', is_success=True, parent_class=None)

Get Bootstrap Features


source

get_bootstrap_features

 get_bootstrap_features (auth:domolibrary.client.DomoAuth.DomoFullAuth,
                         session:httpx.AsyncClient=None,
                         debug_api:bool=False, return_raw:bool=False,
                         debug_num_stacks_to_drop=2, parent_class=None)

sample implementation of get_bootstrap_features

# import pandas as pd

full_auth = dmda.DomoFullAuth(
    domo_instance=os.environ['DOMO_INSTANCE'],
    domo_password=os.environ["DOMO_PASSWORD"],
    domo_username=os.environ["DOMO_USERNAME"],
)

res = await get_bootstrap_features(auth=full_auth, debug_api=False, return_raw=False)

pd.DataFrame(res.response[0:5])
id name label description enabled purchased type environment owner
0 4 search True False STANDARD
1 5 launcher True True PREMIUM
2 9 profile-reminder True False STANDARD
3 17 enableSwapDatasource True False STANDARD
4 19 up True True STANDARD

Get Is_Account_V2


source

get_bootstrap_features_is_accountsv2_enabled

 get_bootstrap_features_is_accountsv2_enabled
                                               (auth:domolibrary.client.Do
                                               moAuth.DomoAuth, session:ht
                                               tpx.AsyncClient=None,
                                               debug_api:bool=False,
                                               return_raw:bool=False,
                                               debug_num_stacks_to_drop=2,
                                               parent_class=None)

sample implementation of get_bootstrap_features_is_accountsv2_enabled

full_auth = dmda.DomoFullAuth(
    domo_instance=os.environ['DOMO_INSTANCE'],
    domo_password=os.environ["DOMO_PASSWORD"],
    domo_username=os.environ["DOMO_USERNAME"],
)

await get_bootstrap_features_is_accountsv2_enabled(
    auth=full_auth, debug_api=False, return_raw=False
)
ResponseGetData(status=200, response=False, is_success=True, parent_class=None)

Get Bootstrap Pages


source

get_bootstrap_pages

 get_bootstrap_pages (auth:domolibrary.client.DomoAuth.DomoFullAuth,
                      session:httpx.AsyncClient=None,
                      debug_api:bool=False, return_raw:bool=False,
                      debug_num_stacks_to_drop=2, parent_class=None)

this API will return the downstream (children) hierarchy of a page

sample get bootstrap pages

# import pandas as pd
full_auth = dmda.DomoFullAuth(
    domo_instance=os.environ['DOMO_INSTANCE'],
    domo_password=os.environ["DOMO_PASSWORD"],
    domo_username=os.environ["DOMO_USERNAME"],
)

res = await get_bootstrap_pages(auth=full_auth, debug_api=False, return_raw=False) # requires full_auth

pd.DataFrame(res.response)[0:5]
id title locked sharedView pageVisible virtualPage isValidBadgePage canAddCard bibHiddenPage hasAccess hierarchy separator type pageLocation owner owners isOwner childCount children
0 -100000 Overview False False True True True True False True 0 NaN NaN NaN NaN NaN NaN NaN NaN
1 -100003 Favorites False False True True NaN False False True 0 NaN NaN NaN NaN NaN NaN NaN NaN
2 -100002 Shared False False True True NaN False False True 0 True NaN NaN NaN NaN NaN NaN NaN
3 30507758 Welcome True True True NaN NaN True False True 0 NaN page 0.0 587894148.0 [{'id': 587894148, 'type': 'USER', 'displayNam... True 0.0 NaN
4 1267639476 Community Solutions True True True NaN NaN True False True 0 NaN page 1.0 587894148.0 [{'id': 587894148, 'type': 'USER', 'displayNam... False 3.0 [{'id': '1759878295', 'title': 'Beast Modes', ...