Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
ksator committed May 28, 2020
1 parent 499724a commit 614eaf9
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions get_schema.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
from ncclient import manager

eos = manager.connect(host="10.83.28.190", port="830", timeout=30, username="arista", password="arista", hostkey_verify=False)

# list all schemas supported on the netconf server using the get operation (RFC 6022)
subtree='''
<netconf-state>
<schemas>
</schemas>
</netconf-state>
'''
subtree='''
<netconf-state xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
<schemas>
</schemas>
</netconf-state>
'''
get_reply = eos.get(filter=("subtree", subtree))
print(get_reply.ok)
# print(get_reply.errors)
# print(get_reply)

# retrieve a schema instance from the NETCONF server via get_schema operation (RFC 6022)
get_schema_reply = eos.get_schema(identifier = "arista-vlan-deviations", version = "2019-11-13", format = 'yang')
print(get_schema_reply.ok)
# print(get_schema_reply.errors)
# print(get_schema_reply)

# get the data model described in RFC 6022
get_schema_reply = eos.get_schema(identifier = "ietf-netconf-monitoring", version = "2010-10-04", format = 'yang')
print(get_schema_reply.ok)
# print(get_schema_reply.errors)
# print(get_schema_reply)

# rfc6022 - NETCONF configuration datastores supported on this device
subtree='''
<netconf-state>
<datastores>
</datastores>
</netconf-state>
'''
get_reply = eos.get(filter=("subtree", subtree))
print(get_reply.ok)
# print(get_reply.errors)
# print(get_reply)


0 comments on commit 614eaf9

Please sign in to comment.