私信发送成功
Watch Star Fork

pippo / netadmin-driverPythonGPL-3.0

驱动服务用于Juniper,Cisco的命令执行
克隆/下载
pippo 最后提交于 2018-01-12 23:05 更新 README.md
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
2017-12-12 10:20
2017-10-20 14:17
2017-12-12 11:17
2017-10-25 09:31
2017-12-12 11:30
Loading...
README.md 2.58 KB

Netadmin-driver

What's This?

  • A service which send command or script to network device like Juniper or Cisco ,then get the results back to you when it's finished
  • Proivde HTTP service with tornado
  • Multiple Execute Commands on devices
  • It's built for providing driver service to netadmin

Build By

Package Page
Python3.6 https://www.python.org/downloads/release/python-363/
Junos-eznc https://github.com/Juniper/py-junos-eznc
Ansible https://github.com/ansible/ansible
Tornado https://github.com/tornadoweb/tornado

Build

Provide Dockerfile, so you can build esaily using

docker build -t <your docker repository url>/netadmin-driver:<your version> .

Web Interface

Juniper

Command
define a JSON named "json_data" like
{
 "hosts":["192.168.1.2","192.168.1.3".....],
 "port":22,
 "user": {
    "name":"ssh name",
    "password":"ssh password"
    },
 "command": "show version"
 }
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d post_data 'http://netadmin-driver-url/juniper/command'
Config
define a JSON named "json_data" like
{
 "hosts":["192.168.1.2","192.168.1.3".....],
 "port":22,
 "user": {
    "name":"ssh name",
    "password":"ssh password"
    },
 "file_content": "line1\nline2\n""
 }
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d post_data 'http://netadmin-driver-url/juniper/config'

Cisco

Command
define a JSON named "json_data" like
{
 "hosts":["192.168.1.2","192.168.1.3".....],
 "port":22,
 "user": {
    "name":"ssh name",
    "password":"ssh password"
    },
 "command": "show version"
 }
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d post_data 'http://netadmin-driver-url/cisco/command'

Config

define a JSON named "json_data" like
{
 "hosts":["192.168.1.2","192.168.1.3".....],
 "port":22,
 "user": {
    "name":"ssh name",
    "password":"ssh password"
    },
 "file_content": "line1\nline2\n",
 "blob_id":"Forza_Milan"
 }
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d post_data 'http://netadmin-driver-url/cisco/config'

"blob_id" is the gitlab file id,it's used for the temporary file name, so you can use any thing to rename it. I prefer "Forza_Milan"

License

GNU General Public License v3.0

项目点评 ( 0 )

你可以在登录后,对此项目发表评论

6_float_left_people 6_float_left_close