diff options
-rw-r--r-- | vio/vio/swagger/urls.py | 64 | ||||
-rw-r--r-- | vio/vio/swagger/views/capacity/views.py | 6 | ||||
-rw-r--r-- | vio/vio/swagger/views/extensions/views.py | 6 | ||||
-rw-r--r-- | vio/vio/swagger/views/network/views.py | 20 | ||||
-rw-r--r-- | vio/vio/swagger/views/port/views.py | 20 | ||||
-rw-r--r-- | vio/vio/swagger/views/registry/views.py | 12 | ||||
-rw-r--r-- | vio/vio/swagger/views/service/views.py | 6 | ||||
-rw-r--r-- | vio/vio/swagger/views/subnet/views.py | 20 | ||||
-rw-r--r-- | vio/vio/swagger/views/tenant/views.py | 6 |
9 files changed, 152 insertions, 8 deletions
diff --git a/vio/vio/swagger/urls.py b/vio/vio/swagger/urls.py index 26f5e50..c909067 100644 --- a/vio/vio/swagger/urls.py +++ b/vio/vio/swagger/urls.py @@ -42,6 +42,13 @@ from vio.swagger.views.server.views import ListServersViewV1, GetServerViewV1 from vio.swagger.views.flavor.views import FlavorsViewV1, FlavorViewV1 from vio.swagger.views.limits.views import LimitsViewV1 from vio.swagger.views.hypervisor.views import HostViewV1 +from vio.swagger.views.service.views import HostsViewV1 +from vio.swagger.views.network.views import CreateNetworkViewV1 +from vio.swagger.views.network.views import DeleteNetworkViewV1 +from vio.swagger.views.subnet.views import CreateSubnetViewV1 +from vio.swagger.views.subnet.views import DeleteSubnetViewV1 +from vio.swagger.views.port.views import CreatePortViewV1, DeletePortViewV1 +from vio.swagger.views.tenant.views import ListTenantsViewV1 # proxy from vio.swagger.views.proxyplugin.identity.views import TokenView @@ -59,14 +66,14 @@ from vio.swagger.views.proxyplugin.dns.views import DesignateServer from vio.swagger.views.proxyplugin.dns.views import DesignateVersionLink # Registry -from vio.swagger.views.registry.views import Registry -from vio.swagger.views.registry.views import UnRegistry +from vio.swagger.views.registry.views import Registry, RegistryV1 +from vio.swagger.views.registry.views import UnRegistry, UnRegistryV1 # Capacity Check -from vio.swagger.views.capacity.views import CapacityCheck +from vio.swagger.views.capacity.views import CapacityCheck, CapacityCheckV1 # Extensions -from vio.swagger.views.extensions.views import Extensions +from vio.swagger.views.extensions.views import Extensions, ExtensionsV1 # fake from vio.swagger.views.fakeplugin.identity.views import FakeProjects @@ -175,6 +182,9 @@ urlpatterns = [ # V1 urls url(r'^api/multicloud-vio/v1/(?P<cloud_owner>[0-9a-zA-Z_-]+)/' + r'(?P<cloud_region>[0-9a-zA-Z_-]+)/tenants$', + ListTenantsViewV1.as_view()), + url(r'^api/multicloud-vio/v1/(?P<cloud_owner>[0-9a-zA-Z_-]+)/' r'(?P<cloud_region>[0-9a-zA-Z_-]+)/(?P<tenantid>[0-9a-zA-Z_-]+)/' r'images$', CreateListImagesViewV1.as_view()), @@ -214,14 +224,41 @@ urlpatterns = [ r'(?P<cloud_region>[0-9a-zA-Z_-]+)/(?P<tenantid>[0-9a-zA-Z]+)/' r'flavors/(?P<flavorid>[0-9a-zA-Z_-]+)$', FlavorViewV1.as_view()), - url(r'^api/multicloud-vio/v0/(?P<cloud_owner>[0-9a-zA-Z_-]+)/' + url(r'^api/multicloud-vio/v1/(?P<cloud_owner>[0-9a-zA-Z_-]+)/' r'(?P<cloud_region>[0-9a-zA-Z_-]+)/(?P<tenantid>[0-9a-zA-Z]+)/' r'limits$', LimitsViewV1.as_view()), url(r'^api/multicloud-vio/v1/(?P<cloud_owner>[0-9a-zA-Z_-]+)/' + r'(?P<cloud_region>[0-9a-zA-Z_-]+)/(?P<tenantid>[0-9a-zA-Z]+)/hosts$', + HostsViewV1.as_view()), + url(r'^api/multicloud-vio/v1/(?P<cloud_owner>[0-9a-zA-Z_-]+)/' r'(?P<cloud_region>[0-9a-zA-Z_-]+)/(?P<tenantid>[0-9a-zA-Z]+)/' r'hosts/(?P<hostname>[0-9a-zA-Z_-]+)$', HostViewV1.as_view()), + url(r'^api/multicloud-vio/v1/(?P<cloud_owner>[0-9a-zA-Z\-\_]+)/' + r'(?P<cloud_region>[0-9a-zA-Z_-]+)/(?P<tenantid>[0-9a-zA-Z\-\_]+)/' + r'networks$', + CreateNetworkViewV1.as_view()), + url(r'^api/multicloud-vio/v1/(?P<cloud_owner>[0-9a-zA-Z\-\_]+)/' + r'(?P<cloud_region>[0-9a-zA-Z_-]+)/(?P<tenantid>[0-9a-zA-Z\-\_]+)/' + r'networks/(?P<networkid>[0-9a-zA-Z\-\_]+)$', + DeleteNetworkViewV1.as_view()), + url(r'^api/multicloud-vio/v1/(?P<cloud_owner>[0-9a-zA-Z\-\_]+)/' + r'(?P<cloud_region>[0-9a-zA-Z_-]+)/(?P<tenantid>[0-9a-zA-Z\-\_]+)/' + r'subnets$', + CreateSubnetViewV1.as_view()), + url(r'^api/multicloud-vio/v1/(?P<cloud_owner>[0-9a-zA-Z\-\_]+)/' + r'(?P<cloud_region>[0-9a-zA-Z_-]+)/(?P<tenantid>[0-9a-zA-Z\-\_]+)/' + r'subnets/(?P<subnetid>[0-9a-zA-Z\-\_]+)$', + DeleteSubnetViewV1.as_view()), + url(r'^api/multicloud-vio/v1/(?P<cloud_owner>[0-9a-zA-Z\-\_]+)/' + r'(?P<cloud_region>[0-9a-zA-Z_-]+)/(?P<tenantid>[0-9a-zA-Z\-\_]+)/' + r'ports$', + CreatePortViewV1.as_view()), + url(r'^api/multicloud-vio/v1/(?P<cloud_owner>[0-9a-zA-Z\-\_]+)/' + r'(?P<cloud_region>[0-9a-zA-Z_-]+)/(?P<tenantid>[0-9a-zA-Z\-\_]+)/' + r'ports/(?P<portid>[0-9a-zA-Z\-\_]+)$', + DeletePortViewV1.as_view()), # fake urls url(r'^api/multicloud-vio/v0/vmware_fake/identity/v3', @@ -313,10 +350,19 @@ urlpatterns = [ Registry.as_view()), url(r'^api/multicloud-vio/v0/(?P<vimid>[0-9a-z-A-Z\-\_]+)$', UnRegistry.as_view()), + url(r'^api/multicloud-vio/v1/(?P<cloud_owner>[0-9a-z-A-Z\-\_]+)/' + r'(?P<cloud_region>[0-9a-z-A-Z\-\_]+)/registry$', + RegistryV1.as_view()), + url(r'^api/multicloud-vio/v1/(?P<cloud_owner>[0-9a-z-A-Z\-\_]+)/' + r'(?P<cloud_region>[0-9a-z-A-Z\-\_]+)$', + UnRegistryV1.as_view()), # CapacityCheck url(r'^api/multicloud-vio/v0/(?P<vimid>[0-9a-z-A-Z\-\_]+)/capacity_check$', CapacityCheck.as_view()), + url(r'^api/multicloud-vio/v1/(?P<cloud_owner>[0-9a-z-A-Z\-\_]+)/' + r'(?P<cloud_region>[0-9a-z-A-Z\-\_]+)/capacity_check$', + CapacityCheckV1.as_view()), # proxy url(r'^api/multicloud-vio/v0/(?P<vimid>[0-9a-z-A-Z\-\_]+)/identity/v3', @@ -380,10 +426,12 @@ urlpatterns = [ DesignateServer.as_view()), # Extensions - url( - (r'^api/multicloud-vio/v0/(?P<vimid>[0-9a-z-A-Z\-\_]+)' - r'/extensions$'), + url(r'^api/multicloud-vio/v0/(?P<vimid>[0-9a-z-A-Z\-\_]+)' + r'/extensions$', Extensions.as_view()), + url(r'^api/multicloud-vio/v1/(?P<cloud_owner>[0-9a-z-A-Z\-\_]+)/' + r'(?P<cloud_region>[0-9a-z-A-Z\-\_]+)/extensions$', + ExtensionsV1.as_view()), ] diff --git a/vio/vio/swagger/views/capacity/views.py b/vio/vio/swagger/views/capacity/views.py index 1fdc481..f679931 100644 --- a/vio/vio/swagger/views/capacity/views.py +++ b/vio/vio/swagger/views/capacity/views.py @@ -121,3 +121,9 @@ class CapacityCheck(APIView): return Response(data={'result': True}, status=status.HTTP_200_OK) return Response(data={'result': False}, status=status.HTTP_200_OK) + + +class CapacityCheckV1(CapacityCheck): + def post(self, request, cloud_owner, cloud_region): + return super(CapacityCheckV1, self).post( + request, cloud_owner + "_" + cloud_region) diff --git a/vio/vio/swagger/views/extensions/views.py b/vio/vio/swagger/views/extensions/views.py index e590615..b3c7c5c 100644 --- a/vio/vio/swagger/views/extensions/views.py +++ b/vio/vio/swagger/views/extensions/views.py @@ -23,3 +23,9 @@ class Extensions(APIView): def get(self, request, vimid): return Response(data={'extensions': []}, status=status.HTTP_200_OK) + + +class ExtensionsV1(Extensions): + def get(self, request, cloud_owner, cloud_region): + return super(ExtensionsV1, self).get( + request, cloud_owner + "_" + cloud_region) diff --git a/vio/vio/swagger/views/network/views.py b/vio/vio/swagger/views/network/views.py index 27d0f3a..6d182e2 100644 --- a/vio/vio/swagger/views/network/views.py +++ b/vio/vio/swagger/views/network/views.py @@ -74,6 +74,16 @@ class CreateNetworkView(APIView): status=status.HTTP_500_INTERNAL_SERVER_ERROR) +class CreateNetworkViewV1(CreateNetworkView): + def post(self, request, cloud_owner, cloud_region, tenantid): + return super(CreateNetworkViewV1, self).post( + request, cloud_owner + "_" + cloud_region, tenantid) + + def get(self, request, cloud_owner, cloud_region, tenantid): + return super(CreateNetworkViewV1, self).get( + request, cloud_owner + "_" + cloud_region, tenantid) + + class DeleteNetworkView(APIView): def get(self, request, vimid, tenantid, networkid): @@ -119,3 +129,13 @@ class DeleteNetworkView(APIView): else: return Response(data={'error': str(e)}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) + + +class DeleteNetworkViewV1(DeleteNetworkView): + def get(self, request, cloud_owner, cloud_region, tenantid, networkid): + return super(DeleteNetworkViewV1, self).get( + request, cloud_owner + "_" + cloud_region, tenantid, networkid) + + def delete(self, request, cloud_owner, cloud_region, tenantid, networkid): + return super(DeleteNetworkViewV1, self).delete( + request, cloud_owner + "_" + cloud_region, tenantid, networkid) diff --git a/vio/vio/swagger/views/port/views.py b/vio/vio/swagger/views/port/views.py index 249e7c3..33d633d 100644 --- a/vio/vio/swagger/views/port/views.py +++ b/vio/vio/swagger/views/port/views.py @@ -75,6 +75,16 @@ class CreatePortView(APIView): status=status.HTTP_500_INTERNAL_SERVER_ERROR) +class CreatePortViewV1(CreatePortView): + def post(self, request, cloud_owner, cloud_region, tenantid): + return super(CreatePortViewV1, self).post( + request, cloud_owner + "_" + cloud_region, tenantid) + + def get(self, request, cloud_owner, cloud_region, tenantid): + return super(CreatePortViewV1, self).get( + request, cloud_owner + "_" + cloud_region, tenantid) + + class DeletePortView(APIView): def get(self, request, vimid, tenantid, portid): @@ -104,3 +114,13 @@ class DeletePortView(APIView): else: return Response(data={'error': str(e)}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) + + +class DeletePortViewV1(DeletePortView): + def get(self, request, cloud_owner, cloud_region, tenantid, portid): + return super(DeletePortViewV1, self).get( + request, cloud_owner + "_" + cloud_region, tenantid, portid) + + def delete(self, request, cloud_owner, cloud_region, tenantid, portid): + return super(DeletePortViewV1, self).delete( + request, cloud_owner + "_" + cloud_region, tenantid, portid) diff --git a/vio/vio/swagger/views/registry/views.py b/vio/vio/swagger/views/registry/views.py index 6e23739..cac49e7 100644 --- a/vio/vio/swagger/views/registry/views.py +++ b/vio/vio/swagger/views/registry/views.py @@ -158,6 +158,12 @@ class Registry(APIView): return Response(data="", status=status.HTTP_200_OK) +class RegistryV1(Registry): + def post(self, request, cloud_owner, cloud_region): + return super(RegistryV1, self).post( + request, cloud_owner + "_" + cloud_region) + + class UnRegistry(APIView): def delete(self, request, vimid): @@ -170,3 +176,9 @@ class UnRegistry(APIView): return Response(data=e.message, status=status.HTTP_500_INTERNAL_SERVER_ERROR) return Response(data="", status=status.HTTP_204_NO_CONTENT) + + +class UnRegistryV1(UnRegistry): + def delete(self, request, cloud_owner, cloud_region): + return super(UnRegistryV1, self).delete( + request, cloud_owner + "_" + cloud_region) diff --git a/vio/vio/swagger/views/service/views.py b/vio/vio/swagger/views/service/views.py index b632370..239e795 100644 --- a/vio/vio/swagger/views/service/views.py +++ b/vio/vio/swagger/views/service/views.py @@ -53,3 +53,9 @@ class HostsView(APIView): 'hosts': hosts} return Response(data=rsp, status=status.HTTP_200_OK) + + +class HostsViewV1(HostsView): + def get(self, request, cloud_owner, cloud_region, tenantid): + return super(HostsViewV1, self).get( + request, cloud_owner + "_" + cloud_region, tenantid) diff --git a/vio/vio/swagger/views/subnet/views.py b/vio/vio/swagger/views/subnet/views.py index 4da8842..c8c412c 100644 --- a/vio/vio/swagger/views/subnet/views.py +++ b/vio/vio/swagger/views/subnet/views.py @@ -75,6 +75,16 @@ class CreateSubnetView(APIView): status=status.HTTP_500_INTERNAL_SERVER_ERROR) +class CreateSubnetViewV1(CreateSubnetView): + def post(self, request, cloud_owner, cloud_region, tenantid): + return super(CreateSubnetViewV1, self).post( + request, cloud_owner + "_" + cloud_region, tenantid) + + def get(self, request, cloud_owner, cloud_region, tenantid): + return super(CreateSubnetViewV1, self).get( + request, cloud_owner + "_" + cloud_region, tenantid) + + class DeleteSubnetView(APIView): def get(self, request, vimid, tenantid, subnetid): @@ -104,3 +114,13 @@ class DeleteSubnetView(APIView): else: return Response(data={'error': str(e)}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) + + +class DeleteSubnetViewV1(DeleteSubnetView): + def get(self, request, cloud_owner, cloud_region, tenantid, subnetid): + return super(DeleteSubnetViewV1, self).get( + request, cloud_owner + "_" + cloud_region, tenantid, subnetid) + + def delete(self, request, cloud_owner, cloud_region, tenantid, subnetid): + return super(DeleteSubnetViewV1, self).delete( + request, cloud_owner + "_" + cloud_region, tenantid, subnetid) diff --git a/vio/vio/swagger/views/tenant/views.py b/vio/vio/swagger/views/tenant/views.py index 004fbbf..0ee58df 100644 --- a/vio/vio/swagger/views/tenant/views.py +++ b/vio/vio/swagger/views/tenant/views.py @@ -60,3 +60,9 @@ class ListTenantsView(APIView): tenant['name'] = project.name rsp['tenants'].append(tenant) return Response(data=rsp, status=status.HTTP_200_OK) + + +class ListTenantsViewV1(ListTenantsView): + def get(self, request, cloud_owner, cloud_region): + return super(ListTenantsViewV1, self).get( + request, cloud_owner + "_" + cloud_region) |