Update the 'last_updated' timestamp on parent objects #6436

Closed
opened 2025-12-29 19:40:43 +01:00 by adam · 4 comments
Owner

Originally created by @siemhermans on GitHub (May 3, 2022).

NetBox version

v2.11.12

Feature type

Change to existing functionality

Proposed functionality

Currently, when updating (for example) a dcim.interface object in Netbox, the parent dcim.device object's last_updated timestamp isn't updated. Understandable, as these are separate objects, but for our use case it would be preferable to have an update on a child object also update the timestamp on the parent object. This way we don't have to recursively check all linked objects for updates.

I'm uncertain whether this is feasible in Django in the first place, or whether it's desirable from a project standpoint, but I'm interested in your thoughts.

Use case

We are using NetBox to build a dynamic Ansible inventory. Due to the scale of the environment and the amount of API calls we require to build a full inventory, we've built a caching layer in a separate MongoDB which stores the (JSON) inventory. We check the timestamp of a cached inventory against the last_updated timestamp in NetBox. When a device is updated, it is retrieved and replaced in the cache. Otherwise a cached entry is retrieved from MongoDB.

Originally created by @siemhermans on GitHub (May 3, 2022). ### NetBox version v2.11.12 ### Feature type Change to existing functionality ### Proposed functionality Currently, when updating (for example) a dcim.interface object in Netbox, the parent dcim.device object's `last_updated` timestamp isn't updated. Understandable, as these are separate objects, but for our use case it would be preferable to have an update on a child object also update the timestamp on the parent object. This way we don't have to recursively check all linked objects for updates. I'm uncertain whether this is feasible in Django in the first place, or whether it's desirable from a project standpoint, but I'm interested in your thoughts. ### Use case We are using NetBox to build a dynamic Ansible inventory. Due to the scale of the environment and the amount of API calls we require to build a full inventory, we've built a caching layer in a separate MongoDB which stores the (JSON) inventory. We check the timestamp of a cached inventory against the `last_updated` timestamp in NetBox. When a device is updated, it is retrieved and replaced in the cache. Otherwise a cached entry is retrieved from MongoDB.
adam added the type: featurepending closurestatus: under review labels 2025-12-29 19:40:43 +01:00
adam closed this issue 2025-12-29 19:40:43 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 3, 2022):

I don't think it makes sense to update the last_updated time on the parent object, because that would effect a "no-op" change record for the object. Looking at the parent object, it would not be clear to the user what changed because the change is recorded separately, on the child object.

I wonder if a webhook from NetBox to trigger an inventory update is feasible to satisfy your use case.

@jeremystretch commented on GitHub (May 3, 2022): I don't think it makes sense to update the `last_updated` time on the parent object, because that would effect a "no-op" change record for the object. Looking at the parent object, it would not be clear to the user what changed because the change is recorded separately, on the child object. I wonder if a webhook from NetBox to trigger an inventory update is feasible to satisfy your use case.
Author
Owner

@DanSheps commented on GitHub (May 3, 2022):

v2.11.12

In the future, you should do FR's against a current version as it makes in unclear as to whether the functionality you desire has been added to a more current version without the maintainers reviewing all change logs to verify.

@DanSheps commented on GitHub (May 3, 2022): > v2.11.12 In the future, you should do FR's against a current version as it makes in unclear as to whether the functionality you desire has been added to a more current version without the maintainers reviewing all change logs to verify.
Author
Owner

@github-actions[bot] commented on GitHub (Jul 3, 2022):

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. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Jul 3, 2022): 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. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Aug 2, 2022):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Aug 2, 2022): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6436