mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-23 07:56:44 -06:00
Misc cleanup
This commit is contained in:
parent
9902e2c36d
commit
2a8cc60aa4
@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
[Data sources](../../models/core/datasource.md) 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.
|
[Data sources](../../models/core/datasource.md) 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.
|
||||||
|
|
||||||
```python
|
```python title="data_backends.py"
|
||||||
# data_backends.py
|
|
||||||
from netbox.data_backends import DataBackend
|
from netbox.data_backends import DataBackend
|
||||||
|
|
||||||
class MyDataBackend(DataBackend):
|
class MyDataBackend(DataBackend):
|
||||||
@ -14,7 +13,7 @@ class MyDataBackend(DataBackend):
|
|||||||
|
|
||||||
To register one or more data backends with NetBox, define a list named `backends` at the end of this file:
|
To register one or more data backends with NetBox, define a list named `backends` at the end of this file:
|
||||||
|
|
||||||
```python
|
```python title="data_backends.py"
|
||||||
backends = [MyDataBackend]
|
backends = [MyDataBackend]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -28,10 +28,10 @@ class DataSourceTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
|||||||
}
|
}
|
||||||
|
|
||||||
cls.csv_data = (
|
cls.csv_data = (
|
||||||
f"name,type,source_url,enabled",
|
"name,type,source_url,enabled",
|
||||||
f"Data Source 4,{'local'},file:///var/tmp/source4/,true",
|
"Data Source 4,local,file:///var/tmp/source4/,true",
|
||||||
f"Data Source 5,{'local'},file:///var/tmp/source4/,true",
|
"Data Source 5,local,file:///var/tmp/source4/,true",
|
||||||
f"Data Source 6,git,http:///exmaple/com/foo/bar/,false",
|
"Data Source 6,git,http:///exmaple/com/foo/bar/,false",
|
||||||
)
|
)
|
||||||
|
|
||||||
cls.csv_update_data = (
|
cls.csv_update_data = (
|
||||||
|
Loading…
Reference in New Issue
Block a user