X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=lcm%2Flcm%2Fnf%2Fbiz%2Finstantiate_vnf.py;h=56e9c146b4417b72e0cd5468b304a5c57cab7a3d;hb=8201d92a453fb182b8fd8c7a35489001a368629d;hp=1c9a66bf6a25458f42db6742056ea1bedb58a7e8;hpb=86af279acebf863b46693e8ba0f2f43013b2b66e;p=vfc%2Fgvnfm%2Fvnflcm.git diff --git a/lcm/lcm/nf/biz/instantiate_vnf.py b/lcm/lcm/nf/biz/instantiate_vnf.py index 1c9a66bf..56e9c146 100644 --- a/lcm/lcm/nf/biz/instantiate_vnf.py +++ b/lcm/lcm/nf/biz/instantiate_vnf.py @@ -155,15 +155,38 @@ class InstantiateVnf(Thread): break def set_location(self, apply_result): + vim_connections = ignore_case_get(apply_result, "vimConnections") + vnfid = ignore_case_get(apply_result, "vnfInstanceId") + directive = ignore_case_get(apply_result, "directive") + vim_assets = ignore_case_get(apply_result, "vimAssets") + access_info = ignore_case_get(vim_connections[0], "accessInfo") + tenant = ignore_case_get(access_info, "tenant") + vimid = ignore_case_get(vim_connections[0], "vimId") + cloud_owner, cloud_regionid = vimid.split("_") + vdu_info = [] + + for flavor in ignore_case_get(vim_assets, "vimComputeResourceFlavour"): + vdu_info.append({"vduName": flavor["resourceProviderId"], + "flavorName": flavor["vimFlavourId"], + "directive": directive}) + for resource_type in ['vdus', 'vls']: for resource in ignore_case_get(self.vnfd_info, resource_type): if "location_info" in resource["properties"]: - resource["properties"]["location_info"]["vimid"] = ignore_case_get(apply_result, "vimid") - resource["properties"]["location_info"]["tenant"] = ignore_case_get(apply_result, "tenant") + resource["properties"]["location_info"]["vimid"] = vimid + resource["properties"]["location_info"]["tenant"] = tenant + resource["properties"]["location_info"]["vnfId"] = vnfid + resource["properties"]["location_info"]["cloudOwner"] = cloud_owner + resource["properties"]["location_info"]["cloudRegionId"] = cloud_regionid + resource["properties"]["location_info"]["vduInfo"] = vdu_info else: resource["properties"]["location_info"] = { - "vimid": ignore_case_get(apply_result, "vimid"), - "tenant": ignore_case_get(apply_result, "tenant")} + "vimid": vimid, + "tenant": tenant, + "vnfId": vnfid, + "cloudOwner": cloud_owner, + "cloudRegionId": cloud_regionid, + "vduInfo": vdu_info} ''' def get_subnet_ids(self, ext_cp):