CSV export/import of cable model not consistent #2083

Closed
opened 2025-12-29 17:22:07 +01:00 by adam · 10 comments
Owner

Originally created by @vink78 on GitHub (Nov 2, 2018).

Environment

  • Python version: 3.5.2-2ubuntu0~16.04.4
  • NetBox version: develop-2.5

Steps to Reproduce

  • Go to the cable list (menu Devices -> Connection -> Cables)

Fields are:

ID Label Termination A   Termination B   Status Type Color Length
  • Click on export

Fields are:

termination_a_type termination_a_id termination_b_type termination_b_id type status label color length length_unit
  • Go to the cable list import (menu Devices -> Connection -> Cables import)

Fields are:

side_a_device side_a_type side_a_name side_b_device side_b_type side_b_name type status label color length length_unit

Expected Behavior

  • The expected behavior is to have an export CSV file which use the same format than import cable function.

Observed Behavior

termination_a_type termination_a_id termination_b_type termination_b_id type status label color length length_unit
dcim.interface 1031 dcim.interface 41   Connected    

Only termination ID are displayed.

Originally created by @vink78 on GitHub (Nov 2, 2018). ### Environment * Python version: 3.5.2-2ubuntu0~16.04.4 * NetBox version: develop-2.5 ### Steps to Reproduce * Go to the cable list (menu Devices -> Connection -> Cables) Fields are: ID | Label | Termination A |   | Termination B |   | Status | Type | Color | Length -- | -- | -- | -- | -- | -- | -- | -- | -- | - * Click on export Fields are: termination_a_type | termination_a_id | termination_b_type | termination_b_id | type | status | label | color | length | length_unit -- | -- | -- | -- | -- | -- | -- | -- | -- | -- * Go to the cable list *import* (menu Devices -> Connection -> Cables import) Fields are: side_a_device | side_a_type | side_a_name | side_b_device |side_b_type | side_b_name | type | status | label | color | length | length_unit -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- <!-- What did you expect to happen? --> ### Expected Behavior * The expected behavior is to have an export CSV file which use the same format than import cable function. <!-- What happened instead? --> ### Observed Behavior termination_a_type | termination_a_id | termination_b_type | termination_b_id | type | status | label | color | length | length_unit -- | -- | -- | -- | -- | -- | -- | -- | -- | -- dcim.interface | 1031 | dcim.interface | 41 |   | Connected |   |   Only termination ID are displayed.
adam closed this issue 2025-12-29 17:22:07 +01:00
Author
Owner

@jeremystretch commented on GitHub (Nov 2, 2018):

What specifically are you requesting be changed? If we replace the (side_x_device, side_x_type, side_x_name) sets with (termination_x_type, termination_x_id) it would require the user to first collect the primary keys of all components being connected when importing new cables.

@jeremystretch commented on GitHub (Nov 2, 2018): What specifically are you requesting be changed? If we replace the (`side_x_device`, `side_x_type`, `side_x_name`) sets with (`termination_x_type`, `termination_x_id`) it would require the user to first collect the primary keys of all components being connected when importing new cables.
Author
Owner

@vink78 commented on GitHub (Nov 2, 2018):

Agree.

I'ld like to have (termination_x_type, termination_x_id) replaced by (side_x_device, side_x_type, side_x_name).

@vink78 commented on GitHub (Nov 2, 2018): Agree. I'ld like to have (`termination_x_type`, `termination_x_id`) replaced by (`side_x_device`, `side_x_type`, `side_x_name`).
Author
Owner

@jeremystretch commented on GitHub (Nov 6, 2018):

This wouldn't allow for the export of cables connecting circuit terminations.

@jeremystretch commented on GitHub (Nov 6, 2018): This wouldn't allow for the export of cables connecting circuit terminations.
Author
Owner

@vink78 commented on GitHub (Nov 7, 2018):

Ok. Now I understand why you choose to export termination_x_type and termination_x_id field.

An alternate solution for my problem is to define a custom export template for the cable model (thus I could re-import data on a second netbox installation). Do you have this feature on the roadmap?

Regards,

Vincent

@vink78 commented on GitHub (Nov 7, 2018): Ok. Now I understand why you choose to export `termination_x_type` and `termination_x_id` field. An alternate solution for my problem is to define a custom export template for the cable model (thus I could re-import data on a second netbox installation). Do you have this feature on the roadmap? Regards, Vincent
Author
Owner

@jeremystretch commented on GitHub (Nov 7, 2018):

Do you have this feature on the roadmap?

It's supposed to be working right now, but it appears I neglected to add the model to the list. I've opened #2563 for this.

Can we close this out?

@jeremystretch commented on GitHub (Nov 7, 2018): > Do you have this feature on the roadmap? It's supposed to be working right now, but it appears I neglected to add the model to the list. I've opened #2563 for this. Can we close this out?
Author
Owner

@a31amit commented on GitHub (Nov 8, 2018):

I did a fresh install of netbox-2.5-beta1 and it seems Import button is missing from cables view.

Also, It would be really easier if we have exact import and exports csv column. This help will user when working on the DC floor for configuring cable or swapping them. otherwise looking at other things or fill them manually leads to more time spend on prepare proper CSV file.

Is that something nativelly added to netbox itself ?

@a31amit commented on GitHub (Nov 8, 2018): I did a fresh install of netbox-2.5-beta1 and it seems Import button is missing from cables view. Also, It would be really easier if we have exact import and exports csv column. This help will user when working on the DC floor for configuring cable or swapping them. otherwise looking at other things or fill them manually leads to more time spend on prepare proper CSV file. Is that something nativelly added to netbox itself ?
Author
Owner

@jeremystretch commented on GitHub (Nov 8, 2018):

I did a fresh install of netbox-2.5-beta1 and it seems Import button is missing from cables view.

Yes, it's only fixed in the develop-2.5 branch.

Also, It would be really easier if we have exact import and exports csv column.

This is exactly what was just discussed above.

@jeremystretch commented on GitHub (Nov 8, 2018): > I did a fresh install of netbox-2.5-beta1 and it seems Import button is missing from cables view. Yes, it's only fixed in the `develop-2.5` branch. > Also, It would be really easier if we have exact import and exports csv column. This is exactly what was just discussed above.
Author
Owner

@a31amit commented on GitHub (Nov 9, 2018):

Yes, it's only fixed in the develop-2.5 branch.

I did a pull from develop-2.5 and it seems its still missing?
https://github.com/digitalocean/netbox/blob/develop-2.5/netbox/templates/dcim/cable_list.html
There is no import button exist there.

@jeremystretch Please check

@a31amit commented on GitHub (Nov 9, 2018): > Yes, it's only fixed in the `develop-2.5` branch. I did a pull from develop-2.5 and it seems its still missing? https://github.com/digitalocean/netbox/blob/develop-2.5/netbox/templates/dcim/cable_list.html There is no import button exist there. @jeremystretch Please check
Author
Owner

@jeremystretch commented on GitHub (Nov 20, 2018):

Added the button to the list view in c29ae9b. The import view was accessible via the navigation menu but not from the list view.

@jeremystretch commented on GitHub (Nov 20, 2018): Added the button to the list view in c29ae9b. The import view was accessible via the navigation menu but not from the list view.
Author
Owner

@ChrisWilkins82 commented on GitHub (Dec 20, 2018):

Thanks Jeremy, but that really wasn't what I was driving at; I guess that I wasn't very clear. However, you'll be happy to hear that this was a PEBKAC error. One of the lines in my data-set was causing my import problem.

My apologies, and thanks for a great tool!

@ChrisWilkins82 commented on GitHub (Dec 20, 2018): Thanks Jeremy, but that really wasn't what I was driving at; I guess that I wasn't very clear. However, you'll be happy to hear that this was a PEBKAC error. One of the lines in my data-set was causing my import problem. My apologies, and thanks for a great tool!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2083