Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add slug to object detail view in NetBox web UI #6955

Closed
sc68cal opened this issue Aug 13, 2021 · 1 comment
Closed

Add slug to object detail view in NetBox web UI #6955

sc68cal opened this issue Aug 13, 2021 · 1 comment
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@sc68cal
Copy link
Contributor

sc68cal commented Aug 13, 2021

NetBox version

v2.11.7

Feature type

Change to existing functionality

Proposed functionality

Include the slug field in object details

Use case

When using the nb_lookup plugin for Ansible, when querying a prefix out of NetBox, based on a role attribute, people sometimes forget that while role is a string parameter in the REST API, it is not the Name attribute of the role, but actually the slug attribute.

This code doesn't work, and causes developer confusion

virtual_edge_tep_ipv4_nw: "{{ lookup('netbox.netbox.nb_lookup', 'prefixes',
                                  api_filter='site=' + netbox_site_slug +
                                  ' tag=' + az_name + ' role=' + '\"NSX-T Virtual Edge Tep\"' +
                                  ' family=4' + ' vlan_vid=401', 
                                  api_endpoint=netbox_url,
                                  token=netbox_token) }}"
"msg": "An unhandled exception occurred while running the lookup plugin 'netbox.netbox.nb_lookup'. 
Error was a <class 'pynetbox.core.query.RequestError'>, original message: 
The request failed with code 400 Bad Request: {'role': ['Select a valid choice. NSX-T Virtual Edge Tep is not one of the available choices.']}"

Using the role's slug value works.

virtual_edge_tep_ipv4_nw: "{{ lookup('netbox.netbox.nb_lookup', 'prefixes',
                                  api_filter='site=' + netbox_site_slug +
                                  ' tag=' + az_name + ' role=' + 'nsx-t-virtual-edge-tep' +
                                  ' family=4' + ' vlan_vid=401', 
                                  api_endpoint=netbox_url,
                                  token=netbox_token) }}"

So, it would be helpful if the NetBox UI listed the slug attribute in each object detail page, so that I don't have to log into netbox, find the prefix, and click the "Edit" button so I can see the slug

Database changes

No response

External dependencies

No response

@sc68cal sc68cal added the type: feature Introduction of new functionality to the application label Aug 13, 2021
@sc68cal
Copy link
Contributor Author

sc68cal commented Aug 13, 2021

Screen Shot 2021-08-13 at 12 36 26 PM

@jeremystretch jeremystretch added the status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation label Sep 8, 2021
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Oct 6, 2021
@jeremystretch jeremystretch self-assigned this Oct 6, 2021
@jbakklund jbakklund mentioned this issue Oct 8, 2021
5 tasks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

2 participants