Add Link for devices/racks/modules using Asset Tags and Names #11215

Closed
opened 2025-12-29 21:42:02 +01:00 by adam · 1 comment
Owner

Originally created by @leomarssilva on GitHub (May 26, 2025).

NetBox version

v4.3.1

Feature type

New functionality

Proposed functionality

It would be a nice feature to have links for devices, racks and modules using asset tags or names instead of their Database IDs.

For example, it is more concise to document/share https://demo.netbox.dev/dcim/devices/asset-tag/abc1234 or https://demo.netbox.dev/dcim/devices/hostname/dmi01-akron-pdu01 than https://demo.netbox.dev/dcim/devices/27/. The strings /dcim/devices/hostname/ and /dcim/devices/asset-tag/ are just initial suggestions.

Changes:

  • Data models: since the models already have unique constraints for the asset_tag field, no changes needed. For name is trickier since there's no unique constraint.
  • User interface: it would be nice (but not necessary) to have a sharable link on the item's detail page, if the asset_tag or name is set.
  • Views: The urls.py need to be changed to include the new view that can query the model by asset tag. Since it can return more than 1 item by name, maybe it could just redirect to the search page.
  • api: it would be nice (but not necessary) to add the url that can query the model by asset tag or name.

I'm curious to see what the community thinks!

Use case

It's hard to ensure link consistency when machines are added using Custom Scripts or Diode after rebuilding the database, for example.

For example, it would make much easier:

  • To add links from other applications (monitoring, for example) to Netbox, specially during the initial migration.
  • To know which link is related to each device when searching emails or tickets
  • To bookmark important machines

Database changes

N/A

External dependencies

N/A

Originally created by @leomarssilva on GitHub (May 26, 2025). ### NetBox version v4.3.1 ### Feature type New functionality ### Proposed functionality It would be a nice feature to have links for devices, racks and modules using asset tags or names instead of their Database IDs. For example, it is more concise to document/share `https://demo.netbox.dev/dcim/devices/asset-tag/abc1234` or `https://demo.netbox.dev/dcim/devices/hostname/dmi01-akron-pdu01` than `https://demo.netbox.dev/dcim/devices/27/`. The strings `/dcim/devices/hostname/` and `/dcim/devices/asset-tag/` are just initial suggestions. Changes: - Data models: since the models already have unique constraints for the `asset_tag` field, no changes needed. For `name` is trickier since there's no unique constraint. - User interface: it would be nice (but not necessary) to have a sharable link on the item's detail page, if the `asset_tag` or `name` is set. - Views: The `urls.py` need to be changed to include the new view that can query the model by asset tag. Since it can return more than 1 item by name, maybe it could just redirect to the search page. - api: it would be nice (but not necessary) to add the url that can query the model by asset tag or name. I'm curious to see what the community thinks! ### Use case It's hard to ensure link consistency when machines are added using Custom Scripts or Diode after rebuilding the database, for example. For example, it would make much easier: - To add links from other applications (monitoring, for example) to Netbox, specially during the initial migration. - To know which link is related to each device when searching emails or tickets - To bookmark important machines ### Database changes N/A ### External dependencies N/A
adam added the type: feature label 2025-12-29 21:42:02 +01:00
adam closed this issue 2025-12-29 21:42:03 +01:00
Author
Owner

@arthanson commented on GitHub (May 29, 2025):

There are filters for this, this would complicate the consistent APIs we have for all models.

@arthanson commented on GitHub (May 29, 2025): There are filters for this, this would complicate the consistent APIs we have for all models.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11215