Adding bundled schemas¶
The bundled schemas at nsc/schemas/bundled/ are the offline fallback when no
live schema is reachable and no per-profile cache exists. They are committed to
the repo and shipped inside the wheel.
Layout¶
nsc/schemas/bundled/
├── manifest.yaml
├── netbox-4.6.0-beta2.json.gz
└── netbox-<other-version>.json.gz
manifest.yaml:
Adding a new version¶
- Spin up
netboxcommunity/netbox:<version>locally (Docker compose snippet intests/e2e/docker-compose.yml). - Wait for it to be healthy.
- Fetch the schema:
curl -sS http://localhost:8080/api/schema/?format=json | gzip -9 \
> nsc/schemas/bundled/netbox-<version>.json.gz
- Add an entry to
manifest.yaml. Keep entries in chronological order (newest last) —scripts/gen_docs.pyuses the last entry as the canonical source for the auto-generated CLI reference. - Run
just testandpython scripts/gen_docs.pyto regenerate the reference pages with the new schema. - Commit both the new file and the updated
manifest.yamltogether.
When to add a new version¶
- A new NetBox release lands (major or minor).
- Plugin authors report a schema-shape change
nscdoesn't yet handle. - The current bundled version is the only entry and it's getting stale (>6 months).
Bundled schemas are large (~2MB compressed) — keep the list short. Drop old versions when they're no longer cited by any active deployment.
Why bundle schemas at all?¶
nsc always tries the live schema first. Bundling exists for two narrow cases:
- First-run offline. A new install with no cache, no network — the user gets a usable command tree from the bundled schema.
- CI without a NetBox container.
nsc commands --schema bundled-default --output jsonproduces a deterministic command-model for tests that don't need a live NetBox.