summaryrefslogtreecommitdiffstats
path: root/lcm
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2017-08-15 14:48:02 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2017-08-15 14:48:02 +0800
commit098b7e99394fcbaaff005239a2143836c02b03e0 (patch)
tree33164427c0081460132e0a570a151575d32465d7 /lcm
parente3f942cc4182d82284c421e345c7bd6081eec497 (diff)
Remove vfc-gvnfm-vnflcm openo labels
As the seed code comes from openo, there are many openo labels in vfc-gvnfm-vnflcm, for example, in the Rest URL, now remove the openo labels. Change-Id: Iba041d18f626603d4e21b9f9ea60fdcfe31e41da Issue-ID: VFC-85 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'lcm')
-rw-r--r--lcm/lcm/jobs/tests.py2
-rw-r--r--lcm/lcm/jobs/urls.py2
-rw-r--r--lcm/lcm/nf/vnfs/tests/test_vnf_cancel.py8
-rw-r--r--lcm/lcm/nf/vnfs/tests/test_vnf_create.py6
-rw-r--r--lcm/lcm/nf/vnfs/tests/test_vnf_query.py4
-rw-r--r--lcm/lcm/nf/vnfs/urls.py10
-rw-r--r--lcm/lcm/pub/config/config.py4
-rw-r--r--lcm/lcm/pub/msapi/catalog.py16
-rw-r--r--lcm/lcm/pub/msapi/gvnfmdriver.py6
-rw-r--r--lcm/lcm/pub/vimapi/api.py2
-rw-r--r--lcm/lcm/samples/tests.py4
-rw-r--r--lcm/lcm/samples/urls.py2
12 files changed, 33 insertions, 33 deletions
diff --git a/lcm/lcm/jobs/tests.py b/lcm/lcm/jobs/tests.py
index 9957b9cf..df466563 100644
--- a/lcm/lcm/jobs/tests.py
+++ b/lcm/lcm/jobs/tests.py
@@ -28,5 +28,5 @@ class JobsViewTest(TestCase):
def test_job(self):
JobModel(jobid=self.job_id, jobtype='VNF', jobaction='INST', resid='1').save()
JobStatusModel(indexid=1, jobid=self.job_id, status='inst', progress=20, descp='inst').save()
- response = self.client.get("/openoapi/vnflcm/v1/vnf_lc_ops/%s?responseId=123456jhj" % self.job_id)
+ response = self.client.get("/api/vnflcm/v1/vnf_lc_ops/%s?responseId=123456jhj" % self.job_id)
self.failUnlessEqual(status.HTTP_200_OK, response.status_code) \ No newline at end of file
diff --git a/lcm/lcm/jobs/urls.py b/lcm/lcm/jobs/urls.py
index f2ab2bbd..0aeb7fa8 100644
--- a/lcm/lcm/jobs/urls.py
+++ b/lcm/lcm/jobs/urls.py
@@ -17,7 +17,7 @@ from rest_framework.urlpatterns import format_suffix_patterns
from lcm.jobs.views import JobView
urlpatterns = patterns('',
- url(r'^openoapi/vnflcm/v1/vnf_lc_ops/(?P<job_id>[0-9a-zA-Z_-]+)$', JobView.as_view()),
+ url(r'^api/vnflcm/v1/vnf_lc_ops/(?P<job_id>[0-9a-zA-Z_-]+)$', JobView.as_view()),
)
urlpatterns = format_suffix_patterns(urlpatterns)
diff --git a/lcm/lcm/nf/vnfs/tests/test_vnf_cancel.py b/lcm/lcm/nf/vnfs/tests/test_vnf_cancel.py
index 2f7fd27b..e4cf7d90 100644
--- a/lcm/lcm/nf/vnfs/tests/test_vnf_cancel.py
+++ b/lcm/lcm/nf/vnfs/tests/test_vnf_cancel.py
@@ -61,13 +61,13 @@ class TestNFTerminate(TestCase):
netype='', vnfd_model='', status='NOT_INSTANTIATED', nf_desc='', vnfdid='',
vnfSoftwareVersion='', vnfConfigurableProperties='todo',
localizationLanguage='EN_US', create_time=now_time())
- response = self.client.delete("/openoapi/vnflcm/v1/vnf_instances/1111")
+ response = self.client.delete("/api/vnflcm/v1/vnf_instances/1111")
self.failUnlessEqual(status.HTTP_204_NO_CONTENT, response.status_code)
self.assertEqual(None, response.data)
"""
def test_delete_vnf_identifier_when_vnf_not_exist(self):
- response = self.client.delete("/openoapi/vnflcm/v1/vnf_instances/1111")
+ response = self.client.delete("/api/vnflcm/v1/vnf_instances/1111")
self.failUnlessEqual(status.HTTP_500_INTERNAL_SERVER_ERROR, response.status_code)
self.assertEqual("VnfInst(1111) does not exist", response.data["error"])
@@ -76,7 +76,7 @@ class TestNFTerminate(TestCase):
netype='', vnfd_model='', status='VNF_INSTANTIATED', nf_desc='', vnfdid='',
vnfSoftwareVersion='', vnfConfigurableProperties='todo',
localizationLanguage='EN_US', create_time=now_time())
- response = self.client.delete("/openoapi/vnflcm/v1/vnf_instances/1111")
+ response = self.client.delete("/api/vnflcm/v1/vnf_instances/1111")
self.failUnlessEqual(status.HTTP_500_INTERNAL_SERVER_ERROR, response.status_code)
self.assertEqual("Don't allow to delete vnf(status:[VNF_INSTANTIATED])", response.data["error"])
"""
@@ -84,7 +84,7 @@ class TestNFTerminate(TestCase):
@mock.patch.object(TermVnf, 'run')
def test_terminate_vnf(self, mock_run):
mock_run.re.return_value = None
- response = self.client.post("/openoapi/vnflcm/v1/vnf_instances/12/terminate", data={}, format='json')
+ response = self.client.post("/api/vnflcm/v1/vnf_instances/12/terminate", data={}, format='json')
self.failUnlessEqual(status.HTTP_202_ACCEPTED, response.status_code)
"""
diff --git a/lcm/lcm/nf/vnfs/tests/test_vnf_create.py b/lcm/lcm/nf/vnfs/tests/test_vnf_create.py
index 94307587..9942183d 100644
--- a/lcm/lcm/nf/vnfs/tests/test_vnf_create.py
+++ b/lcm/lcm/nf/vnfs/tests/test_vnf_create.py
@@ -44,7 +44,7 @@ class TestNFInstantiate(TestCase):
self.assertEqual(1, len(jobs))
def test_swagger_ok(self):
- response = self.client.get("/openoapi/vnflcm/v1/swagger.json", format='json')
+ response = self.client.get("/api/vnflcm/v1/swagger.json", format='json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
@mock.patch.object(restcall, 'call_req')
@@ -58,7 +58,7 @@ class TestNFInstantiate(TestCase):
"vnfdId": "111",
"vnfInstanceName": "vFW_01",
"vnfInstanceDescription": "vFW in Nanjing TIC Edge"}
- response = self.client.post("/openoapi/vnflcm/v1/vnf_instances", data=data, format='json')
+ response = self.client.post("/api/vnflcm/v1/vnf_instances", data=data, format='json')
self.failUnlessEqual(status.HTTP_201_CREATED, response.status_code)
context = json.loads(response.content)
self.assertTrue(NfInstModel.objects.filter(nfinstid=context['vnfInstanceId']).exists())
@@ -66,7 +66,7 @@ class TestNFInstantiate(TestCase):
@mock.patch.object(InstVnf, 'run')
def test_instantiate_vnf(self, mock_run):
mock_run.re.return_value = None
- response = self.client.post("/openoapi/vnflcm/v1/vnf_instances/12/instantiate", data={}, format='json')
+ response = self.client.post("/api/vnflcm/v1/vnf_instances/12/instantiate", data={}, format='json')
self.failUnlessEqual(status.HTTP_202_ACCEPTED, response.status_code)
"""
def test_instantiate_vnf_when_inst_id_not_exist(self):
diff --git a/lcm/lcm/nf/vnfs/tests/test_vnf_query.py b/lcm/lcm/nf/vnfs/tests/test_vnf_query.py
index 599372ef..5141ff88 100644
--- a/lcm/lcm/nf/vnfs/tests/test_vnf_query.py
+++ b/lcm/lcm/nf/vnfs/tests/test_vnf_query.py
@@ -113,7 +113,7 @@ class ResourceTest(TestCase):
vnf_inst_id = "1"
NfInstModel(nfinstid=vnf_inst_id, nf_name='VNF1').save()
StorageInstModel(storageid='s02', vimid='vim01', resouceid='resource01', insttype=1, instid=vnf_inst_id).save()
- response = self.client.get("/openoapi/vnflcm/v1/vnf_instances/%s" % vnf_inst_id, format='json')
+ response = self.client.get("/api/vnflcm/v1/vnf_instances/%s" % vnf_inst_id, format='json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(self.test_data_single_vnf, response.data)
@@ -122,6 +122,6 @@ class ResourceTest(TestCase):
NfInstModel(nfinstid='%s' % i, nf_name='VNF%s' % i).save()
StorageInstModel(storageid='s0%s' % i, vimid='vim0%s' % i, resouceid='resource0%s' % i,
insttype=1, instid='%s' % i).save()
- response = self.client.get("/openoapi/vnflcm/v1/vnf_instances", format='json')
+ response = self.client.get("/api/vnflcm/v1/vnf_instances", format='json')
self.failUnlessEqual(status.HTTP_200_OK, response.status_code)
self.assertEqual(self.test_data_multi_vnf, response.data)
diff --git a/lcm/lcm/nf/vnfs/urls.py b/lcm/lcm/nf/vnfs/urls.py
index b40190d2..c6f00a6f 100644
--- a/lcm/lcm/nf/vnfs/urls.py
+++ b/lcm/lcm/nf/vnfs/urls.py
@@ -18,14 +18,14 @@ from rest_framework.urlpatterns import format_suffix_patterns
from lcm.nf.vnfs.views import InstantiateVnf, TerminateVnf, SwaggerJsonView, DeleteVnfAndQueryVnf, CreateVnfAndQueryVnfs
urlpatterns = patterns('',
- url(r'^openoapi/vnflcm/v1/vnf_instances$', CreateVnfAndQueryVnfs.as_view()),
- url(r'^openoapi/vnflcm/v1/vnf_instances/(?P<instanceid>[0-9a-zA-Z_-]+)/instantiate$',
+ url(r'^api/vnflcm/v1/vnf_instances$', CreateVnfAndQueryVnfs.as_view()),
+ url(r'^api/vnflcm/v1/vnf_instances/(?P<instanceid>[0-9a-zA-Z_-]+)/instantiate$',
InstantiateVnf.as_view()),
- url(r'^openoapi/vnflcm/v1/vnf_instances/(?P<instanceid>[0-9a-zA-Z_-]+)$',
+ url(r'^api/vnflcm/v1/vnf_instances/(?P<instanceid>[0-9a-zA-Z_-]+)$',
DeleteVnfAndQueryVnf.as_view()),
- url(r'^openoapi/vnflcm/v1/vnf_instances/(?P<instanceid>[0-9a-zA-Z_-]+)/terminate$',
+ url(r'^api/vnflcm/v1/vnf_instances/(?P<instanceid>[0-9a-zA-Z_-]+)/terminate$',
TerminateVnf.as_view()),
- url(r'^openoapi/vnflcm/v1/swagger.json$', SwaggerJsonView.as_view()),
+ url(r'^api/vnflcm/v1/swagger.json$', SwaggerJsonView.as_view()),
)
urlpatterns = format_suffix_patterns(urlpatterns)
diff --git a/lcm/lcm/pub/config/config.py b/lcm/lcm/pub/config/config.py
index 04dcf462..b965ae89 100644
--- a/lcm/lcm/pub/config/config.py
+++ b/lcm/lcm/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": "vnflcm",
"version": "v1",
- "url": "/openoapi/vnflcm/v1",
+ "url": "/api/vnflcm/v1",
"protocol": "REST",
"visualRange": "1",
"nodes": [{
diff --git a/lcm/lcm/pub/msapi/catalog.py b/lcm/lcm/pub/msapi/catalog.py
index d62651a1..6683370a 100644
--- a/lcm/lcm/pub/msapi/catalog.py
+++ b/lcm/lcm/pub/msapi/catalog.py
@@ -28,7 +28,7 @@ P_STATUS_DELETING, P_STATUS_DELETEFAILED = "deleting", "deleteFailed"
def query_csar_from_catalog(csar_id, key=''):
- ret = req_by_msb("/openoapi/catalog/v1/csars/%s" % csar_id, "GET")
+ ret = req_by_msb("/api/catalog/v1/csars/%s" % csar_id, "GET")
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
if ret[2] == '404':
@@ -40,7 +40,7 @@ def query_csar_from_catalog(csar_id, key=''):
def query_rawdata_from_catalog(csar_id, input_parameters=[]):
req_param = json.JSONEncoder().encode({"csarId": csar_id, "inputParameters": input_parameters})
- ret = req_by_msb("/openoapi/catalog/v1/servicetemplates/queryingrawdata", "POST", req_param)
+ ret = req_by_msb("/api/catalog/v1/servicetemplates/queryingrawdata", "POST", req_param)
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Failed to query rawdata of CSAR(%s) from catalog." % csar_id)
@@ -48,7 +48,7 @@ def query_rawdata_from_catalog(csar_id, input_parameters=[]):
def set_csar_state(csar_id, prop, val):
- ret = req_by_msb("/openoapi/catalog/v1/csars/%s?%s=%s" % (csar_id, prop, val), "PUT")
+ ret = req_by_msb("/api/catalog/v1/csars/%s?%s=%s" % (csar_id, prop, val), "PUT")
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
return [1, "Failed to set %s to %s of CSAR(%s)." % (prop, val, csar_id)]
@@ -56,7 +56,7 @@ def set_csar_state(csar_id, prop, val):
def delete_csar_from_catalog(csar_id):
- ret = req_by_msb("/openoapi/catalog/v1/csars/%s" % csar_id, "DELETE")
+ ret = req_by_msb("/api/catalog/v1/csars/%s" % csar_id, "DELETE")
if ret[0] != 0 and ret[2] != '404':
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
set_csar_state(csar_id, "processState", P_STATUS_DELETEFAILED)
@@ -65,7 +65,7 @@ def delete_csar_from_catalog(csar_id):
def get_download_url_from_catalog(csar_id, relative_path):
- ret = req_by_msb("/openoapi/catalog/v1/csars/%s/files?relativePath=%s" % (csar_id, relative_path), "GET")
+ ret = req_by_msb("/api/catalog/v1/csars/%s/files?relativePath=%s" % (csar_id, relative_path), "GET")
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Failed to get download url of CSAR(%s)." % csar_id)
@@ -74,7 +74,7 @@ def get_download_url_from_catalog(csar_id, relative_path):
def get_process_id(name, srv_template_id):
- ret = req_by_msb('/openoapi/catalog/v1/servicetemplates/%s/operations' % srv_template_id, 'GET')
+ ret = req_by_msb('/api/catalog/v1/servicetemplates/%s/operations' % srv_template_id, 'GET')
if ret[0] != 0:
raise NFLCMException('Failed to get service[%s,%s] process id' % (name, srv_template_id))
items = json.JSONDecoder().decode(ret[1])
@@ -85,7 +85,7 @@ def get_process_id(name, srv_template_id):
def get_servicetemplate_id(nsd_id):
- ret = req_by_msb('/openoapi/catalog/v1/servicetemplates', 'GET')
+ ret = req_by_msb('/api/catalog/v1/servicetemplates', 'GET')
if ret[0] != 0:
raise NFLCMException('Failed to get servicetemplates info')
stpls = json.JSONDecoder().decode(ret[1])
@@ -96,7 +96,7 @@ def get_servicetemplate_id(nsd_id):
def get_servicetemplate(nsd_id):
- ret = req_by_msb('/openoapi/catalog/v1/servicetemplates', 'GET')
+ ret = req_by_msb('/api/catalog/v1/servicetemplates', 'GET')
if ret[0] != 0:
raise NFLCMException('Failed to get servicetemplates info')
stpls = json.JSONDecoder().decode(ret[1])
diff --git a/lcm/lcm/pub/msapi/gvnfmdriver.py b/lcm/lcm/pub/msapi/gvnfmdriver.py
index 954e1b82..a09cb2a0 100644
--- a/lcm/lcm/pub/msapi/gvnfmdriver.py
+++ b/lcm/lcm/pub/msapi/gvnfmdriver.py
@@ -21,7 +21,7 @@ logger = logging.getLogger(__name__)
def get_packageinfo_by_vnfdid(vnfdid):
- ret = req_by_msb("openoapi/gvnfmdriver/v1/vnfpackages", "GET") # TODO
+ ret = req_by_msb("api/gvnfmdriver/v1/vnfpackages", "GET") # TODO
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Failed to query package_info of vnfdid(%s) from nslcm." % vnfdid)
@@ -29,7 +29,7 @@ def get_packageinfo_by_vnfdid(vnfdid):
def apply_grant_to_nfvo(data):
- ret = req_by_msb("openoapi/gvnfmdriver/v1/resource/grant", "PUT", data)
+ ret = req_by_msb("api/gvnfmdriver/v1/resource/grant", "PUT", data)
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Nf instancing apply grant exception")
@@ -37,7 +37,7 @@ def apply_grant_to_nfvo(data):
def notify_lcm_to_nfvo(data):
- ret = req_by_msb("openoapi/gvnfmdriver/v1/vnfs/lifecyclechangesnotification", "POST", data)
+ ret = req_by_msb("api/gvnfmdriver/v1/vnfs/lifecyclechangesnotification", "POST", data)
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Nf lcm notify exception")
diff --git a/lcm/lcm/pub/vimapi/api.py b/lcm/lcm/pub/vimapi/api.py
index 64f40cac..4ad4230a 100644
--- a/lcm/lcm/pub/vimapi/api.py
+++ b/lcm/lcm/pub/vimapi/api.py
@@ -17,7 +17,7 @@ import json
from lcm.pub.utils.restcall import req_by_msb
from .exceptions import VimException
-VIM_DRIVER_BASE_URL = "openoapi/multivim/v1"
+VIM_DRIVER_BASE_URL = "api/multivim/v1"
def call(vim_id, tenant_id, res, method, data=''):
if data and not isinstance(data, (str, unicode)):
diff --git a/lcm/lcm/samples/tests.py b/lcm/lcm/samples/tests.py
index d85e2d30..78fda054 100644
--- a/lcm/lcm/samples/tests.py
+++ b/lcm/lcm/samples/tests.py
@@ -20,8 +20,8 @@ from rest_framework import status
from lcm.pub.vimapi import api
-inst_res_url = "/openoapi/vnflcm/v1/resources/inst"
-term_res_url = "/openoapi/vnflcm/v1/resources/term"
+inst_res_url = "/api/vnflcm/v1/resources/inst"
+term_res_url = "/api/vnflcm/v1/resources/term"
inst_res_data = {
"vdus": [
{
diff --git a/lcm/lcm/samples/urls.py b/lcm/lcm/samples/urls.py
index 260c2436..2e163274 100644
--- a/lcm/lcm/samples/urls.py
+++ b/lcm/lcm/samples/urls.py
@@ -16,5 +16,5 @@ from django.conf.urls import url
from lcm.samples import views
urlpatterns = [
- url(r'^openoapi/vnflcm/v1/resources/(?P<action_type>[inst|term]+)$', views.ResourceList.as_view()),
+ url(r'^api/vnflcm/v1/resources/(?P<action_type>[inst|term]+)$', views.ResourceList.as_view()),
url(r'^samples/$', views.SampleList.as_view()), ]