Skip to content

Models

netbox-pbs registers five NetBoxModel subclasses. All appear in the NetBox UI with list, detail, edit, and bulk-delete views and are exposed by the plugin REST API at /api/plugins/pbs/.


PBSPluginSettings

Singleton runtime-configuration object (singleton_key="default"). Access via PBSPluginSettings.get_solo().

Field Type Default Notes
proxbox_api_url URL Fallback when netbox-proxbox is not installed
proxbox_api_key string Bearer / API key for the fallback URL
branching_enabled bool False Wrap sync in a NetBox branch (requires netbox-branching)
branch_name_prefix string "pbs-sync" Prefix for auto-generated branch names
branch_on_conflict choice "fail" fail or acknowledge

REST endpoint: GET /api/plugins/pbs/settings/


PBSServer

A Proxmox Backup Server endpoint discovered through proxbox-api.

Field Type Notes
name string (unique) Human-readable label
host string Hostname or IP address
port integer Default 8007
token_id string PBS API token identifier
fingerprint string TLS fingerprint for the server
verify_ssl bool Default True
status choice unknown (gray) · reachable (green) · unreachable (red)
version string PBS version string
last_seen_at datetime Last successful contact

REST endpoint: GET /api/plugins/pbs/servers/

Filterset fields: id, name, host, port, status, verify_ssl, version


PBSDatastore

Datastore inventory for a PBS server.

Field Type Notes
server FK → PBSServer Cascade delete
name string Datastore name on the PBS host
path string Filesystem path on the PBS host
used_bytes integer Used storage in bytes
total_bytes integer Total capacity in bytes
avail_bytes integer Available storage in bytes
gc_status choice ok · running · error · pending · unknown
comment string Optional comment
last_seen_at datetime Last sync timestamp

Unique constraint: (server, name)

REST endpoint: GET /api/plugins/pbs/datastores/

Filterset fields: id, server, name, path, gc_status


PBSSnapshot

Snapshot inventory per datastore. One row per PBS backup snapshot.

Field Type Notes
server FK → PBSServer Cascade delete
datastore_name string Datastore name the snapshot belongs to
backup_type choice vm (blue) · ct (purple) · host (green) · unknown (gray)
backup_id string PBS backup ID (e.g. VMID)
backup_time datetime Snapshot creation time
size_bytes integer Snapshot size in bytes
owner string PBS token / user that owns the snapshot
protected bool Default False
comment string Optional comment
verification_state string Last verification result from PBS
last_seen_at datetime Last sync timestamp

Unique constraint: (server, datastore_name, backup_type, backup_id, backup_time)

REST endpoint: GET /api/plugins/pbs/snapshots/

Filterset fields: id, server, datastore_name, backup_type, backup_id, owner, protected, verification_state


PBSJob

PBS backup / verify / prune / GC / sync / tape job records.

Field Type Notes
server FK → PBSServer Cascade delete
job_type choice verify · prune · gc · sync · tape · unknown
job_id string Job identifier on the PBS host
store string Target datastore name
schedule string PBS schedule expression
comment string Optional comment
disable bool Default FalseTrue if the job is disabled on PBS
last_run_state choice ok · error · warning · running · unknown
last_run_endtime datetime When the last run finished
next_run datetime Scheduled next run
last_seen_at datetime Last sync timestamp

Unique constraint: (server, job_type, job_id)

REST endpoint: GET /api/plugins/pbs/jobs/

Filterset fields: id, server, job_type, job_id, store, disable, last_run_state