GET /api/dcim/interfaces/{id}/ response doesn't follow provided example/model #8556

Closed
opened 2025-12-29 20:38:05 +01:00 by adam · 2 comments
Owner

Originally created by @AndersBallegaard on GitHub (Sep 1, 2023).

Change Type

Correction

Area

Integrations/API

Proposed Changes

Hello,
In the GET /api/dcim/interfaces/{id}/ response example, and in the Interface model the tagged_vlans attribute is described to contain a list of integers. However when i use the API call i get a list of nestedVlans in the response.
I would propose that the API docs are changed to reflect the actual response structure given that the real response is more useful than the one the current documentation describes.

Expected response model
{ "id": 0, "url": "string", "display": "string", "device": { "id": 0, "url": "string", "display": "string", "name": "string" }, "vdcs": [ 0 ], "module": { "id": 0, "url": "string", "display": "string", "device": 0, "module_bay": { "id": 0, "url": "string", "display": "string", "name": "string" } }, "name": "string", "label": "string", "type": { "value": "virtual", "label": "Virtual" }, "enabled": true, "parent": { "id": 0, "url": "string", "display": "string", "device": { "id": 0, "url": "string", "display": "string", "name": "string" }, "name": "string", "cable": 0, "_occupied": true }, "bridge": { "id": 0, "url": "string", "display": "string", "device": { "id": 0, "url": "string", "display": "string", "name": "string" }, "name": "string", "cable": 0, "_occupied": true }, "lag": { "id": 0, "url": "string", "display": "string", "device": { "id": 0, "url": "string", "display": "string", "name": "string" }, "name": "string", "cable": 0, "_occupied": true }, "mtu": 65536, "mac_address": "string", "speed": 2147483647, "duplex": { "value": "half", "label": "Half" }, "wwn": "string", "mgmt_only": true, "description": "string", "mode": { "value": "access", "label": "Access" }, "rf_role": { "value": "ap", "label": "Access point" }, "rf_channel": { "value": "2.4g-1-2412-22", "label": "1 (2412 MHz)" }, "poe_mode": { "value": "pd", "label": "PD" }, "poe_type": { "value": "type1-ieee802.3af", "label": "802.3af (Type 1)" }, "rf_channel_frequency": 99999, "rf_channel_width": 9999, "tx_power": 127, "untagged_vlan": { "id": 0, "url": "string", "display": "string", "vid": 4094, "name": "string" }, "tagged_vlans": [ 0 ], "mark_connected": true, "cable": { "id": 0, "url": "string", "display": "string", "label": "string" }, "cable_end": "string", "wireless_link": { "id": 0, "url": "string", "display": "string", "ssid": "string" }, "link_peers": [ "string" ], "link_peers_type": "string", "wireless_lans": [ 0 ], "vrf": { "id": 0, "url": "string", "display": "string", "name": "string", "rd": "string" }, "l2vpn_termination": { "id": 0, "url": "string", "display": "string", "l2vpn": { "id": 0, "url": "string", "display": "string", "identifier": 9223372036854776000, "name": "string", "slug": "-tCoioc63GAFifCvZIMAAAmalbvS_FpWcWtCnq0_hOS9WS7Yfm5Y0k5xZ0fG", "type": "vpws" } }, "connected_endpoints": [ "string" ], "connected_endpoints_type": "string", "connected_endpoints_reachable": true, "tags": [ { "id": 0, "url": "string", "display": "string", "name": "string", "slug": "ntFDOLOJbPOWQofjtD6cqhKCwrmpdhpMr0js2Z", "color": "3e480a" } ], "custom_fields": { "additionalProp1": "string", "additionalProp2": "string", "additionalProp3": "string" }, "created": "2023-09-01T07:25:56.746Z", "last_updated": "2023-09-01T07:25:56.746Z", "count_ipaddresses": 0, "count_fhrp_groups": 0, "_occupied": true }

Actual response
{ "id": 1, "url": "http://127.0.0.1:8000/api/dcim/interfaces/1/", "display": "test0/0", "device": { "id": 1, "url": "http://127.0.0.1:8000/api/dcim/devices/1/", "display": "test_device", "name": "test_device" }, "vdcs": [], "module": null, "name": "test0/0", "label": "", "type": { "value": "100base-fx", "label": "100BASE-FX (10/100ME FIBER)" }, "enabled": true, "parent": null, "bridge": null, "lag": null, "mtu": null, "mac_address": null, "speed": null, "duplex": null, "wwn": null, "mgmt_only": false, "description": "", "mode": { "value": "tagged", "label": "Tagged" }, "rf_role": null, "rf_channel": null, "poe_mode": null, "poe_type": null, "rf_channel_frequency": null, "rf_channel_width": null, "tx_power": null, "untagged_vlan": null, "tagged_vlans": [ { "id": 1, "url": "http://127.0.0.1:8000/api/ipam/vlans/1/", "display": "Vlan 20 (20)", "vid": 20, "name": "Vlan 20" }, { "id": 2, "url": "http://127.0.0.1:8000/api/ipam/vlans/2/", "display": "Vlan 30 (30)", "vid": 30, "name": "Vlan 30" } ], "mark_connected": false, "cable": null, "cable_end": "", "wireless_link": null, "link_peers": [], "link_peers_type": null, "wireless_lans": [], "vrf": null, "l2vpn_termination": null, "connected_endpoints": null, "connected_endpoints_type": null, "connected_endpoints_reachable": null, "tags": [], "custom_fields": {}, "created": "2023-09-01T07:17:22.190598Z", "last_updated": "2023-09-01T07:18:18.250446Z", "count_ipaddresses": 0, "count_fhrp_groups": 0, "_occupied": false }

The output above is from version 3.6.0, but i have seen the same on 3.5.x
Given that it goes so far back i expected an issue about this to already be created, but i have not been able to find any.

Originally created by @AndersBallegaard on GitHub (Sep 1, 2023). ### Change Type Correction ### Area Integrations/API ### Proposed Changes Hello, In the GET /api/dcim/interfaces/{id}/ response example, and in the Interface model the tagged_vlans attribute is described to contain a list of integers. However when i use the API call i get a list of nestedVlans in the response. I would propose that the API docs are changed to reflect the actual response structure given that the real response is more useful than the one the current documentation describes. Expected response model ` { "id": 0, "url": "string", "display": "string", "device": { "id": 0, "url": "string", "display": "string", "name": "string" }, "vdcs": [ 0 ], "module": { "id": 0, "url": "string", "display": "string", "device": 0, "module_bay": { "id": 0, "url": "string", "display": "string", "name": "string" } }, "name": "string", "label": "string", "type": { "value": "virtual", "label": "Virtual" }, "enabled": true, "parent": { "id": 0, "url": "string", "display": "string", "device": { "id": 0, "url": "string", "display": "string", "name": "string" }, "name": "string", "cable": 0, "_occupied": true }, "bridge": { "id": 0, "url": "string", "display": "string", "device": { "id": 0, "url": "string", "display": "string", "name": "string" }, "name": "string", "cable": 0, "_occupied": true }, "lag": { "id": 0, "url": "string", "display": "string", "device": { "id": 0, "url": "string", "display": "string", "name": "string" }, "name": "string", "cable": 0, "_occupied": true }, "mtu": 65536, "mac_address": "string", "speed": 2147483647, "duplex": { "value": "half", "label": "Half" }, "wwn": "string", "mgmt_only": true, "description": "string", "mode": { "value": "access", "label": "Access" }, "rf_role": { "value": "ap", "label": "Access point" }, "rf_channel": { "value": "2.4g-1-2412-22", "label": "1 (2412 MHz)" }, "poe_mode": { "value": "pd", "label": "PD" }, "poe_type": { "value": "type1-ieee802.3af", "label": "802.3af (Type 1)" }, "rf_channel_frequency": 99999, "rf_channel_width": 9999, "tx_power": 127, "untagged_vlan": { "id": 0, "url": "string", "display": "string", "vid": 4094, "name": "string" }, "tagged_vlans": [ 0 ], "mark_connected": true, "cable": { "id": 0, "url": "string", "display": "string", "label": "string" }, "cable_end": "string", "wireless_link": { "id": 0, "url": "string", "display": "string", "ssid": "string" }, "link_peers": [ "string" ], "link_peers_type": "string", "wireless_lans": [ 0 ], "vrf": { "id": 0, "url": "string", "display": "string", "name": "string", "rd": "string" }, "l2vpn_termination": { "id": 0, "url": "string", "display": "string", "l2vpn": { "id": 0, "url": "string", "display": "string", "identifier": 9223372036854776000, "name": "string", "slug": "-tCoioc63GAFifCvZIMAAAmalbvS_FpWcWtCnq0_hOS9WS7Yfm5Y0k5xZ0fG", "type": "vpws" } }, "connected_endpoints": [ "string" ], "connected_endpoints_type": "string", "connected_endpoints_reachable": true, "tags": [ { "id": 0, "url": "string", "display": "string", "name": "string", "slug": "ntFDOLOJbPOWQofjtD6cqhKCwrmpdhpMr0js2Z", "color": "3e480a" } ], "custom_fields": { "additionalProp1": "string", "additionalProp2": "string", "additionalProp3": "string" }, "created": "2023-09-01T07:25:56.746Z", "last_updated": "2023-09-01T07:25:56.746Z", "count_ipaddresses": 0, "count_fhrp_groups": 0, "_occupied": true } ` Actual response ` { "id": 1, "url": "http://127.0.0.1:8000/api/dcim/interfaces/1/", "display": "test0/0", "device": { "id": 1, "url": "http://127.0.0.1:8000/api/dcim/devices/1/", "display": "test_device", "name": "test_device" }, "vdcs": [], "module": null, "name": "test0/0", "label": "", "type": { "value": "100base-fx", "label": "100BASE-FX (10/100ME FIBER)" }, "enabled": true, "parent": null, "bridge": null, "lag": null, "mtu": null, "mac_address": null, "speed": null, "duplex": null, "wwn": null, "mgmt_only": false, "description": "", "mode": { "value": "tagged", "label": "Tagged" }, "rf_role": null, "rf_channel": null, "poe_mode": null, "poe_type": null, "rf_channel_frequency": null, "rf_channel_width": null, "tx_power": null, "untagged_vlan": null, "tagged_vlans": [ { "id": 1, "url": "http://127.0.0.1:8000/api/ipam/vlans/1/", "display": "Vlan 20 (20)", "vid": 20, "name": "Vlan 20" }, { "id": 2, "url": "http://127.0.0.1:8000/api/ipam/vlans/2/", "display": "Vlan 30 (30)", "vid": 30, "name": "Vlan 30" } ], "mark_connected": false, "cable": null, "cable_end": "", "wireless_link": null, "link_peers": [], "link_peers_type": null, "wireless_lans": [], "vrf": null, "l2vpn_termination": null, "connected_endpoints": null, "connected_endpoints_type": null, "connected_endpoints_reachable": null, "tags": [], "custom_fields": {}, "created": "2023-09-01T07:17:22.190598Z", "last_updated": "2023-09-01T07:18:18.250446Z", "count_ipaddresses": 0, "count_fhrp_groups": 0, "_occupied": false } ` The output above is from version 3.6.0, but i have seen the same on 3.5.x Given that it goes so far back i expected an issue about this to already be created, but i have not been able to find any.
adam added the type: documentationpending closure labels 2025-12-29 20:38:05 +01:00
adam closed this issue 2025-12-29 20:38:05 +01:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 1, 2023):

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 (Dec 1, 2023): 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 (Dec 31, 2023):

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 (Dec 31, 2023): 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#8556