Restore the "Parent" field in the IPAM view #4032

Closed
opened 2025-12-29 18:32:42 +01:00 by adam · 4 comments
Owner

Originally created by @Tavoons on GitHub (Aug 27, 2020).

Originally assigned to: @jeremystretch on GitHub.

Environment

  • Python version: 3.7.9
  • NetBox version: 2.9.1

Proposed Functionality

It is not a new feature, I just want to get the parent field back in IPAM, it disappear with the 2.9.1 version
Here is a screenshot of 2.8.9 version of Netbox
image

There is no big changes, when I go to /api/ipam/ip-addresses/ with the 2.9.1, I got :

 "results": [
        {
            "id": 288,
            "url": "http://netbox/api/ipam/ip-addresses/288/",
            "family": {
                "value": 4,
                "label": "IPv4"
            },
            "address": "IP/32",
            "vrf": null,
            "tenant": null,
            "status": {
                "value": "active",
                "label": "Active"
            },
            "role": null,
            "assigned_object_type": "dcim.interface",
            "assigned_object_id": 288,
            "assigned_object": {
                "id": 288,
                "url": "http://netbox/api/dcim/interfaces/288/",
                "device": {
                    "id": 278,
                    "url": "http://netbox/api/dcim/devices/278/",
                    "name": "DEVICE NAME",
                    "display_name": "DISPLAY_NAME"
                },
                "name": "console",
                "cable": null,
                "connection_status": null
            },
            "nat_inside": null,
            "nat_outside": null,
            "dns_name": "DNS_NAME",
            "description": "",
            "tags": [],
            "custom_fields": {},
            "created": "2020-08-26",
            "last_updated": "2020-08-27T10:54:05.566978+02:00"
        },

The link is in ["assigned_object"]["device"]["url"], is it possible to add this to the view ?

Use Case

One less click to access the device and if we don't want to see the field we can hide him with "configure"
My team used to click on the "parent" field to go directly to the device.

Database Changes

No

External Dependencies

No

Originally created by @Tavoons on GitHub (Aug 27, 2020). Originally assigned to: @jeremystretch on GitHub. ### Environment * Python version: 3.7.9 * NetBox version: 2.9.1 ### Proposed Functionality It is not a new feature, I just want to get the parent field back in IPAM, it disappear with the 2.9.1 version Here is a screenshot of 2.8.9 version of Netbox ![image](https://user-images.githubusercontent.com/39608697/91421916-ca794c80-e856-11ea-9d94-627cea1e2df7.png) There is no big changes, when I go to `/api/ipam/ip-addresses/` with the 2.9.1, I got : ```json "results": [ { "id": 288, "url": "http://netbox/api/ipam/ip-addresses/288/", "family": { "value": 4, "label": "IPv4" }, "address": "IP/32", "vrf": null, "tenant": null, "status": { "value": "active", "label": "Active" }, "role": null, "assigned_object_type": "dcim.interface", "assigned_object_id": 288, "assigned_object": { "id": 288, "url": "http://netbox/api/dcim/interfaces/288/", "device": { "id": 278, "url": "http://netbox/api/dcim/devices/278/", "name": "DEVICE NAME", "display_name": "DISPLAY_NAME" }, "name": "console", "cable": null, "connection_status": null }, "nat_inside": null, "nat_outside": null, "dns_name": "DNS_NAME", "description": "", "tags": [], "custom_fields": {}, "created": "2020-08-26", "last_updated": "2020-08-27T10:54:05.566978+02:00" }, ``` The link is in ["assigned_object"]["device"]["url"], is it possible to add this to the view ? ### Use Case One less click to access the device and if we don't want to see the field we can hide him with "configure" My team used to click on the "parent" field to go directly to the device. ### Database Changes No ### External Dependencies No
adam added the status: acceptedtype: feature labels 2025-12-29 18:32:42 +01:00
adam closed this issue 2025-12-29 18:32:42 +01:00
Author
Owner

@dteknet commented on GitHub (Aug 27, 2020):

It was a really useful feature, so I definitely voting to return it back.

@dteknet commented on GitHub (Aug 27, 2020): It was a really useful feature, so I definitely voting to return it back.
Author
Owner

@jeremystretch commented on GitHub (Aug 27, 2020):

There is no big changes

If you'll refer to the v2.9 release notes, you'll see that the relationship between the IPAddress and Interface models has been completely replaced to accommodate the new VMInterface model, hence the change. The assignment of an IP address to an interface is now done using a GenericForeignKey. The REST API representation has likewise been modified to indicate a generic assigned_object as opposed to a device/interface as before.

@jeremystretch commented on GitHub (Aug 27, 2020): > There is no big changes If you'll refer to the v2.9 release notes, you'll see that the relationship between the IPAddress and Interface models has been completely replaced to accommodate the new VMInterface model, hence the change. The assignment of an IP address to an interface is now done using a GenericForeignKey. The REST API representation has likewise been modified to indicate a generic `assigned_object` as opposed to a device/interface as before.
Author
Owner

@jeremystretch commented on GitHub (Aug 27, 2020):

I've added "interface" and "parent" as non-default columns for the IP addresses table due to the performance penalty they introduce.

Interestingly, prefetching assigned_object for the API view does yield a performance improvement, however the UI view seems to not take advantage of it, likely due to how django-tables2 is accessing record data. This probably warrants further investigation, but unfortunately I can't spend any more time on it at the moment.

@jeremystretch commented on GitHub (Aug 27, 2020): I've added "interface" and "parent" as non-default columns for the IP addresses table due to the performance penalty they introduce. Interestingly, prefetching `assigned_object` for the API view _does_ yield a performance improvement, however the UI view seems to not take advantage of it, likely due to how django-tables2 is accessing record data. This probably warrants further investigation, but unfortunately I can't spend any more time on it at the moment.
Author
Owner

@ghost commented on GitHub (Aug 27, 2020):

Wow, that was fast! Thanks Jeremy

@ghost commented on GitHub (Aug 27, 2020): Wow, that was fast! Thanks Jeremy
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4032