+ def _load_saps(self):
+ # Each Service Access Point (connection_point) in the nsd is getting its own container
+ SAPs = [p["id"] for p in self.nsd["connection_points"] if p["type"] == "interface"]
+ for sap in SAPs:
+ # endpoints needed in this service
+ sap_vnf_id, sap_vnf_interface = sap.split(':')
+ # set of the connection_point ids found in the nsd (in the examples this is 'ns')
+ self.sap_identifiers.add(sap_vnf_id)
+
+ sap_docker_name = "%s_%s" % (sap_vnf_id, sap_vnf_interface)
+
+ # add SAP to self.vnfds
+ sapfile = pkg_resources.resource_filename(__name__, "sap_vnfd.yml")
+ sap_vnfd = load_yaml(sapfile)
+ sap_vnfd["connection_points"][0]["id"] = sap_vnf_interface
+ sap_vnfd["name"] = sap_docker_name
+ self.vnfds[sap_docker_name] = sap_vnfd
+ # add SAP vnf to list in the NSD so it is deployed later on
+ # each SAP get a unique VNFD and vnf_id in the NSD
+ self.nsd["network_functions"].append({"vnf_id": sap_docker_name, "vnf_name": sap_docker_name})
+ LOG.debug("Loaded SAP: %r" % sap_vnfd.get("name"))
+