summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mgr/mgr/pub/config/config.py4
-rw-r--r--mgr/mgr/swagger/swagger.json2
-rw-r--r--mgr/mgr/swagger/tests.py2
-rw-r--r--mgr/mgr/swagger/urls.py2
-rw-r--r--mgr/mgr/vnfreg/tests.py30
-rw-r--r--mgr/mgr/vnfreg/urls.py6
6 files changed, 23 insertions, 23 deletions
diff --git a/mgr/mgr/pub/config/config.py b/mgr/mgr/pub/config/config.py
index eff591f..3e10230 100644
--- a/mgr/mgr/pub/config/config.py
+++ b/mgr/mgr/pub/config/config.py
@@ -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": [{
diff --git a/mgr/mgr/swagger/swagger.json b/mgr/mgr/swagger/swagger.json
index 552d26f..743612b 100644
--- a/mgr/mgr/swagger/swagger.json
+++ b/mgr/mgr/swagger/swagger.json
@@ -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"
diff --git a/mgr/mgr/swagger/tests.py b/mgr/mgr/swagger/tests.py
index adf4a78..3aed49b 100644
--- a/mgr/mgr/swagger/tests.py
+++ b/mgr/mgr/swagger/tests.py
@@ -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)
diff --git a/mgr/mgr/swagger/urls.py b/mgr/mgr/swagger/urls.py
index 21f7b8e..587dd14 100644
--- a/mgr/mgr/swagger/urls.py
+++ b/mgr/mgr/swagger/urls.py
@@ -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()),
]
diff --git a/mgr/mgr/vnfreg/tests.py b/mgr/mgr/vnfreg/tests.py
index 11bfd6c..c831489 100644
--- a/mgr/mgr/vnfreg/tests.py
+++ b/mgr/mgr/vnfreg/tests.py
@@ -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))
diff --git a/mgr/mgr/vnfreg/urls.py b/mgr/mgr/vnfreg/urls.py
index c2d3e0c..84b4ad1 100644
--- a/mgr/mgr/vnfreg/urls.py
+++ b/mgr/mgr/vnfreg/urls.py
@@ -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)