From: ying.yunlong Date: Fri, 15 Dec 2017 01:12:17 +0000 (+0800) Subject: Resolve VFC code and swagger inconsistencies X-Git-Tag: v1.1.0~255 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F43%2F26343%2F1;p=vfc%2Fnfvo%2Flcm.git Resolve VFC code and swagger inconsistencies Add resourceName in affectedVL of notify Change-Id: Ib2c3d0689eef0dcd9d05083b0610b4bb91898d6a Issue-ID: VFC-620 Signed-off-by: ying.yunlong --- diff --git a/lcm/ns/vnfs/notify_lcm.py b/lcm/ns/vnfs/notify_lcm.py index 9ebd89e5..4ec80526 100644 --- a/lcm/ns/vnfs/notify_lcm.py +++ b/lcm/ns/vnfs/notify_lcm.py @@ -106,6 +106,7 @@ class NotifyLcm(object): networkResource = ignore_case_get(vl, 'networkResource') resourceType = ignore_case_get(networkResource, 'resourceType') resourceId = ignore_case_get(networkResource, 'resourceId') + resourceName = ignore_case_get(networkResource, 'resourceName') if resourceType != 'network': self.exception('affectedVl struct error: resourceType not euqal network') @@ -113,13 +114,14 @@ class NotifyLcm(object): ownerId = self.get_vnfinstid(self.m_vnfInstanceId, self.vnfmid) if changeType == 'added': - VLInstModel(vlinstanceid=vlInstanceId, vldid=vldid, ownertype=0, ownerid=ownerId, - relatednetworkid=resourceId, vltype=0).save() + VLInstModel(vlinstanceid=vlInstanceId, vldid=vldid, vlinstancename=resourceName, ownertype=0, + ownerid=ownerId, relatednetworkid=resourceId, vltype=0).save() elif changeType == 'removed': VLInstModel.objects.filter(vlinstanceid=vlInstanceId).delete() elif changeType == 'modified': VLInstModel.objects.filter(vlinstanceid=vlInstanceId)\ - .update(vldid=vldid, ownertype=0, ownerid=ownerId, relatednetworkid=resourceId, vltype=0) + .update(vldid=vldid, vlinstancename=resourceName, ownertype=0, ownerid=ownerId, + relatednetworkid=resourceId, vltype=0) else: self.exception('affectedVl struct error: changeType not in {added,removed,modified}') diff --git a/lcm/swagger/vfc.vnfdriver.swagger.json b/lcm/swagger/vfc.vnfdriver.swagger.json index 38b30831..49d032ef 100644 --- a/lcm/swagger/vfc.vnfdriver.swagger.json +++ b/lcm/swagger/vfc.vnfdriver.swagger.json @@ -781,6 +781,10 @@ "resourceId": { "type": "string", "description": "Identifier of the resource in the scope of the VIM" + }, + "resourceName": { + "type": "string", + "description": "Name of the resource in the scope of the VIM" } } }