oodle-dashboards
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOodle Dashboards — CRUD and Organization
Oodle仪表板——增删改查与组织管理
This skill teaches the agent to manage Oodle dashboards and folders without losing panel state and without orphaning dashboards in the root folder.
本技能指导Agent管理Oodle仪表板与文件夹,确保不会丢失面板状态,也不会让仪表板孤立在根文件夹中。
Prerequisites
前提条件
bash
brew install oodle-ai/oodle/oodle
oodle configurebash
brew install oodle-ai/oodle/oodle
oodle configureor
or
export OODLE_API_KEY=<key>
export OODLE_INSTANCE=<instance>
export OODLE_DEPLOYMENT=<url>
Verify dashboards endpoint works:
```bash
oodle dashboards list -o json | jq 'length'
oodle folders list -o json | jq 'length'export OODLE_API_KEY=<key>
export OODLE_INSTANCE=<instance>
export OODLE_DEPLOYMENT=<url>
验证仪表板端点是否可用:
```bash
oodle dashboards list -o json | jq 'length'
oodle folders list -o json | jq 'length'Command Execution Order
命令执行顺序
Before running any oodle command:
- Check whether the required resource ID or name is already in context.
- If not, run the discovery command (e.g., ).
oodle dashboards list -o json - If the result is ambiguous, ask the user to confirm before proceeding.
- Run the target command with the resolved ID.
- Do not run speculative commands (e.g., do not without first
delete-ing the resource).get
在运行任何oodle命令之前:
- 检查所需的资源ID或名称是否已在上下文当中。
- 如果没有,运行发现命令(例如:)。
oodle dashboards list -o json - 如果结果不明确,在继续操作前请用户确认。
- 使用解析后的ID运行目标命令。
- 不要运行推测性命令(例如,在未先资源的情况下不要执行
get)。delete
Quick Reference
快速参考
| Task | Command |
|---|---|
| List dashboards | |
| Get dashboard | |
| Create dashboard | |
| Update dashboard | |
| Delete dashboard | |
| List folders | |
| Get folder | |
| Create folder | |
| Delete folder | |
| 任务 | 命令 |
|---|---|
| 列出仪表板 | |
| 获取仪表板 | |
| 创建仪表板 | |
| 更新仪表板 | |
| 删除仪表板 | |
| 列出文件夹 | |
| 获取文件夹 | |
| 创建文件夹 | |
| 删除文件夹 | |
Common Operations
常见操作
Listing dashboards
列出仪表板
bash
undefinedbash
undefined✅ CORRECT
✅ 正确
oodle dashboards list -o json
oodle dashboards list -o json
✅ CORRECT — filter by folder
✅ 正确 — 按文件夹筛选
oodle dashboards list -o json | jq '.[] | select(.folderId=="fld_platform")'
oodle dashboards list -o json | jq '.[] | select(.folderId=="fld_platform")'
❌ WRONG — parsing table output to find an ID
❌ 错误 — 解析表格输出以查找ID
oodle dashboards list | grep "API Overview" | awk '{print $1}'
undefinedoodle dashboards list | grep "API Overview" | awk '{print $1}'
undefinedReading a dashboard before changing it
修改前读取仪表板
bash
undefinedbash
undefined✅ CORRECT — fetch the full definition first; preserves all panels and queries
✅ 正确 — 先获取完整定义;保留所有面板和查询
oodle dashboards get dash_123 -o json > dashboard.json
$EDITOR dashboard.json
oodle dashboards update dash_123 -f dashboard.json
oodle dashboards get dash_123 -o json > dashboard.json
$EDITOR dashboard.json
oodle dashboards update dash_123 -f dashboard.json
❌ WRONG — sending an incomplete payload removes panels
❌ 错误 — 发送不完整的负载会删除面板
oodle dashboards update dash_123 -f <(echo '{"title":"new title"}')
undefinedoodle dashboards update dash_123 -f <(echo '{"title":"new title"}')
undefinedCreating a dashboard
创建仪表板
A complete dashboard JSON places the dashboard in a known folder:
json
{
"title": "API Overview",
"folderId": "fld_platform",
"description": "Latency, error rate, and throughput for the API service.",
"tags": ["service:api", "team:platform"],
"panels": [
{
"title": "Request rate",
"type": "timeseries",
"query": "sum(rate(http_requests_total{service=\"api\"}[5m]))"
},
{
"title": "Error rate",
"type": "timeseries",
"query": "sum(rate(http_requests_total{service=\"api\",status=~\"5..\"}[5m]))"
},
{
"title": "P99 latency",
"type": "timeseries",
"query": "histogram_quantile(0.99, sum by (le) (rate(http_request_duration_seconds_bucket{service=\"api\"}[5m])))"
}
]
}bash
undefined完整的仪表板JSON会将仪表板放置在指定文件夹中:
json
{
"title": "API Overview",
"folderId": "fld_platform",
"description": "Latency, error rate, and throughput for the API service.",
"tags": ["service:api", "team:platform"],
"panels": [
{
"title": "Request rate",
"type": "timeseries",
"query": "sum(rate(http_requests_total{service=\"api\"}[5m]))"
},
{
"title": "Error rate",
"type": "timeseries",
"query": "sum(rate(http_requests_total{service=\"api\",status=~\"5..\"}[5m]))"
},
{
"title": "P99 latency",
"type": "timeseries",
"query": "histogram_quantile(0.99, sum by (le) (rate(http_request_duration_seconds_bucket{service=\"api\"}[5m])))"
}
]
}bash
undefined✅ CORRECT
✅ 正确
oodle dashboards create -f dashboard.json
oodle dashboards create -f dashboard.json
❌ WRONG — no folderId, dashboard ends up in root and is hard to find
❌ 错误 — 未指定folderId,仪表板会出现在根目录中,难以查找
oodle dashboards create -f <(echo '{"title":"API Overview","panels":[...]}')
undefinedoodle dashboards create -f <(echo '{"title":"API Overview","panels":[...]}')
undefinedFolder management
文件夹管理
bash
undefinedbash
undefined✅ CORRECT — create folder first, capture id, then create dashboards in it
✅ 正确 — 先创建文件夹,获取ID,再在其中创建仪表板
FOLDER_ID=$(oodle folders create -f <(echo '{"title":"Platform"}') -o json | jq -r '.id')
jq --arg fid "$FOLDER_ID" '.folderId=$fid' dashboard.json > dashboard.with-folder.json
oodle dashboards create -f dashboard.with-folder.json
FOLDER_ID=$(oodle folders create -f <(echo '{"title":"Platform"}') -o json | jq -r '.id')
jq --arg fid "$FOLDER_ID" '.folderId=$fid' dashboard.json > dashboard.with-folder.json
oodle dashboards create -f dashboard.with-folder.json
❌ WRONG — creating dashboards before folders, then trying to move them later
❌ 错误 — 先创建仪表板再创建文件夹,之后尝试移动它们
oodle dashboards create -f dashboard.json
oodle folders create -f folder.json
undefinedoodle dashboards create -f dashboard.json
oodle folders create -f folder.json
undefinedSafe deletion — two-phase
安全删除——两阶段法
Dashboards are linked from runbooks, slack messages, and bookmarks. Delete in two phases.
bash
undefined仪表板会被运行手册、Slack消息和书签链接引用。删除需分两个阶段进行。
bash
undefined✅ CORRECT — phase 1: rename so users see it's about to be removed
✅ 正确 — 第一阶段:重命名,让用户知道该仪表板即将被移除
oodle dashboards get dash_123 -o json > dash.json
jq '.title = "[MARKED FOR DELETION] " + .title' dash.json > dash.deletion.json
oodle dashboards update dash_123 -f dash.deletion.json
oodle dashboards get dash_123 -o json > dash.json
jq '.title = "[标记为删除] " + .title' dash.json > dash.deletion.json
oodle dashboards update dash_123 -f dash.deletion.json
wait at least 7 days, then:
至少等待7天,然后执行:
oodle dashboards delete dash_123 --force
oodle dashboards delete dash_123 --force
❌ WRONG — immediate hard delete, breaks every existing link
❌ 错误 — 立即硬删除,破坏所有现有链接
oodle dashboards delete dash_123 --force
undefinedoodle dashboards delete dash_123 --force
undefinedBest Practices
最佳实践
Always get
before update
to preserve panel configuration
getupdate始终在update
前执行get
以保留面板配置
updategetUpdate is a full-document replace. Missing panels in the payload will be removed.
bash
undefined更新操作是全文档替换。负载中缺失的面板会被删除。
bash
undefined✅ CORRECT
✅ 正确
oodle dashboards get dash_123 -o json > dash.json
jq '.panels[0].title = "Request rate (per second)"' dash.json > dash.new.json
oodle dashboards update dash_123 -f dash.new.json
oodle dashboards get dash_123 -o json > dash.json
jq '.panels[0].title = "Request rate (per second)"' dash.json > dash.new.json
oodle dashboards update dash_123 -f dash.new.json
❌ WRONG — sends a single-field payload; all panels disappear
❌ 错误 — 发送单字段负载;所有面板都会消失
oodle dashboards update dash_123 -f <(echo '{"description":"updated"}')
undefinedoodle dashboards update dash_123 -f <(echo '{"description":"updated"}')
undefinedAlways set folderId
when creating a dashboard
folderId创建仪表板时始终设置folderId
folderIdDashboards in the root folder are hard for teams to discover.
bash
undefined根文件夹中的仪表板对团队来说难以发现。
bash
undefined✅ CORRECT
✅ 正确
"folderId": "fld_platform"
"folderId": "fld_platform"
❌ WRONG — omitting folderId means root
❌ 错误 — 省略folderId意味着根目录
"folderId": null
undefined"folderId": null
undefinedUse the two-phase rename → wait → delete pattern for shared dashboards
共享仪表板使用重命名→等待→删除的两阶段模式
Hard-deleting a dashboard breaks every external link (runbooks, slack reactions, bookmarks).
bash
undefined硬删除仪表板会破坏所有外部链接(运行手册、Slack消息、书签)。
bash
undefined✅ CORRECT — phase 1: rename
✅ 正确 — 第一阶段:重命名
oodle dashboards update dash_123 -f dash.deletion.json
oodle dashboards update dash_123 -f dash.deletion.json
wait, confirm no traffic, then phase 2: delete
等待,确认无访问量后,执行第二阶段:删除
oodle dashboards delete dash_123 --force
oodle dashboards delete dash_123 --force
❌ WRONG — same-day delete on a shared dashboard
❌ 错误 — 当天删除共享仪表板
oodle dashboards delete dash_123 --force
undefinedoodle dashboards delete dash_123 --force
undefinedTag dashboards with service
and team
labels
serviceteam使用service
和team
标签标记仪表板
serviceteamTags make dashboards searchable and let other tools (e.g. service catalogs) link to them.
bash
undefined标签让仪表板可被搜索,并允许其他工具(如服务目录)链接到它们。
bash
undefined✅ CORRECT
✅ 正确
"tags": ["service:api", "team:platform", "env:prod"]
"tags": ["service:api", "team:platform", "env:prod"]
❌ WRONG
❌ 错误
"tags": []
undefined"tags": []
undefinedFailure Handling
故障处理
| Error | Cause | Fix |
|---|---|---|
| 401 Unauthorized | Invalid or missing API key | Run |
| 404 Not Found | Dashboard or folder ID does not exist | Verify with |
| connection refused | Wrong | Check |
| | List folders with |
| Panels disappeared after update | | Re-create from the last |
| Cannot delete folder | Folder still contains dashboards | Move or delete the dashboards first; `oodle dashboards list -o json |
| 429 Too Many Requests | Bulk dashboard sync | Add |
| 错误 | 原因 | 修复方法 |
|---|---|---|
| 401 Unauthorized | API密钥无效或缺失 | 运行 |
| 404 Not Found | 仪表板或文件夹ID不存在 | 使用 |
| connection refused | | 检查 |
| | 使用 |
| Panels disappeared after update | 使用部分负载调用 | 从最近的 |
| Cannot delete folder | 文件夹中仍包含仪表板 | 先移动或删除仪表板;执行`oodle dashboards list -o json |
| 429 Too Many Requests | 批量仪表板同步 | 添加 |