urls.py 8.35 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
from __future__ import absolute_import
from django.conf.urls import patterns, url, include
20

21
from vm.models import Instance
22
from .views import (
23
    AclUpdateView, FavouriteView, GroupAclUpdateView, GroupDelete,
24
    GroupDetailView, GroupList, IndexView,
25 26 27 28 29 30
    InstanceActivityDetail, LeaseCreate, LeaseDelete, LeaseDetail,
    MyPreferencesView, NodeAddTraitView, NodeCreate, NodeDelete,
    NodeDetailView, NodeFlushView, NodeGraphView, NodeList, NodeStatus,
    NotificationView, PortDelete, TemplateAclUpdateView, TemplateCreate,
    TemplateDelete, TemplateDetail, TemplateList, TransferOwnershipConfirmView,
    TransferOwnershipView, vm_activity, VmCreate, VmDelete, VmDetailView,
31
    VmDetailVncTokenView, VmGraphView, VmList, VmMassDelete,
32
    DiskRemoveView, get_disk_download_status, InterfaceDeleteView,
33
    GroupRemoveAclUserView, GroupRemoveAclGroupView, GroupRemoveUserView,
34
    GroupRemoveFutureUserView,
35
    GroupCreate, GroupProfileUpdate,
36
    TemplateChoose,
37
    UserCreationView,
38
    get_vm_screenshot,
39
    ProfileView, toggle_use_gravatar, UnsubscribeFormView,
40
    UserKeyDelete, UserKeyDetail, UserKeyCreate,
41 42
    VmTraitsUpdate, VmRawDataUpdate,
    GroupPermissionsView,
43
)
44

Kálmán Viktor committed
45 46
urlpatterns = patterns(
    '',
Kálmán Viktor committed
47
    url(r'^$', IndexView.as_view(), name="dashboard.index"),
48 49
    url(r'^lease/(?P<pk>\d+)/$', LeaseDetail.as_view(),
        name="dashboard.views.lease-detail"),
50 51
    url(r'^lease/create/$', LeaseCreate.as_view(),
        name="dashboard.views.lease-create"),
52 53
    url(r'^lease/delete/(?P<pk>\d+)/$', LeaseDelete.as_view(),
        name="dashboard.views.lease-delete"),
54

55 56
    url(r'^template/create/$', TemplateCreate.as_view(),
        name="dashboard.views.template-create"),
57 58
    url(r'^template/choose/$', TemplateChoose.as_view(),
        name="dashboard.views.template-choose"),
59 60
    url(r'template/(?P<pk>\d+)/acl/$', TemplateAclUpdateView.as_view(),
        name='dashboard.views.template-acl'),
61 62
    url(r'^template/(?P<pk>\d+)/$', TemplateDetail.as_view(),
        name='dashboard.views.template-detail'),
63 64
    url(r"^template/list/$", TemplateList.as_view(),
        name="dashboard.views.template-list"),
65 66
    url(r"^template/delete/(?P<pk>\d+)/$", TemplateDelete.as_view(),
        name="dashboard.views.template-delete"),
67

68
    url(r'^vm/(?P<pk>\d+)/op/', include('dashboard.vm.urls')),
69 70
    url(r'^vm/(?P<pk>\d+)/remove_port/(?P<rule>\d+)/$', PortDelete.as_view(),
        name='dashboard.views.remove-port'),
Kálmán Viktor committed
71 72
    url(r'^vm/(?P<pk>\d+)/$', VmDetailView.as_view(),
        name='dashboard.views.detail'),
73 74
    url(r'^vm/(?P<pk>\d+)/vnctoken/$', VmDetailVncTokenView.as_view(),
        name='dashboard.views.detail-vnc'),
75 76
    url(r'^vm/(?P<pk>\d+)/acl/$', AclUpdateView.as_view(model=Instance),
        name='dashboard.views.vm-acl'),
77 78
    url(r'^vm/(?P<pk>\d+)/tx/$', TransferOwnershipView.as_view(),
        name='dashboard.views.vm-transfer-ownership'),
Kálmán Viktor committed
79
    url(r'^vm/list/$', VmList.as_view(), name='dashboard.views.vm-list'),
80 81
    url(r'^vm/create/$', VmCreate.as_view(),
        name='dashboard.views.vm-create'),
82
    url(r'^vm/delete/(?P<pk>\d+)/$', VmDelete.as_view(),
Kálmán Viktor committed
83
        name="dashboard.views.delete-vm"),
84
    url(r'^vm/mass-delete/', VmMassDelete.as_view(),
85
        name='dashboard.view.mass-delete-vm'),
86
    url(r'^vm/(?P<pk>\d+)/activity/$', vm_activity),
87 88
    url(r'^vm/activity/(?P<pk>\d+)/$', InstanceActivityDetail.as_view(),
        name='dashboard.views.vm-activity'),
89 90
    url(r'^vm/(?P<pk>\d+)/screenshot/$', get_vm_screenshot,
        name='dashboard.views.vm-get-screenshot'),
91 92 93 94
    url(r'^vm/(?P<pk>\d+)/traits/$', VmTraitsUpdate.as_view(),
        name='dashboard.views.vm-traits'),
    url(r'^vm/(?P<pk>\d+)/raw_data/$', VmRawDataUpdate.as_view(),
        name='dashboard.views.vm-raw-data'),
95

96 97 98
    url(r'^node/list/$', NodeList.as_view(), name='dashboard.views.node-list'),
    url(r'^node/(?P<pk>\d+)/$', NodeDetailView.as_view(),
        name='dashboard.views.node-detail'),
99 100
    url(r'^node/(?P<pk>\d+)/add-trait/$', NodeAddTraitView.as_view(),
        name='dashboard.views.node-addtrait'),
101
    url(r'^tx/(?P<key>.*)/?$', TransferOwnershipConfirmView.as_view(),
102
        name='dashboard.views.vm-transfer-ownership-confirm'),
103 104
    url(r'^node/delete/(?P<pk>\d+)/$', NodeDelete.as_view(),
        name="dashboard.views.delete-node"),
105 106
    url(r'^node/status/(?P<pk>\d+)/$', NodeStatus.as_view(),
        name="dashboard.views.status-node"),
107 108
    url(r'^node/flush/(?P<pk>\d+)/$', NodeFlushView.as_view(),
        name="dashboard.views.flush-node"),
109 110
    url(r'^node/create/$', NodeCreate.as_view(),
        name='dashboard.views.node-create'),
111

112 113
    url(r'^favourite/$', FavouriteView.as_view(),
        name='dashboard.views.favourite'),
114 115
    url(r'^group/delete/(?P<pk>\d+)/$', GroupDelete.as_view(),
        name="dashboard.views.delete-group"),
116 117
    url(r'^group/list/$', GroupList.as_view(),
        name='dashboard.views.group-list'),
118
    url((r'^vm/(?P<pk>\d+)/graph/(?P<metric>cpu|memory|network)/'
119
         r'(?P<time>[0-9]{1,2}[hdwy])$'),
120 121
        VmGraphView.as_view(),
        name='dashboard.views.vm-graph'),
122 123 124 125
    url((r'^node/(?P<pk>\d+)/graph/(?P<metric>cpu|memory|network)/'
         r'(?P<time>[0-9]{1,2}[hdwy])$'),
        NodeGraphView.as_view(),
        name='dashboard.views.node-graph'),
126 127
    url(r'^group/(?P<pk>\d+)/$', GroupDetailView.as_view(),
        name='dashboard.views.group-detail'),
128 129
    url(r'^group/(?P<pk>\d+)/update/$', GroupProfileUpdate.as_view(),
        name='dashboard.views.group-update'),
130 131
    url(r'^group/(?P<pk>\d+)/acl/$', GroupAclUpdateView.as_view(),
        name='dashboard.views.group-acl'),
132 133
    url(r'^notifications/$', NotificationView.as_view(),
        name="dashboard.views.notifications"),
134

135 136
    url(r'^disk/(?P<pk>\d+)/remove/$', DiskRemoveView.as_view(),
        name="dashboard.views.disk-remove"),
137 138 139
    url(r'^disk/(?P<pk>\d+)/status/$', get_disk_download_status,
        name="dashboard.views.disk-status"),

140 141 142
    url(r'^interface/(?P<pk>\d+)/delete/$', InterfaceDeleteView.as_view(),
        name="dashboard.views.interface-delete"),

143
    url(r'^profile/$', MyPreferencesView.as_view(),
144
        name="dashboard.views.profile-preferences"),
145 146
    url(r'^subscribe/(?P<token>.*)/$', UnsubscribeFormView.as_view(),
        name="dashboard.views.unsubscribe"),
147
    url(r'^profile/(?P<username>[^/]+)/$', ProfileView.as_view(),
148
        name="dashboard.views.profile"),
149
    url(r'^profile/(?P<username>[^/]+)/use_gravatar/$', toggle_use_gravatar),
150

151
    url(r'^group/(?P<group_pk>\d+)/remove/acl/user/(?P<member_pk>\d+)/$',
152 153
        GroupRemoveAclUserView.as_view(),
        name="dashboard.views.remove-acluser"),
154
    url(r'^group/(?P<group_pk>\d+)/remove/acl/group/(?P<member_pk>\d+)/$',
155 156
        GroupRemoveAclGroupView.as_view(),
        name="dashboard.views.remove-aclgroup"),
157
    url(r'^group/(?P<group_pk>\d+)/remove/user/(?P<member_pk>\d+)/$',
158 159
        GroupRemoveUserView.as_view(),
        name="dashboard.views.remove-user"),
160 161 162
    url(r'^group/(?P<group_pk>\d+)/remove/futureuser/(?P<member_org_id>.+)/$',
        GroupRemoveFutureUserView.as_view(),
        name="dashboard.views.remove-future-user"),
163 164
    url(r'^group/create/$', GroupCreate.as_view(),
        name='dashboard.views.group-create'),
165 166 167
    url(r'^group/(?P<group_pk>\d+)/create/$',
        UserCreationView.as_view(),
        name="dashboard.views.create-user"),
168 169 170
    url(r'^group/(?P<group_pk>\d+)/permissions/$',
        GroupPermissionsView.as_view(),
        name="dashboard.views.group-permissions"),
171 172 173 174 175 176 177 178 179 180

    url(r'^sshkey/delete/(?P<pk>\d+)/$',
        UserKeyDelete.as_view(),
        name="dashboard.views.userkey-delete"),
    url(r'^sshkey/(?P<pk>\d+)/$',
        UserKeyDetail.as_view(),
        name="dashboard.views.userkey-detail"),
    url(r'^sshkey/create/$',
        UserKeyCreate.as_view(),
        name="dashboard.views.userkey-create"),
Kálmán Viktor committed
181
)