Device type exports: unclear which is CSV and which is YAML #5784

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

Originally created by @candlerb on GitHub (Dec 15, 2021).

NetBox version

v3.1.1

Python version

3.8

Steps to Reproduce

  1. Navigate to Devices > Device Types
  2. Optionally: mark the checkbox next to one device type (this doesn't make a difference but see below)
  3. Select Export > Current View
  4. Select Export > All Data

Expected Behavior

Either it should export consistently as YAML; or the two different export modes should be clearly labelled as "CSV" and "YAML".

Observed Behavior

"Export > Current View" gives you netbox_device types.csv, in CSV format, with all the devices listed (not just the checked one)

"Export > All Data" gives you a netbox_device types.yaml, a multi-document YAML file with all the devices listed (not just the checked one)


What I was actually trying to do was to export the YAML definition of a single device type, in order to import it to another system.

I eventually found the solution:

  • Go to Device Types
  • Go to the Filter tab
  • Make a filter which selects just the device type of interest
  • Select Export > All Data (not Export > Current View)

That wasn't at all obvious at first.

I have two other ideas which might help:

  1. When you go to an individual Device Type page, have an Export button (which exports just that one). This is where I was looking in the first place.
  2. More generally: if you have a listing of items, and check one or more of them, then limit "Export" to the rows checked (or: have an "Export Selected" button at the bottom, next to Edit Selected and Delete Selected)

I can raise those as separate FRs if you like.

Originally created by @candlerb on GitHub (Dec 15, 2021). ### NetBox version v3.1.1 ### Python version 3.8 ### Steps to Reproduce 1. Navigate to Devices > Device Types 2. Optionally: mark the checkbox next to one device type (this doesn't make a difference but see below) 3. Select Export > Current View 4. Select Export > All Data ### Expected Behavior Either it should export consistently as YAML; or the two different export modes should be clearly labelled as "CSV" and "YAML". ### Observed Behavior "Export > Current View" gives you `netbox_device types.csv`, in CSV format, with all the devices listed (not just the checked one) "Export > All Data" gives you a `netbox_device types.yaml`, a multi-document YAML file with all the devices listed (not just the checked one) ---- What I was actually trying to do was to export the YAML definition of a _single_ device type, in order to import it to another system. I eventually found the solution: * Go to Device Types * Go to the Filter tab * Make a filter which selects just the device type of interest * Select Export > All Data (not Export > Current View) That wasn't at all obvious at first. I have two other ideas which might help: 1. When you go to an individual Device Type page, have an Export button (which exports just that one). This is where I was looking in the first place. 2. More generally: if you have a listing of items, and check one or more of them, then limit "Export" to the rows checked (or: have an "Export Selected" button at the bottom, next to Edit Selected and Delete Selected) I can raise those as separate FRs if you like.
adam closed this issue 2025-12-29 19:32:38 +01:00
Author
Owner

@jeremystretch commented on GitHub (Dec 15, 2021):

Either it should export consistently as YAML; or the two different export modes should be clearly labelled as "CSV" and "YAML".

The "current view" option exports exactly that: the current table view (as CSV). This is consistent across all models, and YAML is not supported for this function. In contrast, "all data" exports all data, not just what has been included on the table. The only thing different about devices types is that "all data" exports as YAML rather than CSV (to include the associated component templates of each object).

Additionally, selecting objects in the table has no bearing on the export function. The checkboxes are used only for the bulk operations listed under the table.

  1. When you go to an individual Device Type page, have an Export button (which exports just that one).

This seems like a pretty niche feature, but you're welcome to submit a feature request for it. Bear in mind it would need to be implemented for every relevant model in NetBox for consistency (not just device types).

  1. More generally: if you have a listing of items, and check one or more of them, then limit "Export" to the rows checked (or: have an "Export Selected" button at the bottom, next to Edit Selected and Delete Selected)

This would also need to be a separate feature request.

@jeremystretch commented on GitHub (Dec 15, 2021): > Either it should export consistently as YAML; or the two different export modes should be clearly labelled as "CSV" and "YAML". The "current view" option exports exactly that: the current table view (as CSV). This is consistent across all models, and YAML is not supported for this function. In contrast, "all data" exports _all_ data, not just what has been included on the table. The only thing different about devices types is that "all data" exports as YAML rather than CSV (to include the associated component templates of each object). Additionally, selecting objects in the table has no bearing on the export function. The checkboxes are used only for the bulk operations listed under the table. > 1. When you go to an individual Device Type page, have an Export button (which exports just that one). This seems like a pretty niche feature, but you're welcome to submit a feature request for it. Bear in mind it would need to be implemented for _every_ relevant model in NetBox for consistency (not just device types). > 2. More generally: if you have a listing of items, and check one or more of them, then limit "Export" to the rows checked (or: have an "Export Selected" button at the bottom, next to Edit Selected and Delete Selected) This would also need to be a separate feature request.
Author
Owner

@candlerb commented on GitHub (Dec 18, 2021):

I think this issue will go away when #4347 is implemented, because at that point you'll have to select CSV or YAML explicitly anyway.

Opened #8109 for filtering export to checked items.

@candlerb commented on GitHub (Dec 18, 2021): I think this issue will go away when #4347 is implemented, because at that point you'll have to select CSV or YAML explicitly anyway. Opened #8109 for filtering export to checked items.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5784