netbox-cesnet-services-plugin 5.2.0__tar.gz → 5.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. {netbox_cesnet_services_plugin-5.2.0/netbox_cesnet_services_plugin.egg-info → netbox_cesnet_services_plugin-5.3.0}/PKG-INFO +3 -1
  2. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/README.md +2 -0
  3. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/__init__.py +1 -1
  4. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/api/serializers.py +24 -0
  5. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/api/urls.py +2 -0
  6. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/api/views.py +43 -1
  7. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/filtersets/__init__.py +2 -0
  8. netbox_cesnet_services_plugin-5.3.0/netbox_cesnet_services_plugin/filtersets/service_nni.py +73 -0
  9. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/forms/__init__.py +8 -0
  10. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/forms/service_core_trunk.py +8 -16
  11. netbox_cesnet_services_plugin-5.3.0/netbox_cesnet_services_plugin/forms/service_nni.py +100 -0
  12. netbox_cesnet_services_plugin-5.3.0/netbox_cesnet_services_plugin/forms/trunk_ports.py +40 -0
  13. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/graphql/filters.py +11 -0
  14. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/graphql/schema.py +4 -0
  15. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/graphql/types.py +19 -0
  16. netbox_cesnet_services_plugin-5.3.0/netbox_cesnet_services_plugin/migrations/0020_servicenni_trunk_port_constraints.py +81 -0
  17. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/models/__init__.py +1 -0
  18. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/models/service_core_trunk.py +20 -0
  19. netbox_cesnet_services_plugin-5.3.0/netbox_cesnet_services_plugin/models/service_nni.py +72 -0
  20. netbox_cesnet_services_plugin-5.3.0/netbox_cesnet_services_plugin/models/trunk_ports.py +119 -0
  21. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/navigation.py +5 -0
  22. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/tables/__init__.py +2 -0
  23. netbox_cesnet_services_plugin-5.3.0/netbox_cesnet_services_plugin/tables/service_nni.py +26 -0
  24. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/template_content.py +2 -0
  25. netbox_cesnet_services_plugin-5.3.0/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/servicenni/servicenni.html +89 -0
  26. netbox_cesnet_services_plugin-5.3.0/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/servicenni.html +2 -0
  27. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/tests/test_related_objects.py +4 -1
  28. netbox_cesnet_services_plugin-5.3.0/netbox_cesnet_services_plugin/tests/test_service_nni.py +326 -0
  29. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/urls.py +2 -0
  30. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/views/__init__.py +14 -0
  31. netbox_cesnet_services_plugin-5.3.0/netbox_cesnet_services_plugin/views/service_nni.py +48 -0
  32. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0/netbox_cesnet_services_plugin.egg-info}/PKG-INFO +3 -1
  33. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin.egg-info/SOURCES.txt +11 -0
  34. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/CONTRIBUTING.md +0 -0
  35. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/LICENSE +0 -0
  36. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/MANIFEST.in +0 -0
  37. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/api/__init__.py +0 -0
  38. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/choices.py +0 -0
  39. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/filtersets/bgpconnection.py +0 -0
  40. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/filtersets/bgpconnection_aggregation.py +0 -0
  41. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/filtersets/lldpneighbor.py +0 -0
  42. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/filtersets/lldpneighborleaf.py +0 -0
  43. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/filtersets/service_core_link.py +0 -0
  44. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/filtersets/service_core_trunk.py +0 -0
  45. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/filtersets/service_ip.py +0 -0
  46. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/filtersets/utils.py +0 -0
  47. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/forms/bgpconnection.py +0 -0
  48. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/forms/bgpconnection_aggregation.py +0 -0
  49. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/forms/lldpneighbor.py +0 -0
  50. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/forms/lldpneighborleaf.py +0 -0
  51. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/forms/service_core_link.py +0 -0
  52. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/forms/service_ip.py +0 -0
  53. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/graphql/__init__.py +0 -0
  54. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/0001_initial.py +0 -0
  55. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/0002_bgpconnection_comments.py +0 -0
  56. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/0003_alter_bgpconnection_options_bgpconnection_device.py +0 -0
  57. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/0004_alter_bgpconnection_options_bgpconnection_raw_vrf_and_more.py +0 -0
  58. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/0005_alter_bgpconnection_role.py +0 -0
  59. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/0006_lldpneighbor.py +0 -0
  60. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/0007_lldpneighbor_comments.py +0 -0
  61. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/0008_alter_lldpneighbor_device_a_and_more.py +0 -0
  62. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/0009_lldpneighbor_status_lldpneighborleaf_status.py +0 -0
  63. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/0010_alter_bgpconnection_raw_vrf_and_more.py +0 -0
  64. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/0011_lldpneighbor_last_seen_lldpneighbor_status_detail.py +0 -0
  65. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/0012_alter_lldpneighbor_last_seen.py +0 -0
  66. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/0013_bgpconnection_last_seen.py +0 -0
  67. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/0014_servicecoretrunk_servicecorelink_serviceip.py +0 -0
  68. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/0015_alter_service_status_to_circuit_choices.py +0 -0
  69. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/0016_serviceip_physical_device_and_more.py +0 -0
  70. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/0017_serviceip_vrf.py +0 -0
  71. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/0018_serviceip_encapsulation_vlan_fks.py +0 -0
  72. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/0019_serviceip_endpoints_bgp_sessions.py +0 -0
  73. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/migrations/__init__.py +0 -0
  74. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/models/bgpconnection.py +0 -0
  75. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/models/cesnet_service_base.py +0 -0
  76. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/models/lldpneighbor.py +0 -0
  77. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/models/lldpneighborleaf.py +0 -0
  78. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/models/service_core_link.py +0 -0
  79. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/models/service_ip.py +0 -0
  80. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/tables/bgpconnection.py +0 -0
  81. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/tables/bgpconnection_aggregation.py +0 -0
  82. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/tables/lldpneighbor.py +0 -0
  83. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/tables/lldpneighborleaf.py +0 -0
  84. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/tables/service_core_link.py +0 -0
  85. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/tables/service_core_trunk.py +0 -0
  86. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/tables/service_ip.py +0 -0
  87. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/bgpconnection/bgpconnection.html +0 -0
  88. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/bgpconnection/bgpconnection_aggregation_list.html +0 -0
  89. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/bgpconnection.html +0 -0
  90. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/details/connection_endpoints.html +0 -0
  91. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/details/detail_interface_inc.html +0 -0
  92. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/details/multiple_children.html +0 -0
  93. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/details/related_tables_tab.html +0 -0
  94. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/inc/related_cards.html +0 -0
  95. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/lldpneighbor/lldpneighbor.html +0 -0
  96. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/lldpneighbor.html +0 -0
  97. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/lldpneighborleaf/lldpneighborleaf.html +0 -0
  98. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/lldpneighborleaf/lldpneighborleaf_include.html +0 -0
  99. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/lldpneighborleaf.html +0 -0
  100. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/servicecorelink/servicecorelink.html +0 -0
  101. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/servicecorelink.html +0 -0
  102. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/servicecoretrunk/servicecoretrunk.html +0 -0
  103. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/servicecoretrunk.html +0 -0
  104. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/serviceip/serviceip.html +0 -0
  105. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/serviceip.html +0 -0
  106. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/serviceipbgpsession/serviceipbgpsession.html +0 -0
  107. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/serviceipbgpsession.html +0 -0
  108. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/serviceipendpoint/serviceipendpoint.html +0 -0
  109. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/serviceipendpoint.html +0 -0
  110. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/tests/__init__.py +0 -0
  111. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/tests/test_service_core_link.py +0 -0
  112. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/tests/test_service_core_trunk.py +0 -0
  113. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/tests/test_service_ip.py +0 -0
  114. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/views/bgpconnection.py +0 -0
  115. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/views/bgpconnection_aggregation.py +0 -0
  116. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/views/lldpneighbor.py +0 -0
  117. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/views/lldpneighborleaf.py +0 -0
  118. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/views/service_core_link.py +0 -0
  119. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/views/service_core_trunk.py +0 -0
  120. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin/views/service_ip.py +0 -0
  121. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin.egg-info/dependency_links.txt +0 -0
  122. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin.egg-info/entry_points.txt +0 -0
  123. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin.egg-info/requires.txt +0 -0
  124. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/netbox_cesnet_services_plugin.egg-info/top_level.txt +0 -0
  125. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/pyproject.toml +0 -0
  126. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/setup.cfg +0 -0
  127. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/tests/__init__.py +0 -0
  128. {netbox_cesnet_services_plugin-5.2.0 → netbox_cesnet_services_plugin-5.3.0}/tests/test_netbox_cesnet_services_plugin.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: netbox_cesnet_services_plugin
3
- Version: 5.2.0
3
+ Version: 5.3.0
4
4
  Summary: NetBox plugin for CESNET services.
5
5
  Author-email: Jan Krupa <jan.krupa@cesnet.cz>, Jiri Vrany <jiri.vrany@cesnet.cz>
6
6
  License: Apache-2.0
@@ -46,6 +46,7 @@ Enables CESNET services in NetBox:
46
46
  - **BGP connections** — tracks BGP peering sessions with last-seen monitoring and status badges
47
47
  - **LLDP Neighbors / LLDP Leafs** — stores discovered LLDP adjacencies and leaf relationships
48
48
  - **ServiceCoreTrunk** — core trunk between two nodes with linked path segments
49
+ - **ServiceNNI** — network-to-network interconnect: trunk from one CESNET node (port or LAG) to a partner network; the tenant (partner) is required. A port or LAG serves at most one Core Trunk / NNI side (`available-trunk-ports` API lists the free ones)
49
50
  - **ServiceCoreLink** — core link with topology, SAPs, L2 (QinQ encapsulation, LLDP, Flowspec), IS-IS/OSPF routing and IP addresses; belongs to one or more CoreTrunks
50
51
  - **ServiceIP** — IP service (Static or BGP) with VRF (null = Global), customer prefixes and BGP peer AS; its attachments are **ServiceIPEndpoints** (Static: exactly one, BGP: 1..N, mixed connection types)
51
52
  - **ServiceIPEndpoint** — one attachment of a ServiceIP: connection type (Direct / Indirect Local / Indirect L2), routed and physical device & interface, VLAN encapsulation (dot1q / QinQ S-VLAN & C-VLAN as `ipam.VLAN` links), IPv4/IPv6 P2P addresses, static next hops
@@ -55,6 +56,7 @@ Enables CESNET services in NetBox:
55
56
 
56
57
  | NetBox Version | Plugin Version | Notes |
57
58
  |-----------------|----------------|-------|
59
+ | 4.7.0 – 4.7.99 | 5.3.0 | ServiceNNI; trunk port rule (a port / LAG serves one Core Trunk or NNI side) with `available-trunk-ports` API |
58
60
  | 4.7.0 – 4.7.99 | 5.2.0 | Related services on Tenant, incl. child tenants via the `parent_tenant` custom field (`tenant_parent_custom_field`) |
59
61
  | 4.7.0 – 4.7.99 | 5.1.0 | Related services (CoreLink / CoreTrunk / ServiceIP) on Device, Interface, Site and ASN detail pages (`services_ext_page`) |
60
62
  | 4.7.0 – 4.7.99 | 5.0.0 | **Breaking**: ServiceIP split into ServiceIP / ServiceIPEndpoint / ServiceIPBGPSession; requires netbox-bgp >= 0.20.2 |
@@ -13,6 +13,7 @@ Enables CESNET services in NetBox:
13
13
  - **BGP connections** — tracks BGP peering sessions with last-seen monitoring and status badges
14
14
  - **LLDP Neighbors / LLDP Leafs** — stores discovered LLDP adjacencies and leaf relationships
15
15
  - **ServiceCoreTrunk** — core trunk between two nodes with linked path segments
16
+ - **ServiceNNI** — network-to-network interconnect: trunk from one CESNET node (port or LAG) to a partner network; the tenant (partner) is required. A port or LAG serves at most one Core Trunk / NNI side (`available-trunk-ports` API lists the free ones)
16
17
  - **ServiceCoreLink** — core link with topology, SAPs, L2 (QinQ encapsulation, LLDP, Flowspec), IS-IS/OSPF routing and IP addresses; belongs to one or more CoreTrunks
17
18
  - **ServiceIP** — IP service (Static or BGP) with VRF (null = Global), customer prefixes and BGP peer AS; its attachments are **ServiceIPEndpoints** (Static: exactly one, BGP: 1..N, mixed connection types)
18
19
  - **ServiceIPEndpoint** — one attachment of a ServiceIP: connection type (Direct / Indirect Local / Indirect L2), routed and physical device & interface, VLAN encapsulation (dot1q / QinQ S-VLAN & C-VLAN as `ipam.VLAN` links), IPv4/IPv6 P2P addresses, static next hops
@@ -22,6 +23,7 @@ Enables CESNET services in NetBox:
22
23
 
23
24
  | NetBox Version | Plugin Version | Notes |
24
25
  |-----------------|----------------|-------|
26
+ | 4.7.0 – 4.7.99 | 5.3.0 | ServiceNNI; trunk port rule (a port / LAG serves one Core Trunk or NNI side) with `available-trunk-ports` API |
25
27
  | 4.7.0 – 4.7.99 | 5.2.0 | Related services on Tenant, incl. child tenants via the `parent_tenant` custom field (`tenant_parent_custom_field`) |
26
28
  | 4.7.0 – 4.7.99 | 5.1.0 | Related services (CoreLink / CoreTrunk / ServiceIP) on Device, Interface, Site and ASN detail pages (`services_ext_page`) |
27
29
  | 4.7.0 – 4.7.99 | 5.0.0 | **Breaking**: ServiceIP split into ServiceIP / ServiceIPEndpoint / ServiceIPBGPSession; requires netbox-bgp >= 0.20.2 |
@@ -2,7 +2,7 @@
2
2
 
3
3
  __author__ = """Jan Krupa"""
4
4
  __email__ = "jan.krupa@cesnet.cz"
5
- __version__ = "5.2.0"
5
+ __version__ = "5.3.0"
6
6
 
7
7
 
8
8
  from netbox.plugins import PluginConfig
@@ -11,6 +11,7 @@ from netbox_cesnet_services_plugin.models import (
11
11
  LLDPNeighborLeaf,
12
12
  ServiceCoreTrunk,
13
13
  ServiceCoreLink,
14
+ ServiceNNI,
14
15
  ServiceIP,
15
16
  ServiceIPBGPSession,
16
17
  ServiceIPEndpoint,
@@ -151,6 +152,29 @@ class ServiceCoreLinkSerializer(NetBoxModelSerializer):
151
152
  )
152
153
 
153
154
 
155
+ class ServiceNNISerializer(NetBoxModelSerializer):
156
+ url = serializers.HyperlinkedIdentityField(
157
+ view_name="plugins-api:netbox_cesnet_services_plugin-api:servicenni-detail"
158
+ )
159
+ tenant = TenantSerializer(nested=True)
160
+ node_a = DeviceSerializer(nested=True, allow_null=True, required=False)
161
+ if_a = InterfaceSerializer(nested=True, allow_null=True, required=False)
162
+
163
+ class Meta:
164
+ model = ServiceNNI
165
+ fields = (
166
+ "id", "display", "url",
167
+ "name", "status", "active", "tenant",
168
+ "service_start", "service_end", "rt", "monitored",
169
+ "node_a", "if_a",
170
+ "linked_segments",
171
+ "tags", "comments", "custom_fields", "created", "last_updated",
172
+ )
173
+ brief_fields = (
174
+ "id", "url", "display", "name", "status", "tenant", "node_a",
175
+ )
176
+
177
+
154
178
  class ServiceIPBGPSessionSerializer(NetBoxModelSerializer):
155
179
  url = serializers.HyperlinkedIdentityField(
156
180
  view_name="plugins-api:netbox_cesnet_services_plugin-api:serviceipbgpsession-detail"
@@ -9,8 +9,10 @@ router.register("lldp-neighbors", views.LLDPNeighborViewSet)
9
9
  router.register("lldp-neighbor-leafs", views.LLDPNeighborLeafViewSet)
10
10
  router.register("service-core-trunks", views.ServiceCoreTrunkViewSet)
11
11
  router.register("service-core-links", views.ServiceCoreLinkViewSet)
12
+ router.register("service-nni", views.ServiceNNIViewSet)
12
13
  router.register("service-ip", views.ServiceIPViewSet)
13
14
  router.register("service-ip-endpoint", views.ServiceIPEndpointViewSet)
14
15
  router.register("service-ip-bgp-session", views.ServiceIPBGPSessionViewSet)
16
+ router.register("available-trunk-ports", views.AvailableTrunkPortViewSet, basename="available-trunk-port")
15
17
 
16
18
  urlpatterns = router.urls
@@ -1,13 +1,20 @@
1
+ from dcim.api.serializers import InterfaceSerializer
2
+ from dcim.api.views import InterfaceViewSet
3
+ from dcim.filtersets import InterfaceFilterSet
4
+ from django.apps import apps
1
5
  from netbox.api.metadata import ContentTypeMetadata
2
- from netbox.api.viewsets import NetBoxModelViewSet
6
+ from netbox.api.viewsets import NetBoxModelViewSet, NetBoxReadOnlyModelViewSet
7
+ from rest_framework.exceptions import ValidationError
3
8
 
4
9
  from netbox_cesnet_services_plugin import filtersets, models
10
+ from netbox_cesnet_services_plugin.models.trunk_ports import APP_LABEL, TRUNK_SIDES, available_trunk_ports
5
11
  from .serializers import (
6
12
  BGPConnectionSerializer,
7
13
  LLDPNeighborSerializer,
8
14
  LLDPNeighborLeafSerializer,
9
15
  ServiceCoreTrunkSerializer,
10
16
  ServiceCoreLinkSerializer,
17
+ ServiceNNISerializer,
11
18
  ServiceIPSerializer,
12
19
  ServiceIPEndpointSerializer,
13
20
  ServiceIPBGPSessionSerializer,
@@ -54,6 +61,41 @@ class ServiceCoreLinkViewSet(NetBoxModelViewSet):
54
61
  filterset_class = filtersets.ServiceCoreLinkFilterSet
55
62
 
56
63
 
64
+ class ServiceNNIViewSet(NetBoxModelViewSet):
65
+ metadata_class = ContentTypeMetadata
66
+ queryset = models.ServiceNNI.objects.select_related("tenant", "node_a", "if_a").prefetch_related(
67
+ "linked_segments"
68
+ )
69
+ serializer_class = ServiceNNISerializer
70
+ filterset_class = filtersets.ServiceNNIFilterSet
71
+
72
+
73
+ class AvailableTrunkPortViewSet(NetBoxReadOnlyModelViewSet):
74
+ """Interfaces that may terminate a trunk service side (Core Trunk, NNI); see models.trunk_ports.
75
+
76
+ Accepts every core interface filter (``device_id``, ``q``, ...) and returns core interface objects.
77
+ ``exclude_<model>_id`` (``exclude_servicecoretrunk_id``, ``exclude_servicenni_id``) keeps the ports of
78
+ that service on offer, for editing it.
79
+ """
80
+
81
+ queryset = InterfaceViewSet.queryset
82
+ serializer_class = InterfaceSerializer
83
+ filterset_class = InterfaceFilterSet
84
+
85
+ def get_queryset(self):
86
+ return available_trunk_ports(super().get_queryset(), exclude=self._excluded_service())
87
+
88
+ def _excluded_service(self):
89
+ for model_name in TRUNK_SIDES:
90
+ value = self.request.query_params.get(f"exclude_{model_name}_id")
91
+ if value is None:
92
+ continue
93
+ if not value.isdigit():
94
+ raise ValidationError({f"exclude_{model_name}_id": "Expected a service ID."})
95
+ return apps.get_model(APP_LABEL, model_name)(pk=int(value))
96
+ return None
97
+
98
+
57
99
  class ServiceIPViewSet(NetBoxModelViewSet):
58
100
  metadata_class = ContentTypeMetadata
59
101
  queryset = models.ServiceIP.objects.select_related(
@@ -4,6 +4,7 @@ from .lldpneighbor import LLDPNeighborFilterSet
4
4
  from .lldpneighborleaf import LLDPNeighborLeafFilterSet
5
5
  from .service_core_trunk import ServiceCoreTrunkFilterSet
6
6
  from .service_core_link import ServiceCoreLinkFilterSet
7
+ from .service_nni import ServiceNNIFilterSet
7
8
  from .service_ip import ServiceIPBGPSessionFilterSet, ServiceIPEndpointFilterSet, ServiceIPFilterSet
8
9
 
9
10
  __all__ = [
@@ -13,6 +14,7 @@ __all__ = [
13
14
  "LLDPNeighborLeafFilterSet",
14
15
  "ServiceCoreTrunkFilterSet",
15
16
  "ServiceCoreLinkFilterSet",
17
+ "ServiceNNIFilterSet",
16
18
  "ServiceIPFilterSet",
17
19
  "ServiceIPEndpointFilterSet",
18
20
  "ServiceIPBGPSessionFilterSet",
@@ -0,0 +1,73 @@
1
+ import django_filters
2
+ from dcim.models import Device, Interface, Site
3
+ from django.db.models import Q
4
+ from extras.filters import TagFilter
5
+ from netbox.filtersets import NetBoxModelFilterSet
6
+ from tenancy.models import Tenant
7
+ from utilities.filtersets import register_filterset
8
+
9
+ from circuits.choices import CircuitStatusChoices
10
+ from netbox_cesnet_services_plugin.filtersets.utils import tenant_tree_filter
11
+ from netbox_cesnet_services_plugin.models import ServiceNNI
12
+
13
+
14
+ @register_filterset
15
+ class ServiceNNIFilterSet(NetBoxModelFilterSet):
16
+ q = django_filters.CharFilter(method="search", label="Search")
17
+
18
+ status = django_filters.MultipleChoiceFilter(choices=CircuitStatusChoices)
19
+ active = django_filters.BooleanFilter()
20
+ monitored = django_filters.BooleanFilter()
21
+
22
+ tenant_id = django_filters.ModelMultipleChoiceFilter(
23
+ field_name="tenant__id",
24
+ queryset=Tenant.objects.all(),
25
+ to_field_name="id",
26
+ label="Tenant (ID)",
27
+ )
28
+ tenant = django_filters.ModelMultipleChoiceFilter(
29
+ field_name="tenant__slug",
30
+ queryset=Tenant.objects.all(),
31
+ to_field_name="slug",
32
+ label="Tenant (slug)",
33
+ )
34
+ tenant_tree_id = tenant_tree_filter()
35
+
36
+ node_a_id = django_filters.ModelMultipleChoiceFilter(
37
+ field_name="node_a__id",
38
+ queryset=Device.objects.all(),
39
+ to_field_name="id",
40
+ label="Node A (ID)",
41
+ )
42
+ if_a_id = django_filters.ModelMultipleChoiceFilter(
43
+ field_name="if_a__id",
44
+ queryset=Interface.objects.all(),
45
+ to_field_name="id",
46
+ label="Interface A (ID)",
47
+ )
48
+
49
+ # same parameter names as the other services (used by the related-services tables on core objects)
50
+ device_id = django_filters.ModelMultipleChoiceFilter(
51
+ field_name="node_a", queryset=Device.objects.all(), label="Device (ID)"
52
+ )
53
+ interface_id = django_filters.ModelMultipleChoiceFilter(
54
+ field_name="if_a", queryset=Interface.objects.all(), label="Interface (ID)"
55
+ )
56
+ site_id = django_filters.ModelMultipleChoiceFilter(
57
+ field_name="node_a__site", queryset=Site.objects.all(), label="Site (ID, via device)"
58
+ )
59
+
60
+ tag = TagFilter()
61
+
62
+ class Meta:
63
+ model = ServiceNNI
64
+ fields = ["name", "status", "active", "monitored", "tenant", "tag"]
65
+
66
+ def search(self, queryset, name, value):
67
+ return queryset.filter(
68
+ Q(name__icontains=value)
69
+ | Q(tenant__name__icontains=value)
70
+ | Q(node_a__name__icontains=value)
71
+ | Q(rt__icontains=value)
72
+ | Q(comments__icontains=value)
73
+ )
@@ -24,6 +24,11 @@ from .service_core_link import (
24
24
  ServiceCoreLinkFilterForm,
25
25
  ServiceCoreLinkBulkEditForm,
26
26
  )
27
+ from .service_nni import (
28
+ ServiceNNIForm,
29
+ ServiceNNIFilterForm,
30
+ ServiceNNIBulkEditForm,
31
+ )
27
32
  from .service_ip import (
28
33
  ServiceIPForm,
29
34
  ServiceIPFilterForm,
@@ -53,6 +58,9 @@ __all__ = [
53
58
  "ServiceCoreLinkForm",
54
59
  "ServiceCoreLinkFilterForm",
55
60
  "ServiceCoreLinkBulkEditForm",
61
+ "ServiceNNIForm",
62
+ "ServiceNNIFilterForm",
63
+ "ServiceNNIBulkEditForm",
56
64
  "ServiceIPForm",
57
65
  "ServiceIPFilterForm",
58
66
  "ServiceIPBulkEditForm",
@@ -1,4 +1,4 @@
1
- from dcim.models import Device, Interface
1
+ from dcim.models import Device
2
2
  from django import forms
3
3
  from django.apps import apps
4
4
  from netbox.forms import NetBoxModelBulkEditForm, NetBoxModelFilterSetForm, NetBoxModelForm
@@ -16,8 +16,12 @@ from utilities.forms.widgets import DateTimePicker
16
16
  from circuits.choices import CircuitStatusChoices
17
17
  from netbox_cesnet_services_plugin.models import ServiceCoreTrunk
18
18
 
19
+ from .trunk_ports import TrunkPortsFormMixin, trunk_port_field
20
+
21
+
22
+ class ServiceCoreTrunkForm(TrunkPortsFormMixin, NetBoxModelForm):
23
+ trunk_port_fields = ("if_a", "if_b")
19
24
 
20
- class ServiceCoreTrunkForm(NetBoxModelForm):
21
25
  tenant = DynamicModelChoiceField(
22
26
  queryset=Tenant.objects.all(),
23
27
  required=False,
@@ -35,20 +39,8 @@ class ServiceCoreTrunkForm(NetBoxModelForm):
35
39
  selector=True,
36
40
  label="Node B",
37
41
  )
38
- if_a = DynamicModelChoiceField(
39
- queryset=Interface.objects.all(),
40
- required=False,
41
- selector=True,
42
- label="Interface A",
43
- query_params={"device_id": "$node_a"},
44
- )
45
- if_b = DynamicModelChoiceField(
46
- queryset=Interface.objects.all(),
47
- required=False,
48
- selector=True,
49
- label="Interface B",
50
- query_params={"device_id": "$node_b"},
51
- )
42
+ if_a = trunk_port_field("Interface A", "node_a")
43
+ if_b = trunk_port_field("Interface B", "node_b")
52
44
  linked_segments = DynamicModelMultipleChoiceField(
53
45
  queryset=apps.get_model("cesnet_service_path_plugin", "Segment").objects.all(),
54
46
  required=False,
@@ -0,0 +1,100 @@
1
+ from dcim.models import Device
2
+ from django import forms
3
+ from django.apps import apps
4
+ from netbox.forms import NetBoxModelBulkEditForm, NetBoxModelFilterSetForm, NetBoxModelForm
5
+ from tenancy.models import Tenant
6
+ from utilities.forms import add_blank_choice
7
+ from utilities.forms.fields import (
8
+ CommentField,
9
+ DynamicModelChoiceField,
10
+ DynamicModelMultipleChoiceField,
11
+ TagFilterField,
12
+ )
13
+ from utilities.forms.rendering import FieldSet
14
+ from utilities.forms.widgets import DateTimePicker
15
+
16
+ from circuits.choices import CircuitStatusChoices
17
+ from netbox_cesnet_services_plugin.models import ServiceNNI
18
+
19
+ from .trunk_ports import TrunkPortsFormMixin, trunk_port_field
20
+
21
+ YES_NO = (("", "---------"), (True, "Yes"), (False, "No"))
22
+
23
+
24
+ class ServiceNNIForm(TrunkPortsFormMixin, NetBoxModelForm):
25
+ trunk_port_fields = ("if_a",)
26
+
27
+ tenant = DynamicModelChoiceField(
28
+ queryset=Tenant.objects.all(),
29
+ required=True,
30
+ selector=True,
31
+ help_text="Partner the NNI connects to",
32
+ )
33
+ node_a = DynamicModelChoiceField(
34
+ queryset=Device.objects.all(),
35
+ required=False,
36
+ selector=True,
37
+ label="Node A",
38
+ )
39
+ if_a = trunk_port_field("Interface A", "node_a")
40
+ linked_segments = DynamicModelMultipleChoiceField(
41
+ queryset=apps.get_model("cesnet_service_path_plugin", "Segment").objects.all(),
42
+ required=False,
43
+ label="Linked Segments",
44
+ )
45
+ service_start = forms.DateTimeField(required=False, widget=DateTimePicker())
46
+ service_end = forms.DateTimeField(required=False, widget=DateTimePicker())
47
+ comments = CommentField(required=False)
48
+
49
+ fieldsets = (
50
+ FieldSet("name", "status", "active", "tenant", "monitored", name="Service"),
51
+ FieldSet("service_start", "service_end", "rt", name="Lifecycle"),
52
+ FieldSet("node_a", "if_a", "linked_segments", name="Topology"),
53
+ FieldSet("tags", "comments", name="Misc"),
54
+ )
55
+
56
+ class Meta:
57
+ model = ServiceNNI
58
+ fields = (
59
+ "name", "status", "active", "tenant", "monitored",
60
+ "service_start", "service_end", "rt",
61
+ "node_a", "if_a", "linked_segments",
62
+ "tags", "comments",
63
+ )
64
+
65
+
66
+ class ServiceNNIFilterForm(NetBoxModelFilterSetForm):
67
+ model = ServiceNNI
68
+
69
+ status = forms.MultipleChoiceField(choices=CircuitStatusChoices, required=False)
70
+ active = forms.NullBooleanField(required=False, widget=forms.Select(choices=YES_NO))
71
+ monitored = forms.NullBooleanField(required=False, widget=forms.Select(choices=YES_NO))
72
+ tenant_id = DynamicModelMultipleChoiceField(queryset=Tenant.objects.all(), required=False, label="Tenant")
73
+ node_a_id = DynamicModelMultipleChoiceField(queryset=Device.objects.all(), required=False, label="Node A")
74
+ tag = TagFilterField(model)
75
+
76
+ fieldsets = (
77
+ FieldSet("filter_id", "q"),
78
+ FieldSet("status", "active", "monitored", "tenant_id", name="Service"),
79
+ FieldSet("node_a_id", name="Topology"),
80
+ FieldSet("tag", name="Misc"),
81
+ )
82
+
83
+
84
+ class ServiceNNIBulkEditForm(NetBoxModelBulkEditForm):
85
+ model = ServiceNNI
86
+
87
+ status = forms.ChoiceField(choices=add_blank_choice(CircuitStatusChoices), required=False)
88
+ active = forms.NullBooleanField(required=False, widget=forms.Select(choices=YES_NO))
89
+ tenant = DynamicModelChoiceField(queryset=Tenant.objects.all(), required=False)
90
+ monitored = forms.NullBooleanField(required=False, widget=forms.Select(choices=YES_NO))
91
+ service_start = forms.DateTimeField(required=False, widget=DateTimePicker())
92
+ service_end = forms.DateTimeField(required=False, widget=DateTimePicker())
93
+ rt = forms.CharField(required=False, label="RT Tickets")
94
+
95
+ fieldsets = (
96
+ FieldSet("status", "active", "tenant", "monitored", name="Service"),
97
+ FieldSet("service_start", "service_end", "rt", name="Lifecycle"),
98
+ )
99
+ # tenant is required, so it cannot be cleared in bulk
100
+ nullable_fields = ("service_start", "service_end", "rt")
@@ -0,0 +1,40 @@
1
+ import json
2
+
3
+ from dcim.models import Interface
4
+ from django.urls import reverse
5
+ from utilities.forms.fields import DynamicModelChoiceField
6
+
7
+ AVAILABLE_TRUNK_PORTS_API = "plugins-api:netbox_cesnet_services_plugin-api:available-trunk-port-list"
8
+
9
+
10
+ def trunk_port_field(label, node_field):
11
+ """An interface selector offering only the ports a trunk side may use (see models.trunk_ports)."""
12
+ return DynamicModelChoiceField(
13
+ queryset=Interface.objects.all(),
14
+ required=False,
15
+ label=label,
16
+ query_params={"device_id": f"${node_field}"},
17
+ )
18
+
19
+
20
+ class TrunkPortsFormMixin:
21
+ """Points the trunk port selectors at the available-trunk-ports API endpoint.
22
+
23
+ The edited service is passed as ``exclude_<model>_id`` so that its own ports stay on offer.
24
+ """
25
+
26
+ trunk_port_fields = ()
27
+
28
+ def __init__(self, *args, **kwargs):
29
+ super().__init__(*args, **kwargs)
30
+ url = reverse(AVAILABLE_TRUNK_PORTS_API)
31
+ for name in self.trunk_port_fields:
32
+ widget = self.fields[name].widget
33
+ widget.attrs["data-url"] = url
34
+ if self.instance.pk:
35
+ # written directly: APISelect.add_query_param() would re-serialize the dynamic params too
36
+ static = json.loads(widget.attrs.get("data-static-params", "[]"))
37
+ static.append(
38
+ {"queryParam": f"exclude_{self.instance._meta.model_name}_id", "queryValue": [self.instance.pk]}
39
+ )
40
+ widget.attrs["data-static-params"] = json.dumps(static, separators=(",", ":"))
@@ -8,6 +8,7 @@ from netbox_cesnet_services_plugin.models import (
8
8
  LLDPNeighborLeaf,
9
9
  ServiceCoreTrunk,
10
10
  ServiceCoreLink,
11
+ ServiceNNI,
11
12
  ServiceIP,
12
13
  ServiceIPBGPSession,
13
14
  ServiceIPEndpoint,
@@ -41,6 +42,16 @@ class ServiceCoreTrunkFilter(NetBoxModelFilter):
41
42
  service_end: DatetimeFilterLookup | None = strawberry_django.filter_field()
42
43
 
43
44
 
45
+ @strawberry_django.filter_type(ServiceNNI, lookups=True)
46
+ class ServiceNNIFilter(NetBoxModelFilter):
47
+ name: StrFilterLookup[str] | None = strawberry_django.filter_field()
48
+ status: StrFilterLookup[str] | None = strawberry_django.filter_field()
49
+ active: FilterLookup[bool] | None = strawberry_django.filter_field()
50
+ monitored: FilterLookup[bool] | None = strawberry_django.filter_field()
51
+ service_start: DatetimeFilterLookup | None = strawberry_django.filter_field()
52
+ service_end: DatetimeFilterLookup | None = strawberry_django.filter_field()
53
+
54
+
44
55
  @strawberry_django.filter_type(ServiceCoreLink, lookups=True)
45
56
  class ServiceCoreLinkFilter(NetBoxModelFilter):
46
57
  name: StrFilterLookup[str] | None = strawberry_django.filter_field()
@@ -9,6 +9,7 @@ from .types import (
9
9
  BGPConnectionType,
10
10
  ServiceCoreTrunkType,
11
11
  ServiceCoreLinkType,
12
+ ServiceNNIType,
12
13
  ServiceIPType,
13
14
  ServiceIPEndpointType,
14
15
  ServiceIPBGPSessionType,
@@ -32,6 +33,9 @@ class CESNETServicesQuery:
32
33
  service_core_link: ServiceCoreLinkType = strawberry_django.field()
33
34
  service_core_link_list: List[ServiceCoreLinkType] = strawberry_django.field()
34
35
 
36
+ service_nni: ServiceNNIType = strawberry_django.field()
37
+ service_nni_list: List[ServiceNNIType] = strawberry_django.field()
38
+
35
39
  service_ip: ServiceIPType = strawberry_django.field()
36
40
  service_ip_list: List[ServiceIPType] = strawberry_django.field()
37
41
 
@@ -11,6 +11,7 @@ from netbox_cesnet_services_plugin.models import (
11
11
  BGPConnection,
12
12
  ServiceCoreTrunk,
13
13
  ServiceCoreLink,
14
+ ServiceNNI,
14
15
  ServiceIP,
15
16
  ServiceIPBGPSession,
16
17
  ServiceIPEndpoint,
@@ -21,6 +22,7 @@ from .filters import (
21
22
  LLDPNeighborLeafFilter,
22
23
  BGPConnectionFilter,
23
24
  ServiceCoreTrunkFilter,
25
+ ServiceNNIFilter,
24
26
  ServiceCoreLinkFilter,
25
27
  ServiceIPFilter,
26
28
  ServiceIPEndpointFilter,
@@ -32,6 +34,7 @@ __all__ = (
32
34
  "LLDPNeighborLeafType",
33
35
  "BGPConnectionType",
34
36
  "ServiceCoreTrunkType",
37
+ "ServiceNNIType",
35
38
  "ServiceCoreLinkType",
36
39
  "ServiceIPType",
37
40
  "ServiceIPEndpointType",
@@ -103,6 +106,22 @@ class ServiceCoreTrunkType(NetBoxObjectType):
103
106
  comments: strawberry.auto
104
107
 
105
108
 
109
+ @strawberry_django.type(ServiceNNI, filters=ServiceNNIFilter, pagination=True)
110
+ class ServiceNNIType(NetBoxObjectType):
111
+ name: strawberry.auto
112
+ status: strawberry.auto
113
+ active: strawberry.auto
114
+ monitored: strawberry.auto
115
+ service_start: strawberry.auto
116
+ service_end: strawberry.auto
117
+ rt: strawberry.auto
118
+ tenant: Annotated["TenantType", strawberry.lazy("tenancy.graphql.types")]
119
+ node_a: Annotated["DeviceType", strawberry.lazy("dcim.graphql.types")] | None
120
+ if_a: Annotated["InterfaceType", strawberry.lazy("dcim.graphql.types")] | None
121
+ linked_segments: List[Annotated["SegmentType", strawberry.lazy("cesnet_service_path_plugin.graphql.types")]]
122
+ comments: strawberry.auto
123
+
124
+
106
125
  @strawberry_django.type(ServiceCoreLink, filters=ServiceCoreLinkFilter, pagination=True)
107
126
  class ServiceCoreLinkType(NetBoxObjectType):
108
127
  name: strawberry.auto
@@ -0,0 +1,81 @@
1
+ # Generated by Django 6.1.1 on 2026-11-13 07:31
2
+
3
+ import django.db.models.deletion
4
+ import netbox.models.deletion
5
+ import taggit.managers
6
+ import utilities.json
7
+ from django.db import migrations, models
8
+
9
+
10
+ class Migration(migrations.Migration):
11
+
12
+ dependencies = [
13
+ ('cesnet_service_path_plugin', '0038_alter_opticalspectrumsegmentdata_spectral_slot_width'),
14
+ ('dcim', '0251_fix_ltree_cascade_triggers'),
15
+ ('extras', '0144_customfield_status'),
16
+ ('netbox_cesnet_services_plugin', '0019_serviceip_endpoints_bgp_sessions'),
17
+ ('tenancy', '0027_fix_ltree_cascade_triggers'),
18
+ ]
19
+
20
+ operations = [
21
+ migrations.CreateModel(
22
+ name='ServiceNNI',
23
+ fields=[
24
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
25
+ ('created', models.DateTimeField(auto_now_add=True, null=True)),
26
+ ('last_updated', models.DateTimeField(auto_now=True, null=True)),
27
+ ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
28
+ ('name', models.CharField(max_length=255)),
29
+ ('active', models.BooleanField(default=True)),
30
+ ('status', models.CharField(default='planned', max_length=50)),
31
+ ('service_start', models.DateTimeField(blank=True, null=True)),
32
+ ('service_end', models.DateTimeField(blank=True, null=True)),
33
+ ('rt', models.CharField(blank=True, max_length=500)),
34
+ ('monitored', models.BooleanField(default=False)),
35
+ ('comments', models.TextField(blank=True)),
36
+ ],
37
+ options={
38
+ 'verbose_name': 'Service NNI',
39
+ 'verbose_name_plural': 'Services NNI',
40
+ 'ordering': ('name',),
41
+ },
42
+ bases=(netbox.models.deletion.DeleteMixin, models.Model),
43
+ ),
44
+ migrations.AddConstraint(
45
+ model_name='servicecoretrunk',
46
+ constraint=models.UniqueConstraint(fields=('if_a',), name='netbox_cesnet_services_plugin_servicecoretrunk_unique_if_a', violation_error_message='This interface is already side A of another Core Trunk.'),
47
+ ),
48
+ migrations.AddConstraint(
49
+ model_name='servicecoretrunk',
50
+ constraint=models.UniqueConstraint(fields=('if_b',), name='netbox_cesnet_services_plugin_servicecoretrunk_unique_if_b', violation_error_message='This interface is already side B of another Core Trunk.'),
51
+ ),
52
+ migrations.AddField(
53
+ model_name='servicenni',
54
+ name='if_a',
55
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='nni_if_a', to='dcim.interface'),
56
+ ),
57
+ migrations.AddField(
58
+ model_name='servicenni',
59
+ name='linked_segments',
60
+ field=models.ManyToManyField(blank=True, related_name='nnis', to='cesnet_service_path_plugin.segment'),
61
+ ),
62
+ migrations.AddField(
63
+ model_name='servicenni',
64
+ name='node_a',
65
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='nni_node_a', to='dcim.device'),
66
+ ),
67
+ migrations.AddField(
68
+ model_name='servicenni',
69
+ name='tags',
70
+ field=taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag'),
71
+ ),
72
+ migrations.AddField(
73
+ model_name='servicenni',
74
+ name='tenant',
75
+ field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='service_nnis', to='tenancy.tenant'),
76
+ ),
77
+ migrations.AddConstraint(
78
+ model_name='servicenni',
79
+ constraint=models.UniqueConstraint(fields=('if_a',), name='netbox_cesnet_services_plugin_servicenni_unique_if_a', violation_error_message='This interface is already used by another NNI.'),
80
+ ),
81
+ ]
@@ -3,4 +3,5 @@ from .lldpneighbor import *
3
3
  from .lldpneighborleaf import *
4
4
  from .service_core_trunk import ServiceCoreTrunk
5
5
  from .service_core_link import ServiceCoreLink
6
+ from .service_nni import ServiceNNI
6
7
  from .service_ip import ServiceIP, ServiceIPBGPSession, ServiceIPEndpoint