get_bgp_summary_information RPC and using logical-systems

466 Views Asked by At

Hi I am trying to use PyEZ to to create an automation script.

My goal is save response from bgp summary with logical system in a variable

This one works:

bgpinfo= cor1.rpc.get_bgp_summary_information

but I want to get the bgp summary for logical system based on this juniper command:

user@COR1> show bgp summary logical-system EXTERNAL
1

There are 1 best solutions below

0
On

Check whether the below line of code works:

bgpinfo= cor1.rpc.get_bgp_summary_information(logical_system='EXTERNAL')

I figured it by giving the below command on the device:

reg@vj1> show bgp summary logical-system EXTERNAL | display xml rpc 
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/18.2D0/junos">
    <rpc>
        <get-bgp-summary-information>
                <logical-system>EXTERNAL</logical-system>
        </get-bgp-summary-information>
    </rpc>
    <cli>
        <banner></banner>
    </cli>
</rpc-reply>