Exemplo n.º 1
0
def configure_nsd(proxy, nsd_xml_hdl):
    nsd_xml = nsd_xml_hdl.read()
    logger.debug("Attempting to deserialize XML into NSD protobuf: %s", nsd_xml)
    nsd = NsdYang.YangData_Nsd_NsdCatalog_Nsd()
    nsd.from_xml_v2(model, nsd_xml)

    logger.debug("Sending NSD to netconf: %s", nsd)
    proxy.merge_config(nsd.to_xml_v2(model))
Exemplo n.º 2
0
def configure_vnfd(proxy, vnfd_xml_hdl):
    vnfd_xml = vnfd_xml_hdl.read()
    logger.debug("Attempting to deserialize XML into VNFD protobuf: %s", vnfd_xml)
    vnfd = VnfdYang.YangData_Vnfd_VnfdCatalog_Vnfd()
    vnfd.from_xml_v2(model, vnfd_xml)

    logger.debug("Sending VNFD to netconf: %s", vnfd)
    proxy.merge_config(vnfd.to_xml_v2(model))
Exemplo n.º 3
0
def configure_vld(proxy, vld_xml_hdl):
    vld_xml = vld_xml_hdl.read()
    logger.debug("Attempting to deserialize XML into VLD protobuf: %s", vld_xml)
    vld = VldYang.YangData_Vld_VldCatalog_Vld()
    vld.from_xml_v2(model, vld_xml)

    logger.debug("Sending VLD to netconf: %s", vld)
    proxy.merge_config(vld.to_xml_v2(model))
Exemplo n.º 4
0
def configure_nsd(proxy, nsd_xml_hdl):
    nsd_xml = nsd_xml_hdl.read()
    logger.debug("Attempting to deserialize XML into NSD protobuf: %s",
                 nsd_xml)
    nsd = NsdYang.YangData_NsdCatalog_Nsd()
    nsd.from_xml_v2(model, nsd_xml)

    logger.debug("Sending NSD to netconf: %s", nsd)
    proxy.merge_config(nsd.to_xml_v2(model))
Exemplo n.º 5
0
def configure_vnfd(proxy, vnfd_xml_hdl):
    vnfd_xml = vnfd_xml_hdl.read()
    logger.debug("Attempting to deserialize XML into VNFD protobuf: %s",
                 vnfd_xml)
    vnfd = VnfdYang.YangData_VnfdCatalog_Vnfd()
    vnfd.from_xml_v2(model, vnfd_xml)

    logger.debug("Sending VNFD to netconf: %s", vnfd)
    proxy.merge_config(vnfd.to_xml_v2(model))
Exemplo n.º 6
0
def configure_vld(proxy, vld_xml_hdl):
    vld_xml = vld_xml_hdl.read()
    logger.debug("Attempting to deserialize XML into VLD protobuf: %s",
                 vld_xml)
    vld = VldYang.YangData_RwProject_Project_VldCatalog_Vld()
    vld.from_xml_v2(model, vld_xml)

    logger.debug("Sending VLD to netconf: %s", vld)
    proxy.merge_config(vld.to_xml_v2(model))
Exemplo n.º 7
0
def run_federation_config_perf_test(proxy, num_federations=1):
    start_time = time.time()

    for i in range(1, num_federations + 1):
        fed = RwMcYang.FederationConfig()
        fed.name = "foobar_%s" % i
        proxy.merge_config(fed.to_xml(yang_model))

    stop_time = time.time()

    print("Configured %s federations using netconf in %s seconds" % (num_federations, stop_time - start_time))
    return (stop_time - start_time)
Exemplo n.º 8
0
    def _apply_config(self, confd_host, xml_file):
        """ Configure the system with desired configuration

        Arguments:
            xml_file - XML configuration file to be applied to the system
            confd_host - The confd netconf host address
        """

        proxy = rift.auto.proxy.NetconfProxy(confd_host)
        proxy.connect()
        rift.vcs.mgmt.wait_until_system_started(proxy)

        for child in xml.etree.ElementTree.parse(xml_file).getroot():
            proxy.merge_config(xml.etree.ElementTree.tostring(child))
Exemplo n.º 9
0
    def _apply_config(self, confd_host, xml_file):
        """ Configure the system with desired configuration

        Arguments:
            xml_file - XML configuration file to be applied to the system
            confd_host - The confd netconf host address
        """

        proxy = rift.auto.proxy.NetconfProxy(confd_host)
        proxy.connect()
        rift.vcs.mgmt.wait_until_system_started(proxy)

        for child in xml.etree.ElementTree.parse(xml_file).getroot():
            proxy.merge_config(xml.etree.ElementTree.tostring(child))
Exemplo n.º 10
0
def run_federation_config_perf_test(proxy, num_federations=1):
    start_time = time.time()

    for i in range(1, num_federations + 1):
        fed = RwMcYang.FederationConfig()
        fed.name = "foobar_%s" % i
        print(proxy.merge_config(fed.to_xml(yang_model)))

    stop_time = time.time()

    print("Configured %s federations using netconf in %s seconds" %
          (num_federations, stop_time - start_time))
    return (stop_time - start_time)