[PR #3621] [MERGED] Enable YAML/JSON-based DeviceType import #12599

Closed
opened 2025-12-29 22:22:33 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/3621
Author: @jeremystretch
Created: 10/17/2019
Status: Merged
Merged: 10/17/2019
Merged by: @jeremystretch

Base: develop-2.7Head: 451-devicetype-import


📝 Commits (10+)

  • f8fdca4 Initial work on JSON/YAML-based DeviceType import
  • 5266fc6 Extend DeviceType import to include related objects
  • 60b70b6 Add RearPortTemplate power_port field
  • 5049c6c Add test for DeviceType import
  • 15b2a7e Fix form rendering; enable toggling of redirect to imported object
  • 2621f17 Remove legacy CSV-based DeviceType import
  • 30ee232 Move JSON/YAML data valdiation to ImportForm
  • 0615d36 Force validation of individual objects within a MultiObjectField
  • 93154ab Merge branch 'develop' into 451-devicetype-import
  • 47f1feb Capture import form field default values

📊 Changes

12 files changed (+908 additions, -85 deletions)

View changed files

📝 netbox/dcim/constants.py (+400 -21)
📝 netbox/dcim/forms.py (+139 -18)
📝 netbox/dcim/tests/test_views.py (+130 -3)
📝 netbox/dcim/urls.py (+1 -1)
📝 netbox/dcim/views.py (+27 -6)
📝 netbox/templates/dcim/device_import.html (+1 -1)
📝 netbox/templates/dcim/device_import_child.html (+1 -1)
📝 netbox/templates/secrets/secret_import.html (+1 -1)
netbox/templates/utilities/obj_bulk_import.html (+60 -0)
📝 netbox/templates/utilities/obj_import.html (+4 -31)
📝 netbox/utilities/forms.py (+39 -0)
📝 netbox/utilities/views.py (+105 -2)

📄 Description

Fixes: #451

Replace the existing CSV-based import functionality for device types with a new, more complete YAML/JSON-based import.

Note that this requires specifying component types as slugs rather than integers (see #3569).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/3621 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 10/17/2019 **Status:** ✅ Merged **Merged:** 10/17/2019 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop-2.7` ← **Head:** `451-devicetype-import` --- ### 📝 Commits (10+) - [`f8fdca4`](https://github.com/netbox-community/netbox/commit/f8fdca49680fe0de8b635628a2149d2920fb1f28) Initial work on JSON/YAML-based DeviceType import - [`5266fc6`](https://github.com/netbox-community/netbox/commit/5266fc67c9fc55ff01cd165a6c7ce528ea16e78a) Extend DeviceType import to include related objects - [`60b70b6`](https://github.com/netbox-community/netbox/commit/60b70b6c7b1f55cf5a65ccd8c3af9b5d3533ce89) Add RearPortTemplate power_port field - [`5049c6c`](https://github.com/netbox-community/netbox/commit/5049c6c0a1a91641f04a50e7bcec9b3b9678a743) Add test for DeviceType import - [`15b2a7e`](https://github.com/netbox-community/netbox/commit/15b2a7eab0612ab43eda6f17f37b4eabe4b34097) Fix form rendering; enable toggling of redirect to imported object - [`2621f17`](https://github.com/netbox-community/netbox/commit/2621f17cdef78d70d8ab1b1ddbba468eed25da92) Remove legacy CSV-based DeviceType import - [`30ee232`](https://github.com/netbox-community/netbox/commit/30ee232654bc7d9220f92c74fda9f15d12802059) Move JSON/YAML data valdiation to ImportForm - [`0615d36`](https://github.com/netbox-community/netbox/commit/0615d368f2b3d0077a6f335d90adcb063414ad3c) Force validation of individual objects within a MultiObjectField - [`93154ab`](https://github.com/netbox-community/netbox/commit/93154abb3166cc00f0f3e459fe01a985a5a62718) Merge branch 'develop' into 451-devicetype-import - [`47f1feb`](https://github.com/netbox-community/netbox/commit/47f1febfc96a54c543ba58b507caa6bfaebe66e6) Capture import form field default values ### 📊 Changes **12 files changed** (+908 additions, -85 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/constants.py` (+400 -21) 📝 `netbox/dcim/forms.py` (+139 -18) 📝 `netbox/dcim/tests/test_views.py` (+130 -3) 📝 `netbox/dcim/urls.py` (+1 -1) 📝 `netbox/dcim/views.py` (+27 -6) 📝 `netbox/templates/dcim/device_import.html` (+1 -1) 📝 `netbox/templates/dcim/device_import_child.html` (+1 -1) 📝 `netbox/templates/secrets/secret_import.html` (+1 -1) ➕ `netbox/templates/utilities/obj_bulk_import.html` (+60 -0) 📝 `netbox/templates/utilities/obj_import.html` (+4 -31) 📝 `netbox/utilities/forms.py` (+39 -0) 📝 `netbox/utilities/views.py` (+105 -2) </details> ### 📄 Description ### Fixes: #451 Replace the existing CSV-based import functionality for device types with a new, more complete YAML/JSON-based import. Note that this requires specifying component types as slugs rather than integers (see #3569). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:22:33 +01:00
adam closed this issue 2025-12-29 22:22:33 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12599