Skip to content

Job_RemoteDomoStats

Job_RemoteDomoStats

DomoJob_RemoteDomoStats dataclass

DomoJob_RemoteDomoStats(
    auth: DomoAuth,
    id: str = None,
    raw: dict = dict(),
    name: str = None,
    application_id: str = None,
    logs_dataset_id: str = None,
    user_id: str = None,
    execution_timeout: int = 1440,
    is_enabled: bool = False,
    customer_id: str = None,
    created_dt: datetime = None,
    updated_dt: datetime = None,
    description: str = None,
    execution_payload: dict = dict(),
    share_state: dict = dict(),
    accounts: list[str] = list(),
    triggers: list[DomoTrigger] = list(),
    remote_instance: str = None,
    subscriber_job_id: str = None,
    Config: RemoteDomoStats_Config = None,
)

Bases: DomoJob_Base

create async classmethod

create(
    auth: DomoAuth,
    name: str,
    config: RemoteDomoStats_Config,
    application_id: str,
    logs_dataset_id: str,
    description: str = f"created via domolibrary f{today()}",
    remote_instance: str | None = None,
    accounts: list[int] | None = None,
    triggers: list[DomoTrigger_Schedule] | None = None,
    execution_timeout: int = 1440,
    return_raw: bool = False,
    debug_api: bool = False,
    debug_num_stacks_to_drop=2,
    session: AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
)

Calls route

Source code in src/crew_dcs/classes/DomoApplication/Job_RemoteDomoStats.py
133
134
135
136
137
138
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
@classmethod
async def create(
    cls,
    auth: DomoAuth,
    name: str,
    config: RemoteDomoStats_Config,
    application_id: str,
    logs_dataset_id: str,
    description: str = f"created via domolibrary f{dt.date.today()}",
    remote_instance: str | None = None,
    accounts: list[int] | None = None,
    triggers: list[DomoTrigger_Schedule] | None = None,
    execution_timeout: int = 1440,
    return_raw: bool = False,
    debug_api: bool = False,
    debug_num_stacks_to_drop=2,
    session: httpx.AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
):
    triggers_ls = []
    if triggers is not None and len(triggers) > 0:
        triggers_ls = [
            DomoTrigger(id=None, job_id=None, schedule=schedule)
            for schedule in triggers
        ]

    domo_job = cls(
        application_id=application_id,
        auth=auth,
        name=name,
        logs_dataset_id=logs_dataset_id,
        accounts=accounts,
        description=description,
        remote_instance=remote_instance,
        Config=config,
        triggers=triggers_ls,
        execution_timeout=execution_timeout,
    )

    body = domo_job.to_dict()

    context = RouteContext.build_context(
        context=context,
        session=session,
        debug_api=debug_api,
        debug_num_stacks_to_drop=debug_num_stacks_to_drop,
        **context_kwargs,
    )

    res = await application_routes.create_application_job(
        auth=auth,
        application_id=application_id,
        body=body,
        context=context,
    )

    if return_raw:
        return res

    return cls.from_dict(res.response, auth=auth)