Remove vfc-gvnfm-vnfmgr openo labels 51/7051/1
authorying.yunlong <ying.yunlong@zte.com.cn>
Wed, 9 Aug 2017 01:28:02 +0000 (09:28 +0800)
committerying.yunlong <ying.yunlong@zte.com.cn>
Wed, 9 Aug 2017 01:28:02 +0000 (09:28 +0800)
As the seed code comes from openo, there are many
openo labels in vfc-gvnfm-vnfmgr, for example, in
the Rest URL, now remove the openo labels.

Change-Id: I7859ad948a10dc9f3e928d35a65733a2579322df
Issue-ID: VFC-85
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
mgr/mgr/pub/config/config.py
mgr/mgr/swagger/swagger.json
mgr/mgr/swagger/tests.py
mgr/mgr/swagger/urls.py
mgr/mgr/vnfreg/tests.py
mgr/mgr/vnfreg/urls.py

index eff591f..3e10230 100644 (file)
@@ -31,11 +31,11 @@ DB_PASSWD = "gvnfm"
 
 # [register]
 REG_TO_MSB_WHEN_START = True
-REG_TO_MSB_REG_URL = "/openoapi/microservices/v1/services"
+REG_TO_MSB_REG_URL = "/api/microservices/v1/services"
 REG_TO_MSB_REG_PARAM = {
     "serviceName": "vnfmgr",
     "version": "v1",
-    "url": "/openoapi/vnfmgr/v1",
+    "url": "/api/vnfmgr/v1",
     "protocol": "REST",
     "visualRange": "1",
     "nodes": [{
index 552d26f..743612b 100644 (file)
@@ -4,7 +4,7 @@
     "version": "1.0.0",
     "title": "VNF Mgr Service rest API"
   },
-  "basePath": "/openoapi/vnfmgr/v1",
+  "basePath": "/api/vnfmgr/v1",
   "tags": [
     {
       "name": "vnfmgr"
index adf4a78..3aed49b 100644 (file)
@@ -26,6 +26,6 @@ class SwaggerViewTest(unittest.TestCase):
         pass
 
     def test_sample(self):
-        response = self.client.get("/openoapi/vnfmgr/v1/swagger.json")
+        response = self.client.get("/api/vnfmgr/v1/swagger.json")
         self.assertEqual(status.HTTP_200_OK, response.status_code, response.content)
 
index 21f7b8e..587dd14 100644 (file)
@@ -16,5 +16,5 @@ from django.conf.urls import url
 from mgr.swagger import views
 
 urlpatterns = [
-    url(r'^openoapi/vnfmgr/v1/swagger.json$', views.SwaggerView.as_view()), 
+    url(r'^api/vnfmgr/v1/swagger.json$', views.SwaggerView.as_view()),
 ]
index 11bfd6c..c831489 100644 (file)
@@ -105,7 +105,7 @@ class VnfRegTest(unittest.TestCase):
         pass
 
     def test_add_vnf_normal(self):
-        response = self.client.post("/openoapi/vnfmgr/v1/vnfs", self.vnfInst1, format='json')
+        response = self.client.post("/api/vnfmgr/v1/vnfs", self.vnfInst1, format='json')
         self.assertEqual(status.HTTP_201_CREATED, response.status_code, response.content)
         vnfs = VnfRegModel.objects.filter()
         self.assertEqual(1, len(vnfs))
@@ -119,14 +119,14 @@ class VnfRegTest(unittest.TestCase):
         self.assertEqual(self.vnfInst1, vnfInstActual)
         
     def test_add_vnf_when_duplicate(self):
-        self.client.post("/openoapi/vnfmgr/v1/vnfs", self.vnfInst1, format='json')
-        response = self.client.post("/openoapi/vnfmgr/v1/vnfs", self.vnfInst1, format='json')
+        self.client.post("/api/vnfmgr/v1/vnfs", self.vnfInst1, format='json')
+        response = self.client.post("/api/vnfmgr/v1/vnfs", self.vnfInst1, format='json')
         self.assertEqual(status.HTTP_500_INTERNAL_SERVER_ERROR, response.status_code, response.content)
         self.assertEqual({'error': "Vnf(1) already exists."}, json.loads(response.content))
         
     def test_set_vnf_normal(self):
-        self.client.post("/openoapi/vnfmgr/v1/vnfs", self.vnfInst1, format='json')
-        response = self.client.put("/openoapi/vnfmgr/v1/vnfs/1", 
+        self.client.post("/api/vnfmgr/v1/vnfs", self.vnfInst1, format='json')
+        response = self.client.put("/api/vnfmgr/v1/vnfs/1",
             json.dumps(self.vnfInst1_new), content_type='application/json')
         self.assertEqual(status.HTTP_202_ACCEPTED, response.status_code, response.content)
         vnfs = VnfRegModel.objects.filter()
@@ -141,40 +141,40 @@ class VnfRegTest(unittest.TestCase):
         self.assertEqual(self.vnfInst1_new, vnfInstActual)
         
     def test_set_vnf_when_not_exist(self):
-        response = self.client.put("/openoapi/vnfmgr/v1/vnfs/1", 
+        response = self.client.put("/api/vnfmgr/v1/vnfs/1",
             json.dumps(self.vnfInst1_new), content_type='application/json')
         self.assertEqual(status.HTTP_404_NOT_FOUND, response.status_code, response.content)
         self.assertEqual({'error': "Vnf(1) does not exist."}, json.loads(response.content))
         
     def test_get_vnf_normal(self):
-        self.client.post("/openoapi/vnfmgr/v1/vnfs", self.vnfInst1, format='json')
-        response = self.client.get("/openoapi/vnfmgr/v1/vnfs/1")
+        self.client.post("/api/vnfmgr/v1/vnfs", self.vnfInst1, format='json')
+        response = self.client.get("/api/vnfmgr/v1/vnfs/1")
         self.assertEqual(status.HTTP_200_OK, response.status_code, response.content)
         self.assertEqual(self.vnfInst1, json.loads(response.content))
         
     def test_get_vnf_when_not_exist(self):
-        response = self.client.get("/openoapi/vnfmgr/v1/vnfs/1")
+        response = self.client.get("/api/vnfmgr/v1/vnfs/1")
         self.assertEqual(status.HTTP_404_NOT_FOUND, response.status_code, response.content)
         self.assertEqual({'error': "Vnf(1) does not exist."}, json.loads(response.content))
         
     def test_del_vnf_normal(self):
-        self.client.post("/openoapi/vnfmgr/v1/vnfs", self.vnfInst1, format='json')
-        response = self.client.delete("/openoapi/vnfmgr/v1/vnfs/1")
+        self.client.post("/api/vnfmgr/v1/vnfs", self.vnfInst1, format='json')
+        response = self.client.delete("/api/vnfmgr/v1/vnfs/1")
         self.assertEqual(status.HTTP_204_NO_CONTENT, response.status_code, response.content)
         
     def test_del_vnf_when_not_exist(self):
-        response = self.client.delete("/openoapi/vnfmgr/v1/vnfs/1")
+        response = self.client.delete("/api/vnfmgr/v1/vnfs/1")
         self.assertEqual(status.HTTP_404_NOT_FOUND, response.status_code, response.content)
         self.assertEqual({'error': "Vnf(1) does not exist."}, json.loads(response.content))
         
     @mock.patch.object(restcall, 'call_req')
     def test_vnf_config_normal(self, mock_call_req):
         mock_call_req.return_value = [0, "", '204']
-        self.client.post("/openoapi/vnfmgr/v1/vnfs", self.vnfInst1, format='json')
-        response = self.client.post("/openoapi/vnfmgr/v1/configuration", self.vnfconfig, format='json')
+        self.client.post("/api/vnfmgr/v1/vnfs", self.vnfInst1, format='json')
+        response = self.client.post("/api/vnfmgr/v1/configuration", self.vnfconfig, format='json')
         self.assertEqual(status.HTTP_202_ACCEPTED, response.status_code, response.content)
         
     def test_vnf_config_when_not_exist(self):
-        response = self.client.post("/openoapi/vnfmgr/v1/configuration", self.vnfconfig, format='json')
+        response = self.client.post("/api/vnfmgr/v1/configuration", self.vnfconfig, format='json')
         self.assertEqual(status.HTTP_500_INTERNAL_SERVER_ERROR, response.status_code, response.content)
         self.assertEqual({'error': "Vnf(1) does not exist."}, json.loads(response.content))
index c2d3e0c..84b4ad1 100644 (file)
@@ -17,9 +17,9 @@ from rest_framework.urlpatterns import format_suffix_patterns
 from mgr.vnfreg import views
 
 urlpatterns = [
-    url(r'^openoapi/vnfmgr/v1/vnfs$', views.add_vnf, name='add_vnf'),
-    url(r'^openoapi/vnfmgr/v1/vnfs/(?P<vnfInstId>[0-9a-zA-Z\-\_]+)$', views.access_vnf, name='access_vnf'),
-    url(r'^openoapi/vnfmgr/v1/configuration$', views.vnf_config, name='vnf_config'),
+    url(r'^api/vnfmgr/v1/vnfs$', views.add_vnf, name='add_vnf'),
+    url(r'^api/vnfmgr/v1/vnfs/(?P<vnfInstId>[0-9a-zA-Z\-\_]+)$', views.access_vnf, name='access_vnf'),
+    url(r'^api/vnfmgr/v1/configuration$', views.vnf_config, name='vnf_config'),
 ]
 
 urlpatterns = format_suffix_patterns(urlpatterns)