urls.py 5.51 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# Copyright 2014 Budapest University of Technology and Economics (BME IK)
#
# This file is part of CIRCLE Cloud.
#
# CIRCLE 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 3 of the License, or (at your option)
# any later version.
#
# CIRCLE 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 CIRCLE.  If not, see <http://www.gnu.org/licenses/>.

18 19 20 21 22 23 24 25 26 27
from django.conf.urls import patterns, url
from .views import (IndexView,
                    HostList, HostDetail, HostCreate, HostDelete,
                    VlanList, VlanDetail, VlanDelete, VlanCreate,
                    DomainList, DomainDetail, DomainDelete, DomainCreate,
                    GroupList, GroupDetail, GroupDelete, GroupCreate,
                    RecordList, RecordDetail, RecordCreate, RecordDelete,
                    BlacklistList, BlacklistDetail, BlacklistDelete,
                    BlacklistCreate,
                    RuleList, RuleDetail, RuleDelete, RuleCreate,
28 29
                    SwitchPortList, SwitchPortDetail, SwitchPortCreate,
                    SwitchPortDelete,
30 31
                    VlanGroupList, VlanGroupDetail, VlanGroupDelete,
                    VlanGroupCreate,
32
                    remove_host_group, add_host_group,
Kálmán Viktor committed
33 34
                    remove_switch_port_device, add_switch_port_device,
                    VlanAclUpdateView)
35 36 37 38

urlpatterns = patterns(
    '',
    url('^$', IndexView.as_view(), name='network.index'),
39
    url('^blacklist/$', BlacklistList.as_view(),
40
        name='network.blacklist_list'),
41
    url('^blacklist/create$', BlacklistCreate.as_view(),
42
        name='network.blacklist_create'),
43
    url('^blacklist/(?P<pk>\d+)/$', BlacklistDetail.as_view(),
44
        name='network.blacklist'),
45
    url('^blacklist/delete/(?P<pk>\d+)/$', BlacklistDelete.as_view(),
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
        name="network.blacklist_delete"),
    url('^domains/$', DomainList.as_view(), name='network.domain_list'),
    url('^domains/create$', DomainCreate.as_view(),
        name='network.domain_create'),
    url('^domains/(?P<pk>\d+)/$', DomainDetail.as_view(),
        name='network.domain'),
    url('^domains/delete/(?P<pk>\d+)/$', DomainDelete.as_view(),
        name="network.domain_delete"),
    url('^groups/$', GroupList.as_view(), name='network.group_list'),
    url('^groups/create$', GroupCreate.as_view(),
        name='network.group_create'),
    url('^groups/(?P<pk>\d+)/$', GroupDetail.as_view(), name='network.group'),
    url('^groups/delete/(?P<pk>\d+)/$', GroupDelete.as_view(),
        name="network.group_delete"),
    url('^hosts/$', HostList.as_view(), name='network.host_list'),
    url('^hosts/create$', HostCreate.as_view(), name='network.host_create'),
    url('^hosts/(?P<pk>\d+)/$', HostDetail.as_view(), name='network.host'),
    url('^hosts/delete/(?P<pk>\d+)/$', HostDelete.as_view(),
        name="network.host_delete"),
    url('^records/$', RecordList.as_view(), name='network.record_list'),
    url('^records/create$', RecordCreate.as_view(),
        name='network.record_create'),
    url('^records/(?P<pk>\d+)/$', RecordDetail.as_view(),
        name='network.record'),
    url('^records/delete/(?P<pk>\d+)/$', RecordDelete.as_view(),
        name="network.record_delete"),
    url('^rules/$', RuleList.as_view(), name='network.rule_list'),
    url('^rules/create$', RuleCreate.as_view(), name='network.rule_create'),
    url('^rules/(?P<pk>\d+)/$', RuleDetail.as_view(),
        name='network.rule'),
76 77 78 79 80 81 82 83
    url('^switchports/$', SwitchPortList.as_view(),
        name='network.switch_port_list'),
    url('^switchports/create$', SwitchPortCreate.as_view(),
        name='network.switch_port_create'),
    url('^switchports/(?P<pk>\d+)/$', SwitchPortDetail.as_view(),
        name='network.switch_port'),
    url('^switchports/delete/(?P<pk>\d+)/$', SwitchPortDelete.as_view(),
        name="network.switch_port_delete"),
84 85 86
    url('^vlans/$', VlanList.as_view(), name='network.vlan_list'),
    url('^vlans/create$', VlanCreate.as_view(), name='network.vlan_create'),
    url('^vlans/(?P<vid>\d+)/$', VlanDetail.as_view(), name='network.vlan'),
Kálmán Viktor committed
87 88
    url('^vlans/(?P<vid>\d+)/acl/$', VlanAclUpdateView.as_view(),
        name='network.vlan-acl'),
89 90 91 92 93 94 95 96 97 98 99 100
    url('^vlans/delete/(?P<vid>\d+)/$', VlanDelete.as_view(),
        name="network.vlan_delete"),
    url('^vlangroups/$', VlanGroupList.as_view(),
        name='network.vlan_group_list'),
    url('^vlangroups/create$', VlanGroupCreate.as_view(),
        name='network.vlan_group_create'),
    url('^vlangroups/(?P<pk>\d+)/$', VlanGroupDetail.as_view(),
        name='network.vlan_group'),
    url('^vlangroups/delete/(?P<pk>\d+)/$', VlanGroupDelete.as_view(),
        name="network.vlan_group_delete"),
    url('^rules/delete/(?P<pk>\d+)/$', RuleDelete.as_view(),
        name="network.rule_delete"),
101 102

    # non class based views
103 104 105 106
    url('^hosts/(?P<pk>\d+)/remove/(?P<group_pk>\d+)/$', remove_host_group,
        name='network.remove_host_group'),
    url('^hosts/(?P<pk>\d+)/add/$', add_host_group,
        name='network.add_host_group'),
107 108 109 110
    url('^switchports/(?P<pk>\d+)/remove/(?P<device_pk>\d+)/$',
        remove_switch_port_device, name='network.remove_switch_port_device'),
    url('^switchports/(?P<pk>\d+)/add/$', add_switch_port_device,
        name='network.add_switch_port_device'),
111
)