Add JSON/YAML import support for all objects #3464

Closed
opened 2025-12-29 18:29:21 +01:00 by adam · 7 comments
Owner

Originally created by @jeremystretch on GitHub (Mar 11, 2020).

Originally assigned to: @arthanson on GitHub.

Proposed Changes

Allow users to import objects in YAML or JSON format in addition to the existing support for CSV. YAML/JSON support was introduced for device types in #451; this extends that same functionality to all models.

Justification

JSON and YAML offer greater flexibility than CSV in incorporating related instances, as well as referencing parent objects.

Originally created by @jeremystretch on GitHub (Mar 11, 2020). Originally assigned to: @arthanson on GitHub. ### Proposed Changes Allow users to import objects in YAML or JSON format in addition to the existing support for CSV. YAML/JSON support was introduced for device types in #451; this extends that same functionality to all models. ### Justification JSON and YAML offer greater flexibility than CSV in incorporating related instances, as well as referencing parent objects.
adam added the status: acceptedtype: feature labels 2025-12-29 18:29:21 +01:00
adam closed this issue 2025-12-29 18:29:21 +01:00
Author
Owner

@BarbarossaTM commented on GitHub (May 10, 2020):

This is really cool, thanks!

Are there any plans to allow import of a full export with multiple items (for examples device types) at once? This would be really awesome!

Thanks and best
Max

@BarbarossaTM commented on GitHub (May 10, 2020): This is really cool, thanks! Are there any plans to allow import of a full export with multiple items (for examples device types) at once? This would be really awesome! Thanks and best Max
Author
Owner

@kjetilho commented on GitHub (Jul 6, 2021):

One use case for this feature: The changelog holds the JSON object for deleted objects, and it would be very convenient if this could be fed directly into an Import Device dialog to get an undo feature. (Since the JSON contains numeric ids for stuff like site or device_type, it is not so convenient to recreate the device by hand.)

@kjetilho commented on GitHub (Jul 6, 2021): One use case for this feature: The changelog holds the JSON object for deleted objects, and it would be very convenient if this could be fed directly into an Import Device dialog to get an undo feature. (Since the JSON contains numeric ids for stuff like `site` or `device_type`, it is not so convenient to recreate the device by hand.)
Author
Owner

@jeremystretch commented on GitHub (Oct 19, 2021):

Punting this to v3.2 as we'll likely need to refactor the current JSON/YAML import view substantially to accommodate models beyond device type.

@jeremystretch commented on GitHub (Oct 19, 2021): Punting this to v3.2 as we'll likely need to refactor the current JSON/YAML import view substantially to accommodate models beyond device type.
Author
Owner

@sol1-matt commented on GitHub (Nov 14, 2021):

The import/export of device types already supports YAML but has limitations (discussion #6228). It works differently from normal import/export so don't know if would fall under the umbrella of this issue.

The ability to automatically create the linked objects is nice but the inability to bulk import isn't.

If there is to be a refactor consideration of device types would be useful.

@sol1-matt commented on GitHub (Nov 14, 2021): The import/export of device types already supports YAML but has limitations (discussion #6228). It works differently from normal import/export so don't know if would fall under the umbrella of this issue. The ability to automatically create the linked objects is nice but the inability to bulk import isn't. If there is to be a refactor consideration of device types would be useful.
Author
Owner

@tom0010 commented on GitHub (Sep 2, 2022):

One use case for this feature: The changelog holds the JSON object for deleted objects, and it would be very convenient if this could be fed directly into an Import Device dialog to get an undo feature. (Since the JSON contains numeric ids for stuff like site or device_type, it is not so convenient to recreate the device by hand.)

Also looking for this type of thing.

In this release, would it be possible to do that via the API too?

@tom0010 commented on GitHub (Sep 2, 2022): > One use case for this feature: The changelog holds the JSON object for deleted objects, and it would be very convenient if this could be fed directly into an Import Device dialog to get an undo feature. (Since the JSON contains numeric ids for stuff like `site` or `device_type`, it is not so convenient to recreate the device by hand.) Also looking for this type of thing. In this release, would it be possible to do that via the API too?
Author
Owner

@jsenecal commented on GitHub (Sep 2, 2022):

One use case for this feature: The changelog holds the JSON object for deleted objects, and it would be very convenient if this could be fed directly into an Import Device dialog to get an undo feature. (Since the JSON contains numeric ids for stuff like site or device_type, it is not so convenient to recreate the device by hand.)

Also looking for this type of thing.

In this release, would it be possible to do that via the API too?

What do you mean by "do that via the API too" ?

@jsenecal commented on GitHub (Sep 2, 2022): > > One use case for this feature: The changelog holds the JSON object for deleted objects, and it would be very convenient if this could be fed directly into an Import Device dialog to get an undo feature. (Since the JSON contains numeric ids for stuff like `site` or `device_type`, it is not so convenient to recreate the device by hand.) > > Also looking for this type of thing. > > In this release, would it be possible to do that via the API too? What do you mean by "do that via the API too" ?
Author
Owner

@tom0010 commented on GitHub (Sep 2, 2022):

Bulk import NetBox information in json format via the API as well as in the GUI.

In this issue, my understanding is that you could bulk import yaml AND json, therefore I am assuming it's just the GUI.
Even though yaml and json follow the same model as such, from how I am reading it, it seems like this is a just GUI functionality. So I'd like to have the ability to do that via the API too if possible.

@tom0010 commented on GitHub (Sep 2, 2022): Bulk import NetBox information in json format via the API as well as in the GUI. In this issue, my understanding is that you could bulk import yaml AND json, therefore I am assuming it's just the GUI. Even though yaml and json follow the same model as such, from how I am reading it, it seems like this is a just GUI functionality. So I'd like to have the ability to do that via the API too if possible.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3464