Cable Export to CSV is Not in an Importable Format and Does Not Contain Human Readable Names #4214

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

Originally created by @lastwednesday on GitHub (Oct 26, 2020).

Environment

  • Python version: 3.8.0
  • NetBox version: 2.9.7

The export to CSV of the current cabling contains column headers and key values which are not valid if one tries to import that CSV back into NetBox. For example if one wanted to export the current cabling for a site, the data exports:

termination_a_type,termination_a_id,termination_b_type,termination_b_id,type,status,label,color,length,length_unit
dcim.rearport,2580,dcim.rearport,121,Multimode Fiber,Connected,DEVICE-01-PORT-LABEL,,,
dcim.rearport,123,dcim.rearport,2546,Multimode Fiber,Connected,,,,

Steps to Reproduce

  1. It would be very helpful if this export contained the human readable names of the devices on either side of the connection, as found in side_a_device, side_a_name, &c. The termination IDs are meaningless to a human, and the only way to find out what they mean is to go type them onto the address bar, eg https://netboxserver/dcim/rear-ports/2580/
    Even if one tries to do a global search for that termination ID it won't return what it means.

  2. The exported CSV is not importable without rewriting the lines entirely. For example if one tries to import this CSV back in, it returns these errors, including eg that the column headers are not valid and things like "dcim.rearport" must be replaced with "rearport" only.
    image

  3. To rewrite the csv so it can be inputted it must take the form of eg:

side_a_device,side_a_type,side_a_name,side_b_device,side_b_type,side_b_name,type,status,label
DEVICE-01,rearport,N2-P1,SWITCH-01,rearport,S2-P8,Multimode Fiber,Connected,DEVICE-01-PORT-LABE

Expected Behavior

The values exported into CSV should be in valid format to be importable, and also should match to what the user is displayed in the table when exporting it.

Observed Behavior

The values exported from CSV cannot be imported back in to the import function and are not accessibly named/labeled.

Originally created by @lastwednesday on GitHub (Oct 26, 2020). ### Environment * Python version: 3.8.0 * NetBox version: 2.9.7 The export to CSV of the current cabling contains column headers and key values which are not valid if one tries to import that CSV back into NetBox. For example if one wanted to export the current cabling for a site, the data exports: ``` termination_a_type,termination_a_id,termination_b_type,termination_b_id,type,status,label,color,length,length_unit dcim.rearport,2580,dcim.rearport,121,Multimode Fiber,Connected,DEVICE-01-PORT-LABEL,,, dcim.rearport,123,dcim.rearport,2546,Multimode Fiber,Connected,,,, ``` ### Steps to Reproduce 1. It would be very helpful if this export contained the human readable names of the devices on either side of the connection, as found in side_a_device, side_a_name, &c. The termination IDs are meaningless to a human, and the only way to find out what they mean is to go type them onto the address bar, eg https://netboxserver/dcim/rear-ports/2580/ Even if one tries to do a global search for that termination ID it won't return what it means. 1. The exported CSV is not importable without rewriting the lines entirely. For example if one tries to import this CSV back in, it returns these errors, including eg that the column headers are not valid and things like "dcim.rearport" must be replaced with "rearport" only. ![image](https://user-images.githubusercontent.com/579420/97234390-b1394180-17ae-11eb-8c27-4ca116c2251a.png) 1. To rewrite the csv so it can be inputted it must take the form of eg: ``` side_a_device,side_a_type,side_a_name,side_b_device,side_b_type,side_b_name,type,status,label DEVICE-01,rearport,N2-P1,SWITCH-01,rearport,S2-P8,Multimode Fiber,Connected,DEVICE-01-PORT-LABE ``` ### Expected Behavior The values exported into CSV should be in valid format to be importable, and also should match to what the user is displayed in the table when exporting it. ### Observed Behavior The values exported from CSV cannot be imported back in to the import function and are not accessibly named/labeled.
adam closed this issue 2025-12-29 18:33:54 +01:00
Author
Owner

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

This issue is pending closure as it does not conform to one of the provided templates as required by the contributing guide. If you'd like to request that your issue be re-opened, please first update the content so that it matches the appropriate template (this may require rewriting your issue entirely).

@jeremystretch commented on GitHub (Oct 27, 2020): This issue is pending closure as it does not conform to one of the [provided templates](https://github.com/netbox-community/netbox/issues/new/choose) as required by the [contributing guide](https://github.com/netbox-community/netbox/blob/master/CONTRIBUTING.md). If you'd like to request that your issue be re-opened, please first update the content so that it matches the appropriate template (this may require rewriting your issue entirely).
Author
Owner

@lastwednesday commented on GitHub (Oct 27, 2020):

This issue is pending closure as it does not conform to one of the provided templates as required by the contributing guide. If you'd like to request that your issue be re-opened, please first update the content so that it matches the appropriate template (this may require rewriting your issue entirely).

Updated into the template. Thank you.

@lastwednesday commented on GitHub (Oct 27, 2020): > This issue is pending closure as it does not conform to one of the [provided templates](https://github.com/netbox-community/netbox/issues/new/choose) as required by the [contributing guide](https://github.com/netbox-community/netbox/blob/master/CONTRIBUTING.md). If you'd like to request that your issue be re-opened, please first update the content so that it matches the appropriate template (this may require rewriting your issue entirely). Updated into the template. Thank you.
Author
Owner

@jeremystretch commented on GitHub (Oct 30, 2020):

This has been raised in other issues. The import and export formats were never intended to match exactly, because additional context is often needed to facilitate the import of objects (e.g. indicating both the site and rack group of a rack when importing devices). The CSV import forms are somewhat dynamic to accommodate this. Further, #4999 seeks to achieve dynamic export rendering, where the format of the output file will match the user's table configuration.

If you need to export a file that exactly matches the expected input, you can always create an export template to do so.

@jeremystretch commented on GitHub (Oct 30, 2020): This has been raised in other issues. The import and export formats were never intended to match exactly, because additional context is often needed to facilitate the import of objects (e.g. indicating both the site and rack group of a rack when importing devices). The CSV import forms are somewhat dynamic to accommodate this. Further, #4999 seeks to achieve dynamic export rendering, where the format of the output file will match the user's table configuration. If you need to export a file that _exactly_ matches the expected input, you can always create an export template to do so.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4214