config
config ¶
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 | |
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 | |
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 | |