from django.urls import include, path from .models import InterfaceTypeMapping from .views import ( AddDeviceToLibreNMSView, AssignVCSerialView, BulkImportConfirmView, BulkImportDevicesView, CreateAndAssignPlatformView, DeleteNetBoxInterfacesView, DeviceCableTableView, DeviceClusterUpdateView, DeviceConflictActionView, DeviceInterfaceTableView, DeviceIPAddressTableView, DeviceLibreNMSSyncView, DeviceRackUpdateView, DeviceRoleUpdateView, DeviceStatusListView, DeviceValidationDetailsView, DeviceVCDetailsView, DeviceVLANTableView, InterfaceTypeMappingBulkDeleteView, InterfaceTypeMappingBulkImportView, InterfaceTypeMappingChangeLogView, InterfaceTypeMappingCreateView, InterfaceTypeMappingDeleteView, InterfaceTypeMappingEditView, InterfaceTypeMappingListView, InterfaceTypeMappingView, LibreNMSImportView, LibreNMSSettingsView, RemoveServerMappingView, SaveUserPrefView, SingleCableVerifyView, SingleInterfaceVerifyView, SingleIPAddressVerifyView, SaveVlanGroupOverridesView, SingleVlanGroupVerifyView, VerifyVlanSyncGroupView, SyncCablesView, SyncInterfacesView, SyncIPAddressesView, SyncSiteLocationView, SyncVLANsView, TestLibreNMSConnectionView, UpdateDeviceLocationView, UpdateDeviceNameView, UpdateDevicePlatformView, UpdateDeviceSerialView, UpdateDeviceTypeView, VMInterfaceTableView, VMIPAddressTableView, VMLibreNMSSyncView, VMStatusListView, ConvertLegacyLibreNMSIdView, ) urlpatterns = [ # Device sync URLs path( "device//librenms-sync/", DeviceLibreNMSSyncView.as_view(), name="device_librenms_sync", ), path( "devices//interface-sync/", DeviceInterfaceTableView.as_view(), name="device_interface_sync", ), path( "devices//cable-sync/", DeviceCableTableView.as_view(), name="device_cable_sync", ), path( "devices//ipaddress-sync/", DeviceIPAddressTableView.as_view(), name="device_ipaddress_sync", ), # Path for single interface verify javascript call path( "verify-interface/", SingleInterfaceVerifyView.as_view(), name="verify_interface", ), path( "verify-cable/", SingleCableVerifyView.as_view(), name="verify_cable", ), # Path for single IP address verify javascript call path( "verify-ipaddress/", SingleIPAddressVerifyView.as_view(), name="verify_ipaddress", ), # Path for VLAN group verify javascript call (interface VLAN coloring) path( "verify-vlan-group/", SingleVlanGroupVerifyView.as_view(), name="verify_vlan_group", ), # Verify VLAN existence in a group (VLAN sync tab coloring) path( "verify-vlan-sync-group/", VerifyVlanSyncGroupView.as_view(), name="verify_vlan_sync_group", ), # Save VLAN group overrides to cache ("apply to all" persistence) path( "save-vlan-group-overrides/", SaveVlanGroupOverridesView.as_view(), name="save_vlan_group_overrides", ), # Virtual machine sync URLs path( "virtual-machines//interface-sync/", VMInterfaceTableView.as_view(), name="vm_interface_sync", ), path( "virtual-machines//ipaddress-sync/", VMIPAddressTableView.as_view(), name="vm_ipaddress_sync", ), path( "virtual-machines//librenms-sync/", VMLibreNMSSyncView.as_view(), name="vm_librenms_sync", ), # Sync interfaces URL path( "//sync-interfaces/", SyncInterfacesView.as_view(), name="sync_selected_interfaces", ), # Delete NetBox-only interfaces URL path( "//delete-netbox-interfaces/", DeleteNetBoxInterfacesView.as_view(), name="delete_netbox_interfaces", ), # Sync cables URL path( "device//sync-cables/", SyncCablesView.as_view(), name="sync_device_cables", ), # Sync IP addresses URL path( "//sync-ip-addresses/", SyncIPAddressesView.as_view(), name="sync_device_ip_addresses", ), # VLAN sync URLs path( "devices//vlan-sync/", DeviceVLANTableView.as_view(), name="device_vlan_sync", ), path( "//sync-vlans/", SyncVLANsView.as_view(), name="sync_selected_vlans", ), # Add Device to LibreNMS URLs path( "add-device//", AddDeviceToLibreNMSView.as_view(), name="add_device_to_librenms", ), # Site > location sync URLs path( "site-location-comparison/", SyncSiteLocationView.as_view(), name="site_location_sync", ), path( "create-librenms-location//", SyncSiteLocationView.as_view(), name="create_librenms_location", ), path( "update-librenms-location//", SyncSiteLocationView.as_view(), name="update_librenms_location", ), # Update device location URLs path( "devices//update-location/", UpdateDeviceLocationView.as_view(), name="update_device_location", ), # Update device field URLs (name, serial, device type, platform) path( "devices//update-name/", UpdateDeviceNameView.as_view(), name="update_device_name", ), path( "devices//update-serial/", UpdateDeviceSerialView.as_view(), name="update_device_serial", ), path( "devices//update-device-type/", UpdateDeviceTypeView.as_view(), name="update_device_type", ), path( "devices//update-platform/", UpdateDevicePlatformView.as_view(), name="update_device_platform", ), path( "devices//create-and-assign-platform/", CreateAndAssignPlatformView.as_view(), name="create_and_assign_platform", ), path( "devices//assign-vc-serial/", AssignVCSerialView.as_view(), name="assign_vc_serial", ), path( "devices//remove-server-mapping/", RemoveServerMappingView.as_view(), name="remove_server_mapping", ), path( "devices//convert-legacy-id/", ConvertLegacyLibreNMSIdView.as_view(), name="convert_legacy_librenms_id", ), path( "device-status/", DeviceStatusListView.as_view(), name="device_status_list", ), path( "librenms-import/", LibreNMSImportView.as_view(), name="librenms_import", ), path( "device-import/bulk/", BulkImportDevicesView.as_view(), name="bulk_import_devices", ), path( "device-import/bulk/confirm/", BulkImportConfirmView.as_view(), name="bulk_import_confirm", ), path( "device-import/validation//", DeviceValidationDetailsView.as_view(), name="device_validation_details", ), path( "device-import/vc-details//", DeviceVCDetailsView.as_view(), name="device_vc_details", ), path( "device-import/role-update//", DeviceRoleUpdateView.as_view(), name="device_role_update", ), path( "device-import/cluster-update//", DeviceClusterUpdateView.as_view(), name="device_cluster_update", ), path( "device-import/rack-update//", DeviceRackUpdateView.as_view(), name="device_rack_update", ), path( "device-import/conflict-action//", DeviceConflictActionView.as_view(), name="device_conflict_action", ), path( "save-user-pref/", SaveUserPrefView.as_view(), name="save_user_pref", ), path( "vm-status/", VMStatusListView.as_view(), name="vm_status_list", ), # Settings URL path( "settings/", LibreNMSSettingsView.as_view(), name="settings", ), # Test LibreNMS connection endpoint path( "settings/test-connection/", TestLibreNMSConnectionView.as_view(), name="test_connection", ), # Interface type mapping URLs path( "interface-type-mappings/", InterfaceTypeMappingListView.as_view(), name="interfacetypemapping_list", ), path( "interface-type-mappings//", InterfaceTypeMappingView.as_view(), name="interfacetypemapping_detail", ), path( "interface-type-mappings/add/", InterfaceTypeMappingCreateView.as_view(), name="interfacetypemapping_add", ), path( "interface-type-mappings/import/", InterfaceTypeMappingBulkImportView.as_view(), name="interfacetypemapping_bulk_import", ), path( "interface-type-mappings//delete/", InterfaceTypeMappingDeleteView.as_view(), name="interfacetypemapping_delete", ), path( "interface-type-mappings//edit/", InterfaceTypeMappingEditView.as_view(), name="interfacetypemapping_edit", ), path( "interface-type-mappings//changelog/", InterfaceTypeMappingChangeLogView.as_view(), name="interfacetypemapping_changelog", kwargs={"model": InterfaceTypeMapping}, ), path( "interface-type-mappings/delete/", InterfaceTypeMappingBulkDeleteView.as_view(), name="interfacetypemapping_bulk_delete", ), path("api/", include("netbox_librenms_plugin.api.urls")), ]