-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
||
|