+ if "vnfd-connection-point-ref" in vld_params:
+ for cp_params in vld_params["vnfd-connection-point-ref"]:
+ # look for interface
+ for constituent_vnfd in nsd["constituent-vnfd"]:
+ if constituent_vnfd["member-vnf-index"] == cp_params["member-vnf-index-ref"]:
+ vnf_descriptor = vnfd_dict[constituent_vnfd["vnfd-id-ref"]]
+ break
+ else:
+ raise LcmException(
+ "Invalid instantiate parameter vld:vnfd-connection-point-ref:member-vnf-index-ref={} "
+ "is not present at nsd:constituent-vnfd".format(cp_params["member-vnf-index-ref"]))
+ match_cp = False
+ for vdu_descriptor in vnf_descriptor["vdu"]:
+ for interface_descriptor in vdu_descriptor["interface"]:
+ if interface_descriptor.get("external-connection-point-ref") == \
+ cp_params["vnfd-connection-point-ref"]:
+ match_cp = True
+ break
+ if match_cp:
+ break
+ else:
+ raise LcmException(
+ "Invalid instantiate parameter vld:vnfd-connection-point-ref:member-vnf-index-ref={}:"
+ "vnfd-connection-point-ref={} is not present at vnfd={}".format(
+ cp_params["member-vnf-index-ref"],
+ cp_params["vnfd-connection-point-ref"],
+ vnf_descriptor["id"]))
+ RO_cp_params = {}
+ if cp_params.get("ip-address"):
+ RO_cp_params["ip_address"] = cp_params["ip-address"]
+ if cp_params.get("mac-address"):
+ RO_cp_params["mac_address"] = cp_params["mac-address"]
+ if RO_cp_params:
+ RO_vnf_params = {
+ cp_params["member-vnf-index-ref"]: {
+ "vdus": {
+ vdu_descriptor["id"]: {
+ "interfaces": {
+ interface_descriptor["name"]: RO_cp_params
+ }
+ }
+ }
+ }
+ }
+ deep_update(RO_ns_params["vnfs"], RO_vnf_params)