[PR #3103] [MERGED] Fixes : #3070 Add the decommissioning status for devices #12500

Closed
opened 2025-12-29 22:21:55 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/3103
Author: @clercrobin
Created: 4/24/2019
Status: Merged
Merged: 4/26/2019
Merged by: @jeremystretch

Base: developHead: add_decommissioning


📝 Commits (1)

  • f463653 Add the decommissioning status for devices

📊 Changes

1 file changed (+2 additions, -0 deletions)

View changed files

📝 netbox/dcim/constants.py (+2 -0)

📄 Description

Fixes : #3070

Environment

  • Python version: 3.6.7
  • NetBox version: 2.5.10

Proposed Functionality

To extend the issue #154, we want to add a status decommissioning to the already existing status list:

  • offline
  • active
  • planned
  • staged
  • failed
  • inventory

Use Case

We are currently using Netbox as our asset management system, in addition to its DCIM functionality and are quite happy with this. A valuable output from Netbox would be a forecasting vision enabled by a status like planned. However it is not sufficient to complete this functionality and thus to indicate that a machine will be soon offline we want to add the status decommissioning.

It would enable the 2 following views:

  • Current status: Active + decommissioning
  • Forecast: Active + planned

Database Changes

The device statuses lines (314 - 328) of the file netbox\dcim\constants.py would change to:

STATUS_OFFLINE = 0
STATUS_ACTIVE = 1
STATUS_PLANNED = 2
STATUS_STAGED = 3
STATUS_FAILED = 4
STATUS_INVENTORY = 5
STATUS_DECOMMISSIONING = 6
DEVICE_STATUS_CHOICES = [
    [DEVICE_STATUS_ACTIVE, 'Active'],
    [DEVICE_STATUS_OFFLINE, 'Offline'],
    [DEVICE_STATUS_PLANNED, 'Planned'],
    [DEVICE_STATUS_STAGED, 'Staged'],
    [DEVICE_STATUS_FAILED, 'Failed'],
    [DEVICE_STATUS_INVENTORY, 'Inventory'],
    [DEVICE_STATUS_DECOMMISSIONING, 'Decommissioning'],
]

External Dependencies

No external dependancy


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/3103 **Author:** [@clercrobin](https://github.com/clercrobin) **Created:** 4/24/2019 **Status:** ✅ Merged **Merged:** 4/26/2019 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `add_decommissioning` --- ### 📝 Commits (1) - [`f463653`](https://github.com/netbox-community/netbox/commit/f4636537ad72f8d776982eddc3090856e082467b) Add the decommissioning status for devices ### 📊 Changes **1 file changed** (+2 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/constants.py` (+2 -0) </details> ### 📄 Description Fixes : #3070 <!-- NOTE: This form is only for proposing specific new features or enhancements. If you have a general idea or question, please post to our mailing list instead of opening an issue: https://groups.google.com/forum/#!forum/netbox-discuss NOTE: Due to an excessive backlog of feature requests, we are not currently accepting any proposals which significantly extend NetBox's feature scope. Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 3.6.7 * NetBox version: 2.5.10 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality To extend the issue #154, we want to add a status **decommissioning** to the already existing status list: - offline - active - planned - staged - failed - inventory <!-- Convey an example use case for your proposed feature. Write from the perspective of a NetBox user who would benefit from the proposed functionality and describe how. ---> ### Use Case We are currently using Netbox as our asset management system, in addition to its DCIM functionality and are quite happy with this. A valuable output from Netbox would be a forecasting vision enabled by a status like **planned**. However it is not sufficient to complete this functionality and thus to indicate that a machine will be soon offline we want to add the status **decommissioning**. It would enable the 2 following views: - Current status: Active + decommissioning - Forecast: Active + planned <!-- Note any changes to the database schema necessary to support the new feature. For example, does the proposal require adding a new model or field? (Not all new features require database changes.) ---> ### Database Changes The device statuses lines (314 - 328) of the file netbox\dcim\constants.py would change to: ```python STATUS_OFFLINE = 0 STATUS_ACTIVE = 1 STATUS_PLANNED = 2 STATUS_STAGED = 3 STATUS_FAILED = 4 STATUS_INVENTORY = 5 STATUS_DECOMMISSIONING = 6 DEVICE_STATUS_CHOICES = [ [DEVICE_STATUS_ACTIVE, 'Active'], [DEVICE_STATUS_OFFLINE, 'Offline'], [DEVICE_STATUS_PLANNED, 'Planned'], [DEVICE_STATUS_STAGED, 'Staged'], [DEVICE_STATUS_FAILED, 'Failed'], [DEVICE_STATUS_INVENTORY, 'Inventory'], [DEVICE_STATUS_DECOMMISSIONING, 'Decommissioning'], ] ``` <!-- List any new dependencies on external libraries or services that this new feature would introduce. For example, does the proposal require the installation of a new Python package? (Not all new features introduce new dependencies.) --> ### External Dependencies No external dependancy --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:21:55 +01:00
adam closed this issue 2025-12-29 22:21:56 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12500