urls.py 5.86 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
from django.conf.urls import patterns, url
Kálmán Viktor committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
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,
    SwitchPortList, SwitchPortDetail, SwitchPortCreate, SwitchPortDelete,
    VlanGroupList, VlanGroupDetail, VlanGroupDelete, VlanGroupCreate,
    FirewallList, FirewallDetail, FirewallCreate, FirewallDelete,
    remove_host_group, add_host_group,
    remove_switch_port_device, add_switch_port_device,
    VlanAclUpdateView
)
35 36 37 38

urlpatterns = patterns(
    '',
    url('^$', IndexView.as_view(), name='network.index'),
Kálmán Viktor committed
39
    # blacklist
40
    url('^blacklist/$', BlacklistList.as_view(),
41
        name='network.blacklist_list'),
42
    url('^blacklist/create$', BlacklistCreate.as_view(),
43
        name='network.blacklist_create'),
44
    url('^blacklist/(?P<pk>\d+)/$', BlacklistDetail.as_view(),
45
        name='network.blacklist'),
46
    url('^blacklist/delete/(?P<pk>\d+)/$', BlacklistDelete.as_view(),
47
        name="network.blacklist_delete"),
Kálmán Viktor committed
48 49

    # domain
50 51 52 53 54 55 56
    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"),
Kálmán Viktor committed
57 58 59 60 61 62 63 64 65 66 67 68

    # firewall
    url('^firewalls/$', FirewallList.as_view(),
        name='network.firewall_list'),
    url('^firewalls/create$', FirewallCreate.as_view(),
        name='network.firewall_create'),
    url('^firewalls/(?P<pk>\d+)/$', FirewallDetail.as_view(),
        name='network.firewall'),
    url('^firewalls/delete/(?P<pk>\d+)/$', FirewallDelete.as_view(),
        name="network.firewall_delete"),

    # group (host)
69 70 71 72 73 74
    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"),
Kálmán Viktor committed
75 76

    # host
77 78 79 80 81
    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"),
Kálmán Viktor committed
82 83

    # record
84 85 86 87 88 89 90
    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"),
Kálmán Viktor committed
91 92

    # rule
93 94 95 96
    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'),
Kálmán Viktor committed
97 98

    # switchport
99 100 101 102 103 104 105 106
    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"),
Kálmán Viktor committed
107 108

    # vlan
109 110 111
    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'),
112
    url('^vlans/(?P<pk>\d+)/acl/$', VlanAclUpdateView.as_view(),
Kálmán Viktor committed
113
        name='network.vlan-acl'),
114 115
    url('^vlans/delete/(?P<vid>\d+)/$', VlanDelete.as_view(),
        name="network.vlan_delete"),
Kálmán Viktor committed
116 117

    # vlangroup
118 119 120 121 122 123 124 125 126 127
    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"),
128 129

    # non class based views
130 131 132 133
    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'),
134 135 136 137
    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'),
138
)