コード例 #1
0
 def __init__(self, source_tn, destination_tn, *args, **kwargs):
     # CIDs of source and destination TN endpoints
     self.src_dom = source_tn
     self.dst_dom = destination_tn
     # Link type can be "nsi" or "gre". Empty means "all"
     self.link_type = kwargs.get("link_type", "")
     # Filters to match against required switches
     self.src_of_cids = kwargs.get("src_of_switch_cids", [])
     self.dst_of_cids = kwargs.get("dst_of_switch_cids", [])
     self.of_cids_check_by_auth = kwargs.get("of_switch_cids_check_by_auth",
                                             False)
     # Dummy list to reduce lines of code
     self.src_dst_values = ["src", "dst"]
     # Nodes and links from database
     self.tn_nodes = [x for x in db_sync_manager.get_tn_nodes()]
     self.se_links = [x for x in db_sync_manager.get_se_links()]
     # Mapping structure to be returned is a list of possible src-dst paths
     self.mapping_tn_se_of = []
     self.organisation_name_mappings = {
         "psnc": ["pionier"],
         "iminds": ["iMinds"],
         "kddi": ["jgn-x.jp"],
     }
     # Update with parameters passed
     self.__dict__.update(kwargs)
コード例 #2
0
 def __init__(self, source_tn, destination_tn, *args, **kwargs):
     # CIDs of source and destination TN endpoints
     self.src_dom = source_tn
     self.dst_dom = destination_tn
     # Link type can be "nsi" or "gre". Empty means "all"
     self.link_type = kwargs.get("link_type", "")
     # Filters to match against required switches
     self.src_of_cids = kwargs.get("src_of_switch_cids", [])
     self.dst_of_cids = kwargs.get("dst_of_switch_cids", [])
     self.of_cids_check_by_auth = kwargs.get(
         "of_switch_cids_check_by_auth", False)
     # Dummy list to reduce lines of code
     self.src_dst_values = ["src", "dst"]
     # Nodes and links from database
     self.tn_nodes = [x for x in db_sync_manager.get_tn_nodes()]
     self.se_links = [x for x in db_sync_manager.get_se_links()]
     # Mapping structure to be returned is a list of possible src-dst paths
     self.mapping_tn_se_of = []
     # Update with parameters passed
     self.__dict__.update(kwargs)
コード例 #3
0
    def generate_list_resources_internal(rspec, inner_call=True):
        """
        Appends TN and SE (internal) information when any of the following:
          * It is an internal call (MRO->RO, MRO->MRO)
          * Configuration flag "interdomain_available_to_user" is set to True
        """
        for n in db_sync_manager.get_tn_nodes():
            logger.debug("TN resources node=%s" % (n, ))
            rspec.tn_node(n, inner_call)

        for n in db_sync_manager.get_se_nodes():
            logger.debug("SE resources node=%s" % (n, ))
            rspec.se_node(n, inner_call)

        for l in db_sync_manager.get_tn_links():
            logger.debug("TN resources tn-link=%s" % (l, ))
            rspec.tn_link(l, inner_call)

        for l in db_sync_manager.get_se_links():
            logger.debug("SE resources se-link=%s" % (l, ))
            rspec.se_link(l, inner_call)
コード例 #4
0
ファイル: ro.py プロジェクト: HalasNet/felix
    def generate_list_resources_internal(rspec, inner_call=True):
        """
        Appends TN and SE (internal) information when any of the following:
          * It is an internal call (MRO->RO, MRO->MRO)
          * Configuration flag "interdomain_available_to_user" is set to True
        """
        for n in db_sync_manager.get_tn_nodes():
            logger.debug("TN resources node=%s" % (n,))
            rspec.tn_node(n, inner_call)

        for n in db_sync_manager.get_se_nodes():
            logger.debug("SE resources node=%s" % (n,))
            rspec.se_node(n, inner_call)

        for l in db_sync_manager.get_tn_links():
            logger.debug("TN resources tn-link=%s" % (l,))
            rspec.tn_link(l, inner_call)

        for l in db_sync_manager.get_se_links():
            logger.debug("SE resources se-link=%s" % (l,))
            rspec.se_link(l, inner_call)