netbox-cesnet-services-plugin 3.0.0__tar.gz → 3.0.2__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.
- {netbox_cesnet_services_plugin-3.0.0/netbox_cesnet_services_plugin.egg-info → netbox_cesnet_services_plugin-3.0.2}/PKG-INFO +30 -17
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/README.md +28 -16
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/__init__.py +1 -1
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/api/serializers.py +229 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/api/urls.py +3 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/api/views.py +64 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/choices.py +24 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/filtersets/__init__.py +6 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/filtersets/service_core_link.py +94 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/filtersets/service_core_trunk.py +70 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/filtersets/service_ip.py +89 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/forms/__init__.py +24 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/forms/service_core_link.py +202 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/forms/service_core_trunk.py +132 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/forms/service_ip.py +260 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/graphql/filters.py +68 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/graphql/schema.py +34 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/graphql/types.py +167 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/migrations/0014_servicecoretrunk_servicecorelink_serviceip.py +135 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/migrations/0015_alter_service_status_to_circuit_choices.py +59 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/migrations/0016_serviceip_physical_device_and_more.py +30 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/models/__init__.py +6 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/models/cesnet_service_base.py +59 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/models/service_core_link.py +170 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/models/service_core_trunk.py +61 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/models/service_ip.py +154 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/navigation.py +20 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/tables/__init__.py +6 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/tables/service_core_link.py +39 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/tables/service_core_trunk.py +30 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/tables/service_ip.py +35 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/servicecorelink/servicecorelink.html +205 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/servicecorelink.html +2 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/servicecoretrunk/servicecoretrunk.html +97 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/servicecoretrunk.html +2 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/serviceip/serviceip.html +164 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/serviceip.html +2 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/tests/__init__.py +0 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/tests/test_service_core_link.py +294 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/tests/test_service_core_trunk.py +268 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/tests/test_service_ip.py +395 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/urls.py +54 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/views/__init__.py +71 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/views/service_core_link.py +49 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/views/service_core_trunk.py +46 -0
- netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/views/service_ip.py +52 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin.egg-info}/PKG-INFO +30 -17
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin.egg-info/SOURCES.txt +29 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin.egg-info/requires.txt +1 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/pyproject.toml +1 -0
- netbox_cesnet_services_plugin-3.0.0/netbox_cesnet_services_plugin/api/serializers.py +0 -129
- netbox_cesnet_services_plugin-3.0.0/netbox_cesnet_services_plugin/api/views.py +0 -30
- netbox_cesnet_services_plugin-3.0.0/netbox_cesnet_services_plugin/graphql/filters.py +0 -28
- netbox_cesnet_services_plugin-3.0.0/netbox_cesnet_services_plugin/graphql/schema.py +0 -18
- netbox_cesnet_services_plugin-3.0.0/netbox_cesnet_services_plugin/graphql/types.py +0 -72
- netbox_cesnet_services_plugin-3.0.0/netbox_cesnet_services_plugin/models/__init__.py +0 -3
- netbox_cesnet_services_plugin-3.0.0/netbox_cesnet_services_plugin/views/__init__.py +0 -29
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/CONTRIBUTING.md +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/LICENSE +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/MANIFEST.in +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/api/__init__.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/filtersets/bgpconnection.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/filtersets/bgpconnection_aggregation.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/filtersets/lldpneighbor.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/filtersets/lldpneighborleaf.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/forms/bgpconnection.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/forms/bgpconnection_aggregation.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/forms/lldpneighbor.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/forms/lldpneighborleaf.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/graphql/__init__.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/migrations/0001_initial.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/migrations/0002_bgpconnection_comments.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/migrations/0003_alter_bgpconnection_options_bgpconnection_device.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/migrations/0004_alter_bgpconnection_options_bgpconnection_raw_vrf_and_more.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/migrations/0005_alter_bgpconnection_role.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/migrations/0006_lldpneighbor.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/migrations/0007_lldpneighbor_comments.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/migrations/0008_alter_lldpneighbor_device_a_and_more.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/migrations/0009_lldpneighbor_status_lldpneighborleaf_status.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/migrations/0010_alter_bgpconnection_raw_vrf_and_more.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/migrations/0011_lldpneighbor_last_seen_lldpneighbor_status_detail.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/migrations/0012_alter_lldpneighbor_last_seen.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/migrations/0013_bgpconnection_last_seen.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/migrations/__init__.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/models/bgpconnection.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/models/lldpneighbor.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/models/lldpneighborleaf.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/tables/bgpconnection.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/tables/bgpconnection_aggregation.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/tables/lldpneighbor.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/tables/lldpneighborleaf.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/template_content.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/bgpconnection/bgpconnection.html +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/bgpconnection/bgpconnection_aggregation_list.html +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/bgpconnection/bgpconnection_include.html +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/bgpconnection.html +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/details/connection_endpoints.html +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/details/detail_interface_inc.html +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/details/multiple_children.html +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/lldpneighbor/lldpneighbor.html +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/lldpneighbor/lldpneighbor_include.html +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/lldpneighbor.html +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/lldpneighborleaf/lldpneighborleaf.html +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/lldpneighborleaf/lldpneighborleaf_include.html +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/templates/netbox_cesnet_services_plugin/lldpneighborleaf.html +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/views/bgpconnection.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/views/bgpconnection_aggregation.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/views/lldpneighbor.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin/views/lldpneighborleaf.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin.egg-info/dependency_links.txt +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/netbox_cesnet_services_plugin.egg-info/top_level.txt +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/setup.cfg +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/tests/__init__.py +0 -0
- {netbox_cesnet_services_plugin-3.0.0 → netbox_cesnet_services_plugin-3.0.2}/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: 3.0.
|
|
3
|
+
Version: 3.0.2
|
|
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
|
|
@@ -23,6 +23,7 @@ Requires-Dist: python-slugify
|
|
|
23
23
|
Requires-Dist: deepdiff
|
|
24
24
|
Requires-Dist: netutils
|
|
25
25
|
Requires-Dist: netbox-scripts-lib
|
|
26
|
+
Requires-Dist: cesnet-service-path-plugin
|
|
26
27
|
Provides-Extra: dev
|
|
27
28
|
Requires-Dist: ruff; extra == "dev"
|
|
28
29
|
Requires-Dist: djlint; extra == "dev"
|
|
@@ -39,21 +40,28 @@ NetBox plugin for CESNET services.
|
|
|
39
40
|
|
|
40
41
|
## Features
|
|
41
42
|
|
|
42
|
-
Enables CESNET services in
|
|
43
|
+
Enables CESNET services in NetBox:
|
|
44
|
+
|
|
45
|
+
- **BGP connections** — tracks BGP peering sessions with last-seen monitoring and status badges
|
|
46
|
+
- **LLDP Neighbors / LLDP Leafs** — stores discovered LLDP adjacencies and leaf relationships
|
|
47
|
+
- **ServiceCoreTrunk** — core trunk between two nodes with linked path segments
|
|
48
|
+
- **ServiceCoreLink** — core link with topology, SAPs, L2 (QinQ encapsulation, LLDP, Flowspec), IS-IS/OSPF routing and IP addresses; belongs to one or more CoreTrunks
|
|
49
|
+
- **ServiceIP** — IP service with SAP attachment, encapsulation, IPv4/IPv6 addresses, and routing (static or BGP)
|
|
43
50
|
|
|
44
51
|
## Compatibility
|
|
45
52
|
|
|
46
|
-
| NetBox Version
|
|
47
|
-
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
| 4.5.4+
|
|
51
|
-
|
|
|
52
|
-
|
|
|
53
|
-
| 4.4.
|
|
54
|
-
| 4.
|
|
55
|
-
| 4.3.1
|
|
56
|
-
| 4.
|
|
53
|
+
| NetBox Version | Plugin Version | Notes |
|
|
54
|
+
|-----------------|----------------|-------|
|
|
55
|
+
| 4.5.4 – 4.6.99 | 3.0.1 | ServiceCoreTrunk, ServiceCoreLink, ServiceIP models + full API/UI/tests |
|
|
56
|
+
| 4.5.4 – 4.6.99 | 3.0.0 | NetBox 4.6 support (Django 6.0) |
|
|
57
|
+
| 4.5.4+ | 2.1.0 | `last_seen` field, bulk ops, status badges |
|
|
58
|
+
| 4.5.4+ | 2.0.1 | GraphQL fix: `StrFilterLookup` replaces `FilterLookup[str]`; requires NetBox 4.5.4 |
|
|
59
|
+
| 4.5.0–4.5.3 | 2.0.0 | **Breaking change**: Filter system updated, NOT compatible with 4.4.x |
|
|
60
|
+
| 4.4.x | 1.2.8 | Last version compatible with NetBox 4.4.x |
|
|
61
|
+
| 4.4.0 | 1.2.5 | |
|
|
62
|
+
| 4.3.1 | 1.2.4 | |
|
|
63
|
+
| 4.3.1 | 1.2.3 | |
|
|
64
|
+
| 4.2.8 | 1.2.2 | |
|
|
57
65
|
|
|
58
66
|
## Installing
|
|
59
67
|
|
|
@@ -62,8 +70,9 @@ For adding to a NetBox Docker setup see
|
|
|
62
70
|
|
|
63
71
|
### Prerequisites
|
|
64
72
|
|
|
65
|
-
- **
|
|
66
|
-
|
|
73
|
+
- **[cesnet-service-path-plugin](https://gitlab.cesnet.cz/701/netbox/cesnet_service_path_plugin)** — required from version 3.0.1 onwards. The `ServiceCoreTrunk` and `ServiceCoreLink` models reference `Segment` objects from this plugin. Both plugins must be installed and listed in `PLUGINS`.
|
|
74
|
+
- **NetBox 4.5.4 – 4.6.99** (for plugin version 3.0.x)
|
|
75
|
+
- **Important**: Plugin version 3.0.x requires NetBox 4.5.4 due to `StrFilterLookup` (ships with strawberry-graphql-django >= 0.79.0). Starting the plugin on NetBox 4.5.0–4.5.3 will raise an `ImportError`.
|
|
67
76
|
- For NetBox 4.5.0–4.5.3, use plugin version 2.0.0
|
|
68
77
|
- For NetBox 4.4.x, use plugin version 1.2.8 or earlier
|
|
69
78
|
|
|
@@ -79,7 +88,10 @@ or by adding to your `local_requirements.txt` or `plugin_requirements.txt` (netb
|
|
|
79
88
|
|
|
80
89
|
```bash
|
|
81
90
|
# For NetBox 4.5.4 – 4.6.99
|
|
82
|
-
netbox-cesnet-services-plugin==3.0.
|
|
91
|
+
netbox-cesnet-services-plugin==3.0.1
|
|
92
|
+
|
|
93
|
+
# For NetBox 4.5.4 – 4.6.99 (without new service models)
|
|
94
|
+
# netbox-cesnet-services-plugin==3.0.0
|
|
83
95
|
|
|
84
96
|
# For NetBox 4.5.4 only
|
|
85
97
|
# netbox-cesnet-services-plugin==2.1.0
|
|
@@ -100,7 +112,8 @@ You can optionally set device platforms for filtering choices in LLDPNeighbor fo
|
|
|
100
112
|
|
|
101
113
|
```python
|
|
102
114
|
PLUGINS = [
|
|
103
|
-
'netbox_cesnet_services_plugin
|
|
115
|
+
'cesnet_service_path_plugin', # required by netbox_cesnet_services_plugin >= 3.0.1
|
|
116
|
+
'netbox_cesnet_services_plugin',
|
|
104
117
|
]
|
|
105
118
|
|
|
106
119
|
PLUGINS_CONFIG = {
|
|
@@ -8,21 +8,28 @@ NetBox plugin for CESNET services.
|
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
11
|
-
Enables CESNET services in
|
|
11
|
+
Enables CESNET services in NetBox:
|
|
12
|
+
|
|
13
|
+
- **BGP connections** — tracks BGP peering sessions with last-seen monitoring and status badges
|
|
14
|
+
- **LLDP Neighbors / LLDP Leafs** — stores discovered LLDP adjacencies and leaf relationships
|
|
15
|
+
- **ServiceCoreTrunk** — core trunk between two nodes with linked path segments
|
|
16
|
+
- **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
|
+
- **ServiceIP** — IP service with SAP attachment, encapsulation, IPv4/IPv6 addresses, and routing (static or BGP)
|
|
12
18
|
|
|
13
19
|
## Compatibility
|
|
14
20
|
|
|
15
|
-
| NetBox Version
|
|
16
|
-
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
| 4.5.4+
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
| 4.4.
|
|
23
|
-
| 4.
|
|
24
|
-
| 4.3.1
|
|
25
|
-
| 4.
|
|
21
|
+
| NetBox Version | Plugin Version | Notes |
|
|
22
|
+
|-----------------|----------------|-------|
|
|
23
|
+
| 4.5.4 – 4.6.99 | 3.0.1 | ServiceCoreTrunk, ServiceCoreLink, ServiceIP models + full API/UI/tests |
|
|
24
|
+
| 4.5.4 – 4.6.99 | 3.0.0 | NetBox 4.6 support (Django 6.0) |
|
|
25
|
+
| 4.5.4+ | 2.1.0 | `last_seen` field, bulk ops, status badges |
|
|
26
|
+
| 4.5.4+ | 2.0.1 | GraphQL fix: `StrFilterLookup` replaces `FilterLookup[str]`; requires NetBox 4.5.4 |
|
|
27
|
+
| 4.5.0–4.5.3 | 2.0.0 | **Breaking change**: Filter system updated, NOT compatible with 4.4.x |
|
|
28
|
+
| 4.4.x | 1.2.8 | Last version compatible with NetBox 4.4.x |
|
|
29
|
+
| 4.4.0 | 1.2.5 | |
|
|
30
|
+
| 4.3.1 | 1.2.4 | |
|
|
31
|
+
| 4.3.1 | 1.2.3 | |
|
|
32
|
+
| 4.2.8 | 1.2.2 | |
|
|
26
33
|
|
|
27
34
|
## Installing
|
|
28
35
|
|
|
@@ -31,8 +38,9 @@ For adding to a NetBox Docker setup see
|
|
|
31
38
|
|
|
32
39
|
### Prerequisites
|
|
33
40
|
|
|
34
|
-
- **
|
|
35
|
-
|
|
41
|
+
- **[cesnet-service-path-plugin](https://gitlab.cesnet.cz/701/netbox/cesnet_service_path_plugin)** — required from version 3.0.1 onwards. The `ServiceCoreTrunk` and `ServiceCoreLink` models reference `Segment` objects from this plugin. Both plugins must be installed and listed in `PLUGINS`.
|
|
42
|
+
- **NetBox 4.5.4 – 4.6.99** (for plugin version 3.0.x)
|
|
43
|
+
- **Important**: Plugin version 3.0.x requires NetBox 4.5.4 due to `StrFilterLookup` (ships with strawberry-graphql-django >= 0.79.0). Starting the plugin on NetBox 4.5.0–4.5.3 will raise an `ImportError`.
|
|
36
44
|
- For NetBox 4.5.0–4.5.3, use plugin version 2.0.0
|
|
37
45
|
- For NetBox 4.4.x, use plugin version 1.2.8 or earlier
|
|
38
46
|
|
|
@@ -48,7 +56,10 @@ or by adding to your `local_requirements.txt` or `plugin_requirements.txt` (netb
|
|
|
48
56
|
|
|
49
57
|
```bash
|
|
50
58
|
# For NetBox 4.5.4 – 4.6.99
|
|
51
|
-
netbox-cesnet-services-plugin==3.0.
|
|
59
|
+
netbox-cesnet-services-plugin==3.0.1
|
|
60
|
+
|
|
61
|
+
# For NetBox 4.5.4 – 4.6.99 (without new service models)
|
|
62
|
+
# netbox-cesnet-services-plugin==3.0.0
|
|
52
63
|
|
|
53
64
|
# For NetBox 4.5.4 only
|
|
54
65
|
# netbox-cesnet-services-plugin==2.1.0
|
|
@@ -69,7 +80,8 @@ You can optionally set device platforms for filtering choices in LLDPNeighbor fo
|
|
|
69
80
|
|
|
70
81
|
```python
|
|
71
82
|
PLUGINS = [
|
|
72
|
-
'netbox_cesnet_services_plugin
|
|
83
|
+
'cesnet_service_path_plugin', # required by netbox_cesnet_services_plugin >= 3.0.1
|
|
84
|
+
'netbox_cesnet_services_plugin',
|
|
73
85
|
]
|
|
74
86
|
|
|
75
87
|
PLUGINS_CONFIG = {
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
from dcim.api.serializers import DeviceSerializer, InterfaceSerializer
|
|
2
|
+
from ipam.api.serializers import ASNSerializer, IPAddressSerializer, PrefixSerializer, VRFSerializer
|
|
3
|
+
from netbox.api.serializers import NetBoxModelSerializer
|
|
4
|
+
from rest_framework import serializers
|
|
5
|
+
from tenancy.api.serializers import TenantSerializer
|
|
6
|
+
|
|
7
|
+
from netbox_cesnet_services_plugin.models import (
|
|
8
|
+
BGPConnection,
|
|
9
|
+
LLDPNeighbor,
|
|
10
|
+
LLDPNeighborLeaf,
|
|
11
|
+
ServiceCoreTrunk,
|
|
12
|
+
ServiceCoreLink,
|
|
13
|
+
ServiceIP,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class LLDPNeighborLeafSerializer(NetBoxModelSerializer):
|
|
18
|
+
url = serializers.HyperlinkedIdentityField(
|
|
19
|
+
view_name="plugins-api:netbox_cesnet_services_plugin-api:lldpneighborleaf-detail"
|
|
20
|
+
)
|
|
21
|
+
device_nb = DeviceSerializer(nested=True)
|
|
22
|
+
interface_nb = InterfaceSerializer(nested=True)
|
|
23
|
+
|
|
24
|
+
class Meta:
|
|
25
|
+
model = LLDPNeighborLeaf
|
|
26
|
+
fields = (
|
|
27
|
+
"id",
|
|
28
|
+
"url",
|
|
29
|
+
"device_nb",
|
|
30
|
+
"interface_nb",
|
|
31
|
+
"device_ext",
|
|
32
|
+
"interface_ext",
|
|
33
|
+
"status",
|
|
34
|
+
"comments",
|
|
35
|
+
"tags",
|
|
36
|
+
"imported_data",
|
|
37
|
+
"custom_fields",
|
|
38
|
+
"created",
|
|
39
|
+
"last_updated",
|
|
40
|
+
)
|
|
41
|
+
brief_fields = (
|
|
42
|
+
"id",
|
|
43
|
+
"device_nb",
|
|
44
|
+
"interface_nb",
|
|
45
|
+
"device_ext",
|
|
46
|
+
"interface_ext",
|
|
47
|
+
"status",
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class LLDPNeighborSerializer(NetBoxModelSerializer):
|
|
52
|
+
url = serializers.HyperlinkedIdentityField(
|
|
53
|
+
view_name="plugins-api:netbox_cesnet_services_plugin-api:lldpneighbor-detail"
|
|
54
|
+
)
|
|
55
|
+
device_a = DeviceSerializer(nested=True)
|
|
56
|
+
interface_a = InterfaceSerializer(nested=True)
|
|
57
|
+
device_b = DeviceSerializer(nested=True)
|
|
58
|
+
interface_b = InterfaceSerializer(nested=True)
|
|
59
|
+
|
|
60
|
+
class Meta:
|
|
61
|
+
model = LLDPNeighbor
|
|
62
|
+
fields = (
|
|
63
|
+
"id",
|
|
64
|
+
"url",
|
|
65
|
+
"device_a",
|
|
66
|
+
"interface_a",
|
|
67
|
+
"device_b",
|
|
68
|
+
"interface_b",
|
|
69
|
+
"status",
|
|
70
|
+
"status_detail",
|
|
71
|
+
"last_seen",
|
|
72
|
+
"comments",
|
|
73
|
+
"tags",
|
|
74
|
+
"imported_data",
|
|
75
|
+
"custom_fields",
|
|
76
|
+
"created",
|
|
77
|
+
"last_updated",
|
|
78
|
+
)
|
|
79
|
+
brief_fields = (
|
|
80
|
+
"id",
|
|
81
|
+
"device_a",
|
|
82
|
+
"interface_a",
|
|
83
|
+
"device_b",
|
|
84
|
+
"interface_b",
|
|
85
|
+
"status",
|
|
86
|
+
"status_detail",
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class ServiceCoreTrunkSerializer(NetBoxModelSerializer):
|
|
91
|
+
url = serializers.HyperlinkedIdentityField(
|
|
92
|
+
view_name="plugins-api:netbox_cesnet_services_plugin-api:servicecoretrunk-detail"
|
|
93
|
+
)
|
|
94
|
+
tenant = TenantSerializer(nested=True, allow_null=True, required=False)
|
|
95
|
+
node_a = DeviceSerializer(nested=True, allow_null=True, required=False)
|
|
96
|
+
node_b = DeviceSerializer(nested=True, allow_null=True, required=False)
|
|
97
|
+
if_a = InterfaceSerializer(nested=True, allow_null=True, required=False)
|
|
98
|
+
if_b = InterfaceSerializer(nested=True, allow_null=True, required=False)
|
|
99
|
+
|
|
100
|
+
class Meta:
|
|
101
|
+
model = ServiceCoreTrunk
|
|
102
|
+
fields = (
|
|
103
|
+
"id", "display", "url",
|
|
104
|
+
"name", "status", "active", "tenant",
|
|
105
|
+
"service_start", "service_end", "rt", "monitored",
|
|
106
|
+
"node_a", "node_b", "if_a", "if_b",
|
|
107
|
+
"linked_segments",
|
|
108
|
+
"tags", "comments", "custom_fields", "created", "last_updated",
|
|
109
|
+
)
|
|
110
|
+
brief_fields = (
|
|
111
|
+
"id", "url", "display", "name", "status", "tenant",
|
|
112
|
+
"node_a", "node_b",
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
class ServiceCoreLinkSerializer(NetBoxModelSerializer):
|
|
117
|
+
url = serializers.HyperlinkedIdentityField(
|
|
118
|
+
view_name="plugins-api:netbox_cesnet_services_plugin-api:servicecorelink-detail"
|
|
119
|
+
)
|
|
120
|
+
tenant = TenantSerializer(nested=True, allow_null=True, required=False)
|
|
121
|
+
node_a = DeviceSerializer(nested=True, allow_null=True, required=False)
|
|
122
|
+
node_b = DeviceSerializer(nested=True, allow_null=True, required=False)
|
|
123
|
+
phy_if_a = InterfaceSerializer(nested=True, allow_null=True, required=False)
|
|
124
|
+
phy_if_b = InterfaceSerializer(nested=True, allow_null=True, required=False)
|
|
125
|
+
ipv4_addr_a = IPAddressSerializer(nested=True, allow_null=True, required=False)
|
|
126
|
+
ipv4_addr_b = IPAddressSerializer(nested=True, allow_null=True, required=False)
|
|
127
|
+
ipv6_addr_a = IPAddressSerializer(nested=True, allow_null=True, required=False)
|
|
128
|
+
ipv6_addr_b = IPAddressSerializer(nested=True, allow_null=True, required=False)
|
|
129
|
+
|
|
130
|
+
class Meta:
|
|
131
|
+
model = ServiceCoreLink
|
|
132
|
+
fields = (
|
|
133
|
+
"id", "display", "url",
|
|
134
|
+
"name", "status", "active", "tenant",
|
|
135
|
+
"service_start", "service_end", "rt", "monitored",
|
|
136
|
+
"node_a", "node_b", "phy_if_a", "phy_if_b",
|
|
137
|
+
"linked_segments", "saps", "core_trunks",
|
|
138
|
+
"lldp_enable", "flowspec_enable",
|
|
139
|
+
"encapsulation_mode", "encapsulation_qinq_s_vlan_id", "encapsulation_qinq_c_vlan_id",
|
|
140
|
+
"routing_isis_enabled", "routing_isis_instance", "routing_isis_bfd",
|
|
141
|
+
"routing_ospf_enable", "routing_ospf_area",
|
|
142
|
+
"ipv4_addr_a", "ipv4_addr_b", "ipv6_addr_a", "ipv6_addr_b",
|
|
143
|
+
"tags", "comments", "custom_fields", "created", "last_updated",
|
|
144
|
+
)
|
|
145
|
+
brief_fields = (
|
|
146
|
+
"id", "url", "display", "name", "status", "tenant",
|
|
147
|
+
"node_a", "node_b", "encapsulation_mode",
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
class ServiceIPSerializer(NetBoxModelSerializer):
|
|
152
|
+
url = serializers.HyperlinkedIdentityField(
|
|
153
|
+
view_name="plugins-api:netbox_cesnet_services_plugin-api:serviceip-detail"
|
|
154
|
+
)
|
|
155
|
+
tenant = TenantSerializer(nested=True, allow_null=True, required=False)
|
|
156
|
+
sap = InterfaceSerializer(nested=True, allow_null=True, required=False)
|
|
157
|
+
routed_device = DeviceSerializer(nested=True, allow_null=True, required=False)
|
|
158
|
+
physical_interface = InterfaceSerializer(nested=True, allow_null=True, required=False)
|
|
159
|
+
physical_device = DeviceSerializer(nested=True, allow_null=True, required=False)
|
|
160
|
+
ipv4_addr = IPAddressSerializer(nested=True, allow_null=True, required=False)
|
|
161
|
+
ipv6_addr = IPAddressSerializer(nested=True, allow_null=True, required=False)
|
|
162
|
+
routing_static_next_hop = IPAddressSerializer(nested=True, allow_null=True, required=False)
|
|
163
|
+
routing_bgp_peer_as = ASNSerializer(nested=True, allow_null=True, required=False)
|
|
164
|
+
routing_bgp_peer_ip = IPAddressSerializer(nested=True, allow_null=True, required=False)
|
|
165
|
+
|
|
166
|
+
class Meta:
|
|
167
|
+
model = ServiceIP
|
|
168
|
+
fields = (
|
|
169
|
+
"id", "display", "url",
|
|
170
|
+
"name", "status", "active", "tenant",
|
|
171
|
+
"service_start", "service_end", "rt", "monitored",
|
|
172
|
+
"sap", "routed_device", "physical_interface", "physical_device",
|
|
173
|
+
"encapsulation_mode", "encapsulation_qinq_s_vlan_id", "encapsulation_qinq_c_vlan_id",
|
|
174
|
+
"ipv4_addr", "ipv6_addr",
|
|
175
|
+
"routing_type", "routing_prefixes",
|
|
176
|
+
"routing_static_next_hop",
|
|
177
|
+
"routing_bgp_peer_as", "routing_bgp_peer_ip", "routing_bgp_policy",
|
|
178
|
+
"tags", "comments", "custom_fields", "created", "last_updated",
|
|
179
|
+
)
|
|
180
|
+
brief_fields = (
|
|
181
|
+
"id", "url", "display", "name", "status", "tenant",
|
|
182
|
+
"sap", "routing_type",
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
class BGPConnectionSerializer(NetBoxModelSerializer):
|
|
187
|
+
url = serializers.HyperlinkedIdentityField(
|
|
188
|
+
view_name="plugins-api:netbox_cesnet_services_plugin-api:bgpconnection-detail"
|
|
189
|
+
)
|
|
190
|
+
device = DeviceSerializer(nested=True)
|
|
191
|
+
next_hop = IPAddressSerializer(nested=True, allow_null=True)
|
|
192
|
+
bgp_prefix = PrefixSerializer(nested=True, allow_null=True)
|
|
193
|
+
vrf = VRFSerializer(nested=True, allow_null=True)
|
|
194
|
+
|
|
195
|
+
class Meta:
|
|
196
|
+
model = BGPConnection
|
|
197
|
+
fields = (
|
|
198
|
+
"id",
|
|
199
|
+
"display",
|
|
200
|
+
"url",
|
|
201
|
+
"device",
|
|
202
|
+
"raw_next_hop",
|
|
203
|
+
"next_hop",
|
|
204
|
+
"raw_bgp_prefix",
|
|
205
|
+
"bgp_prefix",
|
|
206
|
+
"raw_vrf",
|
|
207
|
+
"vrf",
|
|
208
|
+
"role",
|
|
209
|
+
"last_seen",
|
|
210
|
+
"tags",
|
|
211
|
+
"import_data",
|
|
212
|
+
"custom_fields",
|
|
213
|
+
"created",
|
|
214
|
+
"last_updated",
|
|
215
|
+
)
|
|
216
|
+
brief_fields = (
|
|
217
|
+
"id",
|
|
218
|
+
"url",
|
|
219
|
+
"display",
|
|
220
|
+
"device",
|
|
221
|
+
"raw_next_hop",
|
|
222
|
+
"next_hop",
|
|
223
|
+
"raw_bgp_prefix",
|
|
224
|
+
"bgp_prefix",
|
|
225
|
+
"raw_vrf",
|
|
226
|
+
"vrf",
|
|
227
|
+
"role",
|
|
228
|
+
"tags",
|
|
229
|
+
)
|
|
@@ -7,5 +7,8 @@ router = NetBoxRouter()
|
|
|
7
7
|
router.register("bgp-connections", views.BGPConnectionViewSet)
|
|
8
8
|
router.register("lldp-neighbors", views.LLDPNeighborViewSet)
|
|
9
9
|
router.register("lldp-neighbor-leafs", views.LLDPNeighborLeafViewSet)
|
|
10
|
+
router.register("service-core-trunks", views.ServiceCoreTrunkViewSet)
|
|
11
|
+
router.register("service-core-links", views.ServiceCoreLinkViewSet)
|
|
12
|
+
router.register("service-ip", views.ServiceIPViewSet)
|
|
10
13
|
|
|
11
14
|
urlpatterns = router.urls
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from netbox.api.metadata import ContentTypeMetadata
|
|
2
|
+
from netbox.api.viewsets import NetBoxModelViewSet
|
|
3
|
+
|
|
4
|
+
from netbox_cesnet_services_plugin import filtersets, models
|
|
5
|
+
from .serializers import (
|
|
6
|
+
BGPConnectionSerializer,
|
|
7
|
+
LLDPNeighborSerializer,
|
|
8
|
+
LLDPNeighborLeafSerializer,
|
|
9
|
+
ServiceCoreTrunkSerializer,
|
|
10
|
+
ServiceCoreLinkSerializer,
|
|
11
|
+
ServiceIPSerializer,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class BGPConnectionViewSet(NetBoxModelViewSet):
|
|
16
|
+
metadata_class = ContentTypeMetadata
|
|
17
|
+
queryset = models.BGPConnection.objects.all()
|
|
18
|
+
serializer_class = BGPConnectionSerializer
|
|
19
|
+
filterset_class = filtersets.BGPConnectionFilterSet
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class LLDPNeighborViewSet(NetBoxModelViewSet):
|
|
23
|
+
metadata_class = ContentTypeMetadata
|
|
24
|
+
queryset = models.LLDPNeighbor.objects.all()
|
|
25
|
+
serializer_class = LLDPNeighborSerializer
|
|
26
|
+
filterset_class = filtersets.LLDPNeighborFilterSet
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class LLDPNeighborLeafViewSet(NetBoxModelViewSet):
|
|
30
|
+
metadata_class = ContentTypeMetadata
|
|
31
|
+
queryset = models.LLDPNeighborLeaf.objects.all()
|
|
32
|
+
serializer_class = LLDPNeighborLeafSerializer
|
|
33
|
+
filterset_class = filtersets.LLDPNeighborLeafFilterSet
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class ServiceCoreTrunkViewSet(NetBoxModelViewSet):
|
|
37
|
+
metadata_class = ContentTypeMetadata
|
|
38
|
+
queryset = models.ServiceCoreTrunk.objects.select_related(
|
|
39
|
+
"tenant", "node_a", "node_b", "if_a", "if_b"
|
|
40
|
+
)
|
|
41
|
+
serializer_class = ServiceCoreTrunkSerializer
|
|
42
|
+
filterset_class = filtersets.ServiceCoreTrunkFilterSet
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class ServiceCoreLinkViewSet(NetBoxModelViewSet):
|
|
46
|
+
metadata_class = ContentTypeMetadata
|
|
47
|
+
queryset = models.ServiceCoreLink.objects.select_related(
|
|
48
|
+
"tenant", "node_a", "node_b", "phy_if_a", "phy_if_b",
|
|
49
|
+
"ipv4_addr_a", "ipv4_addr_b", "ipv6_addr_a", "ipv6_addr_b",
|
|
50
|
+
).prefetch_related("saps", "core_trunks", "linked_segments")
|
|
51
|
+
serializer_class = ServiceCoreLinkSerializer
|
|
52
|
+
filterset_class = filtersets.ServiceCoreLinkFilterSet
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class ServiceIPViewSet(NetBoxModelViewSet):
|
|
57
|
+
metadata_class = ContentTypeMetadata
|
|
58
|
+
queryset = models.ServiceIP.objects.select_related(
|
|
59
|
+
"tenant", "sap",
|
|
60
|
+
"ipv4_addr", "ipv6_addr",
|
|
61
|
+
"routing_static_next_hop", "routing_bgp_peer_as", "routing_bgp_peer_ip",
|
|
62
|
+
).prefetch_related("routing_prefixes")
|
|
63
|
+
serializer_class = ServiceIPSerializer
|
|
64
|
+
filterset_class = filtersets.ServiceIPFilterSet
|
|
@@ -2,6 +2,30 @@ from utilities.choices import ChoiceSet
|
|
|
2
2
|
from django.utils.translation import gettext_lazy as _
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
class EncapsulationModeChoices(ChoiceSet):
|
|
6
|
+
MODE_NONE = "none"
|
|
7
|
+
MODE_DOT1Q = "dot1q"
|
|
8
|
+
MODE_QINQ = "qinq"
|
|
9
|
+
|
|
10
|
+
CHOICES = [
|
|
11
|
+
(MODE_NONE, _("None / Untagged"), "gray"),
|
|
12
|
+
(MODE_DOT1Q, _("dot1q"), "blue"),
|
|
13
|
+
(MODE_QINQ, _("QinQ"), "purple"),
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class RoutingTypeChoices(ChoiceSet):
|
|
18
|
+
TYPE_NONE = "none"
|
|
19
|
+
TYPE_STATIC = "static"
|
|
20
|
+
TYPE_BGP = "bgp"
|
|
21
|
+
|
|
22
|
+
CHOICES = [
|
|
23
|
+
(TYPE_NONE, _("None"), "gray"),
|
|
24
|
+
(TYPE_STATIC, _("Static"), "blue"),
|
|
25
|
+
(TYPE_BGP, _("BGP"), "green"),
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
|
|
5
29
|
class LLDPNeigborStatusChoices(ChoiceSet):
|
|
6
30
|
STATUS_ACTIVE = "active"
|
|
7
31
|
STATUS_INACTIVE = "inactive"
|
|
@@ -2,10 +2,16 @@ from .bgpconnection import BGPConnectionFilterSet
|
|
|
2
2
|
from .bgpconnection_aggregation import BGPConnectionAggregationFilterSet
|
|
3
3
|
from .lldpneighbor import LLDPNeighborFilterSet
|
|
4
4
|
from .lldpneighborleaf import LLDPNeighborLeafFilterSet
|
|
5
|
+
from .service_core_trunk import ServiceCoreTrunkFilterSet
|
|
6
|
+
from .service_core_link import ServiceCoreLinkFilterSet
|
|
7
|
+
from .service_ip import ServiceIPFilterSet
|
|
5
8
|
|
|
6
9
|
__all__ = [
|
|
7
10
|
"BGPConnectionFilterSet",
|
|
8
11
|
"BGPConnectionAggregationFilterSet",
|
|
9
12
|
"LLDPNeighborFilterSet",
|
|
10
13
|
"LLDPNeighborLeafFilterSet",
|
|
14
|
+
"ServiceCoreTrunkFilterSet",
|
|
15
|
+
"ServiceCoreLinkFilterSet",
|
|
16
|
+
"ServiceIPFilterSet",
|
|
11
17
|
]
|
netbox_cesnet_services_plugin-3.0.2/netbox_cesnet_services_plugin/filtersets/service_core_link.py
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import django_filters
|
|
2
|
+
from dcim.models import Device, Interface
|
|
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
|
+
|
|
8
|
+
from circuits.choices import CircuitStatusChoices
|
|
9
|
+
from netbox_cesnet_services_plugin.choices import (
|
|
10
|
+
EncapsulationModeChoices,
|
|
11
|
+
)
|
|
12
|
+
from netbox_cesnet_services_plugin.models import ServiceCoreLink, ServiceCoreTrunk
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class ServiceCoreLinkFilterSet(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
|
+
|
|
35
|
+
node_a_id = django_filters.ModelMultipleChoiceFilter(
|
|
36
|
+
field_name="node_a__id",
|
|
37
|
+
queryset=Device.objects.all(),
|
|
38
|
+
to_field_name="id",
|
|
39
|
+
label="Node A (ID)",
|
|
40
|
+
)
|
|
41
|
+
node_b_id = django_filters.ModelMultipleChoiceFilter(
|
|
42
|
+
field_name="node_b__id",
|
|
43
|
+
queryset=Device.objects.all(),
|
|
44
|
+
to_field_name="id",
|
|
45
|
+
label="Node B (ID)",
|
|
46
|
+
)
|
|
47
|
+
phy_if_a_id = django_filters.ModelMultipleChoiceFilter(
|
|
48
|
+
field_name="phy_if_a__id",
|
|
49
|
+
queryset=Interface.objects.all(),
|
|
50
|
+
to_field_name="id",
|
|
51
|
+
label="Physical Interface A (ID)",
|
|
52
|
+
)
|
|
53
|
+
phy_if_b_id = django_filters.ModelMultipleChoiceFilter(
|
|
54
|
+
field_name="phy_if_b__id",
|
|
55
|
+
queryset=Interface.objects.all(),
|
|
56
|
+
to_field_name="id",
|
|
57
|
+
label="Physical Interface B (ID)",
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
core_trunk_id = django_filters.ModelMultipleChoiceFilter(
|
|
61
|
+
field_name="core_trunks__id",
|
|
62
|
+
queryset=ServiceCoreTrunk.objects.all(),
|
|
63
|
+
to_field_name="id",
|
|
64
|
+
label="Core Trunk (ID)",
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
lldp_enable = django_filters.BooleanFilter()
|
|
68
|
+
flowspec_enable = django_filters.BooleanFilter()
|
|
69
|
+
routing_isis_enabled = django_filters.BooleanFilter()
|
|
70
|
+
routing_ospf_enable = django_filters.BooleanFilter()
|
|
71
|
+
encapsulation_mode = django_filters.MultipleChoiceFilter(
|
|
72
|
+
choices=EncapsulationModeChoices
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
tag = TagFilter()
|
|
76
|
+
|
|
77
|
+
class Meta:
|
|
78
|
+
model = ServiceCoreLink
|
|
79
|
+
fields = [
|
|
80
|
+
"name", "status", "active", "monitored", "tenant",
|
|
81
|
+
"lldp_enable", "flowspec_enable", "routing_isis_enabled",
|
|
82
|
+
"routing_ospf_enable", "encapsulation_mode", "tag",
|
|
83
|
+
]
|
|
84
|
+
|
|
85
|
+
def search(self, queryset, name, value):
|
|
86
|
+
return queryset.filter(
|
|
87
|
+
Q(name__icontains=value)
|
|
88
|
+
| Q(tenant__name__icontains=value)
|
|
89
|
+
| Q(node_a__name__icontains=value)
|
|
90
|
+
| Q(node_b__name__icontains=value)
|
|
91
|
+
| Q(rt__icontains=value)
|
|
92
|
+
| Q(routing_isis_instance__icontains=value)
|
|
93
|
+
| Q(routing_ospf_area__icontains=value)
|
|
94
|
+
)
|