|
@@ -19,6 +19,7 @@ from utilities.fields import ColorField, NaturalOrderingField
|
|
|
from utilities.mptt import TreeManager
|
|
from utilities.mptt import TreeManager
|
|
|
from utilities.ordering import naturalize_interface
|
|
from utilities.ordering import naturalize_interface
|
|
|
from utilities.query_functions import CollateAsChar
|
|
from utilities.query_functions import CollateAsChar
|
|
|
|
|
+from utilities.tracking import TrackingModelMixin
|
|
|
from wireless.choices import *
|
|
from wireless.choices import *
|
|
|
from wireless.utils import get_channel_attr
|
|
from wireless.utils import get_channel_attr
|
|
|
|
|
|
|
@@ -269,7 +270,7 @@ class PathEndpoint(models.Model):
|
|
|
# Console components
|
|
# Console components
|
|
|
#
|
|
#
|
|
|
|
|
|
|
|
-class ConsolePort(ModularComponentModel, CabledObjectModel, PathEndpoint):
|
|
|
|
|
|
|
+class ConsolePort(ModularComponentModel, CabledObjectModel, PathEndpoint, TrackingModelMixin):
|
|
|
"""
|
|
"""
|
|
|
A physical console port within a Device. ConsolePorts connect to ConsoleServerPorts.
|
|
A physical console port within a Device. ConsolePorts connect to ConsoleServerPorts.
|
|
|
"""
|
|
"""
|
|
@@ -292,7 +293,7 @@ class ConsolePort(ModularComponentModel, CabledObjectModel, PathEndpoint):
|
|
|
return reverse('dcim:consoleport', kwargs={'pk': self.pk})
|
|
return reverse('dcim:consoleport', kwargs={'pk': self.pk})
|
|
|
|
|
|
|
|
|
|
|
|
|
-class ConsoleServerPort(ModularComponentModel, CabledObjectModel, PathEndpoint):
|
|
|
|
|
|
|
+class ConsoleServerPort(ModularComponentModel, CabledObjectModel, PathEndpoint, TrackingModelMixin):
|
|
|
"""
|
|
"""
|
|
|
A physical port within a Device (typically a designated console server) which provides access to ConsolePorts.
|
|
A physical port within a Device (typically a designated console server) which provides access to ConsolePorts.
|
|
|
"""
|
|
"""
|
|
@@ -319,7 +320,7 @@ class ConsoleServerPort(ModularComponentModel, CabledObjectModel, PathEndpoint):
|
|
|
# Power components
|
|
# Power components
|
|
|
#
|
|
#
|
|
|
|
|
|
|
|
-class PowerPort(ModularComponentModel, CabledObjectModel, PathEndpoint):
|
|
|
|
|
|
|
+class PowerPort(ModularComponentModel, CabledObjectModel, PathEndpoint, TrackingModelMixin):
|
|
|
"""
|
|
"""
|
|
|
A physical power supply (intake) port within a Device. PowerPorts connect to PowerOutlets.
|
|
A physical power supply (intake) port within a Device. PowerPorts connect to PowerOutlets.
|
|
|
"""
|
|
"""
|
|
@@ -428,7 +429,7 @@ class PowerPort(ModularComponentModel, CabledObjectModel, PathEndpoint):
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-class PowerOutlet(ModularComponentModel, CabledObjectModel, PathEndpoint):
|
|
|
|
|
|
|
+class PowerOutlet(ModularComponentModel, CabledObjectModel, PathEndpoint, TrackingModelMixin):
|
|
|
"""
|
|
"""
|
|
|
A physical power outlet (output) within a Device which provides power to a PowerPort.
|
|
A physical power outlet (output) within a Device which provides power to a PowerPort.
|
|
|
"""
|
|
"""
|
|
@@ -537,7 +538,7 @@ class BaseInterface(models.Model):
|
|
|
return self.fhrp_group_assignments.count()
|
|
return self.fhrp_group_assignments.count()
|
|
|
|
|
|
|
|
|
|
|
|
|
-class Interface(ModularComponentModel, BaseInterface, CabledObjectModel, PathEndpoint):
|
|
|
|
|
|
|
+class Interface(ModularComponentModel, BaseInterface, CabledObjectModel, PathEndpoint, TrackingModelMixin):
|
|
|
"""
|
|
"""
|
|
|
A network interface within a Device. A physical Interface can connect to exactly one other Interface.
|
|
A network interface within a Device. A physical Interface can connect to exactly one other Interface.
|
|
|
"""
|
|
"""
|
|
@@ -888,7 +889,7 @@ class Interface(ModularComponentModel, BaseInterface, CabledObjectModel, PathEnd
|
|
|
# Pass-through ports
|
|
# Pass-through ports
|
|
|
#
|
|
#
|
|
|
|
|
|
|
|
-class FrontPort(ModularComponentModel, CabledObjectModel):
|
|
|
|
|
|
|
+class FrontPort(ModularComponentModel, CabledObjectModel, TrackingModelMixin):
|
|
|
"""
|
|
"""
|
|
|
A pass-through port on the front of a Device.
|
|
A pass-through port on the front of a Device.
|
|
|
"""
|
|
"""
|
|
@@ -949,7 +950,7 @@ class FrontPort(ModularComponentModel, CabledObjectModel):
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
-class RearPort(ModularComponentModel, CabledObjectModel):
|
|
|
|
|
|
|
+class RearPort(ModularComponentModel, CabledObjectModel, TrackingModelMixin):
|
|
|
"""
|
|
"""
|
|
|
A pass-through port on the rear of a Device.
|
|
A pass-through port on the rear of a Device.
|
|
|
"""
|
|
"""
|
|
@@ -990,7 +991,7 @@ class RearPort(ModularComponentModel, CabledObjectModel):
|
|
|
# Bays
|
|
# Bays
|
|
|
#
|
|
#
|
|
|
|
|
|
|
|
-class ModuleBay(ComponentModel):
|
|
|
|
|
|
|
+class ModuleBay(ComponentModel, TrackingModelMixin):
|
|
|
"""
|
|
"""
|
|
|
An empty space within a Device which can house a child device
|
|
An empty space within a Device which can house a child device
|
|
|
"""
|
|
"""
|
|
@@ -1006,7 +1007,7 @@ class ModuleBay(ComponentModel):
|
|
|
return reverse('dcim:modulebay', kwargs={'pk': self.pk})
|
|
return reverse('dcim:modulebay', kwargs={'pk': self.pk})
|
|
|
|
|
|
|
|
|
|
|
|
|
-class DeviceBay(ComponentModel):
|
|
|
|
|
|
|
+class DeviceBay(ComponentModel, TrackingModelMixin):
|
|
|
"""
|
|
"""
|
|
|
An empty space within a Device which can house a child device
|
|
An empty space within a Device which can house a child device
|
|
|
"""
|
|
"""
|
|
@@ -1064,7 +1065,7 @@ class InventoryItemRole(OrganizationalModel):
|
|
|
return reverse('dcim:inventoryitemrole', args=[self.pk])
|
|
return reverse('dcim:inventoryitemrole', args=[self.pk])
|
|
|
|
|
|
|
|
|
|
|
|
|
-class InventoryItem(MPTTModel, ComponentModel):
|
|
|
|
|
|
|
+class InventoryItem(MPTTModel, ComponentModel, TrackingModelMixin):
|
|
|
"""
|
|
"""
|
|
|
An InventoryItem represents a serialized piece of hardware within a Device, such as a line card or power supply.
|
|
An InventoryItem represents a serialized piece of hardware within a Device, such as a line card or power supply.
|
|
|
InventoryItems are used only for inventory purposes.
|
|
InventoryItems are used only for inventory purposes.
|