Skip to content

API

netbox-pbs exposes a standard NetBox plugin REST API under /api/plugins/pbs/. All endpoints are registered with NetBoxRouter and support the standard NetBox query parameters (limit, offset, q, format, brief).

Endpoints

Endpoint Model Filterset fields
GET /api/plugins/pbs/settings/ PBSPluginSettings id, branching_enabled, branch_on_conflict
GET /api/plugins/pbs/servers/ PBSServer id, name, host, port, status, verify_ssl, version
GET /api/plugins/pbs/datastores/ PBSDatastore id, server, name, path, gc_status
GET /api/plugins/pbs/snapshots/ PBSSnapshot id, server, datastore_name, backup_type, backup_id, owner, protected, verification_state
GET /api/plugins/pbs/jobs/ PBSJob id, server, job_type, job_id, store, disable, last_run_state

All five endpoints are read-write at the DRF level (the standard NetBoxModelViewSet). In practice netbox-pbs is a read-only inventory plugin — objects are created and updated through PBSSyncJob, not through direct API writes.

Example requests

# List all PBS servers
curl -H "Authorization: Token <token>" \
  https://netbox.example.com/api/plugins/pbs/servers/

# Filter snapshots by backup type
curl -H "Authorization: Token <token>" \
  "https://netbox.example.com/api/plugins/pbs/snapshots/?backup_type=vm"

# List datastores for a specific server
curl -H "Authorization: Token <token>" \
  "https://netbox.example.com/api/plugins/pbs/datastores/?server=1"

# Check job records with errors
curl -H "Authorization: Token <token>" \
  "https://netbox.example.com/api/plugins/pbs/jobs/?last_run_state=error"

Authentication

All API endpoints require standard NetBox token authentication (Authorization: Token <token>). Users need the standard NetBox object-level permissions for netbox_pbs models (e.g. netbox_pbs.view_pbsserver).