2

I want to get wia RPC info like this:

> show route output interface ae40.4181 | display xml rpc 
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/17.4R2/junos">
    <rpc>
        <get-route-information>
            <output>
                        <interface>ae40.4181</interface>
                    </output>
            </get-route-information>
        </rpc>
        <cli>
            <banner></banner>
        </cli>
    </rpc-reply>

How shloud I pass these parameters to dev.rpc.get_route_information?

Which are other possible ways to get this info?

brownian
  • 435
  • 3
  • 13

1 Answers1

2

try using dev.execute for this case

for example

rpc = '''<get-route-information>
            <output><interface>ae40.4181</interface>
                    </output>
            </get-route-information>'''
dev.execute(rpc)

let me know if you face any issue

Nitin Kr
  • 521
  • 2
  • 12
  • How can I get the result of the rpc execute, I tried response=dev.execute(rpc) and printed it, but it printed "True" – Alaa Jan 13 '20 at 08:39
  • Alaa, share the API call you did. – Nitin Kr Jan 13 '20 at 09:38
  • rpcRequest= '''''' dev.open(normalize=True) response=dev.execute(rpcRequest) – Alaa Jan 13 '20 at 09:50
  • 1
    just try rpcRequest= "" or rpcRequest= "". Dont pass RPC, check https://github.com/Juniper/py-junos-eznc/blob/master/lib/jnpr/junos/device.py#L735-L736 – Nitin Kr Jan 13 '20 at 09:57