Skip to content

Commit 3cfee80

Browse files
guidooswaldDBclaude
andcommitted
Add Account API catalog, scope switcher, CSV viewer, and configurable timeout
- Add Workspace/Account scope switcher in sidebar with 16 account API categories - Add account-level auth resolution (scans CLI profiles for accounts console token) - Auto-prefill account_id from CLI profile in account endpoint forms - Add inline ID link navigation for account endpoints (Log Delivery, Budgets, etc.) - Fix Budgets API paths (/budget → /budgets) and field mappings - Fix Log Delivery list→get linking (correct id_field and list_key) - Add Usage Download API with sensible date defaults (3 months ago → current month) - Render CSV API responses as styled HTML tables instead of raw text - Add configurable timeout input next to Execute button (default 30s, 120s for Usage) - Extend timeout for Usage Download endpoint to 120 seconds Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2c8fd9f commit 3cfee80

5 files changed

Lines changed: 1050 additions & 69 deletions

File tree

CLAUDE.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ The entire UI and all server-side logic live here. Key sections:
3333
- Callbacks are numbered 1–12 (with 8b inserted between 8 and 9).
3434

3535
### `api_catalog.py` — endpoint definitions + chip extraction
36-
- `API_CATALOG` dict: all 15 categories and 45+ endpoints. Each endpoint has `id`, `method`, `path`, `params`, optional `path_params`, optional `body`.
37-
- `LIST_TO_GET` dict: maps a list-endpoint ID to `(get_endpoint_id, list_key, id_field, param_name, label_field)`. This drives the inline navigation links in list responses.
38-
- `extract_chips()` — reads `LIST_TO_GET`, walks the API response, returns chip dicts with `{get_id, param, id_field, value, label, title}`. The `id_field` key is what `highlight_json_components` uses to match JSON keys by name.
39-
- Adding a new endpoint: add it to `API_CATALOG` and, if it's a list with a corresponding get, add it to `LIST_TO_GET`.
36+
- Two catalogs: `API_CATALOG` (workspace APIs) and `ACCOUNT_API_CATALOG` (account-level APIs targeting `accounts.cloud.databricks.com`).
37+
- Each endpoint has `id`, `method`, `path`, `params`, optional `path_params`, optional `body`. Account endpoints also carry `scope: "account"` when looked up via `get_endpoint_by_id`/`ENDPOINT_MAP`.
38+
- `LIST_TO_GET` / `ACCOUNT_LIST_TO_GET` dicts: map list-endpoint IDs to `(get_endpoint_id, list_key, id_field, param_name, label_field)`. `list_key=None` means the response is a bare JSON array.
39+
- `extract_chips()` — reads both link maps, walks the API response, returns chip dicts. The `id_field` key is what the JSON tree viewer uses to match keys by name.
40+
- Adding a new endpoint: add it to the appropriate `*_CATALOG` and, if it's a list with a corresponding get, add it to the matching `*_LIST_TO_GET`.
41+
- A scope switcher in the sidebar toggles between Workspace and Account views. Account API calls route through `_accounts_host()` which derives the accounts console URL from the workspace host.
4042

4143
### `auth.py` — dual-mode authentication
4244
- `IS_DATABRICKS_APP = bool(os.getenv("DATABRICKS_CLIENT_SECRET"))` — this flag switches the entire app between local and Databricks App mode at startup.

0 commit comments

Comments
 (0)