Skip to content

Commit bfee234

Browse files
committed
Add settings dialog with theme switcher, timezone, language, and startup scripts
New settings modal (gear icon in topbar) with timezone selector, language picker, and 7 themes (4 dark + 3 light) applied via CSS custom properties. Settings persist to localStorage. Added cross-platform startup scripts (start.sh, start.command, start.bat) that handle venv creation and dependency installation. Updated README with full Account API coverage and all new features. Co-authored-by: Isaac
1 parent c892153 commit bfee234

6 files changed

Lines changed: 595 additions & 36 deletions

File tree

README.md

Lines changed: 93 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Databricks API Explorer
22

3-
An ultra-modern, interactive REST API explorer for Databricks workspaces. Built as a Databricks App with dual-mode authentication runs locally via Databricks CLI SSO and in production as a Databricks App using On-Behalf-Of (OBO) authentication.
3+
An ultra-modern, interactive REST API explorer for Databricks — covering both **Workspace** and **Account-level** APIs. Built as a Databricks App with dual-mode authentication: runs locally via Databricks CLI SSO and in production as a Databricks App using On-Behalf-Of (OBO) authentication.
44

55
---
66

@@ -14,7 +14,10 @@ An ultra-modern, interactive REST API explorer for Databricks workspaces. Built
1414

1515
### API Coverage
1616

17-
- **15 API categories** with **45+ endpoints** across the full Databricks REST API surface:
17+
- **32 API categories** with **76 endpoints** across both Workspace and Account REST API surfaces
18+
- **Scope switcher** in the sidebar toggles between Workspace and Account API views
19+
20+
#### Workspace APIs (16 categories, 45 endpoints)
1821

1922
| Category | Endpoints |
2023
|---|---|
@@ -23,7 +26,7 @@ An ultra-modern, interactive REST API explorer for Databricks workspaces. Built
2326
| Workspace | List Objects, Get Status, Search |
2427
| DBFS | List Files, Get File Status |
2528
| SQL Warehouses | List, Get, List Saved Queries |
26-
| Unity Catalog | List Catalogs, Schemas, Tables, Volumes, Get Metastore |
29+
| Unity Catalog | List Catalogs, Schemas, Tables, Volumes, Get Table, Get Metastore |
2730
| MLflow | Search Experiments, Get Experiment, Search Runs, Registered Models |
2831
| Model Serving | List Endpoints, Get Endpoint |
2932
| Pipelines (DLT) | List, Get, List Events |
@@ -35,18 +38,40 @@ An ultra-modern, interactive REST API explorer for Databricks workspaces. Built
3538
| Repos | List Repos |
3639
| Permissions | Get Cluster, Job, and Warehouse Permissions |
3740

41+
#### Account APIs (16 categories, 31 endpoints)
42+
43+
| Category | Endpoints |
44+
|---|---|
45+
| Account Users | List Users, Get User |
46+
| Account Groups | List Groups, Get Group |
47+
| Service Principals | List Service Principals, Get Service Principal |
48+
| Workspaces | List Workspaces, Get Workspace |
49+
| Credentials | List Credential Configs, Get Credential Config |
50+
| Storage | List Storage Configs, Get Storage Config |
51+
| Networks | List Network Configs, Get Network Config |
52+
| Private Access | List Private Access Settings, Get Private Access Settings |
53+
| VPC Endpoints | List VPC Endpoints, Get VPC Endpoint |
54+
| Encryption Keys | List Encryption Key Configs, Get Encryption Key Config |
55+
| Log Delivery | List Log Delivery Configs, Get Log Delivery Config |
56+
| Budgets | List Budgets, Get Budget |
57+
| Usage Download | Download Usage (CSV) |
58+
| Account Metastores | List Metastores, Get Metastore, List Metastore Assignments |
59+
| Account Access Control | Get Rule Set |
60+
| Account Settings | Get Personal Compute Setting, List IP Access Lists |
61+
3862
### Authentication
3963

4064
- **Local mode** — authenticates via the Databricks CLI (`~/.databrickscfg`). Supports all CLI auth flows: OAuth/SSO (browser-based), PAT, Azure Service Principal, Azure Managed Identity, OAuth M2M.
4165
- **Databricks App mode** — auto-detected at runtime. Uses On-Behalf-Of (OBO) authentication: the user's access token is forwarded via the `x-forwarded-access-token` HTTP header, so every API call runs as the logged-in user. No token configuration required.
4266
- **Custom URL / PAT** — optionally specify any workspace URL and Personal Access Token directly in the UI, bypassing the CLI entirely.
67+
- **Account API auth** — account-scope endpoints automatically derive the accounts console URL from the workspace host and obtain an account-level token.
4368

4469
### Connection Management
4570

4671
- **User identity panel** — click the username chip in the top bar to open a slide-down panel showing:
4772
- Display name, username, active status
4873
- Auth type (OBO, OAuth/SSO, PAT, Azure SP, etc.)
49-
- Workspace host
74+
- Workspace host and account ID
5075
- User ID and primary email
5176
- Group memberships (up to 20, with overflow count)
5277
- **CLI profile switcher** — all profiles from `~/.databrickscfg` are listed and refreshed on every panel open. Switch profiles without restarting the app.
@@ -59,23 +84,41 @@ An ultra-modern, interactive REST API explorer for Databricks workspaces. Built
5984
- **Path parameter interpolation** — path parameters (e.g. `{cluster_id}`) are extracted from the URL and shown as dedicated fields
6085
- **JSON body editor** — POST endpoints show a pre-populated JSON textarea with the correct request schema
6186
- **Real-time search** — filter endpoints across all categories by name, path, method, or category
87+
- **Configurable timeout** — per-request timeout control with a spinner input next to the Execute button (defaults vary by endpoint, e.g. 120 s for Usage Download)
88+
- **Auto-fill account ID** — account-scope endpoints automatically populate the `account_id` field from the current CLI profile
6289

6390
### Response Viewer
6491

65-
- **Syntax-highlighted JSON** — token-level syntax coloring using Dash `html.Span` components (no `dangerousHTML` injection)
92+
- **Collapsible JSON tree** — interactive tree viewer rendered in an iframe with expand/collapse toggles, inline syntax highlighting, and compact previews for collapsed nodes
93+
- **Inline ID links** — list API responses render clickable ID chips on matching fields; clicking one fires the corresponding Get API and pre-fills the parameter form
94+
- **Side panel with chip list** — list responses show a scrollable side panel of result chips with labels, allowing quick drill-down into individual items
95+
- **Action buttons on chips** — some list endpoints expose secondary actions (e.g. "List workspace assignments" on metastores) directly on each chip
6696
- **Response metadata bar** — HTTP status code (color-coded), latency in ms, item count for list responses, full request URL
67-
- **Large response handling** — responses over 50 000 characters are truncated with a clear notice
68-
- **Side-by-side layout** — fixed 360 px parameter panel on the left, full-height response panel on the right
97+
- **CSV viewer** — endpoints that return CSV data (e.g. Usage Download) are rendered as a scrollable HTML table
98+
- **curl command** — every executed request generates a ready-to-copy `curl` command displayed below the Execute button, with a one-click copy button
99+
100+
### Pagination
101+
102+
- **Automatic pagination** — when a response contains a `next_page_token`, the app automatically fetches subsequent pages and merges them into a single result
103+
- **"Load All" button** — for APIs with `has_more`-style pagination, a "Load All" button in the side panel fetches all remaining pages in a background thread with live progress updates
104+
- **Abort controls** — both automatic pagination and Load All can be cancelled mid-flight; Load All auto-cancels when switching to a different endpoint
105+
106+
### Resizable Side Panel
107+
108+
- **Drag-to-resize** — the side panel has a left-edge resize handle; drag to adjust width between 20% and 80% of the viewport
109+
- **Persistent width** — panel width is saved to `localStorage` and restored across page reloads
69110

70111
### UI & UX
71112

72113
- **Glassmorphism dark theme** — custom CSS with CSS variables, neon accent colors, backdrop-filter blur effects
73114
- **CYBORG Bootstrap theme** via `dash-bootstrap-components`
115+
- **Scope switcher** — toggle between Workspace and Account API catalogs in the sidebar
74116
- **Mode badge** in the top bar shows whether running as `Local Mode` or `Databricks App`
75-
- **Workspace host display** in the top bar
117+
- **Workspace host display** in the top bar with a clickable link to the workspace
76118
- **Auto-incrementing build version**`version.py` bumps a counter on every app start, displayed as `v<N>` in the topbar
77119
- **Accordion sidebar** with category icons, per-category endpoint counts, and method color badges (GET/POST/PUT/DELETE/PATCH)
78120
- **Active endpoint highlighting** — selected endpoint button is highlighted in the sidebar
121+
- **Debug bar patches** — MutationObserver removes the Plotly Cloud button and injects workspace URL links into the Dash debug bar
79122

80123
---
81124

@@ -93,24 +136,24 @@ An ultra-modern, interactive REST API explorer for Databricks workspaces. Built
93136
│ │
94137
│ ┌─────────────┐ ┌──────────────┐ ┌───────────────┐ │
95138
│ │ TOPBAR │ │ SIDEBAR │ │ MAIN CONTENT │ │
96-
│ │ user chip │ │ accordion │ │ │ │
97-
│ │ host label │ │ search │ │ ┌──────────┐ │ │
98-
│ │ mode badge │ │ endpoints │ │ │ form │ │ │
99-
│ └──────┬──────┘ └──────┬───────┘ │ │ panel │ │ │
100-
│ │ │ └──────────┘ │ │
139+
│ │ user chip │ │ scope switch│ │ │ │
140+
│ │ host label │ │ accordion │ │ ┌──────────┐ │ │
141+
│ │ mode badge │ │ search │ │ │ form │ │ │
142+
│ └──────┬──────┘ │ endpoints │ │ │ panel │ │ │
143+
│ │ └──────┬───────┘ │ └──────────┘ │ │
101144
│ ┌──────▼──────┐ │ │ ┌──────────┐ │ │
102145
│ │ USER │ │ │ │ response │ │ │
103-
│ │ DROPDOWN │ │ │ │ panel │ │ │
104-
│ │ (fixed pos) │ │ │ └──────────┘ │ │
105-
│ └─────────────┘ │ └───────────────┘
106-
│ │
107-
│ ┌────────────────────────▼────────────────────────┐ │
108-
│ │ dcc.Store (conn-config) │ │
109-
│ │ {"mode": "profile"|"custom", │ │
110-
│ │ "profile": "<name>" | "host": "...", │ │
111-
│ │ "token": "..."} │ │
112-
│ └────────────────────────┬────────────────────────┘ │
113-
└───────────────────────────│─────────────────────────────
146+
│ │ DROPDOWN │ │ │ │ tree + │ │ │
147+
│ │ (fixed pos) │ │ │ │ side │ │ │
148+
│ └─────────────┘ │ │ │ panel │ │
149+
│ │ │ └──────────┘ │
150+
│ ┌────────────────────────▼─────────────────────┐ │
151+
│ │ dcc.Store (conn-config) │ │
152+
│ │ {"mode": "profile"|"custom", │ │
153+
│ │ "profile": "<name>" | "host": "...", │ │
154+
│ │ "token": "..."} │ │
155+
│ └────────────────────────┬──────────────────────┘ │
156+
└───────────────────────────│───────────────────────────┘
114157
115158
┌──────────────────▼──────────────────┐
116159
│ auth.py │
@@ -126,23 +169,24 @@ An ultra-modern, interactive REST API explorer for Databricks workspaces. Built
126169
│ │
127170
│ make_api_call() │
128171
│ └─ requests.request() │
129-
└───────────────────────────────────┘
130-
131-
┌──────────────────▼──────────────────┐
132-
Databricks REST API
133-
(workspace host)
134-
└─────────────────────────────────────┘
172+
└───────────────────────────────────┘
173+
174+
┌──────────────▼───────┐ ┌────────▼──────────────────┐
175+
│ Databricks REST API │ │ Databricks Accounts API
176+
│ (workspace host) │ │ (accounts console host)
177+
└──────────────────────┘ └───────────────────────────┘
135178
```
136179

137180
### Key Components
138181

139182
| File | Responsibility |
140183
|---|---|
141-
| `app.py` | Dash app, layout, all callbacks |
142-
| `auth.py` | Auth resolution, profile discovery, `make_api_call()` |
143-
| `api_catalog.py` | All endpoint definitions (15 categories, 45+ endpoints) |
184+
| `app.py` | Dash app, layout, all callbacks (19+ callbacks) |
185+
| `auth.py` | Auth resolution, profile discovery, account token exchange, `make_api_call()` |
186+
| `api_catalog.py` | Endpoint catalog (32 categories, 76 endpoints), chip extraction, list-to-get linking |
144187
| `version.py` | Auto-incrementing build version counter |
145188
| `assets/style.css` | Full dark glassmorphism CSS theme |
189+
| `assets/devtools_patch.js` | Debug bar patches + resizable side panel |
146190
| `app.yaml` | Databricks Apps runtime config (command + env) |
147191
| `databricks.yml` | Asset Bundle config for DABs deployment |
148192
| `resources/api_explorer.app.yml` | DABs app resource definition |
@@ -170,6 +214,12 @@ An ultra-modern, interactive REST API explorer for Databricks workspaces. Built
170214
171215
make_api_call(method, path,
172216
token, host)
217+
218+
┌────────────┴────────────┐
219+
│ scope == "workspace" │ scope == "account"
220+
▼ ▼
221+
workspace host _accounts_host() derives
222+
accounts console URL
173223
```
174224

175225
### Callback Graph
@@ -183,10 +233,16 @@ conn-mode-radio ───► toggle_conn_mode ──► profile-section / custom
183233
profile-select ────► show_profile_hint ──► profile-auth-type hint
184234
apply-conn-btn ────► apply_connection ──► conn-config store
185235
reauth-btn ────────► reauth ──► reauth-status
236+
scope-switch ──────► switch_scope ──► sidebar categories (workspace/account)
186237
endpoint-btn[ALL] ─► select_endpoint ──► selected-endpoint store
238+
selected-endpoint ─► sync_active_button ──► endpoint-btn[ALL] className
187239
selected-endpoint ─► render_endpoint_detail ──► endpoint-detail, param form
188-
execute-btn ───────► execute_api_call ──► response-container
240+
execute-btn ───────► execute_api_call ──► response-container, curl command
241+
► start_pagination ──► auto-fetch next pages
189242
search-input ──────► filter_endpoints ──► endpoint-btn[ALL] styles
243+
id-link-btn ───────► handle_id_link_click ──► selected-endpoint, response
244+
load-all-btn ──────► start_load_all ──► background thread + ticker
245+
last-req ──────────► update_curl_display ──► curl-text, curl-display
190246
```
191247

192248
---
@@ -195,7 +251,7 @@ search-input ──────► filter_endpoints ──► endpoint-btn[ALL]
195251

196252
| Layer | Technology |
197253
|---|---|
198-
| **Framework** | [Dash 2.x](https://dash.plotly.com/) (Plotly) |
254+
| **Framework** | [Dash 4.x](https://dash.plotly.com/) (Plotly) |
199255
| **UI Components** | [dash-bootstrap-components](https://dash-bootstrap-components.opensource.faculty.ai/) — CYBORG theme |
200256
| **Icons** | Bootstrap Icons (via CDN) |
201257
| **HTTP Client** | [requests](https://requests.readthedocs.io/) |
@@ -263,7 +319,7 @@ databricks apps logs databricks-api-explorer --profile guido-demo-azure
263319
DatabricksAPIexplorer/
264320
├── app.py # Main Dash app + all callbacks
265321
├── auth.py # Auth resolution + API call helper
266-
├── api_catalog.py # Endpoint catalog (15 categories)
322+
├── api_catalog.py # Endpoint catalog (32 categories, 76 endpoints)
267323
├── version.py # Auto-incrementing build version
268324
├── version.txt # Current build number (auto-updated)
269325
├── requirements.txt # Python dependencies
@@ -273,5 +329,6 @@ DatabricksAPIexplorer/
273329
│ └── api_explorer.app.yml # DABs app resource definition
274330
└── assets/
275331
├── style.css # Dark glassmorphism CSS theme
332+
├── devtools_patch.js # Debug bar patches + resizable side panel
276333
└── screenshot.png # App screenshot
277334
```

0 commit comments

Comments
 (0)