| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- from django.db.models import Q
- from .choices import InterfaceTypeChoices
- #
- # Racks
- #
- RACK_U_HEIGHT_DEFAULT = 42
- RACK_ELEVATION_LEGEND_WIDTH_DEFAULT = 30
- RACK_ELEVATION_UNIT_WIDTH_DEFAULT = 230
- RACK_ELEVATION_UNIT_HEIGHT_DEFAULT = 20
- #
- # RearPorts
- #
- REARPORT_POSITIONS_MIN = 1
- REARPORT_POSITIONS_MAX = 64
- #
- # Interfaces
- #
- INTERFACE_MTU_MIN = 1
- INTERFACE_MTU_MAX = 32767 # Max value of a signed 16-bit integer
- VIRTUAL_IFACE_TYPES = [
- InterfaceTypeChoices.TYPE_VIRTUAL,
- InterfaceTypeChoices.TYPE_LAG,
- ]
- WIRELESS_IFACE_TYPES = [
- InterfaceTypeChoices.TYPE_80211A,
- InterfaceTypeChoices.TYPE_80211G,
- InterfaceTypeChoices.TYPE_80211N,
- InterfaceTypeChoices.TYPE_80211AC,
- InterfaceTypeChoices.TYPE_80211AD,
- ]
- NONCONNECTABLE_IFACE_TYPES = VIRTUAL_IFACE_TYPES + WIRELESS_IFACE_TYPES
- #
- # PowerFeeds
- #
- POWERFEED_VOLTAGE_DEFAULT = 120
- POWERFEED_AMPERAGE_DEFAULT = 20
- POWERFEED_MAX_UTILIZATION_DEFAULT = 80 # Percentage
- #
- # Cabling and connections
- #
- # TODO: Replace with CableStatusChoices?
- # Console/power/interface connection statuses
- CONNECTION_STATUS_PLANNED = False
- CONNECTION_STATUS_CONNECTED = True
- CONNECTION_STATUS_CHOICES = [
- [CONNECTION_STATUS_PLANNED, 'Planned'],
- [CONNECTION_STATUS_CONNECTED, 'Connected'],
- ]
- # Cable endpoint types
- CABLE_TERMINATION_MODELS = Q(
- Q(app_label='circuits', model__in=(
- 'circuittermination',
- )) |
- Q(app_label='dcim', model__in=(
- 'consoleport',
- 'consoleserverport',
- 'frontport',
- 'interface',
- 'powerfeed',
- 'poweroutlet',
- 'powerport',
- 'rearport',
- ))
- )
- COMPATIBLE_TERMINATION_TYPES = {
- 'consoleport': ['consoleserverport', 'frontport', 'rearport'],
- 'consoleserverport': ['consoleport', 'frontport', 'rearport'],
- 'powerport': ['poweroutlet', 'powerfeed'],
- 'poweroutlet': ['powerport'],
- 'interface': ['interface', 'circuittermination', 'frontport', 'rearport'],
- 'frontport': ['consoleport', 'consoleserverport', 'interface', 'frontport', 'rearport', 'circuittermination'],
- 'rearport': ['consoleport', 'consoleserverport', 'interface', 'frontport', 'rearport', 'circuittermination'],
- 'circuittermination': ['interface', 'frontport', 'rearport'],
- }
|