Преглед изворни кода

Merge branch 'develop' into 2921-tags-select2

Saria Hajjar пре 6 година
родитељ
комит
52f7ef4864
38 измењених фајлова са 250 додато и 6429 уклоњено
  1. 1 1
      docs/installation/3-http-daemon.md
  2. 2 2
      docs/installation/4-ldap.md
  3. 21 1
      docs/release-notes/version-2.7.md
  4. 15 3
      netbox/circuits/api/serializers.py
  5. 3 1
      netbox/circuits/api/views.py
  6. 2 1
      netbox/circuits/forms.py
  7. 0 5790
      netbox/dcim/fixtures/dcim.json
  8. 18 4
      netbox/dcim/forms.py
  9. 1 1
      netbox/dcim/migrations/0079_3569_rack_fields.py
  10. 27 0
      netbox/dcim/migrations/0092_fix_rack_outer_unit.py
  11. 1 1
      netbox/dcim/models/__init__.py
  12. 76 50
      netbox/dcim/tests/test_forms.py
  13. 0 35
      netbox/extras/fixtures/extras.json
  14. 5 4
      netbox/extras/scripts.py
  15. 4 4
      netbox/extras/urls.py
  16. 3 2
      netbox/ipam/api/serializers.py
  17. 0 329
      netbox/ipam/fixtures/ipam.json
  18. 11 0
      netbox/ipam/forms.py
  19. 1 1
      netbox/ipam/migrations/0029_3569_ipaddress_fields.py
  20. 21 0
      netbox/ipam/migrations/0034_fix_ipaddress_status_dhcp.py
  21. 3 0
      netbox/ipam/tests/test_api.py
  22. 2 1
      netbox/netbox/settings.py
  23. 9 7
      netbox/netbox/urls.py
  24. 9 4
      netbox/project-static/js/interface_toggles.js
  25. 1 1
      netbox/templates/dcim/cable_trace.html
  26. 1 1
      netbox/templates/dcim/inc/cable_toggle_buttons.html
  27. 1 1
      netbox/templates/dcim/inc/consoleport.html
  28. 1 1
      netbox/templates/dcim/inc/consoleserverport.html
  29. 1 1
      netbox/templates/dcim/inc/frontport.html
  30. 1 1
      netbox/templates/dcim/inc/interface.html
  31. 1 1
      netbox/templates/dcim/inc/poweroutlet.html
  32. 1 1
      netbox/templates/dcim/inc/powerport.html
  33. 1 1
      netbox/templates/dcim/inc/rearport.html
  34. 1 1
      netbox/templates/ipam/ipaddress_edit.html
  35. 0 1
      netbox/templates/virtualization/cluster_edit.html
  36. 1 4
      netbox/utilities/middleware.py
  37. 0 170
      netbox/virtualization/fixtures/virtualization.json
  38. 4 2
      netbox/virtualization/forms.py

+ 1 - 1
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;
     }

+ 2 - 2
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.

+ 21 - 1
docs/release-notes/version-2.7.md

@@ -1,10 +1,22 @@
-# v2.7.3 (FUTURE)
+# v2.7.4 (FUTURE)
+
+## 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
+* [#4056](https://github.com/netbox-community/netbox/issues/4056) - Repair schema migration for Rack.outer_unit (from #3569)
+
+---
+
+# v2.7.3 (2020-01-28)
 
 ## Enhancements
 
 * [#2921](https://github.com/netbox-community/netbox/issues/2921) - Replace tags filter with Select2 widget
 * [#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
@@ -15,6 +27,14 @@
 * [#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
+* [#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
+* [#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
 
 ---
 

+ 15 - 3
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',
         ]
 
 

+ 3 - 1
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__device'
+    ).prefetch_related('tags')
     serializer_class = serializers.CircuitSerializer
     filterset_class = filters.CircuitFilterSet
 

+ 2 - 1
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:

+ 0 - 5790
netbox/dcim/fixtures/dcim.json

@@ -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": ""
-    }
-}
-]

+ 18 - 4
netbox/dcim/forms.py

@@ -678,7 +678,8 @@ class RackBulkEditForm(BootstrapMixin, AddRemoveTagsForm, CustomFieldBulkEditFor
         widget=StaticSelect2()
     )
     comments = CommentField(
-        widget=SmallTextarea
+        widget=SmallTextarea,
+        label='Comments'
     )
 
     class Meta:
@@ -2758,7 +2759,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()
@@ -2839,6 +2840,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(
@@ -4421,8 +4434,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:

+ 1 - 1
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):

+ 27 - 0
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
+        ),
+    ]

+ 1 - 1
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 ''

+ 76 - 50
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)

+ 0 - 35
netbox/extras/fixtures/extras.json

@@ -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": ""
-    }
-}
-]

+ 5 - 4
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'] = []
 

+ 4 - 4
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/<slug:slug>/', views.TagView.as_view(), name='tag'),
-    path(r'tags/<slug:slug>/edit/', views.TagEditView.as_view(), name='tag_edit'),
-    path(r'tags/<slug:slug>/delete/', views.TagDeleteView.as_view(), name='tag_delete'),
-    path(r'tags/<slug:slug>/changelog/', views.ObjectChangeLogView.as_view(), name='tag_changelog', kwargs={'model': Tag}),
+    path(r'tags/<str:slug>/', views.TagView.as_view(), name='tag'),
+    path(r'tags/<str:slug>/edit/', views.TagEditView.as_view(), name='tag_edit'),
+    path(r'tags/<str:slug>/delete/', views.TagDeleteView.as_view(), name='tag_delete'),
+    path(r'tags/<str:slug>/changelog/', views.ObjectChangeLogView.as_view(), name='tag_changelog', kwargs={'model': Tag}),
 
     # Config contexts
     path(r'config-contexts/', views.ConfigContextListView.as_view(), name='configcontext_list'),

+ 3 - 2
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',
         ]

+ 0 - 329
netbox/ipam/fixtures/ipam.json

@@ -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
-    }
-}
-]

+ 11 - 0
netbox/ipam/forms.py

@@ -638,6 +638,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=(

+ 1 - 1
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 = (

+ 21 - 0
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
+        ),
+    ]

+ 3 - 0
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):
 

+ 2 - 1
netbox/netbox/settings.py

@@ -12,7 +12,7 @@ from django.core.exceptions import ImproperlyConfigured
 # Environment setup
 #
 
-VERSION = '2.7.3-dev'
+VERSION = '2.7.4-dev'
 
 # Hostname
 HOSTNAME = platform.node()
@@ -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',

+ 9 - 7
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,
 )

+ 9 - 4
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,17 +14,22 @@ $('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.interface')) {
         // 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();
+            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();
         }
     }
 });

+ 1 - 1
netbox/templates/dcim/cable_trace.html

@@ -32,7 +32,7 @@
                             {% if cable.label %}<code>{{ cable.label }}</code>{% else %}Cable #{{ cable.pk }}{% endif %}
                         </a>
                     </h4>
-                    <p><span class="label label-{% if cable.status %}success{% else %}info{% endif %}">{{ cable.get_status_display }}</span></p>
+                    <p><span class="label label-{{ cable.get_status_class }}">{{ cable.get_status_display }}</span></p>
                     <p>{{ cable.get_type_display|default:"" }}</p>
                     {% if cable.length %}{{ cable.length }} {{ cable.get_length_unit_display }}{% endif %}
                     {% if cable.color %}

+ 1 - 1
netbox/templates/dcim/inc/cable_toggle_buttons.html

@@ -1,5 +1,5 @@
 {% if perms.dcim.change_cable %}
-    {% if cable.status %}
+    {% if cable.status == 'connected' %}
         <a href="#" class="btn btn-warning btn-xs cable-toggle connected" title="Mark planned" data="{{ cable.pk }}">
             <i class="glyphicon glyphicon-ban-circle" aria-hidden="true"></i>
         </a>

+ 1 - 1
netbox/templates/dcim/inc/consoleport.html

@@ -1,4 +1,4 @@
-<tr class="consoleport{% if cp.cable.status %} success{% elif cp.cable %} info{% endif %}">
+<tr class="consoleport{% if cp.cable %} {{ cp.cable.get_status_class }}{% endif %}">
 
     {# Name #}
     <td>

+ 1 - 1
netbox/templates/dcim/inc/consoleserverport.html

@@ -1,6 +1,6 @@
 {% load helpers %}
 
-<tr class="consoleserverport{% if csp.cable.status %} success{% elif csp.cable %} info{% endif %}">
+<tr class="consoleserverport{% if csp.cable %} {{ csp.cable.get_status_class }}{% endif %}">
 
     {# Checkbox #}
     {% if perms.dcim.change_consoleserverport or perms.dcim.delete_consoleserverport %}

+ 1 - 1
netbox/templates/dcim/inc/frontport.html

@@ -1,5 +1,5 @@
 {% load helpers %}
-<tr class="frontport{% if frontport.cable.status %} success{% elif frontport.cable %} info{% endif %}">
+<tr class="frontport{% if frontport.cable %} {{ frontport.cable.get_status_class }}{% endif %}">
 
     {# Checkbox #}
     {% if perms.dcim.change_frontport or perms.dcim.delete_frontport %}

+ 1 - 1
netbox/templates/dcim/inc/interface.html

@@ -1,5 +1,5 @@
 {% load helpers %}
-<tr class="interface{% if not iface.enabled %} danger{% elif iface.cable.status %} success{% elif iface.cable %} info{% elif iface.is_virtual %} warning{% endif %}" id="interface_{{ iface.name }}">
+<tr class="interface{% if not iface.enabled %} danger{% elif iface.cable %} {{ iface.cable.get_status_class }}{% elif iface.is_virtual %} warning{% endif %}" id="interface_{{ iface.name }}">
 
     {# Checkbox #}
     {% if perms.dcim.change_interface or perms.dcim.delete_interface %}

+ 1 - 1
netbox/templates/dcim/inc/poweroutlet.html

@@ -1,6 +1,6 @@
 {% load helpers %}
 
-<tr class="poweroutlet{% if po.cable.status %} success{% elif po.cable %} info{% endif %}">
+<tr class="poweroutlet{% if po.cable %} {{ po.cable.get_status_class }}{% endif %}">
 
     {# Checkbox #}
     {% if perms.dcim.change_poweroutlet or perms.dcim.delete_poweroutlet %}

+ 1 - 1
netbox/templates/dcim/inc/powerport.html

@@ -1,4 +1,4 @@
-<tr class="powerport{% if pp.cable.status %} success{% elif pp.cable %} info{% endif %}">
+<tr class="powerport{% if pp.cable %} {{ pp.cable.get_status_class }}{% endif %}">
 
     {# Name #}
     <td>

+ 1 - 1
netbox/templates/dcim/inc/rearport.html

@@ -1,5 +1,5 @@
 {% load helpers %}
-<tr class="rearport{% if rearport.cable.status %} success{% elif rearport.cable %} info{% endif %}">
+<tr class="rearport{% if rearport.cable %} {{ rearport.cable.get_status_class }}{% endif %}">
 
     {# Checkbox #}
     {% if perms.dcim.change_rearport or perms.dcim.delete_rearport %}

+ 1 - 1
netbox/templates/ipam/ipaddress_edit.html

@@ -61,7 +61,7 @@
                     {% render_field form.nat_device %}
                 </div>
                 <div class="tab-pane" id="search">
-                    &nbsp;
+                  {% render_field form.nat_vrf %}
                 </div>
             </div>
             {% render_field form.nat_inside %}

+ 0 - 1
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 %}
         </div>
     </div>

+ 1 - 4
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')

+ 0 - 170
netbox/virtualization/fixtures/virtualization.json

@@ -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": ""
-    }
-}
-]

+ 4 - 2
netbox/virtualization/forms.py

@@ -171,7 +171,8 @@ class ClusterBulkEditForm(BootstrapMixin, AddRemoveTagsForm, CustomFieldBulkEdit
         )
     )
     comments = CommentField(
-        widget=SmallTextarea()
+        widget=SmallTextarea,
+        label='Comments'
     )
 
     class Meta:
@@ -536,7 +537,8 @@ class VirtualMachineBulkEditForm(BootstrapMixin, AddRemoveTagsForm, CustomFieldB
         label='Disk (GB)'
     )
     comments = CommentField(
-        widget=SmallTextarea()
+        widget=SmallTextarea,
+        label='Comments'
     )
 
     class Meta: