From 649ddb83743de05ca5df0626de700ac24635fae7 Mon Sep 17 00:00:00 2001 From: YuanHong Deng Date: Tue, 12 May 2020 15:52:07 +0800 Subject: Implement of reporting port instance data from GVNFM to NFVO Change-Id: I62324871456481bea1c743ca4a78700bd1d0dc9a Issue-ID: VFC-1657 Signed-off-by: YuanHong Deng --- lcm/lcm/nf/tests/const.py | 7 +++++++ lcm/lcm/pub/msapi/gvnfmdriver.py | 12 ++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lcm/lcm/nf/tests/const.py b/lcm/lcm/nf/tests/const.py index 2d701a14..c0cdd562 100644 --- a/lcm/lcm/nf/tests/const.py +++ b/lcm/lcm/nf/tests/const.py @@ -81,6 +81,13 @@ inst_req_data = { "resourceProviderId": "resourceProvider_1", "resourceId": "resource_1", "vimLevelResourceType": "vimLevelResourceType_1", + "tenant": "f7b17b0afd374d48a322e95cf4258eec", + "ipAddress": "10.0.101.1", + "macAddress": "fa:16:3e:a3:ac:5e", + "instId": "fb86af68-be48-4804-a454-3892333b9d4a", + "portid": "2dddd81b-a8d4-41f4-8a90-8f334bbbbe3b", + "networkid": "7d907188-46f0-4aa7-b61b-f2d349554a1b", + "subnetworkid": "08ef29e0-5e61-436a-a9ee-6a4ac502a622" } } ] diff --git a/lcm/lcm/pub/msapi/gvnfmdriver.py b/lcm/lcm/pub/msapi/gvnfmdriver.py index 850736ce..8d097574 100644 --- a/lcm/lcm/pub/msapi/gvnfmdriver.py +++ b/lcm/lcm/pub/msapi/gvnfmdriver.py @@ -99,7 +99,14 @@ def prepare_notification_data(nfinstid, jobid, changetype, operation): 'vimConnectionId': port.vimid, 'resourceId': port.resourceid, 'resourceProviderId': port.name, # TODO: is resourceName mapped to resourceProviderId? - 'vimLevelResourceType': 'port' + 'vimLevelResourceType': 'port', + 'tenant': port.tenant, + 'ipAddress': port.ipaddress, + 'macAddress': port.macaddress, + 'instId': port.instid, + 'portid': port.portid, + 'networkid': port.networkid, + 'subnetworkid': port.subnetworkid }, 'cpInstanceId': port.portid # TODO: port.cpinstanceid is not initiated when create port resource. }) @@ -115,6 +122,7 @@ def prepare_notification_data(nfinstid, jobid, changetype, operation): ext_connectivity.append({ 'id': network_id, 'resourceHandle': network_resource, + 'changeType': changetype, 'extLinkPorts': ext_link_ports }) logger.debug("ext_connectivity=%s", ext_connectivity) @@ -146,7 +154,7 @@ def prepare_notification_data(nfinstid, jobid, changetype, operation): 'affectedVnfcs': affected_vnfcs, 'affectedVirtualLinks': affected_vls, 'affectedVirtualStorages': affected_vss, - 'changedExtConnectivity': [], # TODO: will add in R4 + 'changedExtConnectivity': ext_connectivity, '_links': { 'vnfInstance': {'href': '/api/vnflcm/v1/vnf_instances/%s' % nfinstid}, # set 'subscription' link after filtering for subscribers -- cgit 1.2.3-korg