data-backends.md 1.3 KB

Data Backends

Data sources can be defined to reference data which exists on systems of record outside NetBox, such as a git repository or Amazon S3 bucket. Plugins can register their own backend classes to introduce support for additional resource types. This is done by subclassing NetBox's DataBackend class. Administrators can restrict which backends are available using the ALLOWED_DATA_BACKENDS configuration parameter, which references backends by their name.

from netbox.data_backends import DataBackend

class MyDataBackend(DataBackend):
    name = 'mybackend'
    label = 'My Backend'
    ...

To register one or more data backends with NetBox, define a list named backends at the end of this file:

backends = [MyDataBackend]

!!! tip

The path to the list of data backends can be modified by setting `data_backends` in the PluginConfig instance.

A backend can optionally implement get_revision() to report which revision of the remote data it fetched (for example, a commit hash). NetBox records this on the data source after each synchronization.

::: netbox.data_backends.DataBackend