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

Endpoint

  • GET /domoweb/bootstrap

Called by

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

Calls route

Called by

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_features async

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

Calls route

Called by

Source code in src/crew_dcs/routes/bootstrap.py
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
@gd.route_function
@log_call(
    level_name="route",
    config=LogDecoratorConfig(
        entity_extractor=DomoEntityExtractor(),
        result_processor=DomoEntityResultProcessor(),
    ),
)
async def get_bootstrap_features(
    auth: DomoFullAuth,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> rgd.ResponseGetData:
    res = await get_bootstrap(
        auth=auth,
        context=context,
    )

    if return_raw:
        return res

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

get_bootstrap_features_is_accountsv2_enabled async

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

Calls route

Called by

Source code in src/crew_dcs/routes/bootstrap.py
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
@gd.route_function
@log_call(
    level_name="route",
    config=LogDecoratorConfig(
        entity_extractor=DomoEntityExtractor(),
        result_processor=DomoEntityResultProcessor(),
    ),
)
async def get_bootstrap_features_is_accountsv2_enabled(
    auth: DomoAuth,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> rgd.ResponseGetData:
    res = await get_bootstrap_features(
        auth=auth,
        context=context,
        return_raw=False,
    )

    if return_raw:
        return res

    match_accounts_v2 = next(
        (
            domo_feature
            for domo_feature in res.response
            if domo_feature.get("name") == "accounts-v2"
        ),
        None,
    )

    res.response = bool(match_accounts_v2)
    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

Calls route

Called by

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