Skip to main content

Netbox plugin to manage attachments for any model

Project description

NetBox Attachments Plugin

Netbox plugin for attaching files to any model.

Features

This plugin provide following Models:

  • NetBoxAttachment

Compatibility

Netbox Plugin
>= 3.3.4 >= 0.0.5

Installation

The plugin is available as a Python package in pypi and can be installed with pip

pip install netbox-attachments

Enable the plugin in configuration.py:

PLUGINS = ['netbox_attachments']

Restart NetBox and add netbox-attachments to your local_requirements.txt

See NetBox Documentation for details

Configuration

The following options are available:

  • apps:
    • Type: List
    • Default: ['dcim', 'ipam', 'circuits', 'tenancy', 'virtualization', 'wireless']
    • Description: Display Attachments feature on all models definded under the app label. Attachmets are displayed on right_page of the detail-view of model.
  • display_default:
    • Type: String
    • Default: "right_page"
    • Options: "left_page", "right_page", "full_width_page"
    • Description: Setup default setting of where attachments should be displayed under the models
  • display_setting:
    • Type: Dict
    • Default: {}
    • Options: {<app_label.model>: <prefeered_display>}
    • Example: {'dcim.devicerole': 'full_width_page', 'dcim.device': 'left_page', 'ipam.vlan': 'right_page'}
    • Description: Set display setting for concrete model
    • Tip: Proper app_label and model names could be found at API <your_netbox_url>/api/extras/content-types/

Configuration Example:

PLUGINS_CONFIG = {
    'netbox_attachments': {
        'apps': ['dcim', 'ipam', 'circuits', 'tenancy', 'virtualization', 'wireless', 'inventory_monitor'],
        'display_default': "right_page",
        'display_setting': {'ipam.vlan': "left_page", 'dcim.device': "full_width_page", 'dcim.devicerole': "full_width_page", 'inventory_monitor.probe': "right_page"}
    }
}

Enable Attachments for custom plugin (models)

  • Append your plugin to configuration list
    • apps: ['<plugin_name>']
  • Extend detail templates
    •   # At the TOP
        {% load plugins %}
        # Under a comments section
        {% plugin_right_page object %}
        # add the left_page and full_width for future extension
      

Screenshots

  • Model View Platform attachments
  • List View List View
  • Detail View Detail View

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netbox-attachments-0.0.5.tar.gz (10.7 kB view details)

Uploaded Source

File details

Details for the file netbox-attachments-0.0.5.tar.gz.

File metadata

  • Download URL: netbox-attachments-0.0.5.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.6

File hashes

Hashes for netbox-attachments-0.0.5.tar.gz
Algorithm Hash digest
SHA256 0c3868c06877bd187c2e069b8150c879b5c0eb5bf804c7b1a5a3f0f25d2805c2
MD5 b2924f292e8eb1f86b8e7e0d5f79547a
BLAKE2b-256 5a94c7597646a44fee0049e00d7b90fe2471f8dfc9d2043659f61746cce52f08

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page