Skip to content

activity_log

activity_log

class based approach for interacting with the activity log

ActivityLog_ObjectType

Bases: Enum

enumerates valid object types to pass to activity log api

DomoActivityLog

get_activity_log async classmethod

get_activity_log(
    auth: DomoAuth,
    start_time: datetime,
    end_time: datetime,
    object_type: ActivityLog_ObjectType | None = None,
    maximum: int = 1000,
    session: AsyncClient | None = None,
    debug_api: bool = False,
    debug_loop: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs
)

queries the activity log

Source code in src/crew_dcs/classes/activity_log.py
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
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
137
138
139
140
141
142
@classmethod
async def get_activity_log(
    cls,
    auth: DomoAuth,
    start_time: dt.datetime,
    end_time: dt.datetime,
    object_type: ActivityLog_ObjectType | None = None,
    maximum: int = 1000,
    session: httpx.AsyncClient | None = None,
    debug_api: bool = False,
    debug_loop: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
):
    """queries the activity log"""

    start_time_epoch = convert.convert_datetime_to_epoch_millisecond(start_time)
    end_time_epoch = convert.convert_datetime_to_epoch_millisecond(end_time)

    base_context = RouteContext.build_context(
        session=session,
        debug_api=debug_api,
        debug_num_stacks_to_drop=2,
        parent_class=cls.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    res_activity_log = await activity_log_routes.search_activity_log(
        auth=auth,
        start_time=start_time_epoch,
        end_time=end_time_epoch,
        maximum=maximum,
        object_type=object_type.value,
        debug_loop=debug_loop,
        context=context,
    )

    if res_activity_log.is_success:
        return [
            cls._process_activity_log_row(row) for row in res_activity_log.response
        ]

    return None