From d3e6a3d979ee228e50773e0aad8da7774790a3c4 Mon Sep 17 00:00:00 2001 From: Ali-aqrabawi Date: Wed, 29 May 2019 21:53:33 +0300 Subject: [PATCH] update README --- README.rst | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/README.rst b/README.rst index c55be51..345f3a3 100644 --- a/README.rst +++ b/README.rst @@ -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)