File: factory.py

package info (click to toggle)
python-scrapli 2023.7.30-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,536 kB
  • sloc: python: 14,459; makefile: 72
file content (22 lines) | stat: -rw-r--r-- 489 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""examples.basic_usage.factory"""
from scrapli import Scrapli

MY_DEVICE = {
    "host": "172.18.0.11",
    "auth_username": "scrapli",
    "auth_password": "scrapli",
    "auth_strict_key": False,
    "platform": "cisco_iosxe",
}


def main():
    """Scrapli factory will return an IOSXEDriver object based on the platform provided"""
    with Scrapli(**MY_DEVICE) as conn:
        result = conn.send_command("show run")

    print(result.result)


if __name__ == "__main__":
    main()