Skip to content

Plugin endpoints collapse into one resource per plugin (tag 'plugins'): ops overwrite each other #202

Closed

Description

@thomaschristory

NetBox tags every plugin endpoint with the single tag plugins. _resource_from_path (nsc/builder/build.py) anchors on the tag's path segment (plugins), so the "resource" becomes the plugin name (/api/plugins/<plugin>/<resource>/… → resource <plugin>). All of a plugin's endpoints then land in one resource, and _attach lets each CRUD slot be overwritten by whichever path comes last.

Seen on NetBox 4.7.3 + netbox-branching 1.2.2 (the e2e-branching stack). nsc plugins branching --help:

list      Get a list of change diff objects.   ← /changes/
get       Get a change diff object.            ← /changes/{id}/
create    Post a list of branch objects.       ← /branches/
update / replace / delete                      ← /branches/{id}/
branches-merge-create, branches-sync-create, …  (custom actions)
  • branches list/get are unreachable, because changes overwrote them.
  • branch-events and branchable-models don't appear at all.
  • list and create under the same command act on different objects. With --apply, that's a correctness hazard.

Expected: nsc plugins <plugin> <resource> <verb> (or nsc <plugin> <resource> …), one resource per /api/plugins/<plugin>/<resource>/ path. The resource should be derived from the path, not anchored on the generic plugins tag.

Docs: docs/guides/working-with-plugins.md documents nsc my_plugin widgets list (assuming a per-plugin tag), which doesn't match what real NetBox schemas produce today.

This affects every plugin, not only Branching. Found while working on #180. Its optional e2e assertion against the real changes endpoint is blocked on this, because the endpoint currently surfaces as nsc plugins branching list.

Activity

  1. thomaschristory commented on Oct 24, 2026

    @thomaschristory
    OwnerAuthor

    Claiming: derive plugin tag/resource from /api/plugins/// paths, bump MODEL_FORMAT_VERSION so caches rebuild. Branch: fix/plugin-resource-collapse.

  2. thomaschristory commented on Oct 24, 2026

    @thomaschristory
    OwnerAuthor

    PR opened: #204

  3. thomaschristory commented on Oct 24, 2026

    @thomaschristory
    OwnerAuthor

    Fixed by #204 (merged). Ships in the next release (v1.9.0, with #169).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions