示例#1
0
    def prefixes(
        cli_opts: Any,  # noqa: B902
        nodes: List[str],
        json: bool,
        prefix: str,
        client_type: str,
    ) -> None:
        """ show the prefixes in the network """

        nodes = parse_nodes(cli_opts, nodes)
        kvstore.PrefixesCmd(cli_opts).run(nodes, json, prefix, client_type)
示例#2
0
    def prefixes(
        cli_opts: Any,  # noqa: B902
        nodes: List[str],
        json: bool,
        prefix: str,
        client_type: str,
    ) -> None:
        """ show the prefixes from Decision module """

        nodes = parse_nodes(cli_opts, nodes)
        decision.DecisionPrefixesCmd(cli_opts).run(nodes, json, prefix, client_type)
示例#3
0
    def unset_adj_metric(cli_opts, node, interface, yes):  # noqa: B902
        """
        Unset previously set custom metric value on the node.
        """
        question_str = "Are you sure to unset metric " "for adjacency {} {} ?".format(
            node, interface)
        if not utils.yesno(question_str, yes):
            return

        lm.UnsetAdjMetricCmd(cli_opts).run(node, interface, yes)
        nodes = parse_nodes(cli_opts, "")
        kvstore.ShowAdjNodeCmd(cli_opts).run(nodes, node, interface)
示例#4
0
    def unset_adj_metric(cli_opts, node, interface, yes):  # noqa: B902
        '''
        Unset previously set custom metric value on the node.
        '''
        question_str = 'Are you sure to unset metric ' \
                       'for adjacency {} {} ?'.format(node, interface)
        if not utils.yesno(question_str, yes):
            return

        lm.UnsetAdjMetricCmd(cli_opts).run(node, interface, yes)
        nodes = parse_nodes(cli_opts.host, '', cli_opts.lm_cmd_port)
        kvstore.ShowAdjNodeCmd(cli_opts).run(nodes, node, interface)
示例#5
0
    def set_adj_metric(cli_opts, node, interface, metric, yes):  # noqa: B902
        '''
        Set custom metric value for the adjacency
        '''
        question_str = 'Are you sure to override metric '\
                       'for adjacency {} {} ?'.format(node, interface)
        if not utils.yesno(question_str, yes):
            return

        lm.SetAdjMetricCmd(cli_opts).run(node, interface, metric, yes)
        nodes = parse_nodes(cli_opts.host, '', cli_opts.lm_cmd_port)
        kvstore.ShowAdjNodeCmd(cli_opts).run(nodes, node, interface)
示例#6
0
    def set_adj_metric(cli_opts, node, interface, metric, yes):  # noqa: B902
        """
        Set custom metric value for the adjacency
        """
        question_str = "Are you sure to override metric for adjacency {} {} ?".format(
            node, interface)
        if not utils.yesno(question_str, yes):
            return

        lm.SetAdjMetricCmd(cli_opts).run(node, interface, metric, yes)
        nodes = parse_nodes(cli_opts, "")
        kvstore.ShowAdjNodeCmd(cli_opts).run(nodes, node, interface)
示例#7
0
 def print_decision_routes(self):
     if not self.print_routes:
         return
     nodes = parse_nodes(self.cli_opts, "")
     decision.DecisionRoutesComputedCmd(self.cli_opts).run(nodes, [], [], False)
示例#8
0
    def adj(cli_opts, json):  # noqa: B902
        """Dump all formed adjacencies of the current host"""

        nodes = parse_nodes(cli_opts, "")
        lm.LMAdjCmd(cli_opts).run(nodes, json)
示例#9
0
    def interfaces(cli_opts, nodes, json, all):  # noqa: B902
        ''' dump interface information '''

        nodes = parse_nodes(cli_opts.host, nodes, cli_opts.lm_cmd_port)
        kvstore.InterfacesCmd(cli_opts).run(nodes, json, all)
示例#10
0
    def adj(cli_opts, nodes, bidir, json):  # noqa: B902
        """ dump the link-state adjacencies from Decision module """

        nodes = parse_nodes(cli_opts, nodes)
        decision.DecisionAdjCmd(cli_opts).run(nodes, bidir, json)
示例#11
0
文件: decision.py 项目: zyh329/openr
    def routes(cli_opts, nodes, prefixes, json):  # noqa: B902
        ''' Request the routing table from Decision module '''

        nodes = parse_nodes(cli_opts.host, nodes, cli_opts.lm_cmd_port)
        decision.DecisionRoutesComputedCmd(cli_opts).run(nodes, prefixes, json)
示例#12
0
    def adj(cli_opts, nodes, bidir, json):  # noqa: B902
        """ dump the link-state adjacencies """

        nodes = parse_nodes(cli_opts, nodes)
        kvstore.AdjCmd(cli_opts).run(nodes, bidir, json)
示例#13
0
    def prefixes(cli_opts, nodes, json):  # noqa: B902
        """ show the prefixes from Decision module """

        nodes = parse_nodes(cli_opts, nodes)
        decision.DecisionPrefixesCmd(cli_opts).run(nodes, json)
示例#14
0
    def prefixes(cli_opts, nodes, json):  # noqa: B902
        ''' show the prefixes in the network '''

        nodes = parse_nodes(cli_opts.host, nodes, cli_opts.lm_cmd_port)
        kvstore.PrefixesCmd(cli_opts).run(nodes, json)
示例#15
0
 def print_decision_routes(self):
     if not self.print_routes:
         return
     nodes = parse_nodes(self.cli_opts.host, "", self.cli_opts.lm_cmd_port)
     decision.DecisionRoutesComputedCmd(self.cli_opts).run(nodes, [], False)
示例#16
0
文件: decision.py 项目: zyh329/openr
    def adj(cli_opts, nodes, bidir, json):  # noqa: B902
        ''' dump the link-state adjacencies from Decision module '''

        nodes = parse_nodes(cli_opts.host, nodes, cli_opts.lm_cmd_port)
        decision.DecisionAdjCmd(cli_opts).run(nodes, bidir, json)
示例#17
0
    def interfaces(cli_opts, nodes, json, all):  # noqa: B902
        """ dump interface information """

        nodes = parse_nodes(cli_opts, nodes)
        kvstore.InterfacesCmd(cli_opts).run(nodes, json, all)
示例#18
0
文件: decision.py 项目: zyh329/openr
    def prefixes(cli_opts, nodes, json):  # noqa: B902
        ''' show the prefixes from Decision module '''

        nodes = parse_nodes(cli_opts.host, nodes, cli_opts.lm_cmd_port)
        decision.DecisionPrefixesCmd(cli_opts).run(nodes, json)
示例#19
0
    def prefixes(cli_opts, nodes, json):  # noqa: B902
        """ show the prefixes in the network """

        nodes = parse_nodes(cli_opts, nodes)
        kvstore.PrefixesCmd(cli_opts).run(nodes, json)
示例#20
0
    def routes(cli_opts, nodes, prefixes, labels, json):  # noqa: B902
        """ Request the routing table from Decision module """

        nodes = parse_nodes(cli_opts, nodes)
        decision.DecisionRoutesComputedCmd(cli_opts).run(
            nodes, prefixes, labels, json)
示例#21
0
    def adj(cli_opts, nodes, bidir, json):  # noqa: B902
        ''' dump the link-state adjacencies '''

        nodes = parse_nodes(cli_opts.host, nodes, cli_opts.lm_cmd_port)
        kvstore.AdjCmd(cli_opts).run(nodes, bidir, json)