Resolve VFC code and swagger inconsistencies 43/26343/1
authorying.yunlong <ying.yunlong@zte.com.cn>
Fri, 15 Dec 2017 01:12:17 +0000 (09:12 +0800)
committerying.yunlong <ying.yunlong@zte.com.cn>
Fri, 15 Dec 2017 01:12:17 +0000 (09:12 +0800)
Add resourceName in affectedVL of notify

Change-Id: Ib2c3d0689eef0dcd9d05083b0610b4bb91898d6a
Issue-ID: VFC-620
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
lcm/ns/vnfs/notify_lcm.py
lcm/swagger/vfc.vnfdriver.swagger.json

index 9ebd89e..4ec8052 100644 (file)
@@ -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}')
 
index 38b3083..49d032e 100644 (file)
              "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"
              }
            }
          }