Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
ksator committed May 21, 2020
1 parent 6d0253b commit b2eb5b3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
18 changes: 18 additions & 0 deletions get.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from ncclient import manager
eos=manager.connect(host="10.83.28.203", port="830", timeout=30, username="arista", password="arista", hostkey_verify=False)

Interface_Ethernet3='''
<interfaces>
<interface>
<name>Ethernet3</name>
</interface>
</interfaces>
'''

get_interface_ethernet3 = eos.get(filter=("subtree", Interface_Ethernet3))

print (get_interface_ethernet3.ok)

print (get_interface_ethernet3)


20 changes: 20 additions & 0 deletions print_server_capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,24 @@
for item in eos.server_capabilities:
print (item)

# check if the server advertised some NetConf capabilities
assert("urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring" in eos.server_capabilities), "NetConf server not compliant with https://tools.ietf.org/html/rfc6022"

eos.close_session()


<rpc message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get>
<filter type="subtree">
<top xmlns="http://example.com/schema/1.2/stats">
<interfaces>
<interface>
<ifName>eth0</ifName>
</interface>
</interfaces>
</top>
</filter>
</get>
</rpc>

0 comments on commit b2eb5b3

Please sign in to comment.