Currently the Jupyter Compute Tier management is set on an individual user level. Ideally we'd like this to at least be configured on either a role and/or group level to make this as scalable as possible.
Thank you!
This would be a massive unlock for us.
@Oleksii @OleksiiZakrevskyi i'm pretty sure this is built into domojupyter already you should be able to write a MONIT dataset, then just scrape for the PUT command to edit the tier
Stub: GET Jupyter workspace configuration via Domo API Since PUT isn't supported, this is read-only monitoring.
Two API endpoints do the heavy lifting:
Compute tier and python_version are NOT direct fields on the workspace object. They're derived by cross-referencing workspace.cpu/memory against settings.instanceTypes, and workspace kernel info against settings.jupyterKernels. """
import requests import pandas as pd from typing import Optional
def get_jupyter_workspaces(instance: str, token: str) -> list[dict]: """GET /api/content/v1/jupyter/workspaces — paginated list.""" url = f"https://{instance}.domo.com/api/content/v1/jupyter/workspaces" headers = {"X-DOMO-Developer-Token": token} all_workspaces = [] offset = 0 limit = 50
while True: params = {"limit": limit, "offset": offset} resp = requests.get(url, headers=headers, params=params) resp.raise_for_status() data = resp.json() workspaces = data.get("workspaces", []) all_workspaces.extend(workspaces) if len(workspaces) < limit: break offset += limit return all_workspaces
def get_jupyter_settings(instance: str, token: str) -> dict: """GET /api/content/v1/jupyter/settings — instanceTypes, jupyterKernels, etc.""" url = f"https://{instance}.domo.com/api/content/v1/jupyter/settings" headers = {"X-DOMO-Developer-Token": token} resp = requests.get(url, headers=headers) resp.raise_for_status() return resp.json()
def resolve_compute_tier(cpu: str, memory: int, instance_types: list[dict]) -> Optional[str]: """ Match workspace cpu/memory against settings.instanceTypes to find the named compute tier.
instance_types is a list like: [{"name": "Small", "cpu": "1", "memory": 4}, {"name": "Medium", "cpu": "2", "memory": 8}, ...] """ for tier in instance_types: if str(tier.get("cpu")) == str(cpu) and int(tier.get("memory", 0)) == int(memory): return tier.get("name") return None
def resolve_python_version(workspace: dict, jupyter_kernels: list[dict]) -> Optional[str]: """ Try to extract python version from workspace's kernel/instance data. Fall back to matching against settings.jupyterKernels.
jupyter_kernels is a list like: [{"name": "python3", "displayName": "Python 3.11", "language": "python"}, ...] The workspace raw response may include kernel info in: - workspace["kernel"] or workspace["instances"][0]["kernel"] """ # Check if kernel info is in the raw workspace response raw = workspace.get("raw", workspace) kernel_name = raw.get("kernel") or raw.get("kernelName") # Check instances (only populated when workspace is running) if not kernel_name and raw.get("instances"): kernel_name = raw["instances"][0].get("kernel") # Match against known kernels if kernel_name: for k in jupyter_kernels: if k.get("name") == kernel_name: return k.get("displayName") or k.get("language") return kernel_name # return raw value if no match
def generate_monit_jupyter_workspaces(instance: str, token: str) -> pd.DataFrame: """ Fetch all workspace configs and return a DataFrame suitable for upload as MONIT_jupyter_workspaces dataset. """ # Fetch data workspaces = get_jupyter_workspaces(instance, token) settings = get_jupyter_settings(instance, token)
instance_types = settings.get("instanceTypes", []) jupyter_kernels = settings.get("jupyterKernels", []) # Build rows rows = [] for ws in workspaces: cpu = ws.get("cpu") memory = ws.get("memory") rows.append({ "workspace_id": ws.get("id"), "name": ws.get("name"), "description": ws.get("description"), "owner": ws.get("owner"), "cpu": cpu, "memory": memory, "compute_tier": resolve_compute_tier(cpu, memory, instance_types), "python_version": resolve_python_version(ws, jupyter_kernels), "status": ws.get("status"), "created_dt": ws.get("createdDt") or ws.get("created_dt"), "updated_dt": ws.get("updatedDt") or ws.get("updated_dt"), "last_run_dt": ws.get("lastRunDt") or ws.get("last_run_dt"), "timeout": ws.get("timeout"), "input_datasets": ws.get("inputDataSets", []), "output_datasets": ws.get("outputDataSets", []), }) return pd.DataFrame(rows)
if name == "main": INSTANCE = "your-instance" # e.g. "domo-community" TOKEN = "your-developer-token"
df = generate_monit_jupyter_workspaces(INSTANCE, TOKEN) print(df.to_string(index=False)) # Upload as MONIT_ dataset: # domo.dataframe_to_dataset(df, "MONIT_jupyter_workspaces")
Alerts Product Enhancement Ideas
Analyzer Product Enhancement Ideas
API Product Enhancement Ideas
Apps Product Enhancement Ideas
Appstore product enhancement ideas
App Studio Product Enhancement Ideas
Beast Mode Product Enhancement Ideas
Buzz & Navigation Ideas
Charting product enhancement requests
Cloud Amplifier Product Enhancement Ideas
Code Engine Product Enhancement Ideas
Ideas or feedback for the Domo Community or the Community Forums.
Connectors Product Enhancement Ideas
Dashboard Product Enhancement Ideas
Datasets Produce Enhancement Ideas
Domo AI Product Enhancement Ideas
Domo Bricks Product Enhancement Ideas
Domo Developer Product Enhancement Ideas
Domo Everywhere Product Enhancement Ideas
Federated Product Enhancement Ideas
Product enhancement ideas for Domo as a whole
Governance & Security Product Enhancement Ideas
Jupyter Workspaces Product Enhancement Ideas
Localization product enhancement ideas
Magic ETL Product Enhancement Ideas
Mobile Product Enhancement Ideas
Reporting Product Enhancement Ideas
Product enhancement ideas for Sandbox
Software integrations product enhancement ideas
SQL Dataflows Product Enhancement Ideas
Variables Product Enhancement Ideas
Workbench Product Enhancement Ideas
Workflows Product Enhancement Ideas
Other Product Enhancement Ideas