2019-11-21 22:11:02 -05:00
|
|
|
from .choices import InterfaceTypeChoices
|
2018-08-22 11:33:43 -04:00
|
|
|
|
2020-01-09 21:58:38 +00:00
|
|
|
# BGP ASN bounds
|
|
|
|
BGP_ASN_MIN = 1
|
|
|
|
BGP_ASN_MAX = 2**32 - 1
|
2017-06-16 16:01:44 -04:00
|
|
|
|
2019-11-21 22:11:02 -05:00
|
|
|
#
|
|
|
|
# Interface type groups
|
|
|
|
#
|
2017-06-16 16:01:44 -04:00
|
|
|
|
|
|
|
VIRTUAL_IFACE_TYPES = [
|
2019-11-21 22:11:02 -05:00
|
|
|
InterfaceTypeChoices.TYPE_VIRTUAL,
|
|
|
|
InterfaceTypeChoices.TYPE_LAG,
|
2017-06-16 16:01:44 -04:00
|
|
|
]
|
|
|
|
|
2017-06-16 17:52:09 -04:00
|
|
|
WIRELESS_IFACE_TYPES = [
|
2019-11-21 22:11:02 -05:00
|
|
|
InterfaceTypeChoices.TYPE_80211A,
|
|
|
|
InterfaceTypeChoices.TYPE_80211G,
|
|
|
|
InterfaceTypeChoices.TYPE_80211N,
|
|
|
|
InterfaceTypeChoices.TYPE_80211AC,
|
|
|
|
InterfaceTypeChoices.TYPE_80211AD,
|
2017-06-16 17:52:09 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
NONCONNECTABLE_IFACE_TYPES = VIRTUAL_IFACE_TYPES + WIRELESS_IFACE_TYPES
|
|
|
|
|
2017-06-16 16:01:44 -04:00
|
|
|
# Console/power/interface connection statuses
|
|
|
|
CONNECTION_STATUS_PLANNED = False
|
|
|
|
CONNECTION_STATUS_CONNECTED = True
|
|
|
|
CONNECTION_STATUS_CHOICES = [
|
|
|
|
[CONNECTION_STATUS_PLANNED, 'Planned'],
|
|
|
|
[CONNECTION_STATUS_CONNECTED, 'Connected'],
|
|
|
|
]
|
|
|
|
|
2018-10-18 15:43:55 -04:00
|
|
|
# Cable endpoint types
|
2018-10-24 14:38:44 -04:00
|
|
|
CABLE_TERMINATION_TYPES = [
|
2019-10-10 23:24:44 -04:00
|
|
|
'consoleport', 'consoleserverport', 'interface', 'poweroutlet', 'powerport', 'frontport', 'rearport',
|
2019-11-27 09:19:34 -05:00
|
|
|
'circuittermination', 'powerfeed',
|
2017-06-16 16:01:44 -04:00
|
|
|
]
|
2018-10-18 15:43:55 -04:00
|
|
|
|
2018-10-24 14:38:44 -04:00
|
|
|
CABLE_TERMINATION_TYPE_CHOICES = {
|
2018-10-22 16:58:24 -04:00
|
|
|
# (API endpoint, human-friendly name)
|
|
|
|
'consoleport': ('console-ports', 'Console port'),
|
|
|
|
'consoleserverport': ('console-server-ports', 'Console server port'),
|
|
|
|
'powerport': ('power-ports', 'Power port'),
|
|
|
|
'poweroutlet': ('power-outlets', 'Power outlet'),
|
|
|
|
'interface': ('interfaces', 'Interface'),
|
2018-10-25 12:08:13 -04:00
|
|
|
'frontport': ('front-ports', 'Front panel port'),
|
|
|
|
'rearport': ('rear-ports', 'Rear panel port'),
|
2018-10-22 16:58:24 -04:00
|
|
|
}
|
|
|
|
|
2018-10-24 14:38:44 -04:00
|
|
|
COMPATIBLE_TERMINATION_TYPES = {
|
2018-10-25 12:08:13 -04:00
|
|
|
'consoleport': ['consoleserverport', 'frontport', 'rearport'],
|
|
|
|
'consoleserverport': ['consoleport', 'frontport', 'rearport'],
|
2019-03-21 17:47:43 -04:00
|
|
|
'powerport': ['poweroutlet', 'powerfeed'],
|
2018-10-22 16:58:24 -04:00
|
|
|
'poweroutlet': ['powerport'],
|
2018-10-30 12:16:22 -04:00
|
|
|
'interface': ['interface', 'circuittermination', 'frontport', 'rearport'],
|
2018-11-01 11:57:38 -04:00
|
|
|
'frontport': ['consoleport', 'consoleserverport', 'interface', 'frontport', 'rearport', 'circuittermination'],
|
|
|
|
'rearport': ['consoleport', 'consoleserverport', 'interface', 'frontport', 'rearport', 'circuittermination'],
|
2018-10-30 12:16:22 -04:00
|
|
|
'circuittermination': ['interface', 'frontport', 'rearport'],
|
2018-10-22 16:58:24 -04:00
|
|
|
}
|
2019-12-08 18:14:59 +01:00
|
|
|
|
|
|
|
|
2019-12-11 13:39:10 -05:00
|
|
|
# Rack Elevation SVG Size
|
|
|
|
RACK_ELEVATION_UNIT_WIDTH_DEFAULT = 230
|
|
|
|
RACK_ELEVATION_UNIT_HEIGHT_DEFAULT = 20
|