Skip to content

bootstrap

bootstrap

Bootstrap_GET_Error

Bootstrap_GET_Error(
    message: str | None = None, res=None, **kwargs
)

Bases: RouteError

Raised when bootstrap retrieval operations fail.

Source code in src/crew_dcs/routes/bootstrap.py
30
31
32
33
34
35
def __init__(self, message: str | None = None, res=None, **kwargs):
    super().__init__(
        message=message or "Bootstrap retrieval failed",
        res=res,
        **kwargs,
    )

get_bootstrap async

get_bootstrap(
    auth: DomoFullAuth,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> ResponseGetData

get bootstrap data

Source code in src/crew_dcs/routes/bootstrap.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
@gd.route_function
@log_call(
    level_name="route",
    config=LogDecoratorConfig(
        entity_extractor=DomoEntityExtractor(),
        result_processor=DomoEntityResultProcessor(),
    ),
)
async def get_bootstrap(
    auth: DomoFullAuth,  ## only works with DomoFullAuth authentication, do not use TokenAuth
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> rgd.ResponseGetData:
    """get bootstrap data"""

    test_is_full_auth(auth, debug_num_stacks_to_drop=2)

    # url = f"https://{auth.domo_instance}.domo.com/api/domoweb/bootstrap?v2Navigation=false"
    url = (
        f"https://{auth.domo_instance}.domo.com/api/domoweb/bootstrap?v2Navigation=true"
    )

    res = await gd.get_data(
        url=url,
        method="GET",
        auth=auth,
        is_follow_redirects=True,
        context=context,
    )

    if not res.is_success:
        raise Bootstrap_GET_Error(res=res)

    if res.response == "":
        raise Bootstrap_GET_Error(
            message="BSR_Features:  no features returned - is there a VPN?",
            res=res,
        )

    return res

get_bootstrap_customerid async

get_bootstrap_customerid(
    auth: DomoFullAuth,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> ResponseGetData

retrieves the domo_instance customer id

Source code in src/crew_dcs/routes/bootstrap.py
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@gd.route_function
@log_call(
    level_name="route",
    config=LogDecoratorConfig(
        entity_extractor=DomoEntityExtractor(),
        result_processor=DomoEntityResultProcessor(),
    ),
)
async def get_bootstrap_customerid(
    auth: DomoFullAuth,  # this function requires the DomoFullAuth object to authenticate the bootstrap
    return_raw: bool = False,  # pass True to return the raw API response
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> (
    rgd.ResponseGetData
):  # the response contains the string representation of the customer_id
    """retrieves the domo_instance customer id"""

    res = await get_bootstrap(
        auth=auth,
        context=context,
    )

    if return_raw:
        return res

    res.response = res.response.get("currentUser").get("USER_GROUP")
    return res

get_bootstrap_pages async

get_bootstrap_pages(
    auth: DomoFullAuth,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> ResponseGetData

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

Source code in src/crew_dcs/routes/bootstrap.py
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
@gd.route_function
@log_call(
    level_name="route",
    config=LogDecoratorConfig(
        entity_extractor=DomoEntityExtractor(),
        result_processor=DomoEntityResultProcessor(),
    ),
)
async def get_bootstrap_pages(
    auth: DomoFullAuth,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> rgd.ResponseGetData:
    """this API will return the downstream (children) hierarchy of a page"""

    res = await get_bootstrap(
        auth=auth,
        context=context,
    )

    if return_raw:
        return res

    res.response = res.response.get("data").get("pages")
    return res