diff options
author | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-02-14 17:34:44 +0800 |
---|---|---|
committer | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-02-14 17:34:44 +0800 |
commit | cf5cd27bf158f8bd9c4c0578fdd414e5fac53473 (patch) | |
tree | adcb5b453b4533af29e3b446a9ab657a3b90becb /lcm | |
parent | 9f34de4930b7afa5ba6c1da61a5dedc0b2fa5d92 (diff) |
Optimizing instantiation code
Change-Id: I4d15bcc5f2aabb5557eae5c76c51404a44839d78
Issue-Id: GVNFM-11
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'lcm')
-rw-r--r-- | lcm/lcm/nf/vnfs/urls.py | 8 | ||||
-rw-r--r-- | lcm/lcm/nf/vnfs/views.py | 10 | ||||
-rw-r--r-- | lcm/lcm/nf/vnfs/vnf_cancel/delete_vnf_identifier.py | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/lcm/lcm/nf/vnfs/urls.py b/lcm/lcm/nf/vnfs/urls.py index 8f79d61b..6285bc95 100644 --- a/lcm/lcm/nf/vnfs/urls.py +++ b/lcm/lcm/nf/vnfs/urls.py @@ -20,14 +20,14 @@ from lcm.nf.vnfs.views import CreateVnfIdentifier, InstantiateVnf, DeleteVnfIden urlpatterns = patterns('', url(r'^openoapi/vnflcm/v1/vnf_instances$', CreateVnfIdentifier.as_view()), - url(r'^openoapi/vnflcm/v1/vnf_instances/(?P<instanceId>[0-9a-zA-Z_-]+)/instantiate$', + url(r'^openoapi/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'^openoapi/vnflcm/v1/vnf_instances/(?P<instanceid>[0-9a-zA-Z_-]+)$', DeleteVnfIdentifier.as_view()), - url(r'^openoapi/vnflcm/v1/vnf_instances/(?P<instanceId>[0-9a-zA-Z_-]+)/terminate$', + url(r'^openoapi/vnflcm/v1/vnf_instances/(?P<instanceid>[0-9a-zA-Z_-]+)/terminate$', TerminateVnf.as_view()), url(r'^openoapi/vnflcm/v1/vnf_instances$', QueryMultipleVnf.as_view()), - url(r'^openoapi/vnflcm/v1/vnf_instances/(?P<instanceId>[0-9a-zA-Z_-]+)$', + url(r'^openoapi/vnflcm/v1/vnf_instances/(?P<instanceid>[0-9a-zA-Z_-]+)$', QuerySingleVnf.as_view()), url(r'^openoapi/vnflcm/v1/vnf_lc_ops/(?P<vnfLcOpId>[0-9a-zA-Z_-]+)&' r'responseId=(?P<responseId>[0-9a-zA-Z_-]+)$', GetOperationStatus.as_view()), diff --git a/lcm/lcm/nf/vnfs/views.py b/lcm/lcm/nf/vnfs/views.py index 481f308c..e1248e7d 100644 --- a/lcm/lcm/nf/vnfs/views.py +++ b/lcm/lcm/nf/vnfs/views.py @@ -45,20 +45,20 @@ class CreateVnfIdentifier(APIView): class InstantiateVnf(APIView): - def post(self, request, instanceId): + def post(self, request, instanceid): logger.debug("InstantiateVnf--post::> %s" % request.data) - job_id = JobUtil.create_job('NF', 'INSTANTIATE', instanceId) + job_id = JobUtil.create_job('NF', 'INSTANTIATE', instanceid) JobUtil.add_job_status(job_id, 0, "INST_VNF_READY") - InstVnf(request.data, instanceId, job_id).start() + InstVnf(request.data, instanceid, job_id).start() rsp = {"jobId": job_id} return Response(data=rsp, status=status.HTTP_202_ACCEPTED) class DeleteVnfIdentifier(APIView): - def delete(self, request, instanceId): + def delete(self, request, instanceid): logger.debug("DeleteVnfIdentifier--delete::> %s" % request.data) try: - DeleteVnf(request.data, instanceId).do_biz() + DeleteVnf(request.data, instanceid).do_biz() except NFLCMException as e: logger.error(e.message) return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) diff --git a/lcm/lcm/nf/vnfs/vnf_cancel/delete_vnf_identifier.py b/lcm/lcm/nf/vnfs/vnf_cancel/delete_vnf_identifier.py index 107d9ab5..b5e28ba0 100644 --- a/lcm/lcm/nf/vnfs/vnf_cancel/delete_vnf_identifier.py +++ b/lcm/lcm/nf/vnfs/vnf_cancel/delete_vnf_identifier.py @@ -16,9 +16,9 @@ from lcm.pub.exceptions import NFLCMException class DeleteVnf: - def __init__(self, data, instanceId): + def __init__(self, data, instanceid): self.data = data - self.nf_inst_id = instanceId + self.nf_inst_id = instanceid def do_biz(self): sel_vnfs = NfInstModel.objects.filter(pk=self.nf_inst_id) |