Exporting cables doesn't include termination points #2383

Closed
opened 2025-12-29 17:25:33 +01:00 by adam · 3 comments
Owner

Originally created by @snowie-swe on GitHub (Feb 14, 2019).

Environment

NetBox version: 2.5.5

Steps to Reproduce

1: Click export within devices/cables

Expected Behavior

All fields presented within the list to be exported in csv format.
So its in a usable format similar to exporting other things within netbox such as devices.

id,Lable,Termination A (device and port), Termination B (device and port),, Status, Type, Color, Lenght

Observed Behavior

dcim.interface,XXXX,dcim.interface,XXXX,,STATUS,,,,

Originally created by @snowie-swe on GitHub (Feb 14, 2019). ### **Environment** NetBox version: 2.5.5 ### **Steps to Reproduce** 1: Click export within devices/cables ### **Expected Behavior** All fields presented within the list to be exported in csv format. So its in a usable format similar to exporting other things within netbox such as devices. id,Lable,Termination A (device and port), Termination B (device and port),, Status, Type, Color, Lenght ### **Observed Behavior** dcim.interface,XXXX,dcim.interface,XXXX,,STATUS,,,,
adam added the status: duplicate label 2025-12-29 17:25:33 +01:00
adam closed this issue 2025-12-29 17:25:33 +01:00
Author
Owner

@candlerb commented on GitHub (Feb 15, 2019):

More generally: the CSV export format currently does not match the CSV import format for cables. For example, the export says dcim.interface whereas the import requires interface.

People use the export as a guide to the format for importing, and are surprised when it doesn't work (and have to grok the source to find out the actual format for import).

@candlerb commented on GitHub (Feb 15, 2019): More generally: the CSV export format currently does not match the CSV import format for cables. For example, the export says `dcim.interface` whereas the import requires `interface`. People use the export as a guide to the format for importing, and are surprised when it doesn't work (and have to grok the source to find out the actual format for import).
Author
Owner

@candlerb commented on GitHub (Feb 15, 2019):

Here is a concrete example. A cable which I imported using the following CSV:

side_a_device,side_a_type,side_a_name,side_b_device,side_b_type,side_b_name,type
mk938-rtr1,interface,1/1/10a,mk938-r5-odf1,frontport,E1,Singlemode Fiber

Exports as:

termination_a_type,termination_a_id,termination_b_type,termination_b_id,type,status,label,color,length,length_unit
dcim.interface,875,dcim.frontport,11617,Singlemode Fiber,Connected,,,,

Those are the termination IDs not the device IDs; they map to /dcim/interfaces/857/ and /dcim/front-ports/11617/ respectively. So the XXXX does define the termination point, just not in a useful form. At least the Type is the same :-)

In other CSV import/export areas in Netbox, the interface ID doesn't normally appear. You can't directly import or export interfaces, and there is no top-level /dcim/interfaces/ view. But in other areas, the CSV export gives the device name and interface name.

For example, if I attach an IP address to the interface, and then export IP addresses, I get:

address,vrf,tenant,status,role,device,virtual_machine,interface_name,is_primary,description
192.168.1.1/24,,,Active,,mk938-rtr1,,1/1/10a,,

Instead of interface ID there's the device or VM name plus interface name - no need for termination type here, since IP addresses can only be attached to "interface".

@candlerb commented on GitHub (Feb 15, 2019): Here is a concrete example. A cable which I imported using the following CSV: ``` side_a_device,side_a_type,side_a_name,side_b_device,side_b_type,side_b_name,type mk938-rtr1,interface,1/1/10a,mk938-r5-odf1,frontport,E1,Singlemode Fiber ``` Exports as: ``` termination_a_type,termination_a_id,termination_b_type,termination_b_id,type,status,label,color,length,length_unit dcim.interface,875,dcim.frontport,11617,Singlemode Fiber,Connected,,,, ``` Those are the termination IDs not the device IDs; they map to `/dcim/interfaces/857/` and `/dcim/front-ports/11617/` respectively. So the XXXX *does* define the termination point, just not in a useful form. At least the Type is the same :-) In other CSV import/export areas in Netbox, the interface ID doesn't normally appear. You can't directly import or export interfaces, and there is no top-level `/dcim/interfaces/` view. But in other areas, the CSV export gives the device name and interface name. For example, if I attach an IP address to the interface, and then export IP addresses, I get: ``` address,vrf,tenant,status,role,device,virtual_machine,interface_name,is_primary,description 192.168.1.1/24,,,Active,,mk938-rtr1,,1/1/10a,, ``` Instead of interface ID there's the device or VM name plus interface name - no need for termination type here, since IP addresses can only be attached to "interface".
Author
Owner

@DanSheps commented on GitHub (Feb 25, 2019):

See #2563/#2543.

This exports "terminations", which can be more then just front ports, rear ports and interfaces

@DanSheps commented on GitHub (Feb 25, 2019): See #2563/#2543. This exports "terminations", which can be more then just front ports, rear ports and interfaces
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2383