基于yaml文件生成cisco脚本

gen-cisco的Python项目详细描述


LicenseVersion

gen-cisco是一个api和cli,可以帮助您创建cisco 使用yaml文件的脚本。此文件为每个协议分组一个部分 包括要在相应的Cisco模板中替换的值。

这些模板的创建是在各种ccna 思科提供的培训课程,使用Packet Tracer,a 网络仿真与可视化工具。因此,一些命令可能 需要在真正的硬件上进行修改。


安装

就这么简单:

pip install gen-cisco

用法

Usage: gen-cisco.py [OPTIONS]

  Generates Cisco scripts based on YAML files

  Examples:
    python gen-cisco.py -i examples/router.yml
    python gen-cisco.py -i examples/router.yml -o r1.txt
    python gen-cisco.py -i examples/router.yml -o r1.txt -v
    python gen-cisco.py -i examples/router.yml -o r1.txt --no-comments -v
    python gen-cisco.py -i examples/router.yml -o r1.txt --no-comments --no-headers -v
    python gen-cisco.py -i examples/router.yml -o r1.txt --no-override

Options:
  -i, --src FILENAME          The YAML file.
  -o, --dest TEXT             The name of the generated script file.
  --override / --no-override  Deletes the old file if it is overwritten.
  --comments / --no-comments  Deletes comments in the generated script.
  --headers / --no-headers    Deletes headers in the generated script.
  -v, --verbose               Outputs the final script to the console.
  --version                   Show the version and exit.
  --help                      Show this message and exit.

或者,您可以使用Docker运行此工具:

# Build the image
docker build -t gen-cisco .

# Run the image
docker run -v $(pwd):/app gen-cisco python gen-cisco.py [OPTIONS]

支持的功能

以下是可由脚本配置的功能列表:

basic               ➔ basic configuration for routers and switches
eigrp               ➔ advanced distance-vector routing protocol
etherchannel        ➔ port link aggregation technology or port-channel architecture used primarily on Cisco switches
hsrp                ➔ Cisco redundancy protocol for establishing a fault-tolerant default gateway
nat                 ➔ method of remapping one IP address space into another
ospf                ➔ routing protocol for Internet Protocol networks
rip                 ➔ one of the oldest distance-vector routing protocols
stp                 ➔ network protocol that builds a loop-free logical topology for Ethernet networks
ssh                 ➔ cryptographic network protocol for operating network services securely over an unsecured network

有关按设备排序的完整列表,请访问 wiki


贡献

在脚本中添加新协议以及支持新设备是 容易的。要做到这一点,首先要看看 CONTRIBUTING 文件。另外,也可以通过打开 问题追踪器里的问题,对我们有很大帮助。


许可证

代码在MIT License下面。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
如何加载。java文件到编译器?   java写入文件和I/O   java日历返回错误的当前日期安卓   if语句if变量等于1(java)   java很难让Joda有时间使用我的bukkit插件   json如何创建基于java的应用程序,该应用程序将从网站获取输入   java如何在多页中打印大型JPanel   java my spinner在添加从firebase数据库中选择的多个值时被覆盖   java用Play框架覆盖HTTP方法   试图获取所有用户时,java错误请求400。Dto和表格   java支持bean加载图像后javascript自动调用JS函数   java在MTOM的@StreamingAttachment(Metro)中,Parsely的意思是什么   具有可抢占线程队列的多线程java执行器   Java Opencv connectedComponentsWithStats   java如何向数组中添加2D数组的数目   eclipse为什么我的Java Zork克隆不能正确循环?   java在哪里放置定制的第二个web。xml   java如何更改最近应用列表中显示的快照?   java Browser#getText()返回空字符串