DomoApplication
DomoApplication ¶
DomoApplication package - Classes for Domo Applications and Jobs.
Application_CRUD_Error ¶
Application_CRUD_Error(
operation: str,
entity_id: str | None = None,
res: ResponseGetData | None = None,
message: str | None = None,
**kwargs
)
Bases: RouteError
Raised when application create, update, or delete operations fail.
This exception is used for failures during application job creation, modification, or execution operations.
Source code in src/crew_dcs/routes/application.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | |
Application_GET_Error ¶
Application_GET_Error(
entity_id: str | None = None,
res: ResponseGetData | None = None,
message: str | None = None,
**kwargs
)
Bases: RouteError
Raised when application retrieval operations fail.
This exception is used for failures during GET operations on applications, including API errors and unexpected response formats.
Source code in src/crew_dcs/routes/application.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
DomoJob
dataclass
¶
DomoJob(
auth: DomoAuth,
id: str,
raw: dict = dict(),
application_id: str = None,
name: str = None,
user_id: str = None,
logs_dataset_id: str = None,
execution_timeout: int = 1440,
is_enabled: bool = False,
customer_id: str = None,
created_dt: datetime | None = None,
updated_dt: datetime | None = None,
description: str = None,
execution_payload: dict = dict(),
share_state: dict = dict(),
accounts: list[str] = list(),
triggers: list[DomoTrigger] = list(),
)
Bases: DomoEntity
A class for interacting with Domo Application Jobs.
This class represents a job within a Domo application, providing methods for retrieving, creating, updating, and executing jobs.
Attributes:
| Name | Type | Description |
|---|---|---|
auth |
DomoAuth
|
Authentication object for API requests |
id |
str
|
Unique identifier for the job (job_id) |
application_id |
str
|
ID of the parent application |
name |
str
|
Name of the job |
raw |
dict
|
Raw API response data |
user_id |
str
|
ID of the user who created the job |
logs_dataset_id |
str
|
Dataset ID where job logs are stored |
execution_timeout |
int
|
Timeout in minutes for job execution |
is_enabled |
bool
|
Whether the job is enabled (has triggers) |
customer_id |
str
|
Customer ID |
created_dt |
datetime | None
|
Job creation datetime |
updated_dt |
datetime | None
|
Job last update datetime |
description |
str
|
Job description |
execution_payload |
dict
|
Job execution configuration |
share_state |
dict
|
Job sharing state |
accounts |
list[str]
|
list of account IDs associated with the job |
triggers |
list[DomoTrigger]
|
list of job triggers |
display_url
property
¶
display_url: str
Generate the URL to display this job in the Domo interface.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
URL to view the job in Domo |
create
async
classmethod
¶
create(
auth: DomoAuth,
application_id: str,
job_name: str,
execution_payload: dict,
job_description: str | None = None,
execution_timeout: int = 1440,
accounts: list[str] | None = None,
triggers: list[dict] | None = None,
return_raw: bool = False,
debug_api: bool = False,
session: AsyncClient | None = None,
debug_num_stacks_to_drop: int = 2,
*,
context: RouteContext | None = None,
**context_kwargs
)
Create a new job in the application.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
application_id
|
str
|
ID of the parent application |
required |
job_name
|
str
|
Name for the new job |
required |
execution_payload
|
dict
|
Job execution configuration |
required |
job_description
|
str | None
|
Optional job description |
None
|
execution_timeout
|
int
|
Timeout in minutes (default 1440) |
1440
|
accounts
|
list[str] | None
|
list of account IDs |
None
|
triggers
|
list[dict] | None
|
list of job triggers |
None
|
return_raw
|
bool
|
Return raw ResponseGetData instead of DomoJob |
False
|
debug_api
|
bool
|
Enable API debugging |
False
|
session
|
AsyncClient | None
|
Optional httpx session for request pooling |
None
|
debug_num_stacks_to_drop
|
int
|
Number of stack frames to drop in debug output |
2
|
Returns:
| Type | Description |
|---|---|
|
DomoJob or ResponseGetData: Created job object or raw response |
Raises:
| Type | Description |
|---|---|
CRUD_ApplicationJob_Error
|
If creation fails |
Source code in src/crew_dcs/classes/DomoApplication/Job.py
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 | |
execute
async
¶
execute(
return_raw: bool = False,
debug_api: bool = False,
session: AsyncClient | None = None,
debug_num_stacks_to_drop: int = 2,
*,
context: RouteContext | None = None,
**context_kwargs
)
Execute this job.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
return_raw
|
bool
|
Return raw ResponseGetData |
False
|
debug_api
|
bool
|
Enable API debugging |
False
|
session
|
AsyncClient | None
|
Optional httpx session for request pooling |
None
|
debug_num_stacks_to_drop
|
int
|
Number of stack frames to drop in debug output |
2
|
Returns:
| Name | Type | Description |
|---|---|---|
ResponseGetData |
Response from job execution |
Raises:
| Type | Description |
|---|---|
CRUD_ApplicationJob_Error
|
If execution fails |
Source code in src/crew_dcs/classes/DomoApplication/Job.py
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | |
from_dict
classmethod
¶
from_dict(auth: DomoAuth, obj: dict[str, Any])
Create a DomoJob instance from a dictionary representation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
obj
|
dict[str, Any]
|
Dictionary containing job data from API |
required |
Returns:
| Name | Type | Description |
|---|---|---|
DomoJob |
New instance with populated attributes |
Source code in src/crew_dcs/classes/DomoApplication/Job.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
get_by_id
async
classmethod
¶
get_by_id(
auth: DomoAuth,
application_id: str,
job_id: str,
return_raw: bool = False,
debug_api: bool = False,
session: AsyncClient | None = None,
debug_num_stacks_to_drop: int = 2,
*,
context: RouteContext | None = None,
**context_kwargs
)
Retrieve a job by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
application_id
|
str
|
ID of the parent application |
required |
job_id
|
str
|
Unique identifier of the job |
required |
return_raw
|
bool
|
Return raw ResponseGetData instead of DomoJob |
False
|
debug_api
|
bool
|
Enable API debugging |
False
|
session
|
AsyncClient | None
|
Optional httpx session for request pooling |
None
|
debug_num_stacks_to_drop
|
int
|
Number of stack frames to drop in debug output |
2
|
Returns:
| Type | Description |
|---|---|
|
DomoJob or ResponseGetData: The job object or raw response |
Raises:
| Type | Description |
|---|---|
ApplicationError_NoneRetrieved
|
If job retrieval fails |
Source code in src/crew_dcs/classes/DomoApplication/Job.py
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 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
get_entity_by_id
async
classmethod
¶
get_entity_by_id(
auth: DomoAuth,
entity_id: str,
debug_num_stacks_to_drop: int = 2,
debug_api: bool = False,
session: AsyncClient | None = None,
**kwargs
)
Fetch a job by its entity ID.
Note: For DomoJob, this requires both application_id and job_id. The entity_id is treated as the job_id, and application_id must be provided in kwargs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
entity_id
|
str
|
Job ID (job_id) |
required |
debug_num_stacks_to_drop
|
int
|
Number of stack frames to drop in debug |
2
|
debug_api
|
bool
|
Enable API debugging |
False
|
session
|
AsyncClient | None
|
Optional httpx session |
None
|
**kwargs
|
Must include application_id |
{}
|
Returns:
| Type | Description |
|---|---|
|
DomoJob instance |
Raises:
| Type | Description |
|---|---|
ValueError
|
If application_id not provided in kwargs |
Source code in src/crew_dcs/classes/DomoApplication/Job.py
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 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | |
to_dict ¶
to_dict() -> dict
Convert the job to a dictionary for API requests.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Dictionary representation of the job |
Source code in src/crew_dcs/classes/DomoApplication/Job.py
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | |
update
async
¶
update(
body: dict | None = None,
return_raw: bool = False,
debug_api: bool = False,
session: AsyncClient | None = None,
debug_num_stacks_to_drop: int = 2,
*,
context: RouteContext | None = None,
**context_kwargs
)
Update this job's configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
body
|
dict | None
|
Dictionary containing job update data (uses to_dict if None) |
None
|
return_raw
|
bool
|
Return raw ResponseGetData instead of DomoJob |
False
|
debug_api
|
bool
|
Enable API debugging |
False
|
session
|
AsyncClient | None
|
Optional httpx session for request pooling |
None
|
debug_num_stacks_to_drop
|
int
|
Number of stack frames to drop in debug output |
2
|
Returns:
| Type | Description |
|---|---|
|
DomoJob or ResponseGetData: Updated job object or raw response |
Raises:
| Type | Description |
|---|---|
CRUD_ApplicationJob_Error
|
If update fails |
Source code in src/crew_dcs/classes/DomoApplication/Job.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | |
DomoJob_Base
dataclass
¶
DomoJob_Base(
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(),
)
Bases: DomoEntity
the base class only captures attributes applicable to all jobs (i.e. does not destructure execution_payload onto the class) build Application / Job extensions by creating children of the DomoJob_Base class
display_url
property
¶
display_url: str
Generate the URL to display this job in the Domo interface.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Complete URL to view the job in Domo |
from_dict
classmethod
¶
from_dict(auth: DomoAuth, obj: dict[str, Any])
Create a DomoJob_Base instance from an API response dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object for API requests |
required |
obj
|
dict[str, Any]
|
Dictionary representation of the job from API response |
required |
Returns:
| Type | Description |
|---|---|
|
DomoJob_Base instance |
Source code in src/crew_dcs/classes/DomoApplication/Job_Base.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
get_by_id
async
classmethod
¶
get_by_id(
auth: DomoAuth,
application_id: str,
job_id: str,
session: AsyncClient | None = None,
debug_api: bool = False,
debug_num_stacks_to_drop: int = 2,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
)
Retrieve a job by its ID from a specific application.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object for API requests |
required |
application_id
|
str
|
The ID of the application containing the job |
required |
job_id
|
str
|
The ID of the job to retrieve |
required |
session
|
AsyncClient | None
|
Optional HTTP session for connection pooling |
None
|
debug_api
|
bool
|
Enable API debugging output |
False
|
debug_num_stacks_to_drop
|
int
|
Number of stack frames to drop in debugging |
2
|
return_raw
|
bool
|
Return raw response without processing |
False
|
Returns:
| Type | Description |
|---|---|
|
DomoJob_Base instance or ResponseGetData if return_raw=True |
Raises:
| Type | Description |
|---|---|
ApplicationNoJobRetrievedError
|
If job retrieval fails |
Source code in src/crew_dcs/classes/DomoApplication/Job_Base.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | |
to_dict ¶
to_dict()
this is an abstract method, each DomoJob_Base implementation must define a to_dict() function
Source code in src/crew_dcs/classes/DomoApplication/Job_Base.py
333 334 335 | |