FabrikFabrik
FabrikAPI Reference

MIM

Class hierarchy lookups, universal search, favorites, and the MIM registry install flow — endpoints under /api/mim/ and /api/mim-registry/.

Two distinct surfaces:

  • /api/mim/ — read Neo4j. Classes, properties, containment hierarchy, search. Plus small Postgres-backed ViewSets for user favorites and table preferences.
  • /api/mim-registry/ — manage the MIM versions Fabrik has installed. Install, upload, check for updates.

/api/mim/ — Model Explorer

Most of these are function-based views returning bare JSON, not paginated ViewSets. Read-only, cached aggressively.

GET /api/mim/search/?q=<term>

Universal search — classes, properties, descriptions, ACI packages. Returns the top-N ranked matches with type hints.

Response 200:

{
  "query": "vlan",
  "results": [
    { "type": "class", "name": "fvnsVlanInstP", "display_name": "VLAN Pool", "score": 0.98 },
    { "type": "property", "class": "fvBD", "name": "mac", "score": 0.72 },
    { "type": "package", "name": "fvns", "description": "VLAN namespace", "score": 0.65 }
  ]
}

GET /api/mim/explorer/tree/

The full class hierarchy as a lazy-loading tree. Returns the root level; each node has has_children to let the UI decide when to expand.

GET /api/mim/explorer/class/<class_name>/

Full class detail — properties, containment children, DN format, context root, category.

Response 200:

{
  "name": "fvTenant",
  "display_name": "Tenant",
  "package": "fv",
  "description": "A tenant is a logical container for policies.",
  "dn_format": "uni/tn-{name}",
  "context_root": true,
  "category": "tenant",
  "properties": [
    { "name": "name", "type": "string", "required": true, "naming": true },
    { "name": "descr", "type": "string", "required": false }
  ]
}

GET /api/mim/explorer/relationships/<class_name>/

Relational view — what contains this class, what it contains, and what associates with it. Drives the Class Browser relationship graph.

GET /api/mim/explorer/class/<class_name>/insights/

AI-enriched notes about the class (when available): common uses, related classes, pitfalls. Returns a flat payload — not streamed.

GET /api/mim/explorer/ancestors/<class_name>/

Breadcrumb trail from context root to this class. Used by the explorer to show "where am I" context.

GET /api/mim/stats/

Graph statistics: total classes, total properties, packages, relationship count, last sync timestamp.

Classes (legacy, still supported)

The older endpoints under /api/mim/classes/ remain for backward compatibility — new UIs should prefer explorer/ paths above.

RoutePurpose
GET /api/mim/classes/Flat list of classes. Supports ?package=<name> and pagination.
GET /api/mim/classes/search/Simple substring search. Superseded by /search/.
GET /api/mim/classes/search/enhanced/Score-ranked search with package grouping.
GET /api/mim/classes/roots/Context root classes only.
GET /api/mim/classes/suggest/AI-powered class suggestion from free text, validated against Neo4j.
GET /api/mim/classes/<name>/Class detail (same as explorer/class/).
GET /api/mim/classes/<name>/hierarchy/Full containment subtree rooted at this class.
GET /api/mim/classes/<name>/related/Related classes via RN_MAPPING.
GET /api/mim/classes/<parent>/children/search/Search children of a parent class by name.

Packages

GET /api/mim/packages/

Flat list of all ACI packages seen in the graph.

GET /api/mim/packages/top/

Top-N packages by class count — useful for navigation.

Favorites (Postgres-backed)

GET /api/mim/favorites/

User's favorited classes. Returns bare array of class names.

POST /api/mim/favorites/

Add a favorite. Body: { "class_name": "fvTenant" }.

DELETE /api/mim/favorites/<id>/

Remove a favorite.

Table templates and preferences

/api/mim/table-templates/

Reusable column sets for displaying query results. Admin-curated; users can create personal ones.

/api/mim/table-preferences/

Per-user, per-class column visibility and ordering. The Class Browser and query result tables consult these on render.

/api/mim-registry/ — MIM registry

Two surfaces under the same prefix:

  • Status — reports what's currently loaded plus any in-flight import.
  • DevNet streaming — starts and monitors an import that pulls the MIM directly from pubhub.devnetcloud.com into Neo4j. (The earlier GitHub-bundle and manual-upload routes were removed; everything goes through DevNet now.)

Every write under /api/mim-registry/ requires admin privileges. Importing a MIM version wipes and rewrites the Neo4j graph — it's a platform-level operation.

GET /api/mim-registry/status/

What's loaded plus any in-flight import.

Response 200:

{
  "loaded_version": "611",
  "active": {
    "apic_version": "611",
    "class_count": 17647,
    "property_count": 0,
    "rel_count": 8973809,
    "imported_at": "2026-04-25T22:51:04Z",
    "imported_by_username": "admin",
    "is_active": true
  },
  "active_import": {
    "task_id": "abc-…",
    "devnet_run_id": "abc-…",
    "apic_version": "611",
    "source": "devnet",
    "phase": "downloading",
    "state": "running"
  },
  "history": [ /* MIMVersion[] */ ]
}

active_import is null when nothing is running. While a run is active, phase cycles through initdownloadingimportingfinalizingdone.

GET /api/mim-registry/devnet/versions/

List supported pubhub source versions (seeded by data migration).

Response 200:

[
  {
    "version_key": "611",
    "label": "6.1.X",
    "fallback_chain": ["611", "601", "521"],
    "is_supported": true,
    "display_order": 30,
    "class_count_seed": 17648,
    "notes": "APIC 6.1.x"
  },
  { "version_key": "601", "label": "6.0.X",  },
  { "version_key": "521", "label": "5.2.X",  }
]

POST /api/mim-registry/devnet/install/

Start a streaming DevNet import.

Request:

{ "version_key": "611", "concurrency": 10 }

concurrency is optional (1–10, default from MIMRegistryConfig). Returns 409 Conflict if another import is already running.

Response 202:

{
  "run_id": "5daffb3b-…",
  "task_id": "5daffb3b-…",
  "version_key": "611",
  "total_classes": 17648,
  "concurrency": 10
}

run_id and task_id are equal (the run UUID is also the Celery task id). Subscribe to ws://…/ws/mim-import/<run_id>/ for progress events.

GET /api/mim-registry/devnet/runs/<run_id>/

Run state plus the most recent failed jobs (up to 25). Useful for the progress card and post-mortem diagnostics.

Response 200:

{
  "run": {
    "id": "5daffb3b-…",
    "version_key": "611",
    "state": "running",
    "phase": "downloading",
    "total_classes": 17648,
    "completed_count": 8530,
    "fallback_count": 0,
    "not_found_count": 0,
    "failed_count": 1,
    "concurrency": 10,
    "started_at": "2026-04-25T22:51:04Z",
    "finished_at": null,
    "core_ready_at": null,
    "error_summary": "",
    "cancel_requested": false
  },
  "failed_recent": [
    {
      "id": 12345,
      "class_pkg": "hcloud",
      "class_name": "hcloudRtHubCtxToVNet",
      "qualified_name": "hcloud:RtHubCtxToVNet",
      "state": "failed",
      "source_version": "",
      "attempted_versions": ["601"],
      "http_status_last": 500,
      "last_error": "exhausted retries on 500",
      "retry_count": 3,
      "updated_at": "2026-04-25T23:10:11Z"
    }
  ]
}

POST /api/mim-registry/devnet/runs/<run_id>/cancel/

Set cancel_requested=true. The Celery task finishes the current chunk (so Neo4j is never left in a torn state) and stops; pending jobs revert to pending so a later resume can pick them up.

Response 200:

{ "cancelled": true }

POST /api/mim-registry/devnet/runs/<run_id>/resume/

Re-dispatch a cancelled or failed run. Failed and in-progress jobs are flipped back to pending; jobs already done or not_found are left alone. Returns 409 if the run is already active.

Response 202:

{ "run_id": "5daffb3b-…", "task_id": "5daffb3b-…" }