Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
candlerb opened this issue Dec 15, 2021 · 2 comments
Closed

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

candlerb opened this issue Dec 15, 2021 · 2 comments

Comments

@candlerb
Copy link
Contributor

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.

@candlerb candlerb added the type: bug A confirmed report of unexpected behavior in the application label Dec 15, 2021
@jeremystretch
Copy link
Member

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 jeremystretch removed the type: bug A confirmed report of unexpected behavior in the application label Dec 15, 2021
@candlerb
Copy link
Contributor Author

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants