Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali-aqrabawi committed May 29, 2019
1 parent 2c2bb8e commit d3e6a3d
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,13 @@ Example of interacting with Cisco IOS devices:
import aionet
async def task(param):
async with aionet.create(**param) as ios:
# Testing sending simple command
out = await ios.send_command("show ver")
async with aionet.ConnectionHandler(**param) as conn:
# for sending command
out = await conn.send_command("show ver")
print(out)
# Testing sending configuration set
commands = ["line console 0", "exit"]
out = await ios.send_config_set(commands)
print(out)
# Testing sending simple command with long output
out = await ios.send_command("show run")
print(out)
# Testing interactive dialog
out = await ios.send_command("conf", pattern=r'\[terminal\]\?', strip_command=False)
out += await ios.send_command("term", strip_command=False)
out += await ios.send_command("exit", strip_command=False, strip_prompt=False)
# for config commands
commands = ["interface vlan1", "ip address 4.4.4.4 255.255.255.255"]
out = await conn.send_config_set(commands)
print(out)
Expand Down

0 comments on commit d3e6a3d

Please sign in to comment.