netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Public demo: https://demo.netbox.dev
http://netboxlabs.com/oss/netbox/
Apache License 2.0
15.22k stars 2.47k forks source link

Allow custom field objects to be limited #16169

Closed karolyczovek closed 6 days ago

karolyczovek commented 4 weeks ago

NetBox version

v3.7.8

Feature type

Data model extension

Proposed functionality

Is it possible, to set custom fields to honor relations?

For example, I set a custom field related to the site as multi-object with prefixes, then let the custom field honor the global/site-assigned specific prefixes.

Use case

Multi-field custom field object I could select from prefixes already assigned to site.

Database changes

No response

External dependencies

No response

jeffgdotorg commented 4 weeks ago

Thanks for your interest in helping improve NetBox.

I think your proposal makes sense, but since you've opened it against 3.7.8, I wonder whether the same effect might be possible with no code changes by leveraging improvements to the select controls in NetBox 4.0.

In the screenshot below, you can see that the description of a prefix now shows up in the custom field select control, and that by using type-ahead filtering you can limit the values shown. Assuming your prefixes have descriptions, I think this workflow might meet your need. Please give it a try in a test environment or on the [public demo system[(https://demo.netbox.dev/) and indicate whether you agree.

image
karolyczovek commented 4 weeks ago

Will give it a try, does 4.0 API already work with Ansible?

karolyczovek commented 3 weeks ago

Just run the smoke tests - UI-wise it looks fine but still an extra effort from the enduser - however ansible interaction (lookups and modules) are broken from 4.0

jeffgdotorg commented 3 weeks ago

Top people are working on the remaining 4.0 compatibility issues in the Ansible collection. I understand that may be a barrier to you upgrading your instances, but let's please keep the comments in this issue on topic to avoid confusing future time travelers.

karolyczovek commented 3 weeks ago

Same applies in general - imagine sites with same-like named equipments - for example 16 sites with 20 cameras at each named camera NN, so custom field "related objects" would be nice to honor site

github-actions[bot] commented 2 weeks ago

This is a reminder that additional information is needed in order to further triage this issue. If the requested details are not provided, the issue will soon be closed automatically.

github-actions[bot] commented 6 days ago

This issue is being closed as no further information has been provided. If you would like to revisit this topic, please first modify your original post to include all the requested detail, and then ask that the issue be reopened.