choices.py 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. from django.utils.translation import gettext_lazy as _
  2. from utilities.choices import ChoiceSet
  3. #
  4. # Circuits
  5. #
  6. class CircuitStatusChoices(ChoiceSet):
  7. key = 'Circuit.status'
  8. STATUS_DEPROVISIONING = 'deprovisioning'
  9. STATUS_ACTIVE = 'active'
  10. STATUS_PLANNED = 'planned'
  11. STATUS_PROVISIONING = 'provisioning'
  12. STATUS_OFFLINE = 'offline'
  13. STATUS_DECOMMISSIONED = 'decommissioned'
  14. CHOICES = [
  15. (STATUS_PLANNED, _('Planned'), 'cyan'),
  16. (STATUS_PROVISIONING, _('Provisioning'), 'blue'),
  17. (STATUS_ACTIVE, _('Active'), 'green'),
  18. (STATUS_OFFLINE, _('Offline'), 'red'),
  19. (STATUS_DEPROVISIONING, _('Deprovisioning'), 'yellow'),
  20. (STATUS_DECOMMISSIONED, _('Decommissioned'), 'gray'),
  21. ]
  22. class CircuitCommitRateChoices(ChoiceSet):
  23. key = 'Circuit.commit_rate'
  24. CHOICES = [
  25. (10000, '10 Mbps'),
  26. (100000, '100 Mbps'),
  27. (1000000, '1 Gbps'),
  28. (10000000, '10 Gbps'),
  29. (25000000, '25 Gbps'),
  30. (40000000, '40 Gbps'),
  31. (100000000, '100 Gbps'),
  32. (200000000, '200 Gbps'),
  33. (400000000, '400 Gbps'),
  34. (1544, 'T1 (1.544 Mbps)'),
  35. (2048, 'E1 (2.048 Mbps)'),
  36. ]
  37. #
  38. # CircuitTerminations
  39. #
  40. class CircuitTerminationSideChoices(ChoiceSet):
  41. SIDE_A = 'A'
  42. SIDE_Z = 'Z'
  43. CHOICES = (
  44. (SIDE_A, 'A'),
  45. (SIDE_Z, 'Z')
  46. )
  47. class CircuitTerminationPortSpeedChoices(ChoiceSet):
  48. key = 'CircuitTermination.port_speed'
  49. CHOICES = [
  50. (10000, '10 Mbps'),
  51. (100000, '100 Mbps'),
  52. (1000000, '1 Gbps'),
  53. (10000000, '10 Gbps'),
  54. (25000000, '25 Gbps'),
  55. (40000000, '40 Gbps'),
  56. (100000000, '100 Gbps'),
  57. (200000000, '200 Gbps'),
  58. (400000000, '400 Gbps'),
  59. (1544, 'T1 (1.544 Mbps)'),
  60. (2048, 'E1 (2.048 Mbps)'),
  61. ]
  62. class CircuitPriorityChoices(ChoiceSet):
  63. key = 'CircuitGroupAssignment.priority'
  64. PRIORITY_PRIMARY = 'primary'
  65. PRIORITY_SECONDARY = 'secondary'
  66. PRIORITY_TERTIARY = 'tertiary'
  67. PRIORITY_INACTIVE = 'inactive'
  68. CHOICES = [
  69. (PRIORITY_PRIMARY, _('Primary')),
  70. (PRIORITY_SECONDARY, _('Secondary')),
  71. (PRIORITY_TERTIARY, _('Tertiary')),
  72. (PRIORITY_INACTIVE, _('Inactive')),
  73. ]
  74. #
  75. # Virtual circuits
  76. #
  77. class VirtualCircuitTerminationRoleChoices(ChoiceSet):
  78. ROLE_PEER = 'peer'
  79. ROLE_HUB = 'hub'
  80. ROLE_SPOKE = 'spoke'
  81. CHOICES = [
  82. (ROLE_PEER, _('Peer'), 'green'),
  83. (ROLE_HUB, _('Hub'), 'blue'),
  84. (ROLE_SPOKE, _('Spoke'), 'orange'),
  85. ]