Netbox
@tagur/netboxv2026.07.17.1
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}'02Models
@tagur/netboxv2026.07.17.1netbox.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| url | string | NetBox base URL (e.g. https://nsot.example.com) |
| token | string | NetBox API token |
| endpoint | string | REST API path relative to /api/ (e.g. dcim/sites, ipam/prefixes) |
| filters? | record | Query parameter filters (e.g. {region: 'amer', status: 'active'}) |
| pageSize | number | Results per page for paginated requests |
| caCert? | string | Optional 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.
| Argument | Type | Description |
|---|---|---|
| filters? | record | Override or merge with global filters for this run |
fn get(id: number)
Fetch a single object by ID from the configured endpoint.
| Argument | Type | Description |
|---|---|---|
| id | number | NetBox 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