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 05d5bc0 commit 6d0253b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,22 @@
interface = "3"

def vlan_rpc(id, name):
vlan_rpc = """<nc:edit-config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
vlan_rpc = """
<nc:edit-config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
<target>
<running/>
</target>
<commands>
<command>vlan %s</command>
<command>name %s</command>
</commands>
</nc:edit-config>""" % (vlan_id, vlan_name)
</nc:edit-config>
""" % (vlan_id, vlan_name)
return (vlan_rpc)

def interface_rpc(interface, description, vlan):
interface_rpc = """<nc:edit-config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
interface_rpc = """
<nc:edit-config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
<target>
<running/>
</target>
Expand All @@ -28,7 +31,8 @@ def interface_rpc(interface, description, vlan):
<command>description %s</command>
<command>switchport access vlan %s</command>
</commands>
</nc:edit-config>""" % (interface, description, vlan)
</nc:edit-config>
""" % (interface, description, vlan)
return (interface_rpc)

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

0 comments on commit 6d0253b

Please sign in to comment.