Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 11
0
    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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 16
0
    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)
Exemplo n.º 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)
Exemplo n.º 18
0
    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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)