jupyter
jupyter ¶
Jupyter Route Functions
CRUD operations for Domo Jupyter workspaces and their content.
The module is organized into functional areas:
- core — Workspace retrieval, start, and auth-token helpers
(
domo.comAPI, standardDomoAuth). - config — Workspace configuration updates and instance settings
(
domo.comAPI, standardDomoAuth). - content — File / notebook / directory CRUD and checkpoints
(Jupyter server API, requires
DomoJupyterAuthwithjupyter_token). - exceptions — All Jupyter-related exception classes.
JupyterCheckpoint ¶
Bases: TypedDict
Shape returned by checkpoint endpoints.
Example::
{"id": "checkpoint", "last_modified": "2026-03-16T20:23:31.937000Z"}
JupyterContentItem ¶
Bases: TypedDict
Shape returned by GET /api/contents/{path}.
Example::
{
"name": "my_notebook.ipynb",
"path": "folder/my_notebook.ipynb",
"last_modified": "2026-03-16T20:23:31.937000Z",
"created": "2026-03-16T20:23:31.937000Z",
"content": null, # None when ?content=0
"format": "json", # "json" | "text" | null
"mimetype": null,
"size": 624,
"writable": true,
"hash": null,
"hash_algorithm": null,
"type": "notebook" # "notebook" | "file" | "directory"
}
JupyterCreateBody ¶
Bases: TypedDict
Body for POST /api/contents/{parent_path} to create new content.
The Jupyter API creates content with a default name (e.g. Untitled.ipynb
or Untitled Folder). Use rename_jupyter_content afterward to give
it the desired name.
Example::
{"type": "notebook", "path": "my_folder"}
JupyterRenameBody ¶
Bases: TypedDict
Body for PATCH /api/contents/{old_path} to rename or move content.
Example::
{"path": "folder/new_name.ipynb"}
JupyterUpdateBody ¶
Bases: TypedDict
Body for PUT /api/contents/{path} to save content.
Example (notebook)::
{
"type": "notebook",
"format": "json",
"content": {"cells": [...], "metadata": {...}, "nbformat": 4, "nbformat_minor": 5}
}
Example (text file)::
{"type": "file", "format": "text", "content": "hello world"}
JupyterWorkspace_Error ¶
JupyterWorkspace_Error(
operation: str,
workspace_id: str,
message: str | None = None,
res=None,
**kwargs
)
Bases: RouteError
Raised when Jupyter workspace operations fail.
Source code in src/crew_dcs/routes/jupyter/exceptions.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
Jupyter_CRUD_Error ¶
Jupyter_CRUD_Error(
operation: str,
workspace_id: str | None = None,
content_path: str | None = None,
message: str | None = None,
res=None,
**kwargs
)
Bases: RouteError
Raised when Jupyter workspace create, update, or delete operations fail.
Source code in src/crew_dcs/routes/jupyter/exceptions.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
Jupyter_GET_Error ¶
Jupyter_GET_Error(
workspace_id: str | None = None,
message: str | None = None,
res=None,
**kwargs
)
Bases: RouteError
Raised when Jupyter workspace retrieval operations fail.
Source code in src/crew_dcs/routes/jupyter/exceptions.py
22 23 24 25 26 27 28 29 30 31 32 33 34 | |
SearchJupyterNotFoundError ¶
SearchJupyterNotFoundError(
search_criteria: str,
message: str | None = None,
res=None,
**kwargs
)
Bases: RouteError
Raised when Jupyter workspace search operations return no results.
Source code in src/crew_dcs/routes/jupyter/exceptions.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
create_checkpoint
async
¶
create_checkpoint(
auth: DomoJupyterAuth,
content_path: str,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Create a checkpoint (snapshot) for a content item.
POST /api/contents/{path}/checkpoints
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoJupyterAuth
|
Jupyter authentication object. |
required |
content_path
|
str
|
Path of the content to checkpoint. |
required |
return_raw
|
bool
|
Return raw response without error checking. |
False
|
context
|
RouteContext | None
|
Optional |
None
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
|
Raises:
| Type | Description |
|---|---|
Jupyter_CRUD_Error
|
On failure. |
Source code in src/crew_dcs/routes/jupyter/content.py
747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 | |
create_folder
async
¶
create_folder(
auth: DomoJupyterAuth,
folder_path: str,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Create a directory in a Jupyter workspace.
Two-step flow matching the JupyterLab UI:
POST /api/contents/{parent}with{"type": "directory"}— createsUntitled Folder.PATCH /api/contents/Untitled%20Folder— renames tofolder_path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoJupyterAuth
|
Jupyter authentication object. |
required |
folder_path
|
str
|
Desired folder path (e.g. |
required |
return_raw
|
bool
|
Return raw response after POST. |
False
|
context
|
RouteContext | None
|
Optional |
None
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
|
ResponseGetData
|
with |
Raises:
| Type | Description |
|---|---|
Jupyter_CRUD_Error
|
On creation or rename failure. |
Source code in src/crew_dcs/routes/jupyter/content.py
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 | |
create_jupyter_obj
async
¶
create_jupyter_obj(
auth: DomoJupyterAuth,
new_content: Any = "",
content_path: str = "",
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Create new content in a Jupyter workspace.
Performs two API calls:
POST /api/contents/{parent}withJupyterCreateBody— creates an object with a default name (e.g.Untitled.ipynb).PATCH /api/contents/{untitled_path}withJupyterRenameBody— renames to the desiredcontent_path.
If new_content is provided, a third PUT call saves the content.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoJupyterAuth
|
Jupyter authentication object. |
required |
new_content
|
Any
|
Content to write after creation (optional). |
''
|
content_path
|
str
|
Desired full path (e.g. |
''
|
return_raw
|
bool
|
Return raw response after the POST step. |
False
|
context
|
RouteContext | None
|
Optional |
None
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
|
ResponseGetData
|
reflecting the final state. |
Raises:
| Type | Description |
|---|---|
Jupyter_CRUD_Error
|
On creation or rename failure. |
Source code in src/crew_dcs/routes/jupyter/content.py
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 | |
delete_jupyter_content
async
¶
delete_jupyter_content(
auth: DomoJupyterAuth,
content_path: str,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Delete content from a Jupyter workspace.
DELETE /api/contents/{path}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoJupyterAuth
|
Jupyter authentication object. |
required |
content_path
|
str
|
Path to the content to delete. |
required |
return_raw
|
bool
|
Return raw response without error checking. |
False
|
context
|
RouteContext | None
|
Optional |
None
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
|
Raises:
| Type | Description |
|---|---|
Jupyter_CRUD_Error
|
On 403 or other failure. |
SearchJupyterNotFoundError
|
On 404. |
Source code in src/crew_dcs/routes/jupyter/content.py
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 | |
generate_update_jupyter_body ¶
generate_update_jupyter_body(
new_content: Any, content_path: str
) -> JupyterUpdateBody
Build a JupyterUpdateBody for saving content via PUT.
Determines type and format from content_path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_content
|
Any
|
The content payload (notebook JSON dict or text string). |
required |
content_path
|
str
|
Path of the content — extension determines type/format. |
required |
Returns:
| Type | Description |
|---|---|
JupyterUpdateBody
|
A dict conforming to |
Source code in src/crew_dcs/routes/jupyter/content.py
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 | |
get_checkpoints
async
¶
get_checkpoints(
auth: DomoJupyterAuth,
content_path: str,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
List checkpoints for a content item.
GET /api/contents/{path}/checkpoints
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoJupyterAuth
|
Jupyter authentication object. |
required |
content_path
|
str
|
Path of the content. |
required |
return_raw
|
bool
|
Return raw response without error checking. |
False
|
context
|
RouteContext | None
|
Optional |
None
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
|
Raises:
| Type | Description |
|---|---|
Jupyter_GET_Error
|
On failure. |
Source code in src/crew_dcs/routes/jupyter/content.py
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 | |
get_content
async
¶
get_content(
auth: DomoJupyterAuth,
content_path: str = "",
ignore_folders: list[str] | None = None,
included_filetypes: list[str] | None = None,
is_recursive: bool = True,
exclude_hidden: bool = True,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Get all content from a Jupyter workspace, optionally recursive.
Convenience wrapper around get_content_recursive with automatic
deduplication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoJupyterAuth
|
Jupyter authentication object. |
required |
content_path
|
str
|
Starting path ( |
''
|
ignore_folders
|
list[str] | None
|
Folder names to exclude (matches path segments). |
None
|
included_filetypes
|
list[str] | None
|
File extensions to include (e.g. |
None
|
is_recursive
|
bool
|
Descend into subdirectories (default |
True
|
exclude_hidden
|
bool
|
Skip dot-prefixed file and directory names (default |
True
|
return_raw
|
bool
|
Pass through to underlying calls. |
False
|
context
|
RouteContext | None
|
Optional |
None
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
|
ResponseGetData
|
|
Raises:
| Type | Description |
|---|---|
Jupyter_GET_Error
|
On retrieval failure. |
SearchJupyterNotFoundError
|
If starting path does not exist. |
Source code in src/crew_dcs/routes/jupyter/content.py
1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 | |
get_content_recursive
async
¶
get_content_recursive(
auth: DomoJupyterAuth,
all_rows: list,
content_path: str,
res: ResponseGetData,
seen_paths: set,
obj: dict | None = None,
ignore_folders: list[str] | None = None,
included_filetypes: list[str] | None = None,
is_recursive: bool = True,
exclude_hidden: bool = True,
is_run_test_jupyter_auth: bool = True,
return_raw: bool = False,
context: RouteContext | None = None,
**context_kwargs
)
Recursively retrieve content from a Jupyter workspace.
This is an internal accumulator function called by get_content.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoJupyterAuth
|
Jupyter authentication object. |
required |
all_rows
|
list
|
Accumulator list for all content items found so far. |
required |
content_path
|
str
|
Current path being processed. |
required |
res
|
ResponseGetData
|
|
required |
seen_paths
|
set
|
Set of already-visited paths (deduplication). |
required |
obj
|
dict | None
|
Pre-fetched content dict ( |
None
|
ignore_folders
|
list[str] | None
|
Folder names to skip (matched against path segments). |
None
|
included_filetypes
|
list[str] | None
|
File extensions to include (e.g. |
None
|
is_recursive
|
bool
|
Whether to descend into subdirectories. |
True
|
exclude_hidden
|
bool
|
If True, skip files and directories whose Jupyter |
True
|
is_run_test_jupyter_auth
|
bool
|
Validate auth on the first call. |
True
|
return_raw
|
bool
|
Pass through to |
False
|
context
|
RouteContext | None
|
Optional |
None
|
Returns:
| Type | Description |
|---|---|
|
|
Source code in src/crew_dcs/routes/jupyter/content.py
938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 | |
get_jupyter_content
async
¶
get_jupyter_content(
auth: DomoJupyterAuth,
content_path: str = "",
include_content: bool = True,
is_run_test_jupyter_auth: bool = True,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Retrieve content metadata (and optionally body) from a Jupyter workspace.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoJupyterAuth
|
Jupyter authentication object. |
required |
content_path
|
str
|
Path within the workspace ( |
''
|
include_content
|
bool
|
If |
True
|
is_run_test_jupyter_auth
|
bool
|
Validate auth is |
True
|
return_raw
|
bool
|
Return the raw |
False
|
context
|
RouteContext | None
|
Optional |
None
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
|
Raises:
| Type | Description |
|---|---|
Jupyter_GET_Error
|
On 403 or other non-success status. |
SearchJupyterNotFoundError
|
On 404. |
Source code in src/crew_dcs/routes/jupyter/content.py
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 301 302 303 304 305 306 | |
get_jupyter_settings
async
¶
get_jupyter_settings(
auth: DomoAuth,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Retrieve Jupyter settings for the Domo instance.
GET /api/datascience/v1/settings
Returns instance types, limits, kernel specs, feature flags, etc.
Example response shape::
{
"instanceTypes": [{"cpu": 0.5, "memory": 4.0}, ...],
"limits": {...},
"isEnabled": true,
"userAccess": {...},
"currentUserInstanceTypes": [...],
"jupyterKernels": [...],
"featureFlags": {...},
"locale": "en-US",
"timeZone": "America/Denver",
"maintenance": {...}
}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object (standard |
required |
return_raw
|
bool
|
Return raw response without error checking. |
False
|
context
|
RouteContext | None
|
Optional |
None
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
|
Raises:
| Type | Description |
|---|---|
Jupyter_GET_Error
|
On failure. |
Source code in src/crew_dcs/routes/jupyter/config.py
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 | |
get_jupyter_user_namespace
async
¶
get_jupyter_user_namespace(
auth: DomoAuth,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Retrieve the Jupyter user namespace for the current user.
GET /api/datascience/v1/workspaces/user
The namespace string (e.g. "my-company-config-672596669") appears in
the service_prefix path of all Jupyter server URLs:
/user/{namespace}/{workspace_short_id}/api/contents/...
Example response::
{"name": "my-company-config-672596669"}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object (standard |
required |
return_raw
|
bool
|
Return raw response without error checking. |
False
|
context
|
RouteContext | None
|
Optional |
None
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
|
Raises:
| Type | Description |
|---|---|
Jupyter_GET_Error
|
On failure. |
Source code in src/crew_dcs/routes/jupyter/config.py
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 | |
get_jupyter_workspace_by_id
async
¶
get_jupyter_workspace_by_id(
auth: DomoAuth,
workspace_id: str,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Retrieve a specific Jupyter workspace by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object containing credentials and instance info |
required |
workspace_id
|
str
|
Unique identifier for the workspace to retrieve |
required |
return_raw
|
bool
|
Return raw API 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 object containing workspace details |
Raises:
| Type | Description |
|---|---|
Jupyter_GET_Error
|
If workspace retrieval fails |
Source code in src/crew_dcs/routes/jupyter/core.py
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 | |
get_jupyter_workspaces
async
¶
get_jupyter_workspaces(
auth: DomoAuth,
return_raw: bool = False,
debug_loop: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Retrieve all available Jupyter workspaces.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object containing credentials and instance info |
required |
context
|
RouteContext | None
|
Optional RouteContext for request configuration |
None
|
return_raw
|
bool
|
Return raw API response without processing |
False
|
debug_loop
|
bool
|
Enable detailed loop debugging |
False
|
**context_kwargs
|
Additional context parameters (session, debug_api, etc.) |
{}
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object containing list of Jupyter workspaces |
Raises:
| Type | Description |
|---|---|
Jupyter_GET_Error
|
If workspace retrieval fails |
Source code in src/crew_dcs/routes/jupyter/core.py
34 35 36 37 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 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 | |
get_notebook_dataflow
async
¶
get_notebook_dataflow(
auth: DomoJupyterAuth,
workspace_id: str,
notebook_id: str,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Get dataflow (scheduling) configuration for a notebook in a Jupyter workspace.
GET .../services/domo/v1/workspaces/{workspace_id}/notebooks/{notebook_id}/dataflow
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoJupyterAuth
|
Jupyter authentication object. |
required |
workspace_id
|
str
|
Workspace UUID (e.g. from get_jupyter_workspace_by_id). |
required |
notebook_id
|
str
|
Notebook UUID (e.g. from content metadata if exposed by API). |
required |
return_raw
|
bool
|
Return raw response without error checking. |
False
|
context
|
RouteContext | None
|
Optional |
None
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
|
Raises:
| Type | Description |
|---|---|
Jupyter_GET_Error
|
On failure. |
SearchJupyterNotFoundError
|
On 404. |
Source code in src/crew_dcs/routes/jupyter/content.py
805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 | |
get_workspace_auth_token_params
async
¶
get_workspace_auth_token_params(
workspace_id: str,
auth: DomoAuth,
return_raw: bool = False,
) -> ResponseGetData
params are needed for authenticating requests inside the workspace environment Note: you'll also need a internally generated jupyter_token to authenticate requests returns { service_location , service_prefix}
Source code in src/crew_dcs/routes/jupyter/core.py
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 | |
parse_instance_service_location_and_prefix ¶
parse_instance_service_location_and_prefix(
instance_dict: dict, domo_instance: str
) -> dict
Parse service location and prefix from instance dictionary.
Source code in src/crew_dcs/routes/jupyter/core.py
159 160 161 162 163 164 165 166 167 168 169 170 171 | |
rename_jupyter_content
async
¶
rename_jupyter_content(
auth: DomoJupyterAuth,
old_path: str,
new_path: str,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Rename or move content within a Jupyter workspace.
PATCH /api/contents/{old_path}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoJupyterAuth
|
Jupyter authentication object. |
required |
old_path
|
str
|
Current path of the content. |
required |
new_path
|
str
|
Desired new path. |
required |
return_raw
|
bool
|
Return raw response without error checking. |
False
|
context
|
RouteContext | None
|
Optional |
None
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
|
ResponseGetData
|
with the updated path. |
Raises:
| Type | Description |
|---|---|
Jupyter_CRUD_Error
|
On 403, 409 (conflict), or other failure. |
Source code in src/crew_dcs/routes/jupyter/content.py
410 411 412 413 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 | |
resolve_compute_tier ¶
resolve_compute_tier(
cpu: float | int | None,
memory: float | int | None,
instance_types: list[dict] | None = None,
) -> str | None
Resolve a human-readable compute tier label for a workspace's cpu/memory.
Domo's instanceTypes (returned by both get_jupyter_settings and
the per-workspace GET /api/datascience/v1/workspaces/{id} response)
only carries {"cpu": ..., "memory": ...} pairs — there is no
name/label field to surface as-is (confirmed against a live
instance while implementing this — see issue #1497). The label is
therefore synthesized as "{cpu} CPU / {memory} GB".
When instance_types is supplied, the cpu/memory pair must match one
of the listed tiers or None is returned — this distinguishes a
known/standard tier from a custom or unrecognized allocation. When
instance_types is omitted, the label is synthesized unconditionally.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cpu
|
float | int | None
|
Workspace cpu allocation (e.g. |
required |
memory
|
float | int | None
|
Workspace memory allocation in GB (e.g. |
required |
instance_types
|
list[dict] | None
|
Optional list of |
None
|
Returns:
| Type | Description |
|---|---|
str | None
|
A label like |
str | None
|
missing, or if |
Source code in src/crew_dcs/routes/jupyter/config.py
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 | |
resolve_python_version ¶
resolve_python_version(
jupyter_kernel: str | None,
) -> str | None
Parse a Python version string out of a Domo jupyterKernel code.
The workspace API (GET /api/datascience/v1/workspaces/{id}) returns
the active kernel as a code such as "PYTHON_3_12" or "R_4_1" on
the workspace itself (confirmed present on live workspaces regardless of
whether the workspace is currently running — see issue #1497). This
parses that code directly rather than requiring a separate
get_jupyter_settings call to look the code up in jupyterKernels.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jupyter_kernel
|
str | None
|
Raw kernel code, e.g. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
A version string like |
str | None
|
non-Python kernels (e.g. R) or a missing value. |
Source code in src/crew_dcs/routes/jupyter/config.py
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 | |
start_jupyter_workspace
async
¶
start_jupyter_workspace(
auth: DomoAuth,
workspace_id: str,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Start a Jupyter workspace instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object containing credentials and instance info |
required |
workspace_id
|
str
|
Unique identifier for the workspace to start |
required |
context
|
RouteContext | None
|
Optional RouteContext for request configuration |
None
|
return_raw
|
bool
|
Return raw API response without processing |
False
|
**context_kwargs
|
Additional context parameters (session, debug_api, etc.) |
{}
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object containing workspace start result |
Raises:
| Type | Description |
|---|---|
JupyterWorkspace_Error
|
If workspace start operation fails |
Jupyter_GET_Error
|
If workspace retrieval fails |
Source code in src/crew_dcs/routes/jupyter/core.py
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 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | |
update_jupyter_file
async
¶
update_jupyter_file(
auth: DomoJupyterAuth,
new_content: Any,
content_path: str = "",
body: dict | None = None,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Update (save) content in a Jupyter workspace file.
PUT /api/contents/{path}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoJupyterAuth
|
Jupyter authentication object. |
required |
new_content
|
Any
|
New content payload (notebook JSON dict or text string). |
required |
content_path
|
str
|
Path of the file to update. |
''
|
body
|
dict | None
|
Optional fully-formed request body. When provided,
|
None
|
return_raw
|
bool
|
Return raw response without error checking. |
False
|
context
|
RouteContext | None
|
Optional |
None
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
|
Raises:
| Type | Description |
|---|---|
Jupyter_CRUD_Error
|
On 403 or other failure. |
SearchJupyterNotFoundError
|
On 404. |
Source code in src/crew_dcs/routes/jupyter/content.py
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 681 682 683 684 685 686 687 688 689 | |
update_jupyter_workspace_config
async
¶
update_jupyter_workspace_config(
auth: DomoAuth,
workspace_id: str,
config: dict,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Update the configuration of a Jupyter workspace.
PUT /api/datascience/v1/workspaces/{workspace_id}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object. |
required |
workspace_id
|
str
|
UUID of the workspace. |
required |
config
|
dict
|
Configuration dict (inputConfiguration, outputConfiguration, etc.). |
required |
return_raw
|
bool
|
Return raw response without error checking. |
False
|
context
|
RouteContext | None
|
Optional |
None
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
|
Raises:
| Type | Description |
|---|---|
Jupyter_CRUD_Error
|
On update failure. |
SearchJupyterNotFoundError
|
If workspace does not exist (404). |
Source code in src/crew_dcs/routes/jupyter/config.py
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 180 181 | |
update_notebook_dataflow
async
¶
update_notebook_dataflow(
auth: DomoJupyterAuth,
workspace_id: str,
notebook_id: str,
body: dict[str, Any],
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Update dataflow (scheduling) configuration for a notebook in a Jupyter workspace.
PUT .../services/domo/v1/workspaces/{workspace_id}/notebooks/{notebook_id}/dataflow
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoJupyterAuth
|
Jupyter authentication object. |
required |
workspace_id
|
str
|
Workspace UUID. |
required |
notebook_id
|
str
|
Notebook UUID. |
required |
body
|
dict[str, Any]
|
Request body (scheduling/dataflow payload). Shape is API-defined. |
required |
return_raw
|
bool
|
Return raw response without error checking. |
False
|
context
|
RouteContext | None
|
Optional |
None
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
|
Raises:
| Type | Description |
|---|---|
Jupyter_CRUD_Error
|
On failure. |
SearchJupyterNotFoundError
|
On 404. |
Source code in src/crew_dcs/routes/jupyter/content.py
864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 | |