summaryrefslogtreecommitdiffstats
path: root/multivimbroker
diff options
context:
space:
mode:
Diffstat (limited to 'multivimbroker')
-rw-r--r--multivimbroker/multivimbroker/forwarder/urls.py8
-rw-r--r--multivimbroker/multivimbroker/forwarder/views.py18
2 files changed, 25 insertions, 1 deletions
diff --git a/multivimbroker/multivimbroker/forwarder/urls.py b/multivimbroker/multivimbroker/forwarder/urls.py
index 5e1320e..b14333f 100644
--- a/multivimbroker/multivimbroker/forwarder/urls.py
+++ b/multivimbroker/multivimbroker/forwarder/urls.py
@@ -16,6 +16,7 @@
from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
+# API v0
from multivimbroker.forwarder.views import CheckCapacity
from multivimbroker.forwarder.views import Extension
from multivimbroker.forwarder.views import Forward
@@ -34,8 +35,10 @@ from multivimbroker.forwarder.views import APIv1Registry
from multivimbroker.forwarder.views import APIv1UnRegistry
from multivimbroker.forwarder.views import APIv1VIMTypes
from multivimbroker.forwarder.views import APIv1MultiPartView
+from multivimbroker.forwarder.views import APIv1InfraWorkload
urlpatterns = [
+ # API v0
url(r'^api/multicloud/v0/vim_types$',
VIMTypes.as_view()),
url(r'^api/multicloud/v0/check_vim_capacity$',
@@ -69,7 +72,7 @@ urlpatterns = [
url(r'^api/multicloud/v1/(?P<cloud_owner>[0-9a-zA-Z_-]+)'
r'/(?P<cloud_region_id>[0-9a-zA-Z_-]+)/registry$',
APIv1Registry.as_view()),
- url(r'^api/multicloud/v1/(?P<cloud_owner>[0-9a-zA-Z_-]+)i'
+ url(r'^api/multicloud/v1/(?P<cloud_owner>[0-9a-zA-Z_-]+)'
r'/(?P<cloud_region_id>[0-9a-zA-Z_-]+)$',
APIv1UnRegistry.as_view()),
url(r'^api/multicloud/v1/(?P<cloud_owner>[0-9a-zA-Z_-]+)'
@@ -81,6 +84,9 @@ urlpatterns = [
url(r'^api/multicloud/v1/(?P<cloud_owner>[0-9a-zA-Z_-]+)'
r'/(?P<cloud_region_id>[0-9a-zA-Z_-]+)',
APIv1Forward.as_view()),
+ url(r'^api/multicloud/v1/(?P<cloud_owner>[0-9a-zA-Z_-]+)'
+ r'/(?P<cloud_region_id>[0-9a-zA-Z_-]+)/infra_workload',
+ APIv1InfraWorkload.as_view()),
]
urlpatterns = format_suffix_patterns(urlpatterns)
diff --git a/multivimbroker/multivimbroker/forwarder/views.py b/multivimbroker/multivimbroker/forwarder/views.py
index ef7ab95..264692e 100644
--- a/multivimbroker/multivimbroker/forwarder/views.py
+++ b/multivimbroker/multivimbroker/forwarder/views.py
@@ -307,3 +307,21 @@ class APIv1MultiPartView(MultiPartView):
vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id)
return super(APIv1MultiPartView, self).post(request, vimid)
+
+
+class APIv1InfraWorkload(BaseServer):
+
+ def post(self, request, cloud_owner, cloud_region_id):
+ vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id)
+ return self.send(vimid, request.get_full_path(), request.body, "POST",
+ headers=originHeaders(request))
+
+ def get(self, request, cloud_owner, cloud_region_id):
+ vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id)
+ return self.send(vimid, request.get_full_path(), request.body, "GET",
+ headers=originHeaders(request))
+
+ def delete(self, request, cloud_owner, cloud_region_id):
+ vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id)
+ return self.send(vimid, request.get_full_path(), request.body,
+ "DELETE", headers=originHeaders(request))