Skip to main content

Manages device lifecycles for platforms and software.

Project description

Nautobot Plugin - Device Lifecycle Management

A plugin for Nautobot to manage device lifecycles. This plugin works by making related associations to Devices, Device Types, and Inventory Items to help provide data about the hardware end of life notices, appropriate software versions to be running on the devices, and the maintenance contracts associated with devices. This will help with the various aspects of planning life cycle events, and provides quick access to ancillary data about the devices in Nautobot.

Installation

Installation

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

pip install nautobot-device-lifecycle-mgmt

The plugin is compatible with Nautobot 1.1.6 and higher

To ensure Nautobot Device Life Cycle Management plugin is automatically re-installed during future upgrades, create a file named local_requirements.txt (if not already existing) in the Nautobot root directory (alongside requirements.txt) and list the nautobot-plugin-device-lifecycle-mgmt package:

# echo nautobot-device-lifecycle-mgmt >> local_requirements.txt

Installation Continued

Once installed, the plugin needs to be enabled in your configuration.py

# In your configuration.py, if following docs -> /opt/nautobot/nautobot_config.py
PLUGINS = ["nautobot_device_lifecycle_mgmt"]

Run Post Upgrade Steps

Once the configuration has been updated, run the post migration script as the Nautobot user

nautobot-server post_upgrade

This should run migrations for the plugin to be ready for use.

Restart Nautobot Services

As a user account that has privileges to restart services, restart the Nautobot services

sudo systemctl restart nautobot nautobot-worker

If you are on Nautobot >= 1.1.0 and have the RQ worker continuing on, also restart the RQ worker service.

sudo systemctl restart nautobot-rq-worker

Documentation

Usage

Adding Information into the Plugin

The system currently has manual/API entry of data only. There are currently no connections to any particular vendor APIs that provide this data today. See adding data docs for more info.

Hardware Lifecycle Management

API

REST API Example 1

Gather hardware notices that will be end of support by the end of 2021

curl "http://$NBHOST/api/plugins/device-lifecycle/hardware/?end_of_support__lte=2021-12-31" \
-X GET \
-H  "accept: application/json" \
-H  "Authorization: Token $TOKEN" | json_pp
REST API Example 2

Gather hardware notices that are currently expired.

NOTE: expired flag will honor end_of_support if the field exist for the record. If the field does not exist, end_of_sale will be used as the expired field.

curl "http://$NBHOST/api/plugins/device-lifecycle/hardware/?expired=true" \  
-X GET \
-H  "accept: application/json" \
-H  "Authorization: Token $TOKEN" | json_pp

GraphQL Examples

Contributing

Pull requests are welcomed and automatically built and tested against multiple version of Python and multiple version of Nautobot through TravisCI.

The project is packaged with a light development environment based on docker-compose to help with the local development of the project and to run the tests within TravisCI.

The project is following Network to Code software development guideline and is leveraging:

  • Black, Pylint, Bandit and pydocstyle for Python linting and formatting.
  • Django unit test to ensure the plugin is working properly.

CLI Helper Commands

The project is coming with a CLI helper based on invoke to help setup the development environment. The commands are listed below in 3 categories dev environment, utility and testing.

Each command can be executed with invoke <command>. All commands support the arguments --nautobot-ver and --python-ver if you want to manually define the version of Python and Nautobot to use. Each command also has its own help invoke <command> --help

Local dev environment

  build            Build all docker images.
  debug            Start Nautobot and its dependencies in debug mode.
  destroy          Destroy all containers and volumes.
  restart          Restart Nautobot and its dependencies.
  start            Start Nautobot and its dependencies in detached mode.
  stop             Stop Nautobot and its dependencies.

Utility

  cli              Launch a bash shell inside the running Nautobot container.
  create-user      Create a new user in django (default: admin), will prompt for password.
  makemigrations   Run Make Migration in Django.
  nbshell          Launch a nbshell session.

Testing

  bandit           Run bandit to validate basic static code security analysis.
  black            Run black to check that Python files adhere to its style standards.
  flake8           This will run flake8 for the specified name and Python version.
  pydocstyle       Run pydocstyle to validate docstring formatting adheres to NTC defined standards.
  pylint           Run pylint code analysis.
  tests            Run all tests for this plugin.
  unittest         Run Django unit tests for the plugin.

Screenshots

Hardware: Device Life Cycle Management List View

You can view the list of Hardware/Software notices as well as filter the table.

Hardware: Device Life Cycle Management Detail View

You can also click a Hardware/Software Notice and see the detail view. This view provides links to the devices that are part affected by this EoX notice due to their device type.

Device View

You can also view the associated Hardware notice from the device. If the device is end of life or end of support the notice will be red.

Device Type View

This provides the same UI element as the device view, but within the specific device type's view.

Contracts: Device Life Cycle Management Contract Detail View

You can view the details of a contract along with the primary and escalation contacts. This view will also give you an association to the devices under this contract.

Contracts: Device Life Cycle Management Contract Provider View

You can view the details of a provider, along with a listing of the service contracts associated to the provider. Contracts that are expired will display in red.

Software: Software Life Cycle Management List View

You can view the list of Software versions as well as filter the table.

Software: Software Life Cycle Detail View

You can also click a Software version and see the detail view. This view provides link to the list of devices and inventory items that are associated with this software object.

Software: Validated Software Life Cycle Management List View

You can view the list of Validated Software versions as well as filter the table.

Software: Validated Software Life Cycle Detail View

You can also click a Validated Software version and see the detail view. This view provides view of the device and inventory item attributes this validated software applies to.

Software: Device View

You can also view the associated Software and Validated Software versions from the device. If the Software assigned to the device matches Validated Software for this device, the Software will be displayed in green. If it's invalid it will be displayed in red.

Valid software:

Invalid software:

Project details


Download files

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

Source Distribution

nautobot-device-lifecycle-mgmt-0.4.1.tar.gz (59.0 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file nautobot-device-lifecycle-mgmt-0.4.1.tar.gz.

File metadata

  • Download URL: nautobot-device-lifecycle-mgmt-0.4.1.tar.gz
  • Upload date:
  • Size: 59.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for nautobot-device-lifecycle-mgmt-0.4.1.tar.gz
Algorithm Hash digest
SHA256 b9b3391f86fdbdfe0249aa12f0385e2efd8ba40a7b85a50412c8aba640cf2418
MD5 f497ade9f68b670af11ecdf3c9080ddd
BLAKE2b-256 89b2a50d7326c3ebef0a19ec644e5bccca6f07a3c0bf11a4146bb4b579c3ba43

See more details on using hashes here.

File details

Details for the file nautobot_device_lifecycle_mgmt-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: nautobot_device_lifecycle_mgmt-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 92.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for nautobot_device_lifecycle_mgmt-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e376558732642559a3a5b913492b8287861380bd62f20cc2845ec54c74c686ff
MD5 ec2e2de0d1dbe4481f2a50224d208490
BLAKE2b-256 6a18e7329ce72591e6a0de3c4a69c0aa42dba85974873e2e485aa630cc9eccac

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