Skip to main content

Netbox

@tagur/netboxv2026.07.17.1· 9d agoMODELS
01README

Generic NetBox REST API integration model for swamp.

Works with any NetBox instance and any API endpoint. Fetches objects via the REST API and stores each as a separately addressable resource using the factory pattern — enabling CEL queries, cross-model composition, and drift detection via versioned snapshots.

Methods: sync (fetch all objects from an endpoint with pagination and filters), get (fetch a single object by ID).

Quick Start

swamp extension pull @tagur/netbox
swamp vault create local_encryption netbox
swamp vault put netbox NETBOX_TOKEN=<your-api-token>
swamp model create @tagur/netbox sites \
  --global-arg url=https://nsot.example.com \
  --global-arg 'token=${{ vault.get("netbox", "NETBOX_TOKEN") }}' \
  --global-arg endpoint=dcim/sites
swamp model method run sites sync
swamp data query 'modelName == "sites"' --select '{"name": name, "status": attributes.status}'
02Models1
@tagur/netboxv2026.07.17.1netbox.ts

Global Arguments

ArgumentTypeDescription
urlstringNetBox base URL (e.g. https://nsot.example.com)
tokenstringNetBox API token
endpointstringREST API path relative to /api/ (e.g. dcim/sites, ipam/prefixes)
filters?recordQuery parameter filters (e.g. {region: 'amer', status: 'active'})
pageSizenumberResults per page for paginated requests
caCert?stringOptional PEM CA certificate for internal/self-signed TLS endpoints
fn sync(filters?: record)
Fetch all objects from the configured endpoint and store each as a resource. Supports pagination and filters. Writes a snapshot resource with sync metadata.
ArgumentTypeDescription
filters?recordOverride or merge with global filters for this run
fn get(id: number)
Fetch a single object by ID from the configured endpoint.
ArgumentTypeDescription
idnumberNetBox object ID to fetch

Resources

item(infinite)— Individual NetBox object fetched from the API
snapshot(infinite)— Sync metadata — endpoint, filter, count, and timing
03Stats
A
100 / 100
Downloads
0
Archive size
7.1 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
04Platforms
05Labels