summaryrefslogtreecommitdiffstats
path: root/vio
diff options
context:
space:
mode:
Diffstat (limited to 'vio')
-rw-r--r--vio/vio/swagger/urls.py7
-rw-r--r--vio/vio/swagger/views/fakeplugin/heat/views.py31
2 files changed, 38 insertions, 0 deletions
diff --git a/vio/vio/swagger/urls.py b/vio/vio/swagger/urls.py
index c509a42..568b018 100644
--- a/vio/vio/swagger/urls.py
+++ b/vio/vio/swagger/urls.py
@@ -119,6 +119,8 @@ from vio.swagger.views.fakeplugin.neutron.views import FakeNeutronNetwork
from vio.swagger.views.fakeplugin.heat.views import FakeHeatResources
from vio.swagger.views.fakeplugin.heat.views import FakeHeatService
from vio.swagger.views.fakeplugin.heat.views import FakeHeatServicePreview
+from vio.swagger.views.fakeplugin.heat.views import FakeInfraWorkloadAPIGet
+from vio.swagger.views.fakeplugin.heat.views import FakeInfraWorkloadAPIPost
urlpatterns = [
@@ -215,6 +217,11 @@ urlpatterns = [
r'(?P<tenantid>[0-9a-z-A-Z\-\_]+)'
r'/stacks/(?P<stackName>[0-9a-z-A-Z\-\_]+)'
r'/(?P<stackID>[0-9a-z-A-Z\-\_]+)$', FakeHeatService.as_view()),
+ url(r'api/multicloud-vio/v[01]/vmware[_/]fake/infra_workload$',
+ FakeInfraWorkloadAPIPost.as_view()),
+ url(r'api/multicloud-vio/v[01]/vmware[_/]fake/infra_workload$'
+ r'/(?P<workload_id>[0-9a-z-A-Z\-\_]+)$',
+ FakeInfraWorkloadAPIGet.as_view()),
# vio
url(r'^api/multicloud-vio/v0/(?P<vimid>[0-9a-zA-Z_-]+)/'
diff --git a/vio/vio/swagger/views/fakeplugin/heat/views.py b/vio/vio/swagger/views/fakeplugin/heat/views.py
index b662378..9fe00be 100644
--- a/vio/vio/swagger/views/fakeplugin/heat/views.py
+++ b/vio/vio/swagger/views/fakeplugin/heat/views.py
@@ -101,3 +101,34 @@ class FakeHeatService(APIView):
status=data['error']['code'])
return Response(data=data, status=status.HTTP_204_NO_CONTENT)
+
+
+class FakeInfraWorkloadAPIGet(APIView):
+
+ def get(self, request, workload_id):
+ if workload_id != "fdae10c6-664c-48e2-9e86-7bc2d7e42c26":
+ return Response(status=status.HTTP_404_NOT_FOUND)
+
+ data = {
+ "template_type": "heat",
+ "workload_id": "fdae10c6-664c-48e2-9e86-7bc2d7e42c26",
+ }
+
+ return Response(data=data, status=status.HTTP_200_OK)
+
+ def delete(self, request, workload_id):
+ if workload_id != "fdae10c6-664c-48e2-9e86-7bc2d7e42c26":
+ return Response(status=status.HTTP_404_NOT_FOUND)
+
+ return Response(status=status.HTTP_204_NO_CONTENT)
+
+
+class FakeInfraWorkloadAPIPost(APIView):
+
+ def post(self, request):
+ data = {
+ "template_type": "heat",
+ "workload_id": "fdae10c6-664c-48e2-9e86-7bc2d7e42c26",
+ }
+
+ return Response(data=data, status=status.HTTP_200_OK)