Add 'created' and 'last_updated' attributes to device component models #4296

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

Originally created by @bb-Ricardo on GitHub (Nov 23, 2020).

Environment

  • Python version: 3.6.8
  • NetBox version: 2.9.9

Proposed Functionality

Add created and last_updated attributes to dcim.interface and and virtualization.vminterface model

Use Case

I use Netbox as source for our monitoring system. There it is important to get interface data for all interfaces of Device/VM. In order to avoid requesting all interfaces of all devices/VMs a caching was implemented to get only interface objects which have changed since last request cycle. This works pretty well for devices, VMs and IP addresses but interfaces don't support these fields. Our NetBox instance contains thousends of interfaces and retreiving them all takes a long time.

This change would speed up the reading of interface data by A LOT.

Database Changes

Yes. Adding 'created' and 'last_updated' to both models would be necessary.

External Dependencies

None

Pull Request

This change would be ready to go: 2b8fce8686

Originally created by @bb-Ricardo on GitHub (Nov 23, 2020). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. 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/g/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.8 * NetBox version: 2.9.9 <!-- 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 `created` and `last_updated` attributes to dcim.interface and and virtualization.vminterface model <!-- 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 I use Netbox as source for our monitoring system. There it is important to get interface data for all interfaces of Device/VM. In order to avoid requesting all interfaces of all devices/VMs a caching was implemented to get only interface objects which have changed since last request cycle. This works pretty well for devices, VMs and IP addresses but interfaces don't support these fields. Our NetBox instance contains thousends of interfaces and retreiving them all takes a long time. This change would speed up the reading of interface data by A LOT. <!-- 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 Yes. Adding 'created' and 'last_updated' to both models would be necessary. <!-- 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 None ### Pull Request This change would be ready to go: https://github.com/bb-Ricardo/netbox/commit/2b8fce86865f175effefeba16d7a8165f5670adc
adam added the type: feature label 2025-12-29 18:34:29 +01:00
adam closed this issue 2025-12-29 18:34:29 +01:00
Author
Owner

@jeremystretch commented on GitHub (Nov 24, 2020):

This change would need to be made for all component models (not just interfaces). I've updated the scope accordingly.

@jeremystretch commented on GitHub (Nov 24, 2020): This change would need to be made for all component models (not just interfaces). I've updated the scope accordingly.
Author
Owner

@bb-Ricardo commented on GitHub (Nov 24, 2020):

let me know if I can help with anything.

@bb-Ricardo commented on GitHub (Nov 24, 2020): let me know if I can help with anything.
Author
Owner

@jeremystretch commented on GitHub (Mar 29, 2021):

Whoops, looks like this was implemented under #5901.

@jeremystretch commented on GitHub (Mar 29, 2021): Whoops, looks like this was implemented under #5901.
Author
Owner

@bb-Ricardo commented on GitHub (Mar 29, 2021):

Great, thank you very much.

@bb-Ricardo commented on GitHub (Mar 29, 2021): Great, thank you very much.
Author
Owner

@bb-Ricardo commented on GitHub (Apr 23, 2021):

Well, yes this is implemented for dcim but not for virtualization.

Shall I open another issue?

@bb-Ricardo commented on GitHub (Apr 23, 2021): Well, yes this is implemented for dcim but not for `virtualization`. Shall I open another issue?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4296