Add support for API-only custom fields #3045

Closed
opened 2025-12-29 18:25:06 +01:00 by adam · 5 comments
Owner

Originally created by @ananace on GitHub (Dec 5, 2019).

Environment

  • Python version: 3.7.5
  • NetBox version: 2.6.7

Proposed Functionality

Add a flag for setting custom fields as API use only, to allow for better system interoperability without cluttering the UI with non-user editable fields.

Use Case

We're looking at integrating NetBox into several internal systems, some of which all collaborate to build the full view of the devices we manage.
Custom fields containing remote IDs has proven to work well for this, though the fields can be confusing for our users as they're only ever supposed to be filled in by automated API communication between the linked system.

Database Changes

This would most likely require adding a new boolean field to the custom field table, if a field should be user-editable or only accessible by API.

Originally created by @ananace on GitHub (Dec 5, 2019). <!-- 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.7.5 * NetBox version: 2.6.7 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality Add a flag for setting custom fields as API use only, to allow for better system interoperability without cluttering the UI with non-user editable fields. <!-- 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're looking at integrating NetBox into several internal systems, some of which all collaborate to build the full view of the devices we manage. Custom fields containing remote IDs has proven to work well for this, though the fields can be confusing for our users as they're only ever supposed to be filled in by automated API communication between the linked system. <!-- 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 This would most likely require adding a new boolean field to the custom field table, if a field should be user-editable or only accessible by API.
adam added the status: duplicatepending closure labels 2025-12-29 18:25:06 +01:00
adam closed this issue 2025-12-29 18:25:06 +01:00
Author
Owner

@yarnocobussen commented on GitHub (Dec 10, 2019):

This was previously rejected in #2132

@yarnocobussen commented on GitHub (Dec 10, 2019): This was previously rejected in #2132
Author
Owner

@ananace commented on GitHub (Dec 11, 2019):

Apparently I need to practice my google-fu a bit, didn't find that previous issue in any of my searches.

Unfortunately config contexts might not quite be able to fill the entire reason why we're looking to have API-only fields - as we're hoping to add mappings not only for devices, but also tenants, sites, racks, and possibly even more in the future.

@ananace commented on GitHub (Dec 11, 2019): Apparently I need to practice my google-fu a bit, didn't find that previous issue in any of my searches. Unfortunately config contexts might not quite be able to fill the entire reason why we're looking to have API-only fields - as we're hoping to add mappings not only for devices, but also tenants, sites, racks, and possibly even more in the future.
Author
Owner

@hSaria commented on GitHub (Dec 11, 2019):

Another option would be to keep them in the web UI but show them under a collapsed section by default so the user will need to expand that section to see the details, so less visible clutter yet a consistent view in the web UI and the API (the reason #2132 got closed). It'd basically be a conceal toggle.

@hSaria commented on GitHub (Dec 11, 2019): Another option would be to keep them in the web UI but show them under a collapsed section by default so the user will need to expand that section to see the details, so less visible clutter yet a consistent view in the web UI and the API (the reason #2132 got closed). It'd basically be a `conceal` toggle.
Author
Owner

@stale[bot] commented on GitHub (Dec 25, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@stale[bot] commented on GitHub (Dec 25, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@lampwins commented on GitHub (Dec 30, 2019):

As pointed out, this aligns with #2132

Note you can use the field label to "signal" that the field should not be modified by an operator in the UI.

@lampwins commented on GitHub (Dec 30, 2019): As pointed out, this aligns with #2132 Note you can use the field label to "signal" that the field should not be modified by an operator in the UI.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3045