from django.urls import path, include
from rest_framework.routers import SimpleRouter

from devices.views.arma_firewall import ArmaIndustrialFirewallViewSet
from devices.views.device import DeviceViewSet, DeviceGroupViewSet
from devices.views.sensor import ArmaSensorViewSet

router = SimpleRouter()
router.register('firewall', ArmaIndustrialFirewallViewSet, basename='firewall')
router.register('sensor', ArmaSensorViewSet, basename='sensor')
router.register('groups', DeviceGroupViewSet, basename='device-groups')
router.register('', DeviceViewSet)

urlpatterns = [
    path('sensor/<int:pk>/zeek/protocols_disable/', ArmaSensorViewSet.as_view({'post': 'zeek_protocols_disable'})),
    path('sensor/<int:pk>/zeek/settings_update/', ArmaSensorViewSet.as_view({'post': 'zeek_settings_update'})),
    path('', include(router.urls)),
]
