urls.py 9.66 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
import autocomplete_light
22
from vm.models import Instance
23
from .views import (
24
    AclUpdateView, FavouriteView, GroupAclUpdateView, GroupDelete,
25
    GroupDetailView, GroupList, IndexView,
26 27
    InstanceActivityDetail, LeaseCreate, LeaseDelete, LeaseDetail,
    MyPreferencesView, NodeAddTraitView, NodeCreate, NodeDelete,
28
    NodeDetailView, NodeFlushView, NodeList, NodeStatus,
29 30
    NotificationView, PortDelete, TemplateAclUpdateView, TemplateCreate,
    TemplateDelete, TemplateDetail, TemplateList, TransferOwnershipConfirmView,
31
    TransferOwnershipView, vm_activity, VmCreate, VmDetailView,
32
    VmDetailVncTokenView, VmList,
33
    DiskRemoveView, get_disk_download_status, InterfaceDeleteView,
34
    GroupRemoveUserView,
35
    GroupRemoveFutureUserView,
36
    GroupCreate, GroupProfileUpdate,
37
    TemplateChoose,
38
    UserCreationView,
39
    get_vm_screenshot,
40
    ProfileView, toggle_use_gravatar, UnsubscribeFormView,
41
    UserKeyDelete, UserKeyDetail, UserKeyCreate,
42
    ConnectCommandDelete, ConnectCommandDetail, ConnectCommandCreate,
43
    StoreList, store_download, store_upload, store_get_upload_url, StoreRemove,
44
    store_new_directory, store_refresh_toplist,
45 46
    VmTraitsUpdate, VmRawDataUpdate,
    GroupPermissionsView,
47
    LeaseAclUpdateView,
48
    ClientCheck, TokenLogin,
49
    VmGraphView, NodeGraphView, NodeListGraphView,
50
)
51

52 53
autocomplete_light.autodiscover()

Kálmán Viktor committed
54 55
urlpatterns = patterns(
    '',
Kálmán Viktor committed
56
    url(r'^$', IndexView.as_view(), name="dashboard.index"),
57 58
    url(r'^lease/(?P<pk>\d+)/$', LeaseDetail.as_view(),
        name="dashboard.views.lease-detail"),
59 60
    url(r'^lease/create/$', LeaseCreate.as_view(),
        name="dashboard.views.lease-create"),
61 62
    url(r'^lease/delete/(?P<pk>\d+)/$', LeaseDelete.as_view(),
        name="dashboard.views.lease-delete"),
63 64
    url(r'^lease/(?P<pk>\d+)/acl/$', LeaseAclUpdateView.as_view(),
        name="dashboard.views.lease-acl"),
65

66 67
    url(r'^template/create/$', TemplateCreate.as_view(),
        name="dashboard.views.template-create"),
68 69
    url(r'^template/choose/$', TemplateChoose.as_view(),
        name="dashboard.views.template-choose"),
70 71
    url(r'template/(?P<pk>\d+)/acl/$', TemplateAclUpdateView.as_view(),
        name='dashboard.views.template-acl'),
72 73
    url(r'^template/(?P<pk>\d+)/$', TemplateDetail.as_view(),
        name='dashboard.views.template-detail'),
74 75
    url(r"^template/list/$", TemplateList.as_view(),
        name="dashboard.views.template-list"),
76 77
    url(r"^template/delete/(?P<pk>\d+)/$", TemplateDelete.as_view(),
        name="dashboard.views.template-delete"),
78

79
    url(r'^vm/', include('dashboard.vm.urls')),
80 81
    url(r'^vm/(?P<pk>\d+)/remove_port/(?P<rule>\d+)/$', PortDelete.as_view(),
        name='dashboard.views.remove-port'),
Kálmán Viktor committed
82 83
    url(r'^vm/(?P<pk>\d+)/$', VmDetailView.as_view(),
        name='dashboard.views.detail'),
84 85
    url(r'^vm/(?P<pk>\d+)/vnctoken/$', VmDetailVncTokenView.as_view(),
        name='dashboard.views.detail-vnc'),
86 87
    url(r'^vm/(?P<pk>\d+)/acl/$', AclUpdateView.as_view(model=Instance),
        name='dashboard.views.vm-acl'),
88 89
    url(r'^vm/(?P<pk>\d+)/tx/$', TransferOwnershipView.as_view(),
        name='dashboard.views.vm-transfer-ownership'),
Kálmán Viktor committed
90
    url(r'^vm/list/$', VmList.as_view(), name='dashboard.views.vm-list'),
91 92
    url(r'^vm/create/$', VmCreate.as_view(),
        name='dashboard.views.vm-create'),
93
    url(r'^vm/(?P<pk>\d+)/activity/$', vm_activity),
94 95
    url(r'^vm/activity/(?P<pk>\d+)/$', InstanceActivityDetail.as_view(),
        name='dashboard.views.vm-activity'),
96 97
    url(r'^vm/(?P<pk>\d+)/screenshot/$', get_vm_screenshot,
        name='dashboard.views.vm-get-screenshot'),
98 99 100 101
    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'),
102

103 104 105
    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'),
106 107
    url(r'^node/(?P<pk>\d+)/add-trait/$', NodeAddTraitView.as_view(),
        name='dashboard.views.node-addtrait'),
108
    url(r'^tx/(?P<key>.*)/?$', TransferOwnershipConfirmView.as_view(),
109
        name='dashboard.views.vm-transfer-ownership-confirm'),
110 111
    url(r'^node/delete/(?P<pk>\d+)/$', NodeDelete.as_view(),
        name="dashboard.views.delete-node"),
112 113
    url(r'^node/status/(?P<pk>\d+)/$', NodeStatus.as_view(),
        name="dashboard.views.status-node"),
114 115
    url(r'^node/flush/(?P<pk>\d+)/$', NodeFlushView.as_view(),
        name="dashboard.views.flush-node"),
116 117
    url(r'^node/create/$', NodeCreate.as_view(),
        name='dashboard.views.node-create'),
118

119 120
    url(r'^favourite/$', FavouriteView.as_view(),
        name='dashboard.views.favourite'),
121 122
    url(r'^group/delete/(?P<pk>\d+)/$', GroupDelete.as_view(),
        name="dashboard.views.delete-group"),
123 124
    url(r'^group/list/$', GroupList.as_view(),
        name='dashboard.views.group-list'),
125
    url((r'^vm/(?P<pk>\d+)/graph/(?P<metric>[a-z]+)/'
126
         r'(?P<time>[0-9]{1,2}[hdwy])$'),
127 128
        VmGraphView.as_view(),
        name='dashboard.views.vm-graph'),
129
    url((r'^node/(?P<pk>\d+)/graph/(?P<metric>[a-z]+)/'
130 131 132
         r'(?P<time>[0-9]{1,2}[hdwy])$'),
        NodeGraphView.as_view(),
        name='dashboard.views.node-graph'),
133 134 135 136
    url((r'^node/graph/(?P<metric>[a-z]+)/'
         r'(?P<time>[0-9]{1,2}[hdwy])$'),
        NodeListGraphView.as_view(),
        name='dashboard.views.node-list-graph'),
137 138
    url(r'^group/(?P<pk>\d+)/$', GroupDetailView.as_view(),
        name='dashboard.views.group-detail'),
139 140
    url(r'^group/(?P<pk>\d+)/update/$', GroupProfileUpdate.as_view(),
        name='dashboard.views.group-update'),
141 142
    url(r'^group/(?P<pk>\d+)/acl/$', GroupAclUpdateView.as_view(),
        name='dashboard.views.group-acl'),
143 144
    url(r'^notifications/$', NotificationView.as_view(),
        name="dashboard.views.notifications"),
145

146 147
    url(r'^disk/(?P<pk>\d+)/remove/$', DiskRemoveView.as_view(),
        name="dashboard.views.disk-remove"),
148 149 150
    url(r'^disk/(?P<pk>\d+)/status/$', get_disk_download_status,
        name="dashboard.views.disk-status"),

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

154
    url(r'^profile/$', MyPreferencesView.as_view(),
155
        name="dashboard.views.profile-preferences"),
156 157
    url(r'^subscribe/(?P<token>.*)/$', UnsubscribeFormView.as_view(),
        name="dashboard.views.unsubscribe"),
158
    url(r'^profile/(?P<username>[^/]+)/$', ProfileView.as_view(),
159
        name="dashboard.views.profile"),
160
    url(r'^profile/(?P<username>[^/]+)/use_gravatar/$', toggle_use_gravatar),
161

162
    url(r'^group/(?P<group_pk>\d+)/remove/user/(?P<member_pk>\d+)/$',
163 164
        GroupRemoveUserView.as_view(),
        name="dashboard.views.remove-user"),
165 166 167
    url(r'^group/(?P<group_pk>\d+)/remove/futureuser/(?P<member_org_id>.+)/$',
        GroupRemoveFutureUserView.as_view(),
        name="dashboard.views.remove-future-user"),
168 169
    url(r'^group/create/$', GroupCreate.as_view(),
        name='dashboard.views.group-create'),
170 171 172
    url(r'^group/(?P<group_pk>\d+)/create/$',
        UserCreationView.as_view(),
        name="dashboard.views.create-user"),
173 174 175
    url(r'^group/(?P<group_pk>\d+)/permissions/$',
        GroupPermissionsView.as_view(),
        name="dashboard.views.group-permissions"),
176 177 178 179 180 181 182 183 184 185

    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
186

187 188
    url(r'^conncmd/delete/(?P<pk>\d+)/$',
        ConnectCommandDelete.as_view(),
189
        name="dashboard.views.connect-command-delete"),
190 191
    url(r'^conncmd/(?P<pk>\d+)/$',
        ConnectCommandDetail.as_view(),
192
        name="dashboard.views.connect-command-detail"),
193 194
    url(r'^conncmd/create/$',
        ConnectCommandCreate.as_view(),
195
        name="dashboard.views.connect-command-create"),
196

197
    url(r'^autocomplete/', include('autocomplete_light.urls')),
198

Kálmán Viktor committed
199
    url(r"^store/list/$", StoreList.as_view(),
200 201 202
        name="dashboard.views.store-list"),
    url(r"^store/download/$", store_download,
        name="dashboard.views.store-download"),
203 204
    url(r"^store/upload/url$", store_get_upload_url,
        name="dashboard.views.store-upload-url"),
205 206
    url(r"^store/upload/$", store_upload,
        name="dashboard.views.store-upload"),
207 208
    url(r"^store/remove/$", StoreRemove.as_view(),
        name="dashboard.views.store-remove"),
209 210
    url(r"^store/new_directory/$", store_new_directory,
        name="dashboard.views.store-new-directory"),
Kálmán Viktor committed
211 212
    url(r"^store/refresh_toplist$", store_refresh_toplist,
        name="dashboard.views.store-refresh-toplist"),
213 214
    url(r"^client/check$", ClientCheck.as_view(),
        name="dashboard.views.client-check"),
215 216
    url(r'^token-login/(?P<token>.*)/$', TokenLogin.as_view(),
        name="dashboard.views.token-login"),
Kálmán Viktor committed
217
)