mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-21 11:46:37 +00:00
* VLANTranslationPolicy and VLANTranslationRule models and all associated UI classes * Change VLANTranslationPolicy to a PrimaryModel and make name unique * Add serializer classes to InterfaceSerializer * Remake migrations * Add GraphQL typing * Skip tagged models in test * Missing migration * Remove get_absolute_url methods * Remove package-lock.json * Rebuild migration and add constraints and field options * Rebuild migrations * Use DynamicModelChoiceField for policy field * Make vlan_translation_policy fields on filtersets more consistent with existing __name convention * Add vlan_translation_table to VMInterface detail page * Add vlan_translation_policy to VMInterfaceSerializer * Move vlan_translation_policy fields to model and filterset mixins * Protect in-use policies against deletion * Add vlan_translation_policy to fields in VMInterfaceSerializer * Cleanup indentation * Remove unnecessary ordering column * Rebuild migrations * Search methods and registration * Ensure 'id' column is present by default * Add graphql types/filters/schema for VLANTranslationRule * Filterset tests * View tests * API and viewset tests (incomplete) * Add tags to VLANTranslationRuleForm * Complete viewset tests for VLANTranslationRule * Make VLANTranslationRule.policy nullable (but still required) * Revert "Make VLANTranslationRule.policy nullable (but still required)" This reverts commit 4c1bb437ef1a0a3593e5fbb87f08a0f158ea8c47. * Revert nullability * Explicitly prefetch policy in graphql * Documentation of new and affected models * Add note about select_related in graphql * Rework policy/rule documentation * Move vlan_translation_policy into 802.1Q Switching fieldset * Remove redundant InterfaceVLANTranslationTable * Conditionally include vlan_translation_table in interface.html and vminterface.html * Add description field to VLANTranslationRule * Define vlan_translation_table conditionally * Add policy (name) filter to VLANTranslationRuleFilterSet * Revert changes to adding-models.md (moved to another PR) * Dynamic table for linked rules in vlantranslationpolicy.html * Misc cleanup --------- Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
60 lines
1.9 KiB
Python
60 lines
1.9 KiB
Python
from django.urls import path
|
|
|
|
from netbox.api.routers import NetBoxRouter
|
|
from . import views
|
|
|
|
|
|
router = NetBoxRouter()
|
|
router.APIRootView = views.IPAMRootView
|
|
|
|
router.register('asns', views.ASNViewSet)
|
|
router.register('asn-ranges', views.ASNRangeViewSet)
|
|
router.register('vrfs', views.VRFViewSet)
|
|
router.register('route-targets', views.RouteTargetViewSet)
|
|
router.register('rirs', views.RIRViewSet)
|
|
router.register('aggregates', views.AggregateViewSet)
|
|
router.register('roles', views.RoleViewSet)
|
|
router.register('prefixes', views.PrefixViewSet)
|
|
router.register('ip-ranges', views.IPRangeViewSet)
|
|
router.register('ip-addresses', views.IPAddressViewSet)
|
|
router.register('fhrp-groups', views.FHRPGroupViewSet)
|
|
router.register('fhrp-group-assignments', views.FHRPGroupAssignmentViewSet)
|
|
router.register('vlan-groups', views.VLANGroupViewSet)
|
|
router.register('vlans', views.VLANViewSet)
|
|
router.register('vlan-translation-policies', views.VLANTranslationPolicyViewSet)
|
|
router.register('vlan-translation-rules', views.VLANTranslationRuleViewSet)
|
|
router.register('service-templates', views.ServiceTemplateViewSet)
|
|
router.register('services', views.ServiceViewSet)
|
|
|
|
app_name = 'ipam-api'
|
|
|
|
urlpatterns = [
|
|
path(
|
|
'asn-ranges/<int:pk>/available-asns/',
|
|
views.AvailableASNsView.as_view(),
|
|
name='asnrange-available-asns'
|
|
),
|
|
path(
|
|
'ip-ranges/<int:pk>/available-ips/',
|
|
views.IPRangeAvailableIPAddressesView.as_view(),
|
|
name='iprange-available-ips'
|
|
),
|
|
path(
|
|
'prefixes/<int:pk>/available-prefixes/',
|
|
views.AvailablePrefixesView.as_view(),
|
|
name='prefix-available-prefixes'
|
|
),
|
|
path(
|
|
'prefixes/<int:pk>/available-ips/',
|
|
views.PrefixAvailableIPAddressesView.as_view(),
|
|
name='prefix-available-ips'
|
|
),
|
|
path(
|
|
'vlan-groups/<int:pk>/available-vlans/',
|
|
views.AvailableVLANsView.as_view(),
|
|
name='vlangroup-available-vlans'
|
|
),
|
|
]
|
|
|
|
urlpatterns += router.urls
|