netbox icon indicating copy to clipboard operation
netbox copied to clipboard

4347 Add JSON/YAML import support for all objects

Open arthanson opened this issue 3 years ago • 2 comments

Fixes: #4347

Add JSON/YAML import support for all objects. Changes DeviceType and ModuleType import to use the standard BulkImportView. Changes BulkImportView code and forms to incorporate the JSON and YAML import code.

arthanson avatar Sep 14 '22 18:09 arthanson

Sorry it's taken so long to get around to this. This is a great start!

jeremystretch avatar Sep 29 '22 19:09 jeremystretch

One thing we still need to consider is how to replicate the field accessor function from the CSV import to the JSON and YAML imports. For example, you can specify region.id when import sites to reference regions by numeric ID rather than by name. Ideally, we'd support the same mechanism so that both of the example below work:

{
    "name": "Site 1",
    "slug": "site-1",
    "status": "active",
    "region": 4
}
{
    "name": "Site 1",
    "slug": "site-1",
    "status": "active",
    "region": {
        "name": "Africa"
    }
}

jeremystretch avatar Oct 05 '22 18:10 jeremystretch