From 1b26afdfbb5edc39c4a6a09e6862c855e89cb461 Mon Sep 17 00:00:00 2001 From: Saria Hajjar Date: Thu, 23 Jan 2020 14:26:04 +0000 Subject: [PATCH 01/29] Fixes #3935: Swagger DEFAULT_INFO --- netbox/netbox/settings.py | 1 + netbox/netbox/urls.py | 16 +++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index e5925184d..f747c3b1d 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -503,6 +503,7 @@ SWAGGER_SETTINGS = { 'utilities.custom_inspectors.IdInFilterInspector', 'drf_yasg.inspectors.CoreAPICompatInspector', ], + 'DEFAULT_INFO': 'netbox.urls.openapi_info', 'DEFAULT_MODEL_DEPTH': 1, 'DEFAULT_PAGINATOR_INSPECTORS': [ 'utilities.custom_inspectors.NullablePaginatorInspector', diff --git a/netbox/netbox/urls.py b/netbox/netbox/urls.py index 6b6dfe22d..66ab982eb 100644 --- a/netbox/netbox/urls.py +++ b/netbox/netbox/urls.py @@ -9,14 +9,16 @@ from netbox.views import APIRootView, HomeView, SearchView from users.views import LoginView, LogoutView from .admin import admin_site +openapi_info = openapi.Info( + title="NetBox API", + default_version='v2', + description="API to access NetBox", + terms_of_service="https://github.com/netbox-community/netbox", + license=openapi.License(name="Apache v2 License"), +) + schema_view = get_schema_view( - openapi.Info( - title="NetBox API", - default_version='v2', - description="API to access NetBox", - terms_of_service="https://github.com/netbox-community/netbox", - license=openapi.License(name="Apache v2 License"), - ), + openapi_info, validators=['flex', 'ssv'], public=True, ) From eb4c2e5d7f94aff1e190acab04975e1b85e135a8 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 24 Jan 2020 16:00:20 -0500 Subject: [PATCH 02/29] Remove obsolete fixtures files --- netbox/dcim/fixtures/dcim.json | 5790 ----------------- netbox/extras/fixtures/extras.json | 35 - netbox/ipam/fixtures/ipam.json | 329 - .../fixtures/virtualization.json | 170 - 4 files changed, 6324 deletions(-) delete mode 100644 netbox/dcim/fixtures/dcim.json delete mode 100644 netbox/extras/fixtures/extras.json delete mode 100644 netbox/ipam/fixtures/ipam.json delete mode 100644 netbox/virtualization/fixtures/virtualization.json diff --git a/netbox/dcim/fixtures/dcim.json b/netbox/dcim/fixtures/dcim.json deleted file mode 100644 index 2b379b9ff..000000000 --- a/netbox/dcim/fixtures/dcim.json +++ /dev/null @@ -1,5790 +0,0 @@ -[ -{ - "model": "dcim.site", - "pk": 1, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "name": "TEST1", - "slug": "test1", - "facility": "Test Facility", - "asn": 65535, - "physical_address": "555 Test Ave.\r\nTest, NY 55555", - "shipping_address": "", - "comments": "" - } -}, -{ - "model": "dcim.rack", - "pk": 1, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "name": "A1R1", - "facility_id": "T23A01", - "site": 1, - "group": null, - "u_height": 42, - "comments": "" - } -}, -{ - "model": "dcim.rack", - "pk": 2, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "name": "A1R2", - "facility_id": "T24A01", - "site": 1, - "group": null, - "u_height": 42, - "comments": "" - } -}, -{ - "model": "dcim.manufacturer", - "pk": 1, - "fields": { - "name": "Juniper", - "slug": "juniper" - } -}, -{ - "model": "dcim.manufacturer", - "pk": 2, - "fields": { - "name": "Opengear", - "slug": "opengear" - } -}, -{ - "model": "dcim.manufacturer", - "pk": 3, - "fields": { - "name": "ServerTech", - "slug": "servertech" - } -}, -{ - "model": "dcim.manufacturer", - "pk": 4, - "fields": { - "name": "Dell", - "slug": "dell" - } -}, -{ - "model": "dcim.devicetype", - "pk": 1, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "manufacturer": 1, - "model": "MX960", - "slug": "mx960", - "u_height": 16, - "is_full_depth": true - } -}, -{ - "model": "dcim.devicetype", - "pk": 2, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "manufacturer": 1, - "model": "EX9214", - "slug": "ex9214", - "u_height": 16, - "is_full_depth": true - } -}, -{ - "model": "dcim.devicetype", - "pk": 3, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "manufacturer": 1, - "model": "QFX5100-24Q", - "slug": "qfx5100-24q", - "u_height": 1, - "is_full_depth": true - } -}, -{ - "model": "dcim.devicetype", - "pk": 4, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "manufacturer": 1, - "model": "QFX5100-48S", - "slug": "qfx5100-48s", - "u_height": 1, - "is_full_depth": true - } -}, -{ - "model": "dcim.devicetype", - "pk": 5, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "manufacturer": 2, - "model": "CM4148", - "slug": "cm4148", - "u_height": 1, - "is_full_depth": true - } -}, -{ - "model": "dcim.devicetype", - "pk": 6, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "manufacturer": 3, - "model": "CWG-24VYM415C9", - "slug": "cwg-24vym415c9", - "u_height": 0, - "is_full_depth": false - } -}, -{ - "model": "dcim.devicetype", - "pk": 7, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "manufacturer": 4, - "model": "PowerEdge R640", - "slug": "poweredge-r640", - "u_height": 1, - "is_full_depth": false - } -}, -{ - "model": "dcim.consoleporttemplate", - "pk": 1, - "fields": { - "device_type": 1, - "name": "Console (RE0)" - } -}, -{ - "model": "dcim.consoleporttemplate", - "pk": 2, - "fields": { - "device_type": 1, - "name": "Console (RE1)" - } -}, -{ - "model": "dcim.consoleporttemplate", - "pk": 3, - "fields": { - "device_type": 2, - "name": "Console (RE0)" - } -}, -{ - "model": "dcim.consoleporttemplate", - "pk": 4, - "fields": { - "device_type": 2, - "name": "Console (RE1)" - } -}, -{ - "model": "dcim.consoleporttemplate", - "pk": 5, - "fields": { - "device_type": 3, - "name": "Console" - } -}, -{ - "model": "dcim.consoleporttemplate", - "pk": 6, - "fields": { - "device_type": 5, - "name": "Console" - } -}, -{ - "model": "dcim.consoleporttemplate", - "pk": 7, - "fields": { - "device_type": 6, - "name": "Serial" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 1, - "fields": { - "device_type": 3, - "name": "Console" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 3, - "fields": { - "device_type": 4, - "name": "Console" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 4, - "fields": { - "device_type": 5, - "name": "Port 1" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 5, - "fields": { - "device_type": 5, - "name": "Port 2" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 6, - "fields": { - "device_type": 5, - "name": "Port 3" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 7, - "fields": { - "device_type": 5, - "name": "Port 4" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 8, - "fields": { - "device_type": 5, - "name": "Port 5" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 9, - "fields": { - "device_type": 5, - "name": "Port 6" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 10, - "fields": { - "device_type": 5, - "name": "Port 7" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 11, - "fields": { - "device_type": 5, - "name": "Port 8" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 12, - "fields": { - "device_type": 5, - "name": "Port 9" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 13, - "fields": { - "device_type": 5, - "name": "Port 10" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 14, - "fields": { - "device_type": 5, - "name": "Port 11" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 15, - "fields": { - "device_type": 5, - "name": "Port 12" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 16, - "fields": { - "device_type": 5, - "name": "Port 13" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 17, - "fields": { - "device_type": 5, - "name": "Port 14" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 18, - "fields": { - "device_type": 5, - "name": "Port 15" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 19, - "fields": { - "device_type": 5, - "name": "Port 16" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 20, - "fields": { - "device_type": 5, - "name": "Port 17" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 21, - "fields": { - "device_type": 5, - "name": "Port 18" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 22, - "fields": { - "device_type": 5, - "name": "Port 19" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 23, - "fields": { - "device_type": 5, - "name": "Port 20" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 24, - "fields": { - "device_type": 5, - "name": "Port 21" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 25, - "fields": { - "device_type": 5, - "name": "Port 22" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 26, - "fields": { - "device_type": 5, - "name": "Port 23" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 27, - "fields": { - "device_type": 5, - "name": "Port 24" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 28, - "fields": { - "device_type": 5, - "name": "Port 25" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 29, - "fields": { - "device_type": 5, - "name": "Port 26" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 30, - "fields": { - "device_type": 5, - "name": "Port 27" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 31, - "fields": { - "device_type": 5, - "name": "Port 28" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 32, - "fields": { - "device_type": 5, - "name": "Port 29" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 33, - "fields": { - "device_type": 5, - "name": "Port 30" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 34, - "fields": { - "device_type": 5, - "name": "Port 31" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 35, - "fields": { - "device_type": 5, - "name": "Port 32" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 36, - "fields": { - "device_type": 5, - "name": "Port 33" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 37, - "fields": { - "device_type": 5, - "name": "Port 34" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 38, - "fields": { - "device_type": 5, - "name": "Port 35" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 39, - "fields": { - "device_type": 5, - "name": "Port 36" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 40, - "fields": { - "device_type": 5, - "name": "Port 37" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 41, - "fields": { - "device_type": 5, - "name": "Port 38" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 42, - "fields": { - "device_type": 5, - "name": "Port 39" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 43, - "fields": { - "device_type": 5, - "name": "Port 40" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 44, - "fields": { - "device_type": 5, - "name": "Port 41" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 45, - "fields": { - "device_type": 5, - "name": "Port 42" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 46, - "fields": { - "device_type": 5, - "name": "Port 43" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 47, - "fields": { - "device_type": 5, - "name": "Port 44" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 48, - "fields": { - "device_type": 5, - "name": "Port 45" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 49, - "fields": { - "device_type": 5, - "name": "Port 46" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 50, - "fields": { - "device_type": 5, - "name": "Port 47" - } -}, -{ - "model": "dcim.consoleserverporttemplate", - "pk": 51, - "fields": { - "device_type": 5, - "name": "Port 48" - } -}, -{ - "model": "dcim.powerporttemplate", - "pk": 1, - "fields": { - "device_type": 1, - "name": "PEM0" - } -}, -{ - "model": "dcim.powerporttemplate", - "pk": 2, - "fields": { - "device_type": 1, - "name": "PEM1" - } -}, -{ - "model": "dcim.powerporttemplate", - "pk": 3, - "fields": { - "device_type": 1, - "name": "PEM2" - } -}, -{ - "model": "dcim.powerporttemplate", - "pk": 4, - "fields": { - "device_type": 1, - "name": "PEM3" - } -}, -{ - "model": "dcim.powerporttemplate", - "pk": 5, - "fields": { - "device_type": 2, - "name": "PEM0" - } -}, -{ - "model": "dcim.powerporttemplate", - "pk": 6, - "fields": { - "device_type": 2, - "name": "PEM1" - } -}, -{ - "model": "dcim.powerporttemplate", - "pk": 7, - "fields": { - "device_type": 2, - "name": "PEM2" - } -}, -{ - "model": "dcim.powerporttemplate", - "pk": 8, - "fields": { - "device_type": 2, - "name": "PEM3" - } -}, -{ - "model": "dcim.powerporttemplate", - "pk": 9, - "fields": { - "device_type": 4, - "name": "PSU0" - } -}, -{ - "model": "dcim.powerporttemplate", - "pk": 11, - "fields": { - "device_type": 3, - "name": "PSU0" - } -}, -{ - "model": "dcim.powerporttemplate", - "pk": 12, - "fields": { - "device_type": 3, - "name": "PSU1" - } -}, -{ - "model": "dcim.powerporttemplate", - "pk": 13, - "fields": { - "device_type": 4, - "name": "PSU1" - } -}, -{ - "model": "dcim.powerporttemplate", - "pk": 14, - "fields": { - "device_type": 5, - "name": "PSU" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 4, - "fields": { - "device_type": 6, - "name": "AA1" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 5, - "fields": { - "device_type": 6, - "name": "AA2" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 6, - "fields": { - "device_type": 6, - "name": "AA3" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 7, - "fields": { - "device_type": 6, - "name": "AA4" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 8, - "fields": { - "device_type": 6, - "name": "AA5" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 9, - "fields": { - "device_type": 6, - "name": "AA6" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 10, - "fields": { - "device_type": 6, - "name": "AA7" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 11, - "fields": { - "device_type": 6, - "name": "AA8" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 12, - "fields": { - "device_type": 6, - "name": "AB1" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 13, - "fields": { - "device_type": 6, - "name": "AB2" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 14, - "fields": { - "device_type": 6, - "name": "AB3" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 15, - "fields": { - "device_type": 6, - "name": "AB4" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 16, - "fields": { - "device_type": 6, - "name": "AB5" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 17, - "fields": { - "device_type": 6, - "name": "AB6" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 18, - "fields": { - "device_type": 6, - "name": "AB7" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 19, - "fields": { - "device_type": 6, - "name": "AB8" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 20, - "fields": { - "device_type": 6, - "name": "AC1" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 21, - "fields": { - "device_type": 6, - "name": "AC2" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 22, - "fields": { - "device_type": 6, - "name": "AC3" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 23, - "fields": { - "device_type": 6, - "name": "AC4" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 24, - "fields": { - "device_type": 6, - "name": "AC5" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 25, - "fields": { - "device_type": 6, - "name": "AC6" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 26, - "fields": { - "device_type": 6, - "name": "AC7" - } -}, -{ - "model": "dcim.poweroutlettemplate", - "pk": 27, - "fields": { - "device_type": 6, - "name": "AC8" - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 1, - "fields": { - "device_type": 1, - "name": "fxp0 (RE0)", - "type": 1000, - "mgmt_only": true - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 2, - "fields": { - "device_type": 1, - "name": "fxp0 (RE1)", - "type": 800, - "mgmt_only": true - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 3, - "fields": { - "device_type": 1, - "name": "lo0", - "type": 0, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 4, - "fields": { - "device_type": 2, - "name": "fxp0 (RE0)", - "type": 1000, - "mgmt_only": true - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 5, - "fields": { - "device_type": 2, - "name": "fxp0 (RE1)", - "type": 1000, - "mgmt_only": true - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 6, - "fields": { - "device_type": 2, - "name": "lo0", - "type": 0, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 7, - "fields": { - "device_type": 3, - "name": "em0", - "type": 800, - "mgmt_only": true - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 8, - "fields": { - "device_type": 3, - "name": "et-0/0/0", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 9, - "fields": { - "device_type": 3, - "name": "et-0/0/1", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 10, - "fields": { - "device_type": 3, - "name": "et-0/0/2", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 11, - "fields": { - "device_type": 3, - "name": "et-0/0/3", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 12, - "fields": { - "device_type": 3, - "name": "et-0/0/4", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 13, - "fields": { - "device_type": 3, - "name": "et-0/0/5", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 14, - "fields": { - "device_type": 3, - "name": "et-0/0/6", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 15, - "fields": { - "device_type": 3, - "name": "et-0/0/7", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 16, - "fields": { - "device_type": 3, - "name": "et-0/0/8", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 17, - "fields": { - "device_type": 3, - "name": "et-0/0/9", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 18, - "fields": { - "device_type": 3, - "name": "et-0/0/10", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 19, - "fields": { - "device_type": 3, - "name": "et-0/0/11", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 20, - "fields": { - "device_type": 3, - "name": "et-0/0/12", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 21, - "fields": { - "device_type": 3, - "name": "et-0/0/13", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 22, - "fields": { - "device_type": 3, - "name": "et-0/0/14", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 23, - "fields": { - "device_type": 3, - "name": "et-0/0/15", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 24, - "fields": { - "device_type": 3, - "name": "et-0/0/16", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 25, - "fields": { - "device_type": 3, - "name": "et-0/0/17", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 26, - "fields": { - "device_type": 3, - "name": "et-0/0/18", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 27, - "fields": { - "device_type": 3, - "name": "et-0/0/19", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 28, - "fields": { - "device_type": 3, - "name": "et-0/0/20", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 29, - "fields": { - "device_type": 3, - "name": "et-0/0/21", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 30, - "fields": { - "device_type": 3, - "name": "et-0/0/22", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 31, - "fields": { - "device_type": 3, - "name": "et-0/1/0", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 32, - "fields": { - "device_type": 3, - "name": "et-0/1/1", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 33, - "fields": { - "device_type": 3, - "name": "et-0/1/2", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 34, - "fields": { - "device_type": 3, - "name": "et-0/1/3", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 35, - "fields": { - "device_type": 3, - "name": "et-0/2/0", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 36, - "fields": { - "device_type": 3, - "name": "et-0/2/1", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 37, - "fields": { - "device_type": 3, - "name": "et-0/2/2", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 38, - "fields": { - "device_type": 3, - "name": "et-0/2/3", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 138, - "fields": { - "device_type": 4, - "name": "em0", - "type": 1000, - "mgmt_only": true - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 139, - "fields": { - "device_type": 4, - "name": "xe-0/0/0", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 140, - "fields": { - "device_type": 4, - "name": "xe-0/0/1", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 141, - "fields": { - "device_type": 4, - "name": "xe-0/0/2", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 142, - "fields": { - "device_type": 4, - "name": "xe-0/0/3", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 143, - "fields": { - "device_type": 4, - "name": "xe-0/0/4", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 144, - "fields": { - "device_type": 4, - "name": "xe-0/0/5", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 145, - "fields": { - "device_type": 4, - "name": "xe-0/0/6", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 146, - "fields": { - "device_type": 4, - "name": "xe-0/0/7", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 147, - "fields": { - "device_type": 4, - "name": "xe-0/0/8", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 148, - "fields": { - "device_type": 4, - "name": "xe-0/0/9", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 149, - "fields": { - "device_type": 4, - "name": "xe-0/0/10", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 150, - "fields": { - "device_type": 4, - "name": "xe-0/0/11", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 151, - "fields": { - "device_type": 4, - "name": "xe-0/0/12", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 152, - "fields": { - "device_type": 4, - "name": "xe-0/0/13", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 153, - "fields": { - "device_type": 4, - "name": "xe-0/0/14", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 154, - "fields": { - "device_type": 4, - "name": "xe-0/0/15", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 155, - "fields": { - "device_type": 4, - "name": "xe-0/0/16", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 156, - "fields": { - "device_type": 4, - "name": "xe-0/0/17", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 157, - "fields": { - "device_type": 4, - "name": "xe-0/0/18", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 158, - "fields": { - "device_type": 4, - "name": "xe-0/0/19", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 159, - "fields": { - "device_type": 4, - "name": "xe-0/0/20", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 160, - "fields": { - "device_type": 4, - "name": "xe-0/0/21", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 161, - "fields": { - "device_type": 4, - "name": "xe-0/0/22", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 162, - "fields": { - "device_type": 4, - "name": "xe-0/0/23", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 163, - "fields": { - "device_type": 4, - "name": "xe-0/0/24", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 164, - "fields": { - "device_type": 4, - "name": "xe-0/0/25", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 165, - "fields": { - "device_type": 4, - "name": "xe-0/0/26", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 166, - "fields": { - "device_type": 4, - "name": "xe-0/0/27", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 167, - "fields": { - "device_type": 4, - "name": "xe-0/0/28", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 168, - "fields": { - "device_type": 4, - "name": "xe-0/0/29", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 169, - "fields": { - "device_type": 4, - "name": "xe-0/0/30", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 170, - "fields": { - "device_type": 4, - "name": "xe-0/0/31", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 171, - "fields": { - "device_type": 4, - "name": "xe-0/0/32", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 172, - "fields": { - "device_type": 4, - "name": "xe-0/0/33", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 173, - "fields": { - "device_type": 4, - "name": "xe-0/0/34", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 174, - "fields": { - "device_type": 4, - "name": "xe-0/0/35", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 175, - "fields": { - "device_type": 4, - "name": "xe-0/0/36", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 176, - "fields": { - "device_type": 4, - "name": "xe-0/0/37", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 177, - "fields": { - "device_type": 4, - "name": "xe-0/0/38", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 178, - "fields": { - "device_type": 4, - "name": "xe-0/0/39", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 179, - "fields": { - "device_type": 4, - "name": "xe-0/0/40", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 180, - "fields": { - "device_type": 4, - "name": "xe-0/0/41", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 181, - "fields": { - "device_type": 4, - "name": "xe-0/0/42", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 182, - "fields": { - "device_type": 4, - "name": "xe-0/0/43", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 183, - "fields": { - "device_type": 4, - "name": "xe-0/0/44", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 184, - "fields": { - "device_type": 4, - "name": "xe-0/0/45", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 185, - "fields": { - "device_type": 4, - "name": "xe-0/0/46", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 186, - "fields": { - "device_type": 4, - "name": "xe-0/0/47", - "type": 1200, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 187, - "fields": { - "device_type": 4, - "name": "et-0/0/48", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 188, - "fields": { - "device_type": 4, - "name": "et-0/0/49", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 189, - "fields": { - "device_type": 4, - "name": "et-0/0/50", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 190, - "fields": { - "device_type": 4, - "name": "et-0/0/51", - "type": 1400, - "mgmt_only": false - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 191, - "fields": { - "device_type": 5, - "name": "eth0", - "type": 1000, - "mgmt_only": true - } -}, -{ - "model": "dcim.interfacetemplate", - "pk": 192, - "fields": { - "device_type": 6, - "name": "Net", - "type": 800, - "mgmt_only": true - } -}, -{ - "model": "dcim.devicerole", - "pk": 1, - "fields": { - "name": "Router", - "slug": "router", - "color": "purple" - } -}, -{ - "model": "dcim.devicerole", - "pk": 2, - "fields": { - "name": "Spine Switch", - "slug": "spine-switch", - "color": "green" - } -}, -{ - "model": "dcim.devicerole", - "pk": 3, - "fields": { - "name": "Core Switch", - "slug": "core-switch", - "color": "red" - } -}, -{ - "model": "dcim.devicerole", - "pk": 4, - "fields": { - "name": "Leaf Switch", - "slug": "leaf-switch", - "color": "teal" - } -}, -{ - "model": "dcim.devicerole", - "pk": 5, - "fields": { - "name": "OOB Switch", - "slug": "oob-switch", - "color": "purple" - } -}, -{ - "model": "dcim.devicerole", - "pk": 6, - "fields": { - "name": "PDU", - "slug": "pdu", - "color": "yellow" - } -}, -{ - "model": "dcim.devicerole", - "pk": 7, - "fields": { - "name": "Server", - "slug": "server", - "color": "grey" - } -}, -{ - "model": "dcim.platform", - "pk": 1, - "fields": { - "name": "Juniper Junos", - "slug": "juniper-junos" - } -}, -{ - "model": "dcim.platform", - "pk": 2, - "fields": { - "name": "Opengear", - "slug": "opengear" - } -}, -{ - "model": "dcim.device", - "pk": 1, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "device_type": 1, - "device_role": 1, - "platform": 1, - "name": "test1-edge1", - "serial": "5555555555", - "site": 1, - "rack": 1, - "position": 1, - "face": "front", - "status": true, - "primary_ip4": 1, - "primary_ip6": null, - "comments": "" - } -}, -{ - "model": "dcim.device", - "pk": 2, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "device_type": 2, - "device_role": 3, - "platform": 1, - "name": "test1-core1", - "serial": "", - "site": 1, - "rack": 1, - "position": 17, - "face": "rear", - "status": true, - "primary_ip4": 5, - "primary_ip6": null, - "comments": "" - } -}, -{ - "model": "dcim.device", - "pk": 3, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "device_type": 3, - "device_role": 2, - "platform": 1, - "name": "test1-spine1", - "serial": "", - "site": 1, - "rack": 1, - "position": 33, - "face": "rear", - "status": true, - "primary_ip4": null, - "primary_ip6": null, - "comments": "" - } -}, -{ - "model": "dcim.device", - "pk": 4, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "device_type": 4, - "device_role": 4, - "platform": 1, - "name": "test1-leaf1", - "serial": "", - "site": 1, - "rack": 1, - "position": 34, - "face": "rear", - "status": true, - "primary_ip4": null, - "primary_ip6": null, - "comments": "" - } -}, -{ - "model": "dcim.device", - "pk": 5, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "device_type": 4, - "device_role": 4, - "platform": 1, - "name": "test1-leaf2", - "serial": "9823478293748", - "site": 1, - "rack": 2, - "position": 34, - "face": "rear", - "status": true, - "primary_ip4": null, - "primary_ip6": null, - "comments": "" - } -}, -{ - "model": "dcim.device", - "pk": 6, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "device_type": 3, - "device_role": 2, - "platform": 1, - "name": "test1-spine2", - "serial": "45649818158", - "site": 1, - "rack": 2, - "position": 33, - "face": "rear", - "status": true, - "primary_ip4": null, - "primary_ip6": null, - "comments": "" - } -}, -{ - "model": "dcim.device", - "pk": 7, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "device_type": 1, - "device_role": 1, - "platform": 1, - "name": "test1-edge2", - "serial": "7567356345", - "site": 1, - "rack": 2, - "position": 1, - "face": "rear", - "status": true, - "primary_ip4": 3, - "primary_ip6": null, - "comments": "" - } -}, -{ - "model": "dcim.device", - "pk": 8, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "device_type": 2, - "device_role": 3, - "platform": 1, - "name": "test1-core2", - "serial": "67856734534", - "site": 1, - "rack": 2, - "position": 17, - "face": "rear", - "status": true, - "primary_ip4": 19, - "primary_ip6": null, - "comments": "" - } -}, -{ - "model": "dcim.device", - "pk": 9, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "device_type": 5, - "device_role": 5, - "platform": 2, - "name": "test1-oob1", - "serial": "98273942938", - "site": 1, - "rack": 1, - "position": 42, - "face": "rear", - "status": true, - "primary_ip4": null, - "primary_ip6": null, - "comments": "" - } -}, -{ - "model": "dcim.device", - "pk": 11, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "device_type": 6, - "device_role": 6, - "platform": null, - "name": "test1-pdu1", - "serial": "", - "site": 1, - "rack": 1, - "position": null, - "face": "", - "status": true, - "primary_ip4": null, - "primary_ip6": null, - "comments": "" - } -}, -{ - "model": "dcim.device", - "pk": 12, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "device_type": 6, - "device_role": 6, - "platform": null, - "name": "test1-pdu2", - "serial": "", - "site": 1, - "rack": 2, - "position": null, - "face": "", - "status": true, - "primary_ip4": null, - "primary_ip6": null, - "comments": "" - } -}, -{ - "model": "dcim.device", - "pk": 13, - "fields": { - "local_context_data": null, - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "device_type": 7, - "device_role": 6, - "tenant": null, - "platform": null, - "name": "test1-server1", - "serial": "", - "asset_tag": null, - "site": 1, - "rack": 2, - "position": null, - "face": "", - "status": true, - "primary_ip4": null, - "primary_ip6": null, - "cluster": 4, - "virtual_chassis": null, - "vc_position": null, - "vc_priority": null, - "comments": "" - } -}, -{ - "model": "dcim.consoleport", - "pk": 1, - "fields": { - "device": 1, - "name": "Console (RE0)", - "connected_endpoint": 27, - "connection_status": true - } -}, -{ - "model": "dcim.consoleport", - "pk": 2, - "fields": { - "device": 1, - "name": "Console (RE1)", - "connected_endpoint": 38, - "connection_status": true - } -}, -{ - "model": "dcim.consoleport", - "pk": 3, - "fields": { - "device": 2, - "name": "Console (RE0)", - "connected_endpoint": 5, - "connection_status": true - } -}, -{ - "model": "dcim.consoleport", - "pk": 4, - "fields": { - "device": 2, - "name": "Console (RE1)", - "connected_endpoint": 16, - "connection_status": true - } -}, -{ - "model": "dcim.consoleport", - "pk": 5, - "fields": { - "device": 3, - "name": "Console", - "connected_endpoint": 49, - "connection_status": true - } -}, -{ - "model": "dcim.consoleport", - "pk": 6, - "fields": { - "device": 4, - "name": "Console", - "connected_endpoint": 48, - "connection_status": true - } -}, -{ - "model": "dcim.consoleport", - "pk": 7, - "fields": { - "device": 5, - "name": "Console", - "connected_endpoint": null, - "connection_status": true - } -}, -{ - "model": "dcim.consoleport", - "pk": 8, - "fields": { - "device": 6, - "name": "Console", - "connected_endpoint": null, - "connection_status": true - } -}, -{ - "model": "dcim.consoleport", - "pk": 9, - "fields": { - "device": 7, - "name": "Console (RE0)", - "connected_endpoint": null, - "connection_status": true - } -}, -{ - "model": "dcim.consoleport", - "pk": 10, - "fields": { - "device": 7, - "name": "Console (RE1)", - "connected_endpoint": null, - "connection_status": true - } -}, -{ - "model": "dcim.consoleport", - "pk": 11, - "fields": { - "device": 8, - "name": "Console (RE0)", - "connected_endpoint": null, - "connection_status": true - } -}, -{ - "model": "dcim.consoleport", - "pk": 12, - "fields": { - "device": 8, - "name": "Console (RE1)", - "connected_endpoint": null, - "connection_status": true - } -}, -{ - "model": "dcim.consoleport", - "pk": 13, - "fields": { - "device": 9, - "name": "Console", - "connected_endpoint": null, - "connection_status": true - } -}, -{ - "model": "dcim.consoleport", - "pk": 15, - "fields": { - "device": 11, - "name": "Serial", - "connected_endpoint": null, - "connection_status": true - } -}, -{ - "model": "dcim.consoleport", - "pk": 16, - "fields": { - "device": 12, - "name": "Serial", - "connected_endpoint": null, - "connection_status": true - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 5, - "fields": { - "device": 9, - "name": "Port 1" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 6, - "fields": { - "device": 9, - "name": "Port 10" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 7, - "fields": { - "device": 9, - "name": "Port 11" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 8, - "fields": { - "device": 9, - "name": "Port 12" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 9, - "fields": { - "device": 9, - "name": "Port 13" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 10, - "fields": { - "device": 9, - "name": "Port 14" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 11, - "fields": { - "device": 9, - "name": "Port 15" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 12, - "fields": { - "device": 9, - "name": "Port 16" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 13, - "fields": { - "device": 9, - "name": "Port 17" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 14, - "fields": { - "device": 9, - "name": "Port 18" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 15, - "fields": { - "device": 9, - "name": "Port 19" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 16, - "fields": { - "device": 9, - "name": "Port 2" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 17, - "fields": { - "device": 9, - "name": "Port 20" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 18, - "fields": { - "device": 9, - "name": "Port 21" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 19, - "fields": { - "device": 9, - "name": "Port 22" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 20, - "fields": { - "device": 9, - "name": "Port 23" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 21, - "fields": { - "device": 9, - "name": "Port 24" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 22, - "fields": { - "device": 9, - "name": "Port 25" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 23, - "fields": { - "device": 9, - "name": "Port 26" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 24, - "fields": { - "device": 9, - "name": "Port 27" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 25, - "fields": { - "device": 9, - "name": "Port 28" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 26, - "fields": { - "device": 9, - "name": "Port 29" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 27, - "fields": { - "device": 9, - "name": "Port 3" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 28, - "fields": { - "device": 9, - "name": "Port 30" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 29, - "fields": { - "device": 9, - "name": "Port 31" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 30, - "fields": { - "device": 9, - "name": "Port 32" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 31, - "fields": { - "device": 9, - "name": "Port 33" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 32, - "fields": { - "device": 9, - "name": "Port 34" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 33, - "fields": { - "device": 9, - "name": "Port 35" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 34, - "fields": { - "device": 9, - "name": "Port 36" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 35, - "fields": { - "device": 9, - "name": "Port 37" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 36, - "fields": { - "device": 9, - "name": "Port 38" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 37, - "fields": { - "device": 9, - "name": "Port 39" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 38, - "fields": { - "device": 9, - "name": "Port 4" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 39, - "fields": { - "device": 9, - "name": "Port 40" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 40, - "fields": { - "device": 9, - "name": "Port 41" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 41, - "fields": { - "device": 9, - "name": "Port 42" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 42, - "fields": { - "device": 9, - "name": "Port 43" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 43, - "fields": { - "device": 9, - "name": "Port 44" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 44, - "fields": { - "device": 9, - "name": "Port 45" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 45, - "fields": { - "device": 9, - "name": "Port 46" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 46, - "fields": { - "device": 9, - "name": "Port 47" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 47, - "fields": { - "device": 9, - "name": "Port 48" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 48, - "fields": { - "device": 9, - "name": "Port 5" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 49, - "fields": { - "device": 9, - "name": "Port 6" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 50, - "fields": { - "device": 9, - "name": "Port 7" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 51, - "fields": { - "device": 9, - "name": "Port 8" - } -}, -{ - "model": "dcim.consoleserverport", - "pk": 52, - "fields": { - "device": 9, - "name": "Port 9" - } -}, -{ - "model": "dcim.powerport", - "pk": 1, - "fields": { - "device": 1, - "name": "PEM0", - "_connected_poweroutlet": 25, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 2, - "fields": { - "device": 1, - "name": "PEM1", - "_connected_poweroutlet": 49, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 3, - "fields": { - "device": 1, - "name": "PEM2", - "_connected_poweroutlet": null, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 4, - "fields": { - "device": 1, - "name": "PEM3", - "_connected_poweroutlet": null, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 5, - "fields": { - "device": 2, - "name": "PEM0", - "_connected_poweroutlet": 26, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 6, - "fields": { - "device": 2, - "name": "PEM1", - "_connected_poweroutlet": 50, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 7, - "fields": { - "device": 2, - "name": "PEM2", - "_connected_poweroutlet": null, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 8, - "fields": { - "device": 2, - "name": "PEM3", - "_connected_poweroutlet": null, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 9, - "fields": { - "device": 4, - "name": "PSU0", - "_connected_poweroutlet": 28, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 10, - "fields": { - "device": 4, - "name": "PSU1", - "_connected_poweroutlet": 52, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 11, - "fields": { - "device": 5, - "name": "PSU0", - "_connected_poweroutlet": 56, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 12, - "fields": { - "device": 5, - "name": "PSU1", - "_connected_poweroutlet": 32, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 13, - "fields": { - "device": 3, - "name": "PSU0", - "_connected_poweroutlet": 27, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 14, - "fields": { - "device": 3, - "name": "PSU1", - "_connected_poweroutlet": 51, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 15, - "fields": { - "device": 7, - "name": "PEM0", - "_connected_poweroutlet": 53, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 16, - "fields": { - "device": 7, - "name": "PEM1", - "_connected_poweroutlet": 29, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 17, - "fields": { - "device": 7, - "name": "PEM2", - "_connected_poweroutlet": null, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 18, - "fields": { - "device": 7, - "name": "PEM3", - "_connected_poweroutlet": null, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 19, - "fields": { - "device": 8, - "name": "PEM0", - "_connected_poweroutlet": 54, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 20, - "fields": { - "device": 8, - "name": "PEM1", - "_connected_poweroutlet": 30, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 21, - "fields": { - "device": 8, - "name": "PEM2", - "_connected_poweroutlet": null, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 22, - "fields": { - "device": 8, - "name": "PEM3", - "_connected_poweroutlet": null, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 23, - "fields": { - "device": 6, - "name": "PSU0", - "_connected_poweroutlet": 55, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 24, - "fields": { - "device": 6, - "name": "PSU1", - "_connected_poweroutlet": 31, - "connection_status": true - } -}, -{ - "model": "dcim.powerport", - "pk": 25, - "fields": { - "device": 9, - "name": "PSU", - "_connected_poweroutlet": null, - "connection_status": true - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 25, - "fields": { - "device": 11, - "name": "AA1" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 26, - "fields": { - "device": 11, - "name": "AA2" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 27, - "fields": { - "device": 11, - "name": "AA3" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 28, - "fields": { - "device": 11, - "name": "AA4" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 29, - "fields": { - "device": 11, - "name": "AA5" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 30, - "fields": { - "device": 11, - "name": "AA6" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 31, - "fields": { - "device": 11, - "name": "AA7" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 32, - "fields": { - "device": 11, - "name": "AA8" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 33, - "fields": { - "device": 11, - "name": "AB1" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 34, - "fields": { - "device": 11, - "name": "AB2" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 35, - "fields": { - "device": 11, - "name": "AB3" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 36, - "fields": { - "device": 11, - "name": "AB4" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 37, - "fields": { - "device": 11, - "name": "AB5" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 38, - "fields": { - "device": 11, - "name": "AB6" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 39, - "fields": { - "device": 11, - "name": "AB7" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 40, - "fields": { - "device": 11, - "name": "AB8" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 41, - "fields": { - "device": 11, - "name": "AC1" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 42, - "fields": { - "device": 11, - "name": "AC2" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 43, - "fields": { - "device": 11, - "name": "AC3" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 44, - "fields": { - "device": 11, - "name": "AC4" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 45, - "fields": { - "device": 11, - "name": "AC5" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 46, - "fields": { - "device": 11, - "name": "AC6" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 47, - "fields": { - "device": 11, - "name": "AC7" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 48, - "fields": { - "device": 11, - "name": "AC8" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 49, - "fields": { - "device": 12, - "name": "AA1" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 50, - "fields": { - "device": 12, - "name": "AA2" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 51, - "fields": { - "device": 12, - "name": "AA3" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 52, - "fields": { - "device": 12, - "name": "AA4" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 53, - "fields": { - "device": 12, - "name": "AA5" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 54, - "fields": { - "device": 12, - "name": "AA6" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 55, - "fields": { - "device": 12, - "name": "AA7" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 56, - "fields": { - "device": 12, - "name": "AA8" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 57, - "fields": { - "device": 12, - "name": "AB1" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 58, - "fields": { - "device": 12, - "name": "AB2" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 59, - "fields": { - "device": 12, - "name": "AB3" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 60, - "fields": { - "device": 12, - "name": "AB4" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 61, - "fields": { - "device": 12, - "name": "AB5" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 62, - "fields": { - "device": 12, - "name": "AB6" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 63, - "fields": { - "device": 12, - "name": "AB7" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 64, - "fields": { - "device": 12, - "name": "AB8" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 65, - "fields": { - "device": 12, - "name": "AC1" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 66, - "fields": { - "device": 12, - "name": "AC2" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 67, - "fields": { - "device": 12, - "name": "AC3" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 68, - "fields": { - "device": 12, - "name": "AC4" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 69, - "fields": { - "device": 12, - "name": "AC5" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 70, - "fields": { - "device": 12, - "name": "AC6" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 71, - "fields": { - "device": 12, - "name": "AC7" - } -}, -{ - "model": "dcim.poweroutlet", - "pk": 72, - "fields": { - "device": 12, - "name": "AC8" - } -}, -{ - "model": "dcim.interface", - "pk": 1, - "fields": { - "device": 1, - "name": "fxp0 (RE0)", - "type": 1000, - "mgmt_only": true, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 2, - "fields": { - "device": 1, - "name": "fxp0 (RE1)", - "type": 800, - "mgmt_only": true, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 3, - "fields": { - "device": 1, - "name": "lo0", - "type": 0, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 4, - "fields": { - "device": 1, - "name": "xe-0/0/0", - "type": 1200, - "mgmt_only": false, - "description": "TEST" - } -}, -{ - "model": "dcim.interface", - "pk": 5, - "fields": { - "device": 1, - "name": "xe-0/0/1", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 6, - "fields": { - "device": 1, - "name": "xe-0/0/2", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 7, - "fields": { - "device": 1, - "name": "xe-0/0/3", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 8, - "fields": { - "device": 1, - "name": "xe-0/0/4", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 9, - "fields": { - "device": 1, - "name": "xe-0/0/5", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 10, - "fields": { - "device": 2, - "name": "fxp0 (RE0)", - "type": 1000, - "mgmt_only": true, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 11, - "fields": { - "device": 2, - "name": "fxp0 (RE1)", - "type": 1000, - "mgmt_only": true, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 12, - "fields": { - "device": 2, - "name": "lo0", - "type": 0, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 13, - "fields": { - "device": 3, - "name": "em0", - "mac_address": "00-00-00-AA-BB-CC", - "type": 800, - "mgmt_only": true, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 14, - "fields": { - "device": 3, - "name": "et-0/0/0", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 15, - "fields": { - "device": 3, - "name": "et-0/0/1", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 16, - "fields": { - "device": 3, - "name": "et-0/0/10", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 17, - "fields": { - "device": 3, - "name": "et-0/0/11", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 18, - "fields": { - "device": 3, - "name": "et-0/0/12", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 19, - "fields": { - "device": 3, - "name": "et-0/0/13", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 20, - "fields": { - "device": 3, - "name": "et-0/0/14", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 21, - "fields": { - "device": 3, - "name": "et-0/0/15", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 22, - "fields": { - "device": 3, - "name": "et-0/0/16", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 23, - "fields": { - "device": 3, - "name": "et-0/0/17", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 24, - "fields": { - "device": 3, - "name": "et-0/0/18", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 25, - "fields": { - "device": 3, - "name": "et-0/0/19", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 26, - "fields": { - "device": 3, - "name": "et-0/0/2", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 27, - "fields": { - "device": 3, - "name": "et-0/0/20", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 28, - "fields": { - "device": 3, - "name": "et-0/0/21", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 29, - "fields": { - "device": 3, - "name": "et-0/0/22", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 30, - "fields": { - "device": 3, - "name": "et-0/0/3", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 31, - "fields": { - "device": 3, - "name": "et-0/0/4", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 32, - "fields": { - "device": 3, - "name": "et-0/0/5", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 33, - "fields": { - "device": 3, - "name": "et-0/0/6", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 34, - "fields": { - "device": 3, - "name": "et-0/0/7", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 35, - "fields": { - "device": 3, - "name": "et-0/0/8", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 36, - "fields": { - "device": 3, - "name": "et-0/0/9", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 37, - "fields": { - "device": 3, - "name": "et-0/1/0", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 38, - "fields": { - "device": 3, - "name": "et-0/1/1", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 39, - "fields": { - "device": 3, - "name": "et-0/1/2", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 40, - "fields": { - "device": 3, - "name": "et-0/1/3", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 41, - "fields": { - "device": 3, - "name": "et-0/2/0", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 42, - "fields": { - "device": 3, - "name": "et-0/2/1", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 43, - "fields": { - "device": 3, - "name": "et-0/2/2", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 44, - "fields": { - "device": 3, - "name": "et-0/2/3", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 45, - "fields": { - "device": 4, - "name": "em0", - "type": 1000, - "mac_address": "ff-ee-dd-33-22-11", - "mgmt_only": true, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 46, - "fields": { - "device": 4, - "name": "et-0/0/48", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 47, - "fields": { - "device": 4, - "name": "et-0/0/49", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 48, - "fields": { - "device": 4, - "name": "et-0/0/50", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 49, - "fields": { - "device": 4, - "name": "et-0/0/51", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 50, - "fields": { - "device": 4, - "name": "xe-0/0/0", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 51, - "fields": { - "device": 4, - "name": "xe-0/0/1", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 52, - "fields": { - "device": 4, - "name": "xe-0/0/10", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 53, - "fields": { - "device": 4, - "name": "xe-0/0/11", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 54, - "fields": { - "device": 4, - "name": "xe-0/0/12", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 55, - "fields": { - "device": 4, - "name": "xe-0/0/13", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 56, - "fields": { - "device": 4, - "name": "xe-0/0/14", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 57, - "fields": { - "device": 4, - "name": "xe-0/0/15", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 58, - "fields": { - "device": 4, - "name": "xe-0/0/16", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 59, - "fields": { - "device": 4, - "name": "xe-0/0/17", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 60, - "fields": { - "device": 4, - "name": "xe-0/0/18", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 61, - "fields": { - "device": 4, - "name": "xe-0/0/19", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 62, - "fields": { - "device": 4, - "name": "xe-0/0/2", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 63, - "fields": { - "device": 4, - "name": "xe-0/0/20", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 64, - "fields": { - "device": 4, - "name": "xe-0/0/21", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 65, - "fields": { - "device": 4, - "name": "xe-0/0/22", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 66, - "fields": { - "device": 4, - "name": "xe-0/0/23", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 67, - "fields": { - "device": 4, - "name": "xe-0/0/24", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 68, - "fields": { - "device": 4, - "name": "xe-0/0/25", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 69, - "fields": { - "device": 4, - "name": "xe-0/0/26", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 70, - "fields": { - "device": 4, - "name": "xe-0/0/27", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 71, - "fields": { - "device": 4, - "name": "xe-0/0/28", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 72, - "fields": { - "device": 4, - "name": "xe-0/0/29", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 73, - "fields": { - "device": 4, - "name": "xe-0/0/3", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 74, - "fields": { - "device": 4, - "name": "xe-0/0/30", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 75, - "fields": { - "device": 4, - "name": "xe-0/0/31", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 76, - "fields": { - "device": 4, - "name": "xe-0/0/32", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 77, - "fields": { - "device": 4, - "name": "xe-0/0/33", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 78, - "fields": { - "device": 4, - "name": "xe-0/0/34", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 79, - "fields": { - "device": 4, - "name": "xe-0/0/35", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 80, - "fields": { - "device": 4, - "name": "xe-0/0/36", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 81, - "fields": { - "device": 4, - "name": "xe-0/0/37", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 82, - "fields": { - "device": 4, - "name": "xe-0/0/38", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 83, - "fields": { - "device": 4, - "name": "xe-0/0/39", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 84, - "fields": { - "device": 4, - "name": "xe-0/0/4", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 85, - "fields": { - "device": 4, - "name": "xe-0/0/40", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 86, - "fields": { - "device": 4, - "name": "xe-0/0/41", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 87, - "fields": { - "device": 4, - "name": "xe-0/0/42", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 88, - "fields": { - "device": 4, - "name": "xe-0/0/43", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 89, - "fields": { - "device": 4, - "name": "xe-0/0/44", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 90, - "fields": { - "device": 4, - "name": "xe-0/0/45", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 91, - "fields": { - "device": 4, - "name": "xe-0/0/46", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 92, - "fields": { - "device": 4, - "name": "xe-0/0/47", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 93, - "fields": { - "device": 4, - "name": "xe-0/0/5", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 94, - "fields": { - "device": 4, - "name": "xe-0/0/6", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 95, - "fields": { - "device": 4, - "name": "xe-0/0/7", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 96, - "fields": { - "device": 4, - "name": "xe-0/0/8", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 97, - "fields": { - "device": 4, - "name": "xe-0/0/9", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 98, - "fields": { - "device": 5, - "name": "em0", - "type": 1000, - "mgmt_only": true, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 99, - "fields": { - "device": 5, - "name": "et-0/0/48", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 100, - "fields": { - "device": 5, - "name": "et-0/0/49", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 101, - "fields": { - "device": 5, - "name": "et-0/0/50", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 102, - "fields": { - "device": 5, - "name": "et-0/0/51", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 103, - "fields": { - "device": 5, - "name": "xe-0/0/0", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 104, - "fields": { - "device": 5, - "name": "xe-0/0/1", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 105, - "fields": { - "device": 5, - "name": "xe-0/0/10", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 106, - "fields": { - "device": 5, - "name": "xe-0/0/11", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 107, - "fields": { - "device": 5, - "name": "xe-0/0/12", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 108, - "fields": { - "device": 5, - "name": "xe-0/0/13", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 109, - "fields": { - "device": 5, - "name": "xe-0/0/14", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 110, - "fields": { - "device": 5, - "name": "xe-0/0/15", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 111, - "fields": { - "device": 5, - "name": "xe-0/0/16", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 112, - "fields": { - "device": 5, - "name": "xe-0/0/17", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 113, - "fields": { - "device": 5, - "name": "xe-0/0/18", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 114, - "fields": { - "device": 5, - "name": "xe-0/0/19", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 115, - "fields": { - "device": 5, - "name": "xe-0/0/2", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 116, - "fields": { - "device": 5, - "name": "xe-0/0/20", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 117, - "fields": { - "device": 5, - "name": "xe-0/0/21", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 118, - "fields": { - "device": 5, - "name": "xe-0/0/22", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 119, - "fields": { - "device": 5, - "name": "xe-0/0/23", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 120, - "fields": { - "device": 5, - "name": "xe-0/0/24", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 121, - "fields": { - "device": 5, - "name": "xe-0/0/25", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 122, - "fields": { - "device": 5, - "name": "xe-0/0/26", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 123, - "fields": { - "device": 5, - "name": "xe-0/0/27", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 124, - "fields": { - "device": 5, - "name": "xe-0/0/28", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 125, - "fields": { - "device": 5, - "name": "xe-0/0/29", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 126, - "fields": { - "device": 5, - "name": "xe-0/0/3", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 127, - "fields": { - "device": 5, - "name": "xe-0/0/30", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 128, - "fields": { - "device": 5, - "name": "xe-0/0/31", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 129, - "fields": { - "device": 5, - "name": "xe-0/0/32", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 130, - "fields": { - "device": 5, - "name": "xe-0/0/33", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 131, - "fields": { - "device": 5, - "name": "xe-0/0/34", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 132, - "fields": { - "device": 5, - "name": "xe-0/0/35", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 133, - "fields": { - "device": 5, - "name": "xe-0/0/36", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 134, - "fields": { - "device": 5, - "name": "xe-0/0/37", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 135, - "fields": { - "device": 5, - "name": "xe-0/0/38", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 136, - "fields": { - "device": 5, - "name": "xe-0/0/39", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 137, - "fields": { - "device": 5, - "name": "xe-0/0/4", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 138, - "fields": { - "device": 5, - "name": "xe-0/0/40", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 139, - "fields": { - "device": 5, - "name": "xe-0/0/41", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 140, - "fields": { - "device": 5, - "name": "xe-0/0/42", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 141, - "fields": { - "device": 5, - "name": "xe-0/0/43", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 142, - "fields": { - "device": 5, - "name": "xe-0/0/44", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 143, - "fields": { - "device": 5, - "name": "xe-0/0/45", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 144, - "fields": { - "device": 5, - "name": "xe-0/0/46", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 145, - "fields": { - "device": 5, - "name": "xe-0/0/47", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 146, - "fields": { - "device": 5, - "name": "xe-0/0/5", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 147, - "fields": { - "device": 5, - "name": "xe-0/0/6", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 148, - "fields": { - "device": 5, - "name": "xe-0/0/7", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 149, - "fields": { - "device": 5, - "name": "xe-0/0/8", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 150, - "fields": { - "device": 5, - "name": "xe-0/0/9", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 151, - "fields": { - "device": 6, - "name": "em0", - "type": 800, - "mgmt_only": true, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 152, - "fields": { - "device": 6, - "name": "et-0/0/0", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 153, - "fields": { - "device": 6, - "name": "et-0/0/1", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 154, - "fields": { - "device": 6, - "name": "et-0/0/10", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 155, - "fields": { - "device": 6, - "name": "et-0/0/11", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 156, - "fields": { - "device": 6, - "name": "et-0/0/12", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 157, - "fields": { - "device": 6, - "name": "et-0/0/13", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 158, - "fields": { - "device": 6, - "name": "et-0/0/14", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 159, - "fields": { - "device": 6, - "name": "et-0/0/15", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 160, - "fields": { - "device": 6, - "name": "et-0/0/16", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 161, - "fields": { - "device": 6, - "name": "et-0/0/17", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 162, - "fields": { - "device": 6, - "name": "et-0/0/18", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 163, - "fields": { - "device": 6, - "name": "et-0/0/19", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 164, - "fields": { - "device": 6, - "name": "et-0/0/2", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 165, - "fields": { - "device": 6, - "name": "et-0/0/20", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 166, - "fields": { - "device": 6, - "name": "et-0/0/21", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 167, - "fields": { - "device": 6, - "name": "et-0/0/22", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 168, - "fields": { - "device": 6, - "name": "et-0/0/3", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 169, - "fields": { - "device": 6, - "name": "et-0/0/4", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 170, - "fields": { - "device": 6, - "name": "et-0/0/5", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 171, - "fields": { - "device": 6, - "name": "et-0/0/6", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 172, - "fields": { - "device": 6, - "name": "et-0/0/7", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 173, - "fields": { - "device": 6, - "name": "et-0/0/8", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 174, - "fields": { - "device": 6, - "name": "et-0/0/9", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 175, - "fields": { - "device": 6, - "name": "et-0/1/0", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 176, - "fields": { - "device": 6, - "name": "et-0/1/1", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 177, - "fields": { - "device": 6, - "name": "et-0/1/2", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 178, - "fields": { - "device": 6, - "name": "et-0/1/3", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 179, - "fields": { - "device": 6, - "name": "et-0/2/0", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 180, - "fields": { - "device": 6, - "name": "et-0/2/1", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 181, - "fields": { - "device": 6, - "name": "et-0/2/2", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 182, - "fields": { - "device": 6, - "name": "et-0/2/3", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 183, - "fields": { - "device": 7, - "name": "fxp0 (RE0)", - "type": 1000, - "mgmt_only": true, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 184, - "fields": { - "device": 7, - "name": "fxp0 (RE1)", - "type": 800, - "mgmt_only": true, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 185, - "fields": { - "device": 7, - "name": "lo0", - "type": 0, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 186, - "fields": { - "device": 8, - "name": "fxp0 (RE0)", - "type": 1000, - "mgmt_only": true, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 187, - "fields": { - "device": 8, - "name": "fxp0 (RE1)", - "type": 1000, - "mgmt_only": true, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 188, - "fields": { - "device": 8, - "name": "lo0", - "type": 0, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 189, - "fields": { - "device": 2, - "name": "et-0/0/0", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 190, - "fields": { - "device": 2, - "name": "et-0/0/1", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 191, - "fields": { - "device": 2, - "name": "et-0/0/2", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 192, - "fields": { - "device": 2, - "name": "et-0/1/0", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 193, - "fields": { - "device": 2, - "name": "et-0/1/1", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 194, - "fields": { - "device": 2, - "name": "et-0/1/2", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 195, - "fields": { - "device": 8, - "name": "et-0/0/0", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 196, - "fields": { - "device": 8, - "name": "et-0/0/1", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 197, - "fields": { - "device": 8, - "name": "et-0/0/2", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 198, - "fields": { - "device": 8, - "name": "et-0/1/0", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 199, - "fields": { - "device": 8, - "name": "et-0/1/1", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 200, - "fields": { - "device": 8, - "name": "et-0/1/2", - "type": 1400, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 201, - "fields": { - "device": 2, - "name": "xe-0/0/0", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 202, - "fields": { - "device": 2, - "name": "xe-0/0/1", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 203, - "fields": { - "device": 2, - "name": "xe-0/0/2", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 204, - "fields": { - "device": 2, - "name": "xe-0/0/3", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 205, - "fields": { - "device": 2, - "name": "xe-0/0/4", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 206, - "fields": { - "device": 2, - "name": "xe-0/0/5", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 207, - "fields": { - "device": 8, - "name": "xe-0/0/0", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 208, - "fields": { - "device": 8, - "name": "xe-0/0/1", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 209, - "fields": { - "device": 8, - "name": "xe-0/0/2", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 210, - "fields": { - "device": 8, - "name": "xe-0/0/3", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 211, - "fields": { - "device": 8, - "name": "xe-0/0/4", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 212, - "fields": { - "device": 8, - "name": "xe-0/0/5", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 213, - "fields": { - "device": 7, - "name": "xe-0/0/0", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 214, - "fields": { - "device": 7, - "name": "xe-0/0/1", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 215, - "fields": { - "device": 7, - "name": "xe-0/0/2", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 216, - "fields": { - "device": 7, - "name": "xe-0/0/3", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 217, - "fields": { - "device": 7, - "name": "xe-0/0/4", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 218, - "fields": { - "device": 7, - "name": "xe-0/0/5", - "type": 1200, - "mgmt_only": false, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 219, - "fields": { - "device": 9, - "name": "eth0", - "type": 1000, - "mac_address": "44-55-66-77-88-99", - "mgmt_only": true, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 221, - "fields": { - "device": 11, - "name": "Net", - "type": 800, - "mgmt_only": true, - "description": "" - } -}, -{ - "model": "dcim.interface", - "pk": 222, - "fields": { - "device": 12, - "name": "Net", - "type": 800, - "mgmt_only": true, - "description": "" - } -} -] diff --git a/netbox/extras/fixtures/extras.json b/netbox/extras/fixtures/extras.json deleted file mode 100644 index 83b947cb2..000000000 --- a/netbox/extras/fixtures/extras.json +++ /dev/null @@ -1,35 +0,0 @@ -[ -{ - "model": "extras.graph", - "pk": 1, - "fields": { - "type": 300, - "weight": 1000, - "name": "Site Test Graph", - "source": "http://localhost/na.png", - "link": "" - } -}, -{ - "model": "extras.graph", - "pk": 2, - "fields": { - "type": 200, - "weight": 1000, - "name": "Provider Test Graph", - "source": "http://localhost/provider_graph.png", - "link": "" - } -}, -{ - "model": "extras.graph", - "pk": 3, - "fields": { - "type": 100, - "weight": 1000, - "name": "Interface Test Graph", - "source": "http://localhost/interface_graph.png", - "link": "" - } -} -] \ No newline at end of file diff --git a/netbox/ipam/fixtures/ipam.json b/netbox/ipam/fixtures/ipam.json deleted file mode 100644 index e722b3629..000000000 --- a/netbox/ipam/fixtures/ipam.json +++ /dev/null @@ -1,329 +0,0 @@ -[ -{ - "model": "ipam.rir", - "pk": 1, - "fields": { - "name": "RFC1918", - "slug": "rfc1918" - } -}, -{ - "model": "ipam.aggregate", - "pk": 1, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "prefix": "10.0.0.0/8", - "rir": 1, - "date_added": null, - "description": "" - } -}, -{ - "model": "ipam.role", - "pk": 1, - "fields": { - "name": "Lab Network", - "slug": "lab-network", - "weight": 1000 - } -}, -{ - "model": "ipam.prefix", - "pk": 1, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "prefix": "10.1.1.0/24", - "site": 1, - "vrf": null, - "vlan": null, - "status": "active", - "role": 1, - "description": "" - } -}, -{ - "model": "ipam.prefix", - "pk": 2, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "prefix": "10.0.255.0/24", - "site": 1, - "vrf": null, - "vlan": null, - "status": "active", - "role": 1, - "description": "" - } -}, -{ - "model": "ipam.ipaddress", - "pk": 1, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "address": "10.0.255.1/32", - "vrf": null, - "interface_id": 3, - "nat_inside": null, - "description": "" - } -}, -{ - "model": "ipam.ipaddress", - "pk": 2, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "address": "169.254.254.1/31", - "vrf": null, - "interface_id": 4, - "nat_inside": null, - "description": "" - } -}, -{ - "model": "ipam.ipaddress", - "pk": 3, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "address": "10.0.255.2/32", - "vrf": null, - "interface_id": 185, - "nat_inside": null, - "description": "" - } -}, -{ - "model": "ipam.ipaddress", - "pk": 4, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "address": "169.254.1.1/31", - "vrf": null, - "interface_id": 213, - "nat_inside": null, - "description": "" - } -}, -{ - "model": "ipam.ipaddress", - "pk": 5, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "address": "10.0.254.1/24", - "vrf": null, - "interface_id": 12, - "nat_inside": null, - "description": "" - } -}, -{ - "model": "ipam.ipaddress", - "pk": 8, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "address": "10.15.21.1/31", - "vrf": null, - "interface_id": 218, - "nat_inside": null, - "description": "" - } -}, -{ - "model": "ipam.ipaddress", - "pk": 9, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "address": "10.15.21.2/31", - "vrf": null, - "interface_id": 9, - "nat_inside": null, - "description": "" - } -}, -{ - "model": "ipam.ipaddress", - "pk": 10, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "address": "10.15.22.1/31", - "vrf": null, - "interface_id": 8, - "nat_inside": null, - "description": "" - } -}, -{ - "model": "ipam.ipaddress", - "pk": 11, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "address": "10.15.20.1/31", - "vrf": null, - "interface_id": 7, - "nat_inside": null, - "description": "" - } -}, -{ - "model": "ipam.ipaddress", - "pk": 12, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "address": "10.16.20.1/31", - "vrf": null, - "interface_id": 216, - "nat_inside": null, - "description": "" - } -}, -{ - "model": "ipam.ipaddress", - "pk": 13, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "address": "10.15.22.2/31", - "vrf": null, - "interface_id": 206, - "nat_inside": null, - "description": "" - } -}, -{ - "model": "ipam.ipaddress", - "pk": 14, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "address": "10.16.22.1/31", - "vrf": null, - "interface_id": 217, - "nat_inside": null, - "description": "" - } -}, -{ - "model": "ipam.ipaddress", - "pk": 15, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "address": "10.16.22.2/31", - "vrf": null, - "interface_id": 205, - "nat_inside": null, - "description": "" - } -}, -{ - "model": "ipam.ipaddress", - "pk": 16, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "address": "10.16.20.2/31", - "vrf": null, - "interface_id": 211, - "nat_inside": null, - "description": "" - } -}, -{ - "model": "ipam.ipaddress", - "pk": 17, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "address": "10.15.22.2/31", - "vrf": null, - "interface_id": 212, - "nat_inside": null, - "description": "" - } -}, -{ - "model": "ipam.ipaddress", - "pk": 19, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "address": "10.0.254.2/32", - "vrf": null, - "interface_id": 188, - "nat_inside": null, - "description": "" - } -}, -{ - "model": "ipam.ipaddress", - "pk": 20, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "address": "169.254.1.1/31", - "vrf": null, - "interface_id": 200, - "nat_inside": null, - "description": "" - } -}, -{ - "model": "ipam.ipaddress", - "pk": 21, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "family": 4, - "address": "169.254.1.2/31", - "vrf": null, - "interface_id": 194, - "nat_inside": null, - "description": "" - } -}, -{ - "model": "ipam.vlan", - "pk": 1, - "fields": { - "created": "2016-06-23", - "last_updated": "2016-06-23T03:19:56.521Z", - "site": 1, - "vid": 999, - "name": "TEST", - "status": "active", - "role": 1 - } -} -] \ No newline at end of file diff --git a/netbox/virtualization/fixtures/virtualization.json b/netbox/virtualization/fixtures/virtualization.json deleted file mode 100644 index 3c9537802..000000000 --- a/netbox/virtualization/fixtures/virtualization.json +++ /dev/null @@ -1,170 +0,0 @@ -[ -{ - "model": "virtualization.clustertype", - "pk": 1, - "fields": { - "created": "2016-08-01", - "last_updated": "2016-08-01T15:22:42.289Z", - "name": "Public Cloud", - "slug": "public-cloud" - } -}, -{ - "model": "virtualization.clustertype", - "pk": 2, - "fields": { - "created": "2016-08-01", - "last_updated": "2016-08-01T15:22:42.289Z", - "name": "vSphere", - "slug": "vsphere" - } -}, -{ - "model": "virtualization.clustertype", - "pk": 3, - "fields": { - "created": "2016-08-01", - "last_updated": "2016-08-01T15:22:42.289Z", - "name": "Hyper-V", - "slug": "hyper-v" - } -}, -{ - "model": "virtualization.clustertype", - "pk": 4, - "fields": { - "created": "2016-08-01", - "last_updated": "2016-08-01T15:22:42.289Z", - "name": "libvirt", - "slug": "libvirt" - } -}, -{ - "model": "virtualization.clustertype", - "pk": 5, - "fields": { - "created": "2016-08-01", - "last_updated": "2016-08-01T15:22:42.289Z", - "name": "LXD", - "slug": "lxd" - } -}, -{ - "model": "virtualization.clustertype", - "pk": 6, - "fields": { - "created": "2016-08-01", - "last_updated": "2016-08-01T15:22:42.289Z", - "name": "Docker", - "slug": "docker" - } -}, -{ - "model": "virtualization.clustergroup", - "pk": 1, - "fields": { - "created": "2016-08-01", - "last_updated": "2016-08-01T15:22:42.289Z", - "name": "VM Host", - "slug": "vm-host" - } -}, -{ - "model": "virtualization.cluster", - "pk": 1, - "fields": { - "created": "2016-08-01", - "last_updated": "2016-08-01T15:22:42.289Z", - "name": "Digital Ocean", - "type": 1, - "group": 1, - "tenant": null, - "site": null, - "comments": "" - } -}, -{ - "model": "virtualization.cluster", - "pk": 2, - "fields": { - "created": "2016-08-01", - "last_updated": "2016-08-01T15:22:42.289Z", - "name": "Amazon EC2", - "type": 1, - "group": 1, - "tenant": null, - "site": null, - "comments": "" - } -}, -{ - "model": "virtualization.cluster", - "pk": 3, - "fields": { - "created": "2016-08-01", - "last_updated": "2016-08-01T15:22:42.289Z", - "name": "Microsoft Azure", - "type": 1, - "group": 1, - "tenant": null, - "site": null, - "comments": "" - } -}, -{ - "model": "virtualization.cluster", - "pk": 4, - "fields": { - "created": "2016-08-01", - "last_updated": "2016-08-01T15:22:42.289Z", - "name": "vSphere Cluster", - "type": 2, - "group": 1, - "tenant": null, - "site": null, - "comments": "" - } -}, -{ - "model": "virtualization.virtualmachine", - "pk": 1, - "fields": { - "local_context_data": null, - "created": "2019-12-19", - "last_updated": "2019-12-19T05:24:19.146Z", - "cluster": 2, - "tenant": null, - "platform": null, - "name": "vm1", - "status": "active", - "role": null, - "primary_ip4": null, - "primary_ip6": null, - "vcpus": null, - "memory": null, - "disk": null, - "comments": "" - } -}, -{ - "model": "virtualization.virtualmachine", - "pk": 2, - "fields": { - "local_context_data": null, - "created": "2019-12-19", - "last_updated": "2019-12-19T05:24:41.478Z", - "cluster": 1, - "tenant": null, - "platform": null, - "name": "vm2", - "status": "active", - "role": null, - "primary_ip4": null, - "primary_ip6": null, - "vcpus": null, - "memory": null, - "disk": null, - "comments": "" - } -} -] From 47962ea732c802b82bdd2e82b14bb7e151792a79 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 24 Jan 2020 16:30:43 -0500 Subject: [PATCH 03/29] Adapt form tests to work without fixture data --- netbox/dcim/tests/test_forms.py | 126 +++++++++++++++++++------------- 1 file changed, 76 insertions(+), 50 deletions(-) diff --git a/netbox/dcim/tests/test_forms.py b/netbox/dcim/tests/test_forms.py index 5bbe36716..29e741560 100644 --- a/netbox/dcim/tests/test_forms.py +++ b/netbox/dcim/tests/test_forms.py @@ -2,6 +2,7 @@ from django.test import TestCase from dcim.forms import * from dcim.models import * +from virtualization.models import Cluster, ClusterGroup, ClusterType def get_id(model, slug): @@ -10,83 +11,108 @@ def get_id(model, slug): class DeviceTestCase(TestCase): - fixtures = ['dcim', 'ipam', 'virtualization'] + @classmethod + def setUpTestData(cls): + + site = Site.objects.create(name='Site 1', slug='site-1') + rack = Rack.objects.create(name='Rack 1', site=site) + manufacturer = Manufacturer.objects.create(name='Manufacturer 1', slug='manufacturer-1') + device_type = DeviceType.objects.create( + manufacturer=manufacturer, model='Device Type 1', slug='device-type-1', u_height=1 + ) + device_role = DeviceRole.objects.create( + name='Device Role 1', slug='device-role-1', color='ff0000' + ) + Platform.objects.create(name='Platform 1', slug='platform-1') + Device.objects.create( + name='Device 1', device_type=device_type, device_role=device_role, site=site, rack=rack, position=1 + ) + cluster_type = ClusterType.objects.create(name='Cluster Type 1', slug='cluster-type-1') + cluster_group = ClusterGroup.objects.create(name='Cluster Group 1', slug='cluster-group-1') + Cluster.objects.create(name='Cluster 1', type=cluster_type, group=cluster_group) def test_racked_device(self): - test = DeviceForm(data={ - 'name': 'test', - 'device_role': get_id(DeviceRole, 'leaf-switch'), + form = DeviceForm(data={ + 'name': 'New Device', + 'device_role': DeviceRole.objects.first().pk, 'tenant': None, - 'manufacturer': get_id(Manufacturer, 'juniper'), - 'device_type': get_id(DeviceType, 'qfx5100-48s'), - 'site': get_id(Site, 'test1'), - 'rack': '1', + 'manufacturer': Manufacturer.objects.first().pk, + 'device_type': DeviceType.objects.first().pk, + 'site': Site.objects.first().pk, + 'rack': Rack.objects.first().pk, 'face': DeviceFaceChoices.FACE_FRONT, - 'position': 41, - 'platform': get_id(Platform, 'juniper-junos'), + 'position': 2, + 'platform': Platform.objects.first().pk, 'status': DeviceStatusChoices.STATUS_ACTIVE, }) - self.assertTrue(test.is_valid(), test.fields['position'].choices) - self.assertTrue(test.save()) + self.assertTrue(form.is_valid()) + self.assertTrue(form.save()) def test_racked_device_occupied(self): - test = DeviceForm(data={ + form = DeviceForm(data={ 'name': 'test', - 'device_role': get_id(DeviceRole, 'leaf-switch'), + 'device_role': DeviceRole.objects.first().pk, 'tenant': None, - 'manufacturer': get_id(Manufacturer, 'juniper'), - 'device_type': get_id(DeviceType, 'qfx5100-48s'), - 'site': get_id(Site, 'test1'), - 'rack': '1', + 'manufacturer': Manufacturer.objects.first().pk, + 'device_type': DeviceType.objects.first().pk, + 'site': Site.objects.first().pk, + 'rack': Rack.objects.first().pk, 'face': DeviceFaceChoices.FACE_FRONT, 'position': 1, - 'platform': get_id(Platform, 'juniper-junos'), + 'platform': Platform.objects.first().pk, 'status': DeviceStatusChoices.STATUS_ACTIVE, }) - self.assertFalse(test.is_valid()) + self.assertFalse(form.is_valid()) + self.assertIn('position', form.errors) def test_non_racked_device(self): - test = DeviceForm(data={ - 'name': 'test', - 'device_role': get_id(DeviceRole, 'pdu'), + form = DeviceForm(data={ + 'name': 'New Device', + 'device_role': DeviceRole.objects.first().pk, 'tenant': None, - 'manufacturer': get_id(Manufacturer, 'servertech'), - 'device_type': get_id(DeviceType, 'cwg-24vym415c9'), - 'site': get_id(Site, 'test1'), - 'rack': '1', - 'face': '', + 'manufacturer': Manufacturer.objects.first().pk, + 'device_type': DeviceType.objects.first().pk, + 'site': Site.objects.first().pk, + 'rack': None, + 'face': None, 'position': None, - 'platform': None, + 'platform': Platform.objects.first().pk, 'status': DeviceStatusChoices.STATUS_ACTIVE, }) - self.assertTrue(test.is_valid()) - self.assertTrue(test.save()) + self.assertTrue(form.is_valid()) + self.assertTrue(form.save()) - def test_non_racked_device_with_face(self): - test = DeviceForm(data={ - 'name': 'test', - 'device_role': get_id(DeviceRole, 'pdu'), + def test_non_racked_device_with_face_position(self): + form = DeviceForm(data={ + 'name': 'New Device', + 'device_role': DeviceRole.objects.first().pk, 'tenant': None, - 'manufacturer': get_id(Manufacturer, 'servertech'), - 'device_type': get_id(DeviceType, 'cwg-24vym415c9'), - 'site': get_id(Site, 'test1'), - 'rack': '1', + 'manufacturer': Manufacturer.objects.first().pk, + 'device_type': DeviceType.objects.first().pk, + 'site': Site.objects.first().pk, + 'rack': None, 'face': DeviceFaceChoices.FACE_REAR, - 'position': None, + 'position': 10, 'platform': None, 'status': DeviceStatusChoices.STATUS_ACTIVE, }) - self.assertTrue(test.is_valid()) - self.assertTrue(test.save()) + self.assertFalse(form.is_valid()) + self.assertIn('face', form.errors) + self.assertIn('position', form.errors) - def test_cloned_cluster_device_initial_data(self): + def test_initial_data_population(self): + device_type = DeviceType.objects.first() + cluster = Cluster.objects.first() test = DeviceForm(initial={ - 'device_type': get_id(DeviceType, 'poweredge-r640'), - 'device_role': get_id(DeviceRole, 'server'), + 'device_type': device_type.pk, + 'device_role': DeviceRole.objects.first().pk, 'status': DeviceStatusChoices.STATUS_ACTIVE, - 'site': get_id(Site, 'test1'), - "cluster": Cluster.objects.get(id=4).id, + 'site': Site.objects.first().pk, + 'cluster': cluster.pk, }) - self.assertEqual(test.initial['manufacturer'], get_id(Manufacturer, 'dell')) - self.assertIn('cluster_group', test.initial) - self.assertEqual(test.initial['cluster_group'], get_id(ClusterGroup, 'vm-host')) + + # Check that the initial value for the manufacturer is set automatically when assigning the device type + self.assertEqual(test.initial['manufacturer'], device_type.manufacturer.pk) + + # Check that the initial value for the cluster group is set automatically when assigning the cluster + self.assertEqual(test.initial['cluster_group'], cluster.group.pk) From 4e4a05d3b9fc1f5ac033934ccfdd525da06f5d19 Mon Sep 17 00:00:00 2001 From: Saria Hajjar Date: Sun, 26 Jan 2020 12:52:18 +0000 Subject: [PATCH 04/29] Fixes #4016: Removed duplicate tenant field for cluster edit form --- netbox/templates/virtualization/cluster_edit.html | 1 - 1 file changed, 1 deletion(-) diff --git a/netbox/templates/virtualization/cluster_edit.html b/netbox/templates/virtualization/cluster_edit.html index bf81ffd42..c4d39d12e 100644 --- a/netbox/templates/virtualization/cluster_edit.html +++ b/netbox/templates/virtualization/cluster_edit.html @@ -8,7 +8,6 @@ {% render_field form.name %} {% render_field form.type %} {% render_field form.group %} - {% render_field form.tenant %} {% render_field form.site %} From 011280b0bfced7d21d275392da174d5b0b784aec Mon Sep 17 00:00:00 2001 From: hellerve Date: Mon, 27 Jan 2020 13:13:07 +0100 Subject: [PATCH 05/29] dcim: add borders on the rear of devices as well --- netbox/dcim/models/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/dcim/models/__init__.py b/netbox/dcim/models/__init__.py index 37ee0a266..350330757 100644 --- a/netbox/dcim/models/__init__.py +++ b/netbox/dcim/models/__init__.py @@ -405,7 +405,7 @@ class RackElevationHelperMixin: @staticmethod def _draw_device_rear(drawing, device, start, end, text): - rect = drawing.rect(start, end, class_="blocked") + rect = drawing.rect(start, end, class_="slot blocked") rect.set_desc('{} — {} ({}U) {} {}'.format( device.device_role, device.device_type.display_name, device.device_type.u_height, device.asset_tag or '', device.serial or '' From 1901f63b4ce0562ad562406f41a6352d04edfa4e Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 27 Jan 2020 09:45:18 -0500 Subject: [PATCH 06/29] Update changelog --- docs/release-notes/version-2.7.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/release-notes/version-2.7.md b/docs/release-notes/version-2.7.md index 5c489a96c..92fb7203b 100644 --- a/docs/release-notes/version-2.7.md +++ b/docs/release-notes/version-2.7.md @@ -14,6 +14,8 @@ * [#3989](https://github.com/netbox-community/netbox/issues/3989) - Correct HTTP content type assignment for webhooks * [#3999](https://github.com/netbox-community/netbox/issues/3999) - Do not filter child results by null if non-required parent fields are blank * [#4008](https://github.com/netbox-community/netbox/issues/4008) - Toggle rack elevation face using front/rear strings +* [#4017](https://github.com/netbox-community/netbox/issues/4017) - Remove redundant tenant field from cluster form +* [#4019](https://github.com/netbox-community/netbox/issues/4019) - Restore border around background devices in rack elevations --- From 46d0e88da3e145e34f49f0d78d1b8f141570bdb8 Mon Sep 17 00:00:00 2001 From: Saria Hajjar Date: Mon, 27 Jan 2020 15:49:15 +0000 Subject: [PATCH 07/29] Fixes #4010: Fixes IP addresses table when filtering interfaces --- netbox/project-static/js/interface_toggles.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/netbox/project-static/js/interface_toggles.js b/netbox/project-static/js/interface_toggles.js index a46d3185c..87b59b081 100644 --- a/netbox/project-static/js/interface_toggles.js +++ b/netbox/project-static/js/interface_toggles.js @@ -2,9 +2,9 @@ $('button.toggle-ips').click(function() { var selected = $(this).attr('selected'); if (selected) { - $('#interfaces_table tr.ipaddresses').hide(); + $('#interfaces_table tr.interface:visible + tr.ipaddresses').hide(); } else { - $('#interfaces_table tr.ipaddresses').show(); + $('#interfaces_table tr.interface:visible + tr.ipaddresses').show(); } $(this).attr('selected', !selected); $(this).children('span').toggleClass('glyphicon-check glyphicon-unchecked'); @@ -14,10 +14,11 @@ $('button.toggle-ips').click(function() { // Inteface filtering $('input.interface-filter').on('input', function() { var filter = new RegExp(this.value); + var interface; - for (interface of $(this).closest('div.panel').find('tbody > tr')) { + for (interface of $('#interfaces_table > tbody > tr')) { // Slice off 'interface_' at the start of the ID - if (filter && filter.test(interface.id.slice(10))) { + if (filter.test(interface.id.slice(10))) { // Match the toggle in case the filter now matches the interface $(interface).find('input:checkbox[name=pk]').prop('checked', $('input.toggle').prop('checked')); $(interface).show(); @@ -27,4 +28,9 @@ $('input.interface-filter').on('input', function() { $(interface).hide(); } } + + // Show the ip addresses table row for the visible (matched) interfaces, if checked + if ($('button.toggle-ips').attr('selected')) { + $('#interfaces_table > tbody > tr:visible').next('tr.ipaddresses').show(); + } }); From 00b50f9c65629c406f39e75c9695584766126a9f Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 27 Jan 2020 12:34:52 -0500 Subject: [PATCH 08/29] Remove obsolete constants --- netbox/utilities/middleware.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/netbox/utilities/middleware.py b/netbox/utilities/middleware.py index a44273ab0..564771821 100644 --- a/netbox/utilities/middleware.py +++ b/netbox/utilities/middleware.py @@ -7,9 +7,6 @@ from django.urls import reverse from .views import server_error -BASE_PATH = getattr(settings, 'BASE_PATH', False) -LOGIN_REQUIRED = getattr(settings, 'LOGIN_REQUIRED', False) - class LoginRequiredMiddleware(object): """ @@ -19,7 +16,7 @@ class LoginRequiredMiddleware(object): self.get_response = get_response def __call__(self, request): - if LOGIN_REQUIRED and not request.user.is_authenticated: + if settings.LOGIN_REQUIRED and not request.user.is_authenticated: # Redirect unauthenticated requests to the login page. API requests are exempt from redirection as the API # performs its own authentication. Also metrics can be read without login. api_path = reverse('api-root') From 73b35e72d8dbd5a4179c149cec13ec74107d70ba Mon Sep 17 00:00:00 2001 From: Samuel Mutel Date: Mon, 27 Jan 2020 21:09:49 +0100 Subject: [PATCH 09/29] Update nginx documentation --- docs/installation/3-http-daemon.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation/3-http-daemon.md b/docs/installation/3-http-daemon.md index 4ca566aa3..5e19f54a2 100644 --- a/docs/installation/3-http-daemon.md +++ b/docs/installation/3-http-daemon.md @@ -29,7 +29,7 @@ server { location / { proxy_pass http://127.0.0.1:8001; - proxy_set_header X-Forwarded-Host $server_name; + proxy_set_header X-Forwarded-Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; } From d0f127e575ad7a7840a459d4a670545fde3afbe0 Mon Sep 17 00:00:00 2001 From: Saria Hajjar Date: Mon, 27 Jan 2020 21:53:10 +0000 Subject: [PATCH 10/29] Fixes #3338: Added termination A and Z to the circuit --- netbox/circuits/api/serializers.py | 18 +++++++++++++++--- netbox/circuits/api/views.py | 4 +++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/netbox/circuits/api/serializers.py b/netbox/circuits/api/serializers.py index b22135b3f..6bac48a59 100644 --- a/netbox/circuits/api/serializers.py +++ b/netbox/circuits/api/serializers.py @@ -3,11 +3,11 @@ from taggit_serializer.serializers import TaggitSerializer, TagListSerializerFie from circuits.choices import CircuitStatusChoices from circuits.models import Provider, Circuit, CircuitTermination, CircuitType -from dcim.api.nested_serializers import NestedCableSerializer, NestedSiteSerializer +from dcim.api.nested_serializers import NestedCableSerializer, NestedInterfaceSerializer, NestedSiteSerializer from dcim.api.serializers import ConnectedEndpointSerializer from extras.api.customfields import CustomFieldModelSerializer from tenancy.api.nested_serializers import NestedTenantSerializer -from utilities.api import ChoiceField, ValidatedModelSerializer +from utilities.api import ChoiceField, ValidatedModelSerializer, WritableNestedSerializer from .nested_serializers import * @@ -39,18 +39,30 @@ class CircuitTypeSerializer(ValidatedModelSerializer): fields = ['id', 'name', 'slug', 'description', 'circuit_count'] +class CircuitCircuitTerminationSerializer(WritableNestedSerializer): + url = serializers.HyperlinkedIdentityField(view_name='circuits-api:circuittermination-detail') + site = NestedSiteSerializer() + connected_endpoint = NestedInterfaceSerializer() + + class Meta: + model = CircuitTermination + fields = ['id', 'url', 'site', 'connected_endpoint', 'port_speed', 'upstream_speed', 'xconnect_id'] + + class CircuitSerializer(TaggitSerializer, CustomFieldModelSerializer): provider = NestedProviderSerializer() status = ChoiceField(choices=CircuitStatusChoices, required=False) type = NestedCircuitTypeSerializer() tenant = NestedTenantSerializer(required=False, allow_null=True) + termination_a = CircuitCircuitTerminationSerializer(read_only=True) + termination_z = CircuitCircuitTerminationSerializer(read_only=True) tags = TagListSerializerField(required=False) class Meta: model = Circuit fields = [ 'id', 'cid', 'provider', 'type', 'status', 'tenant', 'install_date', 'commit_rate', 'description', - 'comments', 'tags', 'custom_fields', 'created', 'last_updated', + 'termination_a', 'termination_z', 'comments', 'tags', 'custom_fields', 'created', 'last_updated', ] diff --git a/netbox/circuits/api/views.py b/netbox/circuits/api/views.py index 98b7c9184..c98eb0c64 100644 --- a/netbox/circuits/api/views.py +++ b/netbox/circuits/api/views.py @@ -62,7 +62,9 @@ class CircuitTypeViewSet(ModelViewSet): # class CircuitViewSet(CustomFieldModelViewSet): - queryset = Circuit.objects.prefetch_related('type', 'tenant', 'provider').prefetch_related('tags') + queryset = Circuit.objects.prefetch_related( + 'type', 'tenant', 'provider', 'terminations__site', 'terminations__connected_endpoint' + ).prefetch_related('tags') serializer_class = serializers.CircuitSerializer filterset_class = filters.CircuitFilterSet From 5c5b9c95aaf0fc6b003fab7be6746cae408976c6 Mon Sep 17 00:00:00 2001 From: Saria Hajjar Date: Mon, 27 Jan 2020 22:07:42 +0000 Subject: [PATCH 11/29] Interface selector restricted to only interface --- netbox/project-static/js/interface_toggles.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/netbox/project-static/js/interface_toggles.js b/netbox/project-static/js/interface_toggles.js index 87b59b081..df8ac064b 100644 --- a/netbox/project-static/js/interface_toggles.js +++ b/netbox/project-static/js/interface_toggles.js @@ -16,21 +16,20 @@ $('input.interface-filter').on('input', function() { var filter = new RegExp(this.value); var interface; - for (interface of $('#interfaces_table > tbody > tr')) { + for (interface of $('#interfaces_table > tbody > tr.interface')) { // Slice off 'interface_' at the start of the ID if (filter.test(interface.id.slice(10))) { // Match the toggle in case the filter now matches the interface $(interface).find('input:checkbox[name=pk]').prop('checked', $('input.toggle').prop('checked')); $(interface).show(); + if ($('button.toggle-ips').attr('selected')) { + $(interface).next('tr.ipaddresses').show(); + } } else { // Uncheck to prevent actions from including it when it doesn't match $(interface).find('input:checkbox[name=pk]').prop('checked', false); $(interface).hide(); + $(interface).next('tr.ipaddresses').hide(); } } - - // Show the ip addresses table row for the visible (matched) interfaces, if checked - if ($('button.toggle-ips').attr('selected')) { - $('#interfaces_table > tbody > tr:visible').next('tr.ipaddresses').show(); - } }); From 93fa00b673db4e4d6118a8076ea0ba61bc2a4283 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 27 Jan 2020 17:21:57 -0500 Subject: [PATCH 12/29] #3338: Prefetch termination devices to avoid extra database queries --- netbox/circuits/api/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/circuits/api/views.py b/netbox/circuits/api/views.py index c98eb0c64..75f7e0e3e 100644 --- a/netbox/circuits/api/views.py +++ b/netbox/circuits/api/views.py @@ -63,7 +63,7 @@ class CircuitTypeViewSet(ModelViewSet): class CircuitViewSet(CustomFieldModelViewSet): queryset = Circuit.objects.prefetch_related( - 'type', 'tenant', 'provider', 'terminations__site', 'terminations__connected_endpoint' + 'type', 'tenant', 'provider', 'terminations__site', 'terminations__connected_endpoint__device' ).prefetch_related('tags') serializer_class = serializers.CircuitSerializer filterset_class = filters.CircuitFilterSet From 9c4f1d5795e5f1092048a037fdfcc82914f348b0 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 27 Jan 2020 17:24:00 -0500 Subject: [PATCH 13/29] Changelog for #3338 --- docs/release-notes/version-2.7.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/release-notes/version-2.7.md b/docs/release-notes/version-2.7.md index 92fb7203b..b3adafab0 100644 --- a/docs/release-notes/version-2.7.md +++ b/docs/release-notes/version-2.7.md @@ -3,6 +3,7 @@ ## Enhancements * [#3310](https://github.com/netbox-community/netbox/issues/3310) - Pre-select site/rack for B side when creating a new cable +* [#3338](https://github.com/netbox-community/netbox/issues/3338) - Include circuit terminations in API representation of circuits * [#3509](https://github.com/netbox-community/netbox/issues/3509) - Add IP address variables for custom scripts * [#4005](https://github.com/netbox-community/netbox/issues/4005) - Include timezone context in webhook timestamps From 3bce8e97160ef082d4c58cea93a23ab2ed230c14 Mon Sep 17 00:00:00 2001 From: Saria Hajjar Date: Mon, 27 Jan 2020 22:44:38 +0000 Subject: [PATCH 14/29] Fixes #4025: Cable status class --- netbox/templates/dcim/cable_trace.html | 2 +- netbox/templates/dcim/inc/consoleport.html | 2 +- netbox/templates/dcim/inc/consoleserverport.html | 2 +- netbox/templates/dcim/inc/frontport.html | 2 +- netbox/templates/dcim/inc/interface.html | 2 +- netbox/templates/dcim/inc/poweroutlet.html | 2 +- netbox/templates/dcim/inc/powerport.html | 2 +- netbox/templates/dcim/inc/rearport.html | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/netbox/templates/dcim/cable_trace.html b/netbox/templates/dcim/cable_trace.html index 4dd145058..8c7b69f26 100644 --- a/netbox/templates/dcim/cable_trace.html +++ b/netbox/templates/dcim/cable_trace.html @@ -32,7 +32,7 @@ {% if cable.label %}{{ cable.label }}{% else %}Cable #{{ cable.pk }}{% endif %} -

{{ cable.get_status_display }}

+

{{ cable.get_status_display }}

{{ cable.get_type_display|default:"" }}

{% if cable.length %}{{ cable.length }} {{ cable.get_length_unit_display }}{% endif %} {% if cable.color %} diff --git a/netbox/templates/dcim/inc/consoleport.html b/netbox/templates/dcim/inc/consoleport.html index f9fc40fee..9089f19b4 100644 --- a/netbox/templates/dcim/inc/consoleport.html +++ b/netbox/templates/dcim/inc/consoleport.html @@ -1,4 +1,4 @@ - + {# Name #} diff --git a/netbox/templates/dcim/inc/consoleserverport.html b/netbox/templates/dcim/inc/consoleserverport.html index f5b19ed75..0d649f812 100644 --- a/netbox/templates/dcim/inc/consoleserverport.html +++ b/netbox/templates/dcim/inc/consoleserverport.html @@ -1,6 +1,6 @@ {% load helpers %} - + {# Checkbox #} {% if perms.dcim.change_consoleserverport or perms.dcim.delete_consoleserverport %} diff --git a/netbox/templates/dcim/inc/frontport.html b/netbox/templates/dcim/inc/frontport.html index 1b7f85e2c..12915f64d 100644 --- a/netbox/templates/dcim/inc/frontport.html +++ b/netbox/templates/dcim/inc/frontport.html @@ -1,5 +1,5 @@ {% load helpers %} - + {# Checkbox #} {% if perms.dcim.change_frontport or perms.dcim.delete_frontport %} diff --git a/netbox/templates/dcim/inc/interface.html b/netbox/templates/dcim/inc/interface.html index 6ec46824b..095930c92 100644 --- a/netbox/templates/dcim/inc/interface.html +++ b/netbox/templates/dcim/inc/interface.html @@ -1,5 +1,5 @@ {% load helpers %} - + {# Checkbox #} {% if perms.dcim.change_interface or perms.dcim.delete_interface %} diff --git a/netbox/templates/dcim/inc/poweroutlet.html b/netbox/templates/dcim/inc/poweroutlet.html index 5691608b4..1c0630310 100644 --- a/netbox/templates/dcim/inc/poweroutlet.html +++ b/netbox/templates/dcim/inc/poweroutlet.html @@ -1,6 +1,6 @@ {% load helpers %} - + {# Checkbox #} {% if perms.dcim.change_poweroutlet or perms.dcim.delete_poweroutlet %} diff --git a/netbox/templates/dcim/inc/powerport.html b/netbox/templates/dcim/inc/powerport.html index 679082654..045b25dfd 100644 --- a/netbox/templates/dcim/inc/powerport.html +++ b/netbox/templates/dcim/inc/powerport.html @@ -1,4 +1,4 @@ - + {# Name #} diff --git a/netbox/templates/dcim/inc/rearport.html b/netbox/templates/dcim/inc/rearport.html index 27609e726..73ccd6b70 100644 --- a/netbox/templates/dcim/inc/rearport.html +++ b/netbox/templates/dcim/inc/rearport.html @@ -1,5 +1,5 @@ {% load helpers %} - + {# Checkbox #} {% if perms.dcim.change_rearport or perms.dcim.delete_rearport %} From 8306976b3ee8734c2f3a2008a59f95ceda597ffb Mon Sep 17 00:00:00 2001 From: Saria Hajjar Date: Mon, 27 Jan 2020 22:49:36 +0000 Subject: [PATCH 15/29] Removed erroneous double-space --- netbox/templates/dcim/inc/interface.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/templates/dcim/inc/interface.html b/netbox/templates/dcim/inc/interface.html index 095930c92..2fe970fd7 100644 --- a/netbox/templates/dcim/inc/interface.html +++ b/netbox/templates/dcim/inc/interface.html @@ -1,5 +1,5 @@ {% load helpers %} - + {# Checkbox #} {% if perms.dcim.change_interface or perms.dcim.delete_interface %} From 720bd872921f398fbff35d42dd5598bdaa1733ce Mon Sep 17 00:00:00 2001 From: Saria Hajjar Date: Mon, 27 Jan 2020 22:56:25 +0000 Subject: [PATCH 16/29] Fixed interface mark connected/planned buttons --- netbox/templates/dcim/inc/cable_toggle_buttons.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/templates/dcim/inc/cable_toggle_buttons.html b/netbox/templates/dcim/inc/cable_toggle_buttons.html index 3e0209e01..507aab3be 100644 --- a/netbox/templates/dcim/inc/cable_toggle_buttons.html +++ b/netbox/templates/dcim/inc/cable_toggle_buttons.html @@ -1,5 +1,5 @@ {% if perms.dcim.change_cable %} - {% if cable.status %} + {% if cable.status == 'connected' %} From 8d547e99066782393e6725ea512ba71423607821 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 28 Jan 2020 09:47:33 -0500 Subject: [PATCH 17/29] Fixes #4028: Correct URL patterns to match Unicode characters in tag slugs --- docs/release-notes/version-2.7.md | 1 + netbox/extras/urls.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/release-notes/version-2.7.md b/docs/release-notes/version-2.7.md index b3adafab0..255abbc85 100644 --- a/docs/release-notes/version-2.7.md +++ b/docs/release-notes/version-2.7.md @@ -17,6 +17,7 @@ * [#4008](https://github.com/netbox-community/netbox/issues/4008) - Toggle rack elevation face using front/rear strings * [#4017](https://github.com/netbox-community/netbox/issues/4017) - Remove redundant tenant field from cluster form * [#4019](https://github.com/netbox-community/netbox/issues/4019) - Restore border around background devices in rack elevations +* [#4028](https://github.com/netbox-community/netbox/issues/4028) - Correct URL patterns to match Unicode characters in tag slugs --- diff --git a/netbox/extras/urls.py b/netbox/extras/urls.py index edc3ffcad..653fe7c7f 100644 --- a/netbox/extras/urls.py +++ b/netbox/extras/urls.py @@ -11,10 +11,10 @@ urlpatterns = [ path(r'tags/', views.TagListView.as_view(), name='tag_list'), path(r'tags/edit/', views.TagBulkEditView.as_view(), name='tag_bulk_edit'), path(r'tags/delete/', views.TagBulkDeleteView.as_view(), name='tag_bulk_delete'), - path(r'tags//', views.TagView.as_view(), name='tag'), - path(r'tags//edit/', views.TagEditView.as_view(), name='tag_edit'), - path(r'tags//delete/', views.TagDeleteView.as_view(), name='tag_delete'), - path(r'tags//changelog/', views.ObjectChangeLogView.as_view(), name='tag_changelog', kwargs={'model': Tag}), + path(r'tags//', views.TagView.as_view(), name='tag'), + path(r'tags//edit/', views.TagEditView.as_view(), name='tag_edit'), + path(r'tags//delete/', views.TagDeleteView.as_view(), name='tag_delete'), + path(r'tags//changelog/', views.ObjectChangeLogView.as_view(), name='tag_changelog', kwargs={'model': Tag}), # Config contexts path(r'config-contexts/', views.ConfigContextListView.as_view(), name='configcontext_list'), From 3c5346f60ac93d50239a0058a267e2e1622bc693 Mon Sep 17 00:00:00 2001 From: kobayashi Date: Tue, 28 Jan 2020 10:22:28 -0500 Subject: [PATCH 18/29] Fixes #3978: VRF filtering for NAT IP search --- docs/release-notes/version-2.7.md | 1 + netbox/ipam/forms.py | 11 +++++++++++ netbox/templates/ipam/ipaddress_edit.html | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/version-2.7.md b/docs/release-notes/version-2.7.md index b3adafab0..85a9e87e3 100644 --- a/docs/release-notes/version-2.7.md +++ b/docs/release-notes/version-2.7.md @@ -5,6 +5,7 @@ * [#3310](https://github.com/netbox-community/netbox/issues/3310) - Pre-select site/rack for B side when creating a new cable * [#3338](https://github.com/netbox-community/netbox/issues/3338) - Include circuit terminations in API representation of circuits * [#3509](https://github.com/netbox-community/netbox/issues/3509) - Add IP address variables for custom scripts +* [#3978](https://github.com/netbox-community/netbox/issues/3978) - Add VRF filtering to search NAT IP * [#4005](https://github.com/netbox-community/netbox/issues/4005) - Include timezone context in webhook timestamps ## Bug Fixes diff --git a/netbox/ipam/forms.py b/netbox/ipam/forms.py index 35cf12dfb..183fcb717 100644 --- a/netbox/ipam/forms.py +++ b/netbox/ipam/forms.py @@ -635,6 +635,17 @@ class IPAddressForm(BootstrapMixin, TenancyForm, ReturnURLForm, CustomFieldForm) } ) ) + nat_vrf = forms.ModelChoiceField( + queryset=VRF.objects.all(), + required=False, + label='VRF', + widget=APISelect( + api_url="/api/ipam/vrfs/", + filter_for={ + 'nat_inside': 'vrf_id' + } + ) + ) nat_inside = ChainedModelChoiceField( queryset=IPAddress.objects.all(), chains=( diff --git a/netbox/templates/ipam/ipaddress_edit.html b/netbox/templates/ipam/ipaddress_edit.html index c24c94c87..e3f694fe3 100644 --- a/netbox/templates/ipam/ipaddress_edit.html +++ b/netbox/templates/ipam/ipaddress_edit.html @@ -61,7 +61,7 @@ {% render_field form.nat_device %} {% render_field form.nat_inside %} From 9b9e5684460efc68a851407befc7a58015747c32 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 28 Jan 2020 12:49:00 -0500 Subject: [PATCH 19/29] Fixes #4027: Repair schema migration for #3569 to convert IP addresses with DHCP status --- docs/release-notes/version-2.7.md | 1 + .../migrations/0029_3569_ipaddress_fields.py | 2 +- .../0034_fix_ipaddress_status_dhcp.py | 21 +++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 netbox/ipam/migrations/0034_fix_ipaddress_status_dhcp.py diff --git a/docs/release-notes/version-2.7.md b/docs/release-notes/version-2.7.md index 255abbc85..a7b6ec0e7 100644 --- a/docs/release-notes/version-2.7.md +++ b/docs/release-notes/version-2.7.md @@ -17,6 +17,7 @@ * [#4008](https://github.com/netbox-community/netbox/issues/4008) - Toggle rack elevation face using front/rear strings * [#4017](https://github.com/netbox-community/netbox/issues/4017) - Remove redundant tenant field from cluster form * [#4019](https://github.com/netbox-community/netbox/issues/4019) - Restore border around background devices in rack elevations +* [#4027](https://github.com/netbox-community/netbox/issues/4027) - Repair schema migration for #3569 to convert IP addresses with DHCP status * [#4028](https://github.com/netbox-community/netbox/issues/4028) - Correct URL patterns to match Unicode characters in tag slugs --- diff --git a/netbox/ipam/migrations/0029_3569_ipaddress_fields.py b/netbox/ipam/migrations/0029_3569_ipaddress_fields.py index 528efb4fb..195b630db 100644 --- a/netbox/ipam/migrations/0029_3569_ipaddress_fields.py +++ b/netbox/ipam/migrations/0029_3569_ipaddress_fields.py @@ -2,10 +2,10 @@ from django.db import migrations, models IPADDRESS_STATUS_CHOICES = ( - (0, 'container'), (1, 'active'), (2, 'reserved'), (3, 'deprecated'), + (5, 'dhcp'), ) IPADDRESS_ROLE_CHOICES = ( diff --git a/netbox/ipam/migrations/0034_fix_ipaddress_status_dhcp.py b/netbox/ipam/migrations/0034_fix_ipaddress_status_dhcp.py new file mode 100644 index 000000000..9e496153e --- /dev/null +++ b/netbox/ipam/migrations/0034_fix_ipaddress_status_dhcp.py @@ -0,0 +1,21 @@ +from django.db import migrations + + +def ipaddress_status_dhcp_to_slug(apps, schema_editor): + IPAddress = apps.get_model('ipam', 'IPAddress') + IPAddress.objects.filter(status='5').update(status='dhcp') + + +class Migration(migrations.Migration): + + dependencies = [ + ('ipam', '0033_deterministic_ordering'), + ] + + operations = [ + # Fixes a missed integer substitution from #3569; see bug #4027. The original migration has also been fixed, + # so this can be omitted when squashing in the future. + migrations.RunPython( + code=ipaddress_status_dhcp_to_slug + ), + ] From 77292050d4d0ffa1be7320bbe82f04f13e0d786b Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 28 Jan 2020 13:38:03 -0500 Subject: [PATCH 20/29] Changelog for #4025 --- docs/release-notes/version-2.7.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/release-notes/version-2.7.md b/docs/release-notes/version-2.7.md index a7b6ec0e7..e6becd4c9 100644 --- a/docs/release-notes/version-2.7.md +++ b/docs/release-notes/version-2.7.md @@ -17,6 +17,7 @@ * [#4008](https://github.com/netbox-community/netbox/issues/4008) - Toggle rack elevation face using front/rear strings * [#4017](https://github.com/netbox-community/netbox/issues/4017) - Remove redundant tenant field from cluster form * [#4019](https://github.com/netbox-community/netbox/issues/4019) - Restore border around background devices in rack elevations +* [#4025](https://github.com/netbox-community/netbox/issues/4025) - Correct display of cable status (various places) * [#4027](https://github.com/netbox-community/netbox/issues/4027) - Repair schema migration for #3569 to convert IP addresses with DHCP status * [#4028](https://github.com/netbox-community/netbox/issues/4028) - Correct URL patterns to match Unicode characters in tag slugs From ede576a2ae250b404ea65404cf11d8da69855aef Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 28 Jan 2020 13:55:44 -0500 Subject: [PATCH 21/29] Changelog for #4022 --- docs/release-notes/version-2.7.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/release-notes/version-2.7.md b/docs/release-notes/version-2.7.md index ef04aa19c..25aad4283 100644 --- a/docs/release-notes/version-2.7.md +++ b/docs/release-notes/version-2.7.md @@ -18,6 +18,7 @@ * [#4008](https://github.com/netbox-community/netbox/issues/4008) - Toggle rack elevation face using front/rear strings * [#4017](https://github.com/netbox-community/netbox/issues/4017) - Remove redundant tenant field from cluster form * [#4019](https://github.com/netbox-community/netbox/issues/4019) - Restore border around background devices in rack elevations +* [#4022](https://github.com/netbox-community/netbox/issues/4022) - Fix display of assigned IPs when filtering device interfaces * [#4025](https://github.com/netbox-community/netbox/issues/4025) - Correct display of cable status (various places) * [#4027](https://github.com/netbox-community/netbox/issues/4027) - Repair schema migration for #3569 to convert IP addresses with DHCP status * [#4028](https://github.com/netbox-community/netbox/issues/4028) - Correct URL patterns to match Unicode characters in tag slugs From 0a11fc1221075569b47557398e9e0e52effb7ef8 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 28 Jan 2020 14:19:29 -0500 Subject: [PATCH 22/29] Fixes #4030: Fix exception when setting interfaces to tagged mode in bulk --- docs/release-notes/version-2.7.md | 1 + netbox/dcim/forms.py | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/version-2.7.md b/docs/release-notes/version-2.7.md index 25aad4283..ae4be060a 100644 --- a/docs/release-notes/version-2.7.md +++ b/docs/release-notes/version-2.7.md @@ -22,6 +22,7 @@ * [#4025](https://github.com/netbox-community/netbox/issues/4025) - Correct display of cable status (various places) * [#4027](https://github.com/netbox-community/netbox/issues/4027) - Repair schema migration for #3569 to convert IP addresses with DHCP status * [#4028](https://github.com/netbox-community/netbox/issues/4028) - Correct URL patterns to match Unicode characters in tag slugs +* [#4030](https://github.com/netbox-community/netbox/issues/4030) - Fix exception when setting interfaces to tagged mode in bulk --- diff --git a/netbox/dcim/forms.py b/netbox/dcim/forms.py index f0667c143..e713d2c7c 100644 --- a/netbox/dcim/forms.py +++ b/netbox/dcim/forms.py @@ -2748,7 +2748,7 @@ class InterfaceCSVForm(forms.ModelForm): return self.cleaned_data['enabled'] -class InterfaceBulkEditForm(InterfaceCommonForm, BootstrapMixin, AddRemoveTagsForm, BulkEditForm): +class InterfaceBulkEditForm(BootstrapMixin, AddRemoveTagsForm, BulkEditForm): pk = forms.ModelMultipleChoiceField( queryset=Interface.objects.all(), widget=forms.MultipleHiddenInput() @@ -2829,6 +2829,18 @@ class InterfaceBulkEditForm(InterfaceCommonForm, BootstrapMixin, AddRemoveTagsFo else: self.fields['lag'].choices = [] + def clean(self): + + # Untagged interfaces cannot be assigned tagged VLANs + if self.cleaned_data['mode'] == InterfaceModeChoices.MODE_ACCESS and self.cleaned_data['tagged_vlans']: + raise forms.ValidationError({ + 'mode': "An access interface cannot have tagged VLANs assigned." + }) + + # Remove all tagged VLAN assignments from "tagged all" interfaces + elif self.cleaned_data['mode'] == InterfaceModeChoices.MODE_TAGGED_ALL: + self.cleaned_data['tagged_vlans'] = [] + class InterfaceBulkRenameForm(BulkRenameForm): pk = forms.ModelMultipleChoiceField( From 8de9f521519c21c529c79b053cf261d9bac53d84 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 28 Jan 2020 16:09:10 -0500 Subject: [PATCH 23/29] Fixes #4033: Restore missing comments field label of various bulk edit forms --- docs/release-notes/version-2.7.md | 1 + netbox/circuits/forms.py | 3 ++- netbox/dcim/forms.py | 8 +++++--- netbox/virtualization/forms.py | 6 ++++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/release-notes/version-2.7.md b/docs/release-notes/version-2.7.md index ae4be060a..ff8391585 100644 --- a/docs/release-notes/version-2.7.md +++ b/docs/release-notes/version-2.7.md @@ -23,6 +23,7 @@ * [#4027](https://github.com/netbox-community/netbox/issues/4027) - Repair schema migration for #3569 to convert IP addresses with DHCP status * [#4028](https://github.com/netbox-community/netbox/issues/4028) - Correct URL patterns to match Unicode characters in tag slugs * [#4030](https://github.com/netbox-community/netbox/issues/4030) - Fix exception when setting interfaces to tagged mode in bulk +* [#4033](https://github.com/netbox-community/netbox/issues/4033) - Restore missing comments field label of various bulk edit forms --- diff --git a/netbox/circuits/forms.py b/netbox/circuits/forms.py index d5d78e7bd..165e32eb3 100644 --- a/netbox/circuits/forms.py +++ b/netbox/circuits/forms.py @@ -89,7 +89,8 @@ class ProviderBulkEditForm(BootstrapMixin, AddRemoveTagsForm, CustomFieldBulkEdi label='Admin contact' ) comments = CommentField( - widget=SmallTextarea() + widget=SmallTextarea, + label='Comments' ) class Meta: diff --git a/netbox/dcim/forms.py b/netbox/dcim/forms.py index e713d2c7c..ca5d25389 100644 --- a/netbox/dcim/forms.py +++ b/netbox/dcim/forms.py @@ -676,7 +676,8 @@ class RackBulkEditForm(BootstrapMixin, AddRemoveTagsForm, CustomFieldBulkEditFor widget=StaticSelect2() ) comments = CommentField( - widget=SmallTextarea + widget=SmallTextarea, + label='Comments' ) class Meta: @@ -4418,8 +4419,9 @@ class PowerFeedBulkEditForm(BootstrapMixin, AddRemoveTagsForm, CustomFieldBulkEd max_utilization = forms.IntegerField( required=False ) - comments = forms.CharField( - required=False + comments = CommentField( + widget=SmallTextarea, + label='Comments' ) class Meta: diff --git a/netbox/virtualization/forms.py b/netbox/virtualization/forms.py index ae516fcb3..cbabc20c4 100644 --- a/netbox/virtualization/forms.py +++ b/netbox/virtualization/forms.py @@ -171,7 +171,8 @@ class ClusterBulkEditForm(BootstrapMixin, AddRemoveTagsForm, CustomFieldBulkEdit ) ) comments = CommentField( - widget=SmallTextarea() + widget=SmallTextarea, + label='Comments' ) class Meta: @@ -535,7 +536,8 @@ class VirtualMachineBulkEditForm(BootstrapMixin, AddRemoveTagsForm, CustomFieldB label='Disk (GB)' ) comments = CommentField( - widget=SmallTextarea() + widget=SmallTextarea, + label='Comments' ) class Meta: From be716a33458d4f35b7d537a90709adfe13e37e61 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 28 Jan 2020 16:33:55 -0500 Subject: [PATCH 24/29] Release v2.7.3 --- docs/release-notes/version-2.7.md | 2 +- netbox/netbox/settings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/version-2.7.md b/docs/release-notes/version-2.7.md index ff8391585..a6a6b65cf 100644 --- a/docs/release-notes/version-2.7.md +++ b/docs/release-notes/version-2.7.md @@ -1,4 +1,4 @@ -# v2.7.3 (FUTURE) +# v2.7.3 (2020-01-28) ## Enhancements diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index f747c3b1d..3a780f55a 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -12,7 +12,7 @@ from django.core.exceptions import ImproperlyConfigured # Environment setup # -VERSION = '2.7.3-dev' +VERSION = '2.7.3' # Hostname HOSTNAME = platform.node() From 4629cda9ad8bbd59075cfcf7323e5fd03efcdb30 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 28 Jan 2020 16:42:33 -0500 Subject: [PATCH 25/29] Post-release version bump --- netbox/netbox/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index 3a780f55a..8cdbb60a3 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -12,7 +12,7 @@ from django.core.exceptions import ImproperlyConfigured # Environment setup # -VERSION = '2.7.3' +VERSION = '2.7.4-dev' # Hostname HOSTNAME = platform.node() From 6fefa3c7dd10d931d801ebd7e735813734a7ac7e Mon Sep 17 00:00:00 2001 From: Kevin Newland Date: Tue, 28 Jan 2020 18:34:26 -0600 Subject: [PATCH 26/29] update ldap documentation use new ldap cache configuration in documentation https://github.com/netbox-community/netbox/blob/develop/netbox/netbox/settings.py#L360 --- docs/installation/4-ldap.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/installation/4-ldap.md b/docs/installation/4-ldap.md index a41400808..953d3cb28 100644 --- a/docs/installation/4-ldap.md +++ b/docs/installation/4-ldap.md @@ -110,8 +110,8 @@ AUTH_LDAP_USER_FLAGS_BY_GROUP = { AUTH_LDAP_FIND_GROUP_PERMS = True # Cache groups for one hour to reduce LDAP traffic -AUTH_LDAP_CACHE_GROUPS = True -AUTH_LDAP_GROUP_CACHE_TIMEOUT = 3600 +AUTH_LDAP_CACHE_TIMEOUT = 3600 + ``` * `is_active` - All users must be mapped to at least this group to enable authentication. Without this, users cannot log in. From e0d538ad310265a97b5f89c980d522cdd174ef2a Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 29 Jan 2020 09:40:17 -0500 Subject: [PATCH 27/29] Fixes #4043: Fix toggling of required fields in custom scripts --- docs/release-notes/version-2.7.md | 8 ++++++++ netbox/extras/scripts.py | 9 +++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/release-notes/version-2.7.md b/docs/release-notes/version-2.7.md index a6a6b65cf..ab1e2de0d 100644 --- a/docs/release-notes/version-2.7.md +++ b/docs/release-notes/version-2.7.md @@ -1,3 +1,11 @@ +# v2.7.4 (FUTURE) + +## Bug Fixes + +* [#4043](https://github.com/netbox-community/netbox/issues/4043) - Fix toggling of required fields in custom scripts + +--- + # v2.7.3 (2020-01-28) ## Enhancements diff --git a/netbox/extras/scripts.py b/netbox/extras/scripts.py index bd7e864e1..6567fe707 100644 --- a/netbox/extras/scripts.py +++ b/netbox/extras/scripts.py @@ -53,14 +53,15 @@ class ScriptVariable: # Initialize field attributes if not hasattr(self, 'field_attrs'): self.field_attrs = {} - if description: - self.field_attrs['help_text'] = description if label: self.field_attrs['label'] = label + if description: + self.field_attrs['help_text'] = description if default: self.field_attrs['initial'] = default - if required: - self.field_attrs['required'] = True + self.field_attrs['required'] = required + + # Initialize the list of optional validators if none have already been defined if 'validators' not in self.field_attrs: self.field_attrs['validators'] = [] From 03087e9d01c678600beb70a7eca8fca5506cd8b9 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 29 Jan 2020 16:22:06 -0500 Subject: [PATCH 28/29] Fixes #4049: Restore missing tags field in IPAM service serializer --- docs/release-notes/version-2.7.md | 1 + netbox/ipam/api/serializers.py | 5 +++-- netbox/ipam/tests/test_api.py | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/version-2.7.md b/docs/release-notes/version-2.7.md index ab1e2de0d..68487ebb8 100644 --- a/docs/release-notes/version-2.7.md +++ b/docs/release-notes/version-2.7.md @@ -3,6 +3,7 @@ ## Bug Fixes * [#4043](https://github.com/netbox-community/netbox/issues/4043) - Fix toggling of required fields in custom scripts +* [#4049](https://github.com/netbox-community/netbox/issues/4049) - Restore missing `tags` field in IPAM service serializer --- diff --git a/netbox/ipam/api/serializers.py b/netbox/ipam/api/serializers.py index 44f67d538..e52c172e5 100644 --- a/netbox/ipam/api/serializers.py +++ b/netbox/ipam/api/serializers.py @@ -237,7 +237,7 @@ class AvailableIPSerializer(serializers.Serializer): # Services # -class ServiceSerializer(CustomFieldModelSerializer): +class ServiceSerializer(TaggitSerializer, CustomFieldModelSerializer): device = NestedDeviceSerializer(required=False, allow_null=True) virtual_machine = NestedVirtualMachineSerializer(required=False, allow_null=True) protocol = ChoiceField(choices=ServiceProtocolChoices) @@ -247,10 +247,11 @@ class ServiceSerializer(CustomFieldModelSerializer): required=False, many=True ) + tags = TagListSerializerField(required=False) class Meta: model = Service fields = [ - 'id', 'device', 'virtual_machine', 'name', 'port', 'protocol', 'ipaddresses', 'description', + 'id', 'device', 'virtual_machine', 'name', 'port', 'protocol', 'ipaddresses', 'description', 'tags', 'custom_fields', 'created', 'last_updated', ] diff --git a/netbox/ipam/tests/test_api.py b/netbox/ipam/tests/test_api.py index 983787b0c..99a7eaca4 100644 --- a/netbox/ipam/tests/test_api.py +++ b/netbox/ipam/tests/test_api.py @@ -1064,6 +1064,7 @@ class ServiceTest(APITestCase): 'name': 'Test Service 4', 'protocol': ServiceProtocolChoices.PROTOCOL_TCP, 'port': 4, + 'tags': ['Foo', 'Bar'], } url = reverse('ipam-api:service-list') @@ -1076,6 +1077,8 @@ class ServiceTest(APITestCase): self.assertEqual(service4.name, data['name']) self.assertEqual(service4.protocol, data['protocol']) self.assertEqual(service4.port, data['port']) + tags = [tag.name for tag in service4.tags.all()] + self.assertEqual(sorted(tags), sorted(data['tags'])) def test_create_service_bulk(self): From 923c2728b38407335dec892386aa41ddc980204d Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 30 Jan 2020 12:08:40 -0500 Subject: [PATCH 29/29] Fixes #4056: Repair schema migration for Rack.outer_unit (from #3569) --- docs/release-notes/version-2.7.md | 1 + .../dcim/migrations/0079_3569_rack_fields.py | 2 +- .../migrations/0092_fix_rack_outer_unit.py | 27 +++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 netbox/dcim/migrations/0092_fix_rack_outer_unit.py diff --git a/docs/release-notes/version-2.7.md b/docs/release-notes/version-2.7.md index 68487ebb8..9fc1c1c91 100644 --- a/docs/release-notes/version-2.7.md +++ b/docs/release-notes/version-2.7.md @@ -4,6 +4,7 @@ * [#4043](https://github.com/netbox-community/netbox/issues/4043) - Fix toggling of required fields in custom scripts * [#4049](https://github.com/netbox-community/netbox/issues/4049) - Restore missing `tags` field in IPAM service serializer +* [#4056](https://github.com/netbox-community/netbox/issues/4056) - Repair schema migration for Rack.outer_unit (from #3569) --- diff --git a/netbox/dcim/migrations/0079_3569_rack_fields.py b/netbox/dcim/migrations/0079_3569_rack_fields.py index 4e76a270f..da544bb7a 100644 --- a/netbox/dcim/migrations/0079_3569_rack_fields.py +++ b/netbox/dcim/migrations/0079_3569_rack_fields.py @@ -37,7 +37,7 @@ def rack_status_to_slug(apps, schema_editor): def rack_outer_unit_to_slug(apps, schema_editor): Rack = apps.get_model('dcim', 'Rack') for id, slug in RACK_DIMENSION_CHOICES: - Rack.objects.filter(status=str(id)).update(status=slug) + Rack.objects.filter(outer_unit=str(id)).update(outer_unit=slug) class Migration(migrations.Migration): diff --git a/netbox/dcim/migrations/0092_fix_rack_outer_unit.py b/netbox/dcim/migrations/0092_fix_rack_outer_unit.py new file mode 100644 index 000000000..2a8cbf4e5 --- /dev/null +++ b/netbox/dcim/migrations/0092_fix_rack_outer_unit.py @@ -0,0 +1,27 @@ +from django.db import migrations + +RACK_DIMENSION_CHOICES = ( + (1000, 'mm'), + (2000, 'in'), +) + + +def rack_outer_unit_to_slug(apps, schema_editor): + Rack = apps.get_model('dcim', 'Rack') + for id, slug in RACK_DIMENSION_CHOICES: + Rack.objects.filter(outer_unit=str(id)).update(outer_unit=slug) + + +class Migration(migrations.Migration): + + dependencies = [ + ('dcim', '0091_interface_type_other'), + ] + + operations = [ + # Fixes a missed field migration from #3569; see bug #4056. The original migration has also been fixed, + # so this can be omitted when squashing in the future. + migrations.RunPython( + code=rack_outer_unit_to_slug + ), + ]