Skip to content

grant

grant

Grant_GET_Error

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

Bases: RouteError

Raised when grant retrieval operations fail.

Source code in src/crew_dcs/routes/grant.py
25
26
27
28
29
30
31
32
33
34
35
def __init__(
    self,
    message: str | None = None,
    res: Any | None = None,
    **kwargs: Any,
):
    super().__init__(
        message=message or "Grant retrieval failed",
        res=res,
        **kwargs,
    )

get_grants async

get_grants(
    auth: DomoAuth,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> ResponseGetData

Endpoint

  • GET /authorization/v1/authorities

Called by

Source code in src/crew_dcs/routes/grant.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
@gd.route_function
@log_call(
    level_name="route",
    config=LogDecoratorConfig(
        entity_extractor=DomoEntityExtractor(),
        result_processor=DomoEntityResultProcessor(),
    ),
)
async def get_grants(
    auth: DomoAuth,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> rgd.ResponseGetData:
    url = f"https://{auth.domo_instance}.domo.com/api/authorization/v1/authorities"

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

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

    if len(res.response) == 0:
        raise Grant_GET_Error(
            message=f"{len(res.response)} grants returned",
            res=res,
        )

    return cast(rgd.ResponseGetData, res)

See also

Domo Knowledge Base categories

  • Administer Domo (users, groups, roles, grants, instance settings, activity log)