netbox-documents


Namenetbox-documents JSON
Version 0.6.3 PyPI version JSON
download
home_pagehttps://github.com/jasonyates/netbox-documents
SummaryManage site, location, circuit and device diagrams and documents in Netbox
upload_time2023-11-21 08:12:04
maintainer
docs_urlNone
authorJason Yates
requires_python
license
keywords netbox netbox-plugin plugin
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Netbox Documents Plugin

A plugin designed to faciliate the storage of site, circuit, device type and device specific documents within [NetBox](https://github.com/netbox-community/netbox)

## Features

* Store documents against the following NetBox models:
   - Circuits
   - Devices
   - Device Types
   - Sites
   - Locations

* Upload documents to your NetBox media/ folder or other Django supported storage method e.g. S3
* Supports a wide array of common file types (bmp, gif, jpeg, jpg, png, pdf, txt, doc, docx, xls, xlsx, xlsm)
* Store links to external URL's to save duplication of remote documents


## Compatibility

| NetBox Version | Plugin Version |
|----------------|----------------|
|     3.6+       |      0.6.3     |
|     3.5.x      |      0.6.0     |
| 3.3.x - 3.4.x  |      0.5.1     |


## Installation

A working installation of Netbox 3.3+ is required. 3.6+ is recommended. **NOTE: Netbox 3.5 introduced breaking changes for plugins, please use the correct plugin version for your netbox install.**

#### Package Installation from PyPi

Activate your virtual env and install via pip:

```
$ source /opt/netbox/venv/bin/activate
(venv) $ pip install netbox-documents
```

To ensure the Netbox Documents plugin is automatically re-installed during future upgrades, add the package to your `local_requirements.txt` :

```no-highlight
# echo netbox-documents >> local_requirements.txt
```

#### Enable the Plugin

In the Netbox `configuration.py` configuration file add or update the PLUGINS parameter, adding `netbox_documents`:

```python
PLUGINS = [
    'netbox_documents',
]
```

(Optional) Add or update a PLUGINS_CONFIG parameter in `configuration.py` to configure plugin settings. Options shown below are the configured defaults:

```python
PLUGINS_CONFIG = {
     'netbox_documents': {
         # Enable the management of site specific documents (True/False)
         'enable_site_documents': True,
         # Enable the management of location specific documents (True/False)
         'enable_location_documents': True,
         # Enable the management of circuit specific documents (True/False)
         'enable_circuit_documents': True,
         # Enable the management of device specific documents (True/False)
         'enable_device_documents': True,
         # Enable the management of device type specific documents (True/False)
         'enable_device_type_documents': True,
         # Enable the global menu options (True/False)   
         'enable_navigation_menu': True,
         # Location to inject the document widget in the site view (left/right)
         'site_documents_location': 'left',
         # Location to inject the document widget in the location view (left/right)
         'location_documents_location': 'left',
         # Location to inject the document widget in the device view (left/right
         'device_documents_location': 'left',
         # Location to inject the document type widget in the device type view (left/right
         'device_type_documents_location': 'left',
         # Location to inject the document widget in the device view (left/right
         'circuit_documents_location': 'left'
     }
}

```

(Optional) Add or replace the built-in Document Type choices via Netbox's [`FIELD_CHOICES`](https://netbox.readthedocs.io/en/feature/configuration/optional-settings/#field_choices) configuration parameter:

The colours that can be used are listed in the Netbox CSS netbox-light.css:

(https://github.com/netbox-community/netbox/blob/develop/netbox/project-static/dist/netbox-light.css)

The bg- must not be specified in the configuration.
Here are a few examples from the CSS:

* bg-indigo = #6610f2 --> 'indigo'
* bg-blue = #0d6efd --> 'blue'
* bg-purple = #6f42c1 --> 'purple'
* bg-pink = #d63384 --> 'pink'
* bg-red = #dc3545 --> 'red'
* bg-orange = #fd7e14 --> 'orange'
* bg-yellow = #ffc107 --> 'yellow'
* bg-green = #198754 --> 'green'
* bg-teal = #20c997 --> 'teal'
* bg-cyan = #0dcaf0 --> 'cyan'
* bg-gray = #adb5bd --> 'gray'
* bg-black = #000 --> 'black'
* bg-white --> 'white'

```python
FIELD_CHOICES = {
    'netbox_documents.DocTypeChoices.site+': (
        ('mydocument', 'My Custom Site Document Type', 'green'),
    ),
    'netbox_documents.DocTypeChoices.location+': (
        ('mydocument', 'My Custom Location Document Type', 'green'),
    ),
    'netbox_documents.DocTypeChoices.device+': (
        ('mydocument', 'My Custom Device Document Type', 'green'),
    ),
    'netbox_documents.DocTypeChoices.devicetype+': (
        ('mydocument', 'My Custom Device Type Document Type', 'green'),
    ),
    'netbox_documents.DocTypeChoices.circuit+': (
        ('mydocument', 'My Custom Circuit Document Type', 'green'),
    )
}
```

#### Apply Database Migrations

Apply database migrations with Netbox `manage.py`:

```
(venv) $ python manage.py migrate
```

#### Restart Netbox

Restart the Netbox service to apply changes:

```
sudo systemctl restart netbox
```

#### Re-index Netbox search index (Upgrade to 3.4 only)

If you are upgrading from Netbox 3.3 or above to Netbox 3.4, any previously inserted documents may not show up in the new search feature. To resolve this, re-index the plugin:

```
(venv) $ python manage.py reindex netbox_documents
```

### Screenshots

![Site Document View](docs/img/siteview.png)
![Add Circuit Document](docs/img/addcircuit.png)
![Site Document List](docs/img/sitedocuments.png)
![Device Document List](docs/img/devicedocuments.png)
![Device Type Document](docs/img/devicetypedocuments.png)
![Device Type Document List](docs/img/devicetypedocumentsList.png)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jasonyates/netbox-documents",
    "name": "netbox-documents",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "netbox,netbox-plugin,plugin",
    "author": "Jason Yates",
    "author_email": "me@jasonyates.co.uk",
    "download_url": "https://files.pythonhosted.org/packages/f6/0b/dac066b0eef53684e9e9182055df5c0aaea93923c4ac31091f792dc2698e/netbox-documents-0.6.3.tar.gz",
    "platform": null,
    "description": "# Netbox Documents Plugin\n\nA plugin designed to faciliate the storage of site, circuit, device type and device specific documents within [NetBox](https://github.com/netbox-community/netbox)\n\n## Features\n\n* Store documents against the following NetBox models:\n   - Circuits\n   - Devices\n   - Device Types\n   - Sites\n   - Locations\n\n* Upload documents to your NetBox media/ folder or other Django supported storage method e.g. S3\n* Supports a wide array of common file types (bmp, gif, jpeg, jpg, png, pdf, txt, doc, docx, xls, xlsx, xlsm)\n* Store links to external URL's to save duplication of remote documents\n\n\n## Compatibility\n\n| NetBox Version | Plugin Version |\n|----------------|----------------|\n|     3.6+       |      0.6.3     |\n|     3.5.x      |      0.6.0     |\n| 3.3.x - 3.4.x  |      0.5.1     |\n\n\n## Installation\n\nA working installation of Netbox 3.3+ is required. 3.6+ is recommended. **NOTE: Netbox 3.5 introduced breaking changes for plugins, please use the correct plugin version for your netbox install.**\n\n#### Package Installation from PyPi\n\nActivate your virtual env and install via pip:\n\n```\n$ source /opt/netbox/venv/bin/activate\n(venv) $ pip install netbox-documents\n```\n\nTo ensure the Netbox Documents plugin is automatically re-installed during future upgrades, add the package to your `local_requirements.txt` :\n\n```no-highlight\n# echo netbox-documents >> local_requirements.txt\n```\n\n#### Enable the Plugin\n\nIn the Netbox `configuration.py` configuration file add or update the PLUGINS parameter, adding `netbox_documents`:\n\n```python\nPLUGINS = [\n    'netbox_documents',\n]\n```\n\n(Optional) Add or update a PLUGINS_CONFIG parameter in `configuration.py` to configure plugin settings. Options shown below are the configured defaults:\n\n```python\nPLUGINS_CONFIG = {\n     'netbox_documents': {\n         # Enable the management of site specific documents (True/False)\n         'enable_site_documents': True,\n         # Enable the management of location specific documents (True/False)\n         'enable_location_documents': True,\n         # Enable the management of circuit specific documents (True/False)\n         'enable_circuit_documents': True,\n         # Enable the management of device specific documents (True/False)\n         'enable_device_documents': True,\n         # Enable the management of device type specific documents (True/False)\n         'enable_device_type_documents': True,\n         # Enable the global menu options (True/False)   \n         'enable_navigation_menu': True,\n         # Location to inject the document widget in the site view (left/right)\n         'site_documents_location': 'left',\n         # Location to inject the document widget in the location view (left/right)\n         'location_documents_location': 'left',\n         # Location to inject the document widget in the device view (left/right\n         'device_documents_location': 'left',\n         # Location to inject the document type widget in the device type view (left/right\n         'device_type_documents_location': 'left',\n         # Location to inject the document widget in the device view (left/right\n         'circuit_documents_location': 'left'\n     }\n}\n\n```\n\n(Optional) Add or replace the built-in Document Type choices via Netbox's [`FIELD_CHOICES`](https://netbox.readthedocs.io/en/feature/configuration/optional-settings/#field_choices) configuration parameter:\n\nThe colours that can be used are listed in the Netbox CSS netbox-light.css:\n\n(https://github.com/netbox-community/netbox/blob/develop/netbox/project-static/dist/netbox-light.css)\n\nThe bg- must not be specified in the configuration.\nHere are a few examples from the CSS:\n\n* bg-indigo = #6610f2 --> 'indigo'\n* bg-blue = #0d6efd --> 'blue'\n* bg-purple = #6f42c1 --> 'purple'\n* bg-pink = #d63384 --> 'pink'\n* bg-red = #dc3545 --> 'red'\n* bg-orange = #fd7e14 --> 'orange'\n* bg-yellow = #ffc107 --> 'yellow'\n* bg-green = #198754 --> 'green'\n* bg-teal = #20c997 --> 'teal'\n* bg-cyan = #0dcaf0 --> 'cyan'\n* bg-gray = #adb5bd --> 'gray'\n* bg-black = #000 --> 'black'\n* bg-white --> 'white'\n\n```python\nFIELD_CHOICES = {\n    'netbox_documents.DocTypeChoices.site+': (\n        ('mydocument', 'My Custom Site Document Type', 'green'),\n    ),\n    'netbox_documents.DocTypeChoices.location+': (\n        ('mydocument', 'My Custom Location Document Type', 'green'),\n    ),\n    'netbox_documents.DocTypeChoices.device+': (\n        ('mydocument', 'My Custom Device Document Type', 'green'),\n    ),\n    'netbox_documents.DocTypeChoices.devicetype+': (\n        ('mydocument', 'My Custom Device Type Document Type', 'green'),\n    ),\n    'netbox_documents.DocTypeChoices.circuit+': (\n        ('mydocument', 'My Custom Circuit Document Type', 'green'),\n    )\n}\n```\n\n#### Apply Database Migrations\n\nApply database migrations with Netbox `manage.py`:\n\n```\n(venv) $ python manage.py migrate\n```\n\n#### Restart Netbox\n\nRestart the Netbox service to apply changes:\n\n```\nsudo systemctl restart netbox\n```\n\n#### Re-index Netbox search index (Upgrade to 3.4 only)\n\nIf you are upgrading from Netbox 3.3 or above to Netbox 3.4, any previously inserted documents may not show up in the new search feature. To resolve this, re-index the plugin:\n\n```\n(venv) $ python manage.py reindex netbox_documents\n```\n\n### Screenshots\n\n![Site Document View](docs/img/siteview.png)\n![Add Circuit Document](docs/img/addcircuit.png)\n![Site Document List](docs/img/sitedocuments.png)\n![Device Document List](docs/img/devicedocuments.png)\n![Device Type Document](docs/img/devicetypedocuments.png)\n![Device Type Document List](docs/img/devicetypedocumentsList.png)\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Manage site, location, circuit and device diagrams and documents in Netbox",
    "version": "0.6.3",
    "project_urls": {
        "Homepage": "https://github.com/jasonyates/netbox-documents"
    },
    "split_keywords": [
        "netbox",
        "netbox-plugin",
        "plugin"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e940fab6100b86054272445f4d2ee022b4367206fd7bf9213178b8435d741f85",
                "md5": "c1d711a3a6bc3642d3d32c9ce56ccc9b",
                "sha256": "69cb5df78e143ce85bff8a98220fd393fddca840c813481c47753c7aa2c28b70"
            },
            "downloads": -1,
            "filename": "netbox_documents-0.6.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c1d711a3a6bc3642d3d32c9ce56ccc9b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 35750,
            "upload_time": "2023-11-21T08:12:02",
            "upload_time_iso_8601": "2023-11-21T08:12:02.957952Z",
            "url": "https://files.pythonhosted.org/packages/e9/40/fab6100b86054272445f4d2ee022b4367206fd7bf9213178b8435d741f85/netbox_documents-0.6.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f60bdac066b0eef53684e9e9182055df5c0aaea93923c4ac31091f792dc2698e",
                "md5": "327b4ccf966b851caf5e00becba5f498",
                "sha256": "352ab25eaeae776d0c52e38c97567c0a176d693335ea4632cda30bec7046e9cc"
            },
            "downloads": -1,
            "filename": "netbox-documents-0.6.3.tar.gz",
            "has_sig": false,
            "md5_digest": "327b4ccf966b851caf5e00becba5f498",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 20984,
            "upload_time": "2023-11-21T08:12:04",
            "upload_time_iso_8601": "2023-11-21T08:12:04.321629Z",
            "url": "https://files.pythonhosted.org/packages/f6/0b/dac066b0eef53684e9e9182055df5c0aaea93923c4ac31091f792dc2698e/netbox-documents-0.6.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-21 08:12:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jasonyates",
    "github_project": "netbox-documents",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "netbox-documents"
}
        
Elapsed time: 0.15442s