Example #1
0
File: ro.py Project: HalasNet/felix
    def generate_list_resources(rspec, geni_available=False, show_interdomain=False, inner_call=True):
        for n in db_sync_manager.get_com_nodes():
            logger.debug("COM resources node=%s" % (n,))
            rspec.com_node(n, inner_call)

        for d in db_sync_manager.get_sdn_datapaths():
            logger.debug("OF resources dpid=%s" % (d,))
            rspec.datapath(d, inner_call)

        for l in db_sync_manager.get_com_links():
            logger.debug("COM resources link=%s" % (l,))
            rspec.com_link(l, inner_call)

        (of_links, fed_links) = db_sync_manager.get_sdn_links()
        for l in of_links:
            logger.debug("OF resources of-link=%s" % (l,))
            rspec.of_link(l, inner_call)

        for l in fed_links:
            logger.debug("OF resources fed-link=%s" % (l,))
            rspec.fed_link(l, inner_call)

        # Internal use (M/RO) -- OR show inter-domain resources, through config flag
        if inner_call or show_interdomain:
            ROUtils.generate_list_resources_internal(rspec, inner_call)

        # External use (experimenter) -- OR show inter-domain resources, through config flag
        if geni_available or show_interdomain:
            ROUtils.generate_list_resources_external(rspec, inner_call)
        return rspec
Example #2
0
    def generate_list_resources(rspec,
                                geni_available=False,
                                show_interdomain=False,
                                inner_call=True):
        for n in db_sync_manager.get_com_nodes():
            logger.debug("COM resources node=%s" % (n, ))
            rspec.com_node(n, inner_call)

        for d in db_sync_manager.get_sdn_datapaths():
            logger.debug("OF resources dpid=%s" % (d, ))
            rspec.datapath(d, inner_call)

        for l in db_sync_manager.get_com_links():
            logger.debug("COM resources link=%s" % (l, ))
            rspec.com_link(l, inner_call)

        (of_links, fed_links) = db_sync_manager.get_sdn_links()
        for l in of_links:
            logger.debug("OF resources of-link=%s" % (l, ))
            rspec.of_link(l, inner_call)

        for l in fed_links:
            logger.debug("OF resources fed-link=%s" % (l, ))
            rspec.fed_link(l, inner_call)

        # Internal use (M/RO) -- OR show inter-domain resources, through config flag
        if inner_call or show_interdomain:
            ROUtils.generate_list_resources_internal(rspec, inner_call)

        # External use (experimenter) -- OR show inter-domain resources, through config flag
        if geni_available or show_interdomain:
            ROUtils.generate_list_resources_external(rspec, inner_call)
        return rspec
Example #3
0
    def generate_list_resources(rspec, geni_available=False,
                                show_interdomain=False, inner_call=True):
        for n in db_sync_manager.get_com_nodes():
            logger.debug("COM resources node=%s" % (n,))
            rspec.com_node(n, inner_call)

        for d in db_sync_manager.get_sdn_datapaths():
            logger.debug("OF resources dpid=%s" % (d,))
            rspec.datapath(d, inner_call)

        for l in db_sync_manager.get_com_links():
            logger.debug("COM resources link=%s" % (l,))
            rspec.com_link(l, inner_call)

        (of_links, fed_links) = db_sync_manager.get_sdn_links()
        for l in of_links:
            logger.debug("OF resources of-link=%s" % (l,))
            rspec.of_link(l, inner_call)

        for l in fed_links:
            logger.debug("OF resources fed-link=%s" % (l,))
            rspec.fed_link(l, inner_call)

        # Check for internal/external usage
        ROUtils.list_resources_check_conds(
            rspec, geni_available, show_interdomain, inner_call)

        return rspec