コード例 #1
0
ファイル: node.py プロジェクト: wrouesnel/calico-containers
def node_bgppeer_show(version):
    """
    Print a list of the BGP Peers for this node.
    """
    assert version in (4, 6)
    peers = client.get_bgp_peers(version, hostname=hostname)
    if peers:
        heading = "Node specific IPv%s BGP Peer" % version
        x = PrettyTable([heading, "AS Num"], sortby=heading)
        for peer in peers:
            x.add_row([peer.ip, peer.as_num])
        x.align = "l"
        print x.get_string(sortby=heading)
    else:
        print "No IPv%s BGP Peers defined for this node.\n" % version
コード例 #2
0
ファイル: node.py プロジェクト: ajaybhatnagar/calico-docker
def node_bgppeer_show(version):
    """
    Print a list of the BGP Peers for this node.
    """
    assert version in (4, 6)
    peers = client.get_bgp_peers(version, hostname=hostname)
    if peers:
        heading = "Node specific IPv%s BGP Peer" % version
        x = PrettyTable([heading, "AS Num"], sortby=heading)
        for peer in peers:
            x.add_row([peer.ip, peer.as_num])
        x.align = "l"
        print x.get_string(sortby=heading)
    else:
        print "No IPv%s BGP Peers defined for this node.\n" % version
コード例 #3
0
def bgp_peer_show(version):
    """
    Print a list of the global BGP Peers.
    """
    assert version in (4, 6)
    peers = client.get_bgp_peers(version)
    if peers:
        heading = "Global IPv%s BGP Peer" % version
        x = PrettyTable([heading, "AS Num"], sortby=heading)
        for peer in peers:
            x.add_row([peer.ip, peer.as_num])
        x.align = "l"
        print x.get_string(sortby=heading)
    else:
        print "No global IPv%s BGP Peers defined.\n" % version
コード例 #4
0
ファイル: bgp.py プロジェクト: DockerLab/calico-containers
def bgp_peer_show(version):
    """
    Print a list of the global BGP Peers.
    """
    assert version in (4, 6)
    peers = client.get_bgp_peers(version)
    if peers:
        heading = "Global IPv%s BGP Peer" % version
        x = PrettyTable([heading, "AS Num"], sortby=heading)
        for peer in peers:
            x.add_row([peer.ip, peer.as_num])
        x.align = "l"
        print x.get_string(sortby=heading)
    else:
        print "No global IPv%s BGP Peers defined.\n" % version