codeengine
codeengine ¶
CodeEngine Package
This package provides codeengine management functionality split across multiple modules for better organization.
Modules:
| Name | Description |
|---|---|
exceptions |
Exception classes for codeengine operations |
core |
Core codeengine retrieval functions |
crud |
Create, read, update, delete operations |
upload |
Upload Python code to CodeEngine packages |
CodeEnginePackageBuilder ¶
CodeEnginePackageBuilder()
Helper class for building CodeEngine packages.
Source code in src/crew_dcs/routes/codeengine/crud.py
61 62 | |
CodeEngine_CRUD_Error ¶
CodeEngine_CRUD_Error(
operation: str = "CRUD",
entity_id: str | None = None,
res: ResponseGetData | None = None,
message: str | None = None,
**kwargs
)
Bases: RouteError
Raised when codeengine create, update, or delete operations fail.
Source code in src/crew_dcs/routes/codeengine/exceptions.py
60 61 62 63 64 65 66 67 68 69 70 | |
CodeEngine_FunctionCallError ¶
CodeEngine_FunctionCallError(
auth: DomoAuth | None = None,
message: str | None = None,
res: ResponseGetData | None = None,
**kwargs
)
Bases: RouteError
Raised when function call parameters are invalid.
Source code in src/crew_dcs/routes/codeengine/exceptions.py
93 94 95 96 97 98 99 100 101 102 103 104 | |
CodeEngine_GET_Error ¶
CodeEngine_GET_Error(
entity_id: str | None = None,
res: ResponseGetData | None = None,
message: str | None = None,
**kwargs
)
Bases: RouteError
Raised when codeengine retrieval operations fail.
Source code in src/crew_dcs/routes/codeengine/exceptions.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 | |
CodeEngine_InvalidPackageError ¶
CodeEngine_InvalidPackageError(
message: str,
auth: DomoAuth | None = None,
res: ResponseGetData | None = None,
**kwargs
)
Bases: RouteError
Raised when package validation fails.
Source code in src/crew_dcs/routes/codeengine/exceptions.py
76 77 78 79 80 81 82 83 84 85 86 87 | |
CodeEngine_Package_Parts ¶
SearchCodeEngineNotFoundError ¶
SearchCodeEngineNotFoundError(
search_criteria: str,
res: ResponseGetData | None = None,
**kwargs
)
Bases: RouteError
Raised when codeengine search operations return no results.
Source code in src/crew_dcs/routes/codeengine/exceptions.py
43 44 45 46 47 48 49 50 51 52 53 54 | |
create_codeengine_package
async
¶
create_codeengine_package(
auth: DomoAuth,
payload: dict,
*,
context: RouteContext | None = None,
return_raw: bool = False,
**context_kwargs
) -> ResponseGetData
Create a new codeengine package.
Trap: a Google-style Args: docstring whose parameter description WRAPS
across indented lines silently 400s here — _create_manifest_from_code's
function-boundary extraction mis-slices the source. Use flowing-prose
docstrings in any function you upload. (Bug is in crew-dcs manifest
extraction, not the Domo API; not yet fixed.)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
payload
|
dict
|
Package data dictionary |
required |
context
|
RouteContext | None
|
Route context (optional) |
None
|
return_raw
|
bool
|
Return raw response without processing |
False
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object containing created package data |
Raises:
| Type | Description |
|---|---|
CodeEngine_CRUD_Error
|
If package creation fails |
Source code in src/crew_dcs/routes/codeengine/crud.py
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 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 | |
delete_codeengine_package
async
¶
delete_codeengine_package(
auth: DomoAuth,
package_id: str,
*,
context: RouteContext | None = None,
return_raw: bool = False,
**context_kwargs
) -> ResponseGetData
Delete a codeengine package by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
package_id
|
str
|
Package identifier |
required |
context
|
RouteContext | None
|
Route context (optional) |
None
|
return_raw
|
bool
|
Return raw response without processing |
False
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object containing deletion result |
Raises:
| Type | Description |
|---|---|
CodeEngine_FunctionCallError
|
If package_id is not provided |
CodeEngine_CRUD_Error
|
If package deletion fails |
Source code in src/crew_dcs/routes/codeengine/core.py
551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 | |
delete_codeengine_package_version
async
¶
delete_codeengine_package_version(
auth: DomoAuth,
package_id: str,
version: str,
*,
context: RouteContext | None = None,
return_raw: bool = False,
**context_kwargs
) -> ResponseGetData
Delete a specific version of a codeengine package.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
package_id
|
str
|
Package identifier |
required |
version
|
str
|
Version string to delete |
required |
context
|
RouteContext | None
|
Route context (optional) |
None
|
return_raw
|
bool
|
Return raw response without processing |
False
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object containing deletion result |
Raises:
| Type | Description |
|---|---|
CodeEngine_FunctionCallError
|
If package_id or version is not provided |
CodeEngine_CRUD_Error
|
If version deletion fails |
Source code in src/crew_dcs/routes/codeengine/core.py
617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 | |
deploy_codeengine_package
async
¶
deploy_codeengine_package(
auth: DomoAuth,
package_id: str,
version: str,
*,
context: RouteContext | None = None,
return_raw: bool = False,
**context_kwargs
) -> ResponseGetData
Deploy a specific codeengine package version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
package_id
|
str
|
Package identifier |
required |
version
|
str
|
Package version to deploy |
required |
context
|
RouteContext | None
|
Route context (optional) |
None
|
return_raw
|
bool
|
Return raw response without processing |
False
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object containing deployment result |
Raises:
| Type | Description |
|---|---|
CodeEngine_CRUD_Error
|
If deployment fails |
Source code in src/crew_dcs/routes/codeengine/crud.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 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 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
execute_codeengine_function
async
¶
execute_codeengine_function(
auth: DomoAuth,
package_id: str,
version: str,
function_name: str,
input_variables: dict,
is_get_logs: bool = True,
*,
context: RouteContext | None = None,
return_raw: bool = False,
**context_kwargs
)
Execute one function of a deployed package version.
input_variables must supply EVERY input the manifest declares — omitting
one 400s with no hint which. Read the manifest first
(get_codeengine_package_by_id_and_version(params={"parts": "functions"})).
Type traps (both fail at EXECUTION, not at package creation):
- str | None raises TypeError: unsupported operand type(s) for | in
Domo's own executor. Use typing.Optional[str], and pin it with
# noqa: UP045 or ruff --fix rewrites it back to the broken form.
Source code in src/crew_dcs/routes/codeengine/core.py
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 | |
generate_share_account_package ¶
generate_share_account_package(
code: str,
package_id: str,
version: str,
name: str,
account_mappings: list[dict[str, Any]],
environment: str = "LAMBDA",
language: str = "PYTHON",
functions: list[dict[str, Any]] | None = None,
) -> dict[str, Any]
Generate a CodeEngine package dictionary structure.
Same parameters as generate_package_json but returns a dict instead of JSON string. Useful when you need to manipulate the structure before serializing.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary in CodeEngine package format |
Source code in src/crew_dcs/routes/codeengine/packages.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
get_codeengine_package_by_id
async
¶
get_codeengine_package_by_id(
auth: DomoAuth,
package_id: str,
params: dict | None = None,
*,
context: RouteContext | None = None,
return_raw: bool = False,
**context_kwargs
) -> ResponseGetData
Retrieve a specific codeengine package by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
package_id
|
str
|
Package identifier |
required |
params
|
dict | None
|
Query parameters (optional, defaults to {"parts": "versions"}) |
None
|
context
|
RouteContext | None
|
Route context (optional) |
None
|
return_raw
|
bool
|
Return raw response without processing |
False
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object containing package data |
Raises:
| Type | Description |
|---|---|
CodeEngine_FunctionCallError
|
If package_id is not provided |
CodeEngine_GET_Error
|
If package retrieval fails |
Source code in src/crew_dcs/routes/codeengine/core.py
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 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
get_codeengine_package_by_id_and_version
async
¶
get_codeengine_package_by_id_and_version(
auth: DomoAuth,
package_id: str,
version: str,
params: dict | None = None,
*,
context: RouteContext | None = None,
return_raw: bool = False,
**context_kwargs
) -> ResponseGetData
Retrieve a specific codeengine package by ID and version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
package_id
|
str
|
Package identifier |
required |
version
|
str
|
Package version |
required |
params
|
dict | None
|
Query parameters (optional, defaults to {"parts": "functions,code"}) |
None
|
context
|
RouteContext | None
|
Route context (optional) |
None
|
return_raw
|
bool
|
Return raw response without processing |
False
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object containing package version data |
Raises:
| Type | Description |
|---|---|
CodeEngine_FunctionCallError
|
If package_id or version is not provided |
CodeEngine_GET_Error
|
If package retrieval fails |
Source code in src/crew_dcs/routes/codeengine/core.py
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 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 | |
get_current_package_version
async
¶
get_current_package_version(
auth: DomoAuth,
package_id: str,
*,
context: RouteContext | None = None,
**context_kwargs
) -> str
Get the current version of a CodeEngine package.
Convenience function that retrieves the package metadata and extracts the current version string from the versions array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
package_id
|
str
|
Package identifier |
required |
context
|
RouteContext | None
|
Route context (optional) |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Current package version (e.g., "1.0.0") |
Raises:
| Type | Description |
|---|---|
CodeEngine_GET_Error
|
If package retrieval fails or version not found |
Example
version = await get_current_package_version( ... auth=auth, ... package_id="b368d630-7ca5-4b8a-b4ec-f130cf312dc1" ... ) print(f"Current version: {version}") Current version: 1.2.3
Source code in src/crew_dcs/routes/codeengine/core.py
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 209 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 | |
get_package_versions
async
¶
get_package_versions(
auth: DomoAuth,
package_id: str,
*,
context: RouteContext | None = None,
return_raw: bool = False,
**context_kwargs
) -> ResponseGetData
Retrieve all versions of a codeengine package.
Each package can have one or many versions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
package_id
|
str
|
Package identifier |
required |
context
|
RouteContext | None
|
Route context (optional) |
None
|
return_raw
|
bool
|
Return raw response without processing |
False
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object containing package versions |
Raises:
| Type | Description |
|---|---|
CodeEngine_FunctionCallError
|
If package_id is not provided |
CodeEngine_GET_Error
|
If version retrieval fails |
Source code in src/crew_dcs/routes/codeengine/core.py
253 254 255 256 257 258 259 260 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 306 307 308 309 310 311 312 313 | |
get_packages
async
¶
get_packages(
auth: DomoAuth,
*,
context: RouteContext | None = None,
return_raw: bool = False,
**context_kwargs
) -> ResponseGetData
Retrieve all codeengine packages.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
context
|
RouteContext | None
|
Route context (optional) |
None
|
return_raw
|
bool
|
Return raw response without processing |
False
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object containing package list |
Raises:
| Type | Description |
|---|---|
CodeEngine_GET_Error
|
If package retrieval fails |
Source code in src/crew_dcs/routes/codeengine/core.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 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 110 111 112 113 114 | |
increment_version ¶
increment_version(version: str) -> str
Increment the version number.
Increments the last part of a dot-separated version string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
version
|
str
|
Version string (e.g., "1.0.0") |
required |
Returns:
| Type | Description |
|---|---|
str
|
Incremented version string (e.g., "1.0.1") |
Source code in src/crew_dcs/routes/codeengine/crud.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | |
share_accounts_with_package
async
¶
share_accounts_with_package(
auth: DomoAuth,
package_id: str,
account_mappings: list[dict[str, str | int]],
is_set: bool = True,
version_id: str | None = None,
*,
context: RouteContext | None = None,
return_raw: bool = False,
dry_run: bool = False,
**context_kwargs
) -> ResponseGetData
Share Domo accounts with a CodeEngine package.
Updates the package manifest to include account mappings, allowing the package to access specific Domo accounts by alias.
⚠️ DESTRUCTIVE BY DEFAULT. is_set defaults to True, which REPLACES every
existing account mapping on the package. Pass is_set=False to merge. There
is no read-back, so a package that loses its mappings reports success.
dry_run=True simulates ONLY the destructive write. The reads this function
needs (current version, package, version body) still execute, so the request
body it shows you is the real one it would have sent. Nothing is written.
Check the result with res.is_dry_run — a simulated call still returns
status=200, is_success=True, so is_success cannot tell the two apart.
See .agents/guides/access-and-sharing.md.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
package_id
|
str
|
Package identifier |
required |
account_mappings
|
list[dict[str, str | int]]
|
List of account mapping dicts with 'accountId' and 'alias' keys Example: [{"accountId": 92, "alias": "sdk_config"}] |
required |
is_set
|
bool
|
If True, replace all existing account mappings with new ones. If False, add new mappings to existing ones (default: True) |
True
|
context
|
RouteContext | None
|
Route context (optional) |
None
|
return_raw
|
bool
|
Return raw response without processing |
False
|
dry_run
|
bool
|
Simulate the write. Reads still run; the POST is not sent.
Inspect |
False
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object containing updated package data |
Raises:
| Type | Description |
|---|---|
CodeEngine_CRUD_Error
|
If account sharing fails |
Example
Replace all account mappings¶
accounts = [ ... {"accountId": 92, "alias": "sdk_config"}, ... {"accountId": 189, "alias": "sdk_d2c"} ... ] res = await share_accounts_with_package( ... auth=auth, ... package_id="b368d630-7ca5-4b8a-b4ec-f130cf312dc1", ... account_mappings=accounts, ... is_set=True ... )
Add to existing account mappings¶
new_accounts = [{"accountId": 366, "alias": "sdk_audit"}] res = await share_accounts_with_package( ... auth=auth, ... package_id="b368d630-7ca5-4b8a-b4ec-f130cf312dc1", ... account_mappings=new_accounts, ... is_set=False ... )
Source code in src/crew_dcs/routes/codeengine/crud.py
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 | |
test_package_is_identical
async
¶
test_package_is_identical(
package_id: str,
version: str,
auth: DomoAuth,
existing_package: dict | None = None,
new_package: dict | None = None,
new_code: str | None = None,
params: dict | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
) -> bool
Test if the code in a new package matches the existing package.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
package_id
|
str
|
Package identifier |
required |
version
|
str
|
Package version |
required |
auth
|
DomoAuth
|
Authentication object |
required |
existing_package
|
dict | None
|
Pre-fetched existing package data (optional) |
None
|
new_package
|
dict | None
|
New package data to compare (optional) |
None
|
new_code
|
str | None
|
New code to compare (optional) |
None
|
params
|
dict | None
|
Query parameters (optional) |
None
|
context
|
RouteContext | None
|
Route context (optional) |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Returns:
| Type | Description |
|---|---|
bool
|
True if the package code is identical, False otherwise |
Source code in src/crew_dcs/routes/codeengine/core.py
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 | |
test_package_is_released
async
¶
test_package_is_released(
package_id: str,
version: str,
auth: DomoAuth,
existing_package: dict | None = None,
params: dict | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
) -> bool
Test if a package version is already released.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
package_id
|
str
|
Package identifier |
required |
version
|
str
|
Package version |
required |
auth
|
DomoAuth
|
Authentication object |
required |
existing_package
|
dict | None
|
Pre-fetched package data (optional) |
None
|
params
|
dict | None
|
Query parameters (optional) |
None
|
context
|
RouteContext | None
|
Route context (optional) |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Returns:
| Type | Description |
|---|---|
bool
|
True if the package is already released, False otherwise |
Source code in src/crew_dcs/routes/codeengine/core.py
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 414 415 416 417 418 419 420 421 | |
update_codeengine_package_owner
async
¶
update_codeengine_package_owner(
auth: DomoAuth,
package_id: str,
owner_id: int,
*,
context: RouteContext | None = None,
return_raw: bool = False,
**context_kwargs
) -> ResponseGetData
Update the owner of a codeengine package.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
package_id
|
str
|
Package identifier |
required |
owner_id
|
int
|
New owner user ID |
required |
context
|
RouteContext | None
|
Route context (optional) |
None
|
return_raw
|
bool
|
Return raw response without processing |
False
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object containing updated package data |
Raises:
| Type | Description |
|---|---|
CodeEngine_FunctionCallError
|
If package_id is not provided |
CodeEngine_CRUD_Error
|
If owner update fails |
Source code in src/crew_dcs/routes/codeengine/core.py
683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 | |
upload_package_version
async
¶
upload_package_version(
auth: DomoAuth,
package_id: str,
code: str,
is_new_version: bool = False,
metadata: dict | None = None,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Upload Python code to a CodeEngine package.
This route function validates inputs, builds a manifest from the Python code, and deploys it to the specified CodeEngine package.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object with valid Domo credentials |
required |
package_id
|
str
|
ID of the CodeEngine package to update |
required |
code
|
str
|
Python source code string to deploy |
required |
is_new_version
|
bool
|
If True, create a new version. If False (default), update the current version. |
False
|
metadata
|
dict | None
|
Optional metadata overrides including: - runtime: Runtime version (default: "PYTHON_3_13") - accountsMapping: List of account mapping dicts - name: Package name override - description: Package description - handler_name: Name of the handler function |
None
|
return_raw
|
bool
|
Return raw response without processing |
False
|
context
|
RouteContext | None
|
RouteContext for request configuration |
None
|
**context_kwargs
|
Additional context parameters (session, debug_api, etc.) |
{}
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData containing: - package_id: The package ID - version: The version that was created/updated - status: "created" or "updated" - manifest: The generated manifest |
Raises:
| Type | Description |
|---|---|
CodeEngine_CRUD_Error
|
If validation fails or deployment fails |
Example
from crew_dcs.auth import DomoTokenAuth auth = DomoTokenAuth( ... domo_instance="mycompany", ... domo_access_token="your-token" ... ) code = ''' ... def process_data(items: list, limit: int = 10) -> dict: ... """Process items and return summary.""" ... return {"count": len(items[:limit])} ... ''' result = await upload_package_version( ... auth=auth, ... package_id="517ca12c-3459-4e66-b0bb-40f000720a84", ... code=code, ... is_new_version=False ... )
Note
- Default runtime is Python 3.13 ("PYTHON_3_13")
- Multi-file packages are not supported; code must be a single string
- The first top-level function in the code is used as the handler unless handler_name is specified in metadata
Source code in src/crew_dcs/routes/codeengine/upload.py
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 79 80 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 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 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | |
upsert_codeengine_package_version
async
¶
upsert_codeengine_package_version(
auth: DomoAuth,
payload: dict,
version: str | None = None,
auto_increment_version: bool = True,
*,
context: RouteContext | None = None,
return_raw: bool = False,
**context_kwargs
) -> ResponseGetData
Create or update a codeengine package version.
If the package version exists and is released, optionally increment the version. If the package code is identical to existing, skip the update.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
payload
|
dict
|
Package data dictionary |
required |
version
|
str | None
|
Package version (optional, defaults to version in payload) |
None
|
auto_increment_version
|
bool
|
Automatically increment version if deployed |
True
|
debug_prn
|
Enable debug printing |
required | |
context
|
RouteContext | None
|
Route context (optional) |
None
|
return_raw
|
bool
|
Return raw response without processing |
False
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object containing package data |
Raises:
| Type | Description |
|---|---|
CodeEngine_InvalidPackageError
|
If package is already deployed and auto_increment is False |
CodeEngine_CRUD_Error
|
If package creation/update fails |
Source code in src/crew_dcs/routes/codeengine/crud.py
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 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 | |
upsert_package
async
¶
upsert_package(
auth: DomoAuth,
payload: dict,
check_different: bool = True,
create_new_version: bool = False,
*,
context: RouteContext | None = None,
return_raw: bool = False,
**context_kwargs
) -> ResponseGetData
Create or update a codeengine package.
If the package doesn't exist, create it. If it exists, update the version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
payload
|
dict
|
Package data dictionary |
required |
check_different
|
bool
|
If True, compare payload with existing package and skip update if identical (default: True) |
True
|
create_new_version
|
bool
|
If True, force creation of a new version even if package exists (default: False) |
False
|
context
|
RouteContext | None
|
Route context (optional) |
None
|
return_raw
|
bool
|
Return raw response without processing |
False
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object containing package data |
Raises:
| Type | Description |
|---|---|
CodeEngine_CRUD_Error
|
If package creation/update fails |
Source code in src/crew_dcs/routes/codeengine/crud.py
303 304 305 306 307 308 309 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 337 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 | |