summaryrefslogtreecommitdiffstats
path: root/pharos-dashboard/api/urls.py
diff options
context:
space:
mode:
authormaxbr <maxbr@mi.fu-berlin.de>2016-09-19 10:14:19 +0200
committermaxbr <maxbr@mi.fu-berlin.de>2016-09-19 10:14:19 +0200
commit100d67d065866c74954cb4b2135027a48e13d969 (patch)
tree699efcdb0bb0097161ebf2298e5994c2cf537a45 /pharos-dashboard/api/urls.py
parentd77560162ebf4805bab5eaaf051467590f2b414f (diff)
Add a REST API for the dashboard
JIRA: PHAROS-265 Change-Id: Ic1b2d20415b0b84473d5915c4f26f3e65bbb1ecf Signed-off-by: maxbr <maxbr@mi.fu-berlin.de>
Diffstat (limited to 'pharos-dashboard/api/urls.py')
-rw-r--r--pharos-dashboard/api/urls.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/pharos-dashboard/api/urls.py b/pharos-dashboard/api/urls.py
new file mode 100644
index 0000000..22f12eb
--- /dev/null
+++ b/pharos-dashboard/api/urls.py
@@ -0,0 +1,28 @@
+"""pharos_dashboard URL Configuration
+
+The `urlpatterns` list routes URLs to views. For more information please see:
+ https://docs.djangoproject.com/en/1.10/topics/http/urls/
+Examples:
+Function views
+ 1. Add an import: from my_app import views
+ 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
+Class-based views
+ 1. Add an import: from other_app.views import Home
+ 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
+Including another URLconf
+ 1. Import the include() function: from django.conf.urls import url, include
+ 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
+"""
+from django.conf.urls import url, include
+from rest_framework import routers
+
+from api.views import *
+
+router = routers.DefaultRouter()
+router.register(r'resources', ResourceViewSet)
+router.register(r'servers', ServerViewSet)
+router.register(r'bookings', BookingViewSet)
+
+urlpatterns = [
+ url(r'^', include(router.urls)),
+] \ No newline at end of file