47fac22230
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
64 lines
2.0 KiB
Markdown
64 lines
2.0 KiB
Markdown
---
|
|
name: metabase_create_dashboard
|
|
kind: function
|
|
lang: go
|
|
domain: infra
|
|
version: "1.0.0"
|
|
purity: impure
|
|
signature: "func MetabaseCreateDashboard(client MetabaseClient, name, description string, collectionID int) (map[string]any, error)"
|
|
description: "Crea un nuevo dashboard vacio en Metabase. Para agregar cards usar MetabaseUpdateDashboard con el campo dashcards. Endpoint: POST /api/dashboard."
|
|
tags: [metabase, dashboard, create, api, pendiente-usar]
|
|
uses_functions: []
|
|
uses_types: [MetabaseClient_go_infra]
|
|
returns: []
|
|
returns_optional: false
|
|
error_type: "error_go_core"
|
|
imports: [fmt]
|
|
params:
|
|
- name: client
|
|
desc: "cliente MetabaseClient autenticado"
|
|
- name: name
|
|
desc: "nombre del dashboard"
|
|
- name: description
|
|
desc: "descripcion del dashboard o vacio"
|
|
- name: collectionID
|
|
desc: "ID de la coleccion destino (0 = root collection)"
|
|
output: "mapa con los detalles del dashboard creado incluyendo su ID"
|
|
tested: false
|
|
tests: []
|
|
test_file_path: ""
|
|
file_path: "functions/infra/metabase_create_dashboard.go"
|
|
---
|
|
|
|
## Ejemplo
|
|
|
|
```go
|
|
// Crear dashboard vacio
|
|
dashboard, err := MetabaseCreateDashboard(client, "Sales Overview", "KPIs de ventas", 5)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
dashboardID := int(dashboard["id"].(float64))
|
|
|
|
// Luego agregar cards con MetabaseUpdateDashboard
|
|
MetabaseUpdateDashboard(client, dashboardID, map[string]any{
|
|
"dashcards": []map[string]any{
|
|
{"id": -1, "card_id": 42, "size_x": 6, "size_y": 4, "col": 0, "row": 0},
|
|
},
|
|
})
|
|
```
|
|
|
|
## Notas
|
|
|
|
### Parametros para un LLM
|
|
|
|
| Parametro | Tipo | Requerido | Descripcion |
|
|
|-----------|------|-----------|-------------|
|
|
| client | MetabaseClient | si | Cliente autenticado |
|
|
| name | string | si | Nombre del dashboard |
|
|
| description | string | no | Descripcion. Vacio = sin descripcion |
|
|
| collectionID | int | no | Coleccion destino. 0 = root |
|
|
|
|
El dashboard se crea vacio. Para agregar cards, usar MetabaseUpdateDashboard con el array dashcards.
|
|
Retorna el objeto dashboard creado.
|