8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-25 16:33:47 +00:00
re2o/api/urls.py

128 lines
6.8 KiB
Python
Raw Normal View History

2018-06-30 01:25:46 +00:00
# -*- mode: python; coding: utf-8 -*-
2018-03-17 17:20:31 +00:00
# Re2o est un logiciel d'administration développé initiallement au rezometz. Il
# se veut agnostique au réseau considéré, de manière à être installable en
# quelques clics.
#
2018-06-17 01:06:58 +00:00
# Copyright © 2018 Maël Kervella
2018-03-17 17:20:31 +00:00
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2018-06-17 01:06:58 +00:00
"""Defines the URLs of the API
2018-03-17 17:20:31 +00:00
2018-06-17 01:06:58 +00:00
A custom router is used to register all the routes. That allows to register
all the URL patterns from the viewsets as a standard router but, the views
can also be register. That way a complete API root page presenting all URLs
can be generated automatically.
"""
2018-03-17 17:20:31 +00:00
2018-04-19 22:00:49 +00:00
from django.conf.urls import url, include
2018-03-17 17:20:31 +00:00
2018-03-17 17:50:03 +00:00
from . import views
2018-06-17 01:06:58 +00:00
from .routers import AllViewsRouter
2018-06-16 19:20:13 +00:00
router = AllViewsRouter()
2018-06-17 01:06:58 +00:00
# COTISATIONS
2018-06-20 11:44:43 +00:00
router.register_viewset(r'cotisations/facture', views.FactureViewSet)
router.register_viewset(r'cotisations/vente', views.VenteViewSet)
router.register_viewset(r'cotisations/article', views.ArticleViewSet)
router.register_viewset(r'cotisations/banque', views.BanqueViewSet)
router.register_viewset(r'cotisations/paiement', views.PaiementViewSet)
router.register_viewset(r'cotisations/cotisation', views.CotisationViewSet)
2018-06-17 01:06:58 +00:00
# MACHINES
2018-06-20 11:44:43 +00:00
router.register_viewset(r'machines/machine', views.MachineViewSet)
router.register_viewset(r'machines/machinetype', views.MachineTypeViewSet)
router.register_viewset(r'machines/iptype', views.IpTypeViewSet)
router.register_viewset(r'machines/vlan', views.VlanViewSet)
2018-06-16 19:20:13 +00:00
router.register_viewset(r'machines/nas', views.NasViewSet)
router.register_viewset(r'machines/soa', views.SOAViewSet)
2018-06-20 11:44:43 +00:00
router.register_viewset(r'machines/extension', views.ExtensionViewSet)
2018-06-16 19:20:13 +00:00
router.register_viewset(r'machines/mx', views.MxViewSet)
router.register_viewset(r'machines/ns', views.NsViewSet)
router.register_viewset(r'machines/txt', views.TxtViewSet)
2018-06-25 15:35:40 +00:00
router.register_viewset(r'machines/dname', views.DNameViewSet)
2018-06-16 19:20:13 +00:00
router.register_viewset(r'machines/srv', views.SrvViewSet)
router.register_viewset(r'machines/sshfp', views.SshFpViewSet)
2018-06-20 11:44:43 +00:00
router.register_viewset(r'machines/interface', views.InterfaceViewSet)
router.register_viewset(r'machines/ipv6list', views.Ipv6ListViewSet)
router.register_viewset(r'machines/domain', views.DomainViewSet)
router.register_viewset(r'machines/iplist', views.IpListViewSet)
router.register_viewset(r'machines/service', views.ServiceViewSet)
router.register_viewset(r'machines/servicelink', views.ServiceLinkViewSet, base_name='servicelink')
router.register_viewset(r'machines/ouvertureportlist', views.OuverturePortListViewSet)
router.register_viewset(r'machines/ouvertureport', views.OuverturePortViewSet)
router.register_viewset(r'machines/role', views.RoleViewSet)
2018-06-17 01:06:58 +00:00
# PREFERENCES
2018-06-16 19:20:13 +00:00
router.register_view(r'preferences/optionaluser', views.OptionalUserView),
router.register_view(r'preferences/optionalmachine', views.OptionalMachineView),
router.register_view(r'preferences/optionaltopologie', views.OptionalTopologieView),
router.register_view(r'preferences/generaloption', views.GeneralOptionView),
router.register_viewset(r'preferences/service', views.HomeServiceViewSet, base_name='homeservice'),
2018-06-16 19:20:13 +00:00
router.register_view(r'preferences/assooption', views.AssoOptionView),
router.register_view(r'preferences/homeoption', views.HomeOptionView),
router.register_view(r'preferences/mailmessageoption', views.MailMessageOptionView),
2018-06-17 01:06:58 +00:00
# TOPOLOGIE
2018-06-16 19:20:13 +00:00
router.register_viewset(r'topologie/stack', views.StackViewSet)
router.register_viewset(r'topologie/acesspoint', views.AccessPointViewSet)
router.register_viewset(r'topologie/switch', views.SwitchViewSet)
2018-06-20 12:13:23 +00:00
router.register_viewset(r'topologie/server', views.ServerViewSet)
2018-06-16 19:20:13 +00:00
router.register_viewset(r'topologie/modelswitch', views.ModelSwitchViewSet)
router.register_viewset(r'topologie/constructorswitch', views.ConstructorSwitchViewSet)
router.register_viewset(r'topologie/switchbay', views.SwitchBayViewSet)
router.register_viewset(r'topologie/building', views.BuildingViewSet)
2018-07-02 09:00:32 +00:00
router.register_viewset(r'topologie/switchport', views.SwitchPortViewSet, base_name='switchport')
router.register_viewset(r'topologie/portprofile', views.PortProfileViewSet, base_name='portprofile')
2018-06-16 19:20:13 +00:00
router.register_viewset(r'topologie/room', views.RoomViewSet)
router.register(r'topologie/portprofile', views.PortProfileViewSet)
2018-06-17 01:06:58 +00:00
# USERS
router.register_viewset(r'users/user', views.UserViewSet, base_name='user')
router.register_viewset(r'users/homecreation', views.HomeCreationViewSet, base_name='homecreation')
2018-11-17 18:51:37 +00:00
router.register_viewset(r'users/normaluser', views.NormalUserViewSet, base_name='normaluser')
router.register_viewset(r'users/criticaluser', views.CriticalUserViewSet, base_name='criticaluser')
2018-06-20 11:44:43 +00:00
router.register_viewset(r'users/club', views.ClubViewSet)
router.register_viewset(r'users/adherent', views.AdherentViewSet)
router.register_viewset(r'users/serviceuser', views.ServiceUserViewSet)
router.register_viewset(r'users/school', views.SchoolViewSet)
router.register_viewset(r'users/listright', views.ListRightViewSet)
router.register_viewset(r'users/shell', views.ShellViewSet, base_name='shell')
router.register_viewset(r'users/ban', views.BanViewSet)
router.register_viewset(r'users/whitelist', views.WhitelistViewSet)
2018-08-01 11:06:25 +00:00
router.register_viewset(r'users/emailaddress', views.EMailAddressViewSet)
2018-06-17 01:06:58 +00:00
# SERVICE REGEN
2018-06-16 19:20:13 +00:00
router.register_viewset(r'services/regen', views.ServiceRegenViewSet, base_name='serviceregen')
# DHCP
router.register_view(r'dhcp/hostmacip', views.HostMacIpView),
2018-07-30 15:00:41 +00:00
# LOCAL EMAILS
router.register_view(r'localemail/users', views.LocalEmailUsersView),
# Firewall
router.register_view(r'firewall/subnet-ports', views.SubnetPortsOpenView),
router.register_view(r'firewall/interface-ports', views.InterfacePortsOpenView),
2018-07-02 09:00:32 +00:00
# Switches config
router.register_view(r'switchs/ports-config', views.SwitchPortView),
router.register_view(r'switchs/role', views.RoleView),
# Reminder
router.register_view(r'reminder/get-users', views.ReminderView),
2018-06-16 19:20:13 +00:00
# DNS
router.register_view(r'dns/zones', views.DNSZonesView),
2018-07-14 08:59:17 +00:00
router.register_view(r'dns/reverse-zones', views.DNSReverseZonesView),
2018-06-16 19:20:13 +00:00
# MAILING
router.register_view(r'mailing/standard', views.StandardMailingView),
router.register_view(r'mailing/club', views.ClubMailingView),
2018-06-17 01:06:58 +00:00
# TOKEN AUTHENTICATION
2018-06-16 19:20:13 +00:00
router.register_view(r'token-auth', views.ObtainExpiringAuthToken)
2018-03-17 17:20:31 +00:00
urlpatterns = [
2018-04-19 22:00:49 +00:00
url(r'^', include(router.urls)),
2018-03-17 17:20:31 +00:00
]