We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When trying to query subscribers using tables and view, no data is returned.
The script below gives the following output:-
There are 4 subscribers using dev.rpc.get_subscribers() There are 0 subscribers using SubscriberTable()
Script:-
#!/usr/bin/python3 import yaml from jnpr.junos import Device from jnpr.junos.factory.factory_loader import FactoryLoader subscriber_table = """ --- SubscriberTable: rpc: get-subscribers item: subscriber view: SubscriberView SubscriberView: fields: interface: interface user_name: user-name logical_system: logical-system routing_instance: routing-instance stacked_vlan_id: stacked-vlan-id vlan_id: vlan-id ipv6_address: ipv6-address """ globals().update( FactoryLoader().load(yaml.load(subscriber_table, Loader=yaml.FullLoader)) ) HOST = "mx204-bng.lab" dev = Device(host=HOST, port=22) dev.open() res = dev.rpc.get_subscribers() subscribers = res.xpath('//subscriber') print(f"There are {len(subscribers)} subscribers using dev.rpc.get_subscribers()") res = SubscriberTable(dev) res.get() print(f"There are {len(res)} subscribers using SubscriberTable()") dev.close()
This is the result of ssh mx204-bng.lab 'show subscribers | display xml':-
ssh mx204-bng.lab 'show subscribers | display xml'
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/21.2R0/junos"> <subscribers-information xmlns="http://xml.juniper.net/junos/21.2R0/junos-subscribers"> <subscriber junos:style="terse"> <interface>ae2.3732871645</interface> <user-name></user-name> <logical-system>default</logical-system> <routing-instance>default</routing-instance> <stacked-vlan-id>0x8100.1000</stacked-vlan-id> <vlan-id>0x8100.7</vlan-id> </subscriber> <subscriber junos:style="terse"> <interface>demux0.3298857643</interface> <user-name>XXXXXXXXXXXX/1/1000/0001</user-name> <logical-system>default</logical-system> <routing-instance>default</routing-instance> <ip-address>10.10.10.10</ip-address> </subscriber> <subscriber junos:style="terse"> <interface>*</interface> <ipv6-address>2001:db8::/56</ipv6-address> </subscriber> <subscriber junos:style="terse"> <interface>*</interface> <ipv6-address>2001:db8:1::/64</ipv6-address> </subscriber> </subscribers-information> <cli> <banner></banner> </cli> </rpc-reply>
The text was updated successfully, but these errors were encountered:
dineshbaburam91
No branches or pull requests
When trying to query subscribers using tables and view, no data is returned.
The script below gives the following output:-
Script:-
This is the result of
ssh mx204-bng.lab 'show subscribers | display xml'
:-The text was updated successfully, but these errors were encountered: