netbox
netbox copied to clipboard
4347 Add JSON/YAML import support for all objects
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.
Sorry it's taken so long to get around to this. This is a great start!
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"
}
}