[![Build Status](https://travis-ci.org/internap/netman.svg?branch=master)](https://travis-ci.org/internap/netman)
[![Documentation Status](https://readthedocs.org/projects/netman/badge/?version=latest)](http://netman.readthedocs.org/en/latest/?badge=latest)
[![PyPI version](https://badge.fury.io/py/netman.svg)](http://badge.fury.io/py/netman)
Netman
======
Netman is a unified REST API that provides vendor-agnostic network automation.
It abstracts the vendor-specific bits and leaves you with a clean and
simplified API.
Python code usage
-----------------
```python
switch_factory = SwitchFactory(MemoryStorage(), ThreadingLockFactory())
switch = switch_factory.get_anonymous_switch(
model="cisco",
hostname="hostname_or_ip",
username="username",
password="password",
)
switch.add_vlan(1000, name="myvlan")
```
REST API usage
--------------
First, start the service
```bash
tox
.tox/py27/bin/python netman/main.py
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
```
Then you can access it by http
```bash
curl -X POST http://127.0.0.1:5000/switches/hostname_or_ip/vlans -d '{"number": 1000, "name": "myvlan"}'
-H "Content-Type: application/json"
-H "Netman-model: cisco"
-H "Netman-username: username"
-H "Netman-password: password"
```
Disaggregated mode
------------------
Netman supports a disaggregated mode. This is a special mode of operation where netman will use a remote netman server to access the network equipment. This mode is particularly useful in the case where your network equipment is not available to your main netman server. You can start a server somewhere, let's say at 192.168.1.1, running netman as described above. And use the proxy like this for direct code usage :
```python
switch_factory = SwitchFactory(MemoryStorage(), ThreadingLockFactory())
switch = switch_factory.get_anonymous_switch(
model="cisco",
hostname="hostname_or_ip",
username="username",
password="password",
netman_server="http://192.168.1.1")
switch.add_vlan(1000, name="myvlan")
```
Or when invoked using the REST API, you can call the main server and provide the proxy netman server to be used.
```bash
curl -X POST http://127.0.0.1:5000/switches/hostname_or_ip/vlans -d '{"number": 1000, "name": "myvlan"}'
-H "Content-Type: application/json"
-H "Netman-model: cisco"
-H "Netman-username: username"
-H "Netman-password: password"
-H "Netman-Proxy-Server: http://192.168.1.1"
```
Contributing
============
Feel free to raise issues and send some pull request, we'll be happy to look at them!
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
资源分类:Python库 所属语言:Python 资源全名:netman-1.2.16.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
Python库 | netman-1.2.16.tar.gz (171个子文件)
AUTHORS 645B
setup.cfg 842B
ChangeLog 7KB
MANIFEST.in 27B
tox.ini 237B
get_switch_hostname_vlans.json 1KB
get_switch_hostname_bonds_v1.json 976B
get_switch_hostname_interfaces.json 876B
get_switch_hostname_bonds_v2.json 798B
get_switch_hostname_vlans_vlan.json 488B
get_switch_hostname_bond_v1.json 249B
get_switch_hostname_interface.json 193B
get_switch_hostname_bond_v2.json 183B
post_switch_hostname_vlans_vlanid_vrrp_groups.json 175B
get_info.json 148B
get_switch_hostname_versions.json 79B
get_switch_hostname_vlans_vlan_interfaces.json 58B
post_switch_hostname_vlans.json 50B
pbr.json 47B
post_switch_hostname_vlans_vlanid_ips.json 43B
post_switch_session.json 31B
post_switch_session_result.json 30B
post_switch_hostname_bonds.json 20B
put_switch_hostname_interfaces_intname_spanningtree.json 19B
LICENSE 10KB
Makefile 7KB
README.md 3KB
README.md 1KB
NOMENCLATURE.md 995B
not-zip-safe 1B
PKG-INFO 4KB
PKG-INFO 4KB
juniper_test.py 191KB
cisco_test.py 128KB
brocade_test.py 115KB
dell_test.py 83KB
switch_api_test.py 81KB
remote_test.py 58KB
dell10g_test.py 53KB
base.py 41KB
switch_api.py 33KB
cached_switch_test.py 30KB
brocade.py 26KB
cisco.py 23KB
flow_control_switch_test.py 17KB
juniper_qfx_copper_test.py 17KB
dell.py 17KB
remote.py 16KB
cached.py 14KB
brocade_backward_compatibility_test.py 12KB
conf.py 11KB
dell10g.py 10KB
terminal_client_test.py 10KB
validators.py 10KB
exceptions.py 9KB
vlan_management_test.py 9KB
switch_session_test.py 8KB
switch_base.py 7KB
model_list.py 6KB
ip_management_test.py 5KB
flow_control_switch.py 5KB
switch_sessions.py 5KB
configured_test_case.py 5KB
switch_factory_test.py 5KB
switch_transactional_test.py 4KB
ssh.py 4KB
backward_compatible_switch_operations_test.py 4KB
validator_tests.py 4KB
switch_session_api.py 4KB
api_utils.py 4KB
telnet.py 3KB
session_test.py 3KB
backward_compatible_switch_operations.py 3KB
mock_terminal_commands.py 3KB
switch_base_test.py 3KB
mock_telnet.py 3KB
juniper_issue_125_test.py 3KB
__init__.py 3KB
get_interface_test.py 3KB
add_interface_to_bond.py 3KB
switch_api_base.py 3KB
main.py 3KB
reset_interface.py 3KB
util.py 2KB
add_vlan_test.py 2KB
switch_factory.py 2KB
netman_api.py 2KB
vrrp_test.py 2KB
unset_interface_state_test.py 2KB
base_api_test.py 2KB
session_storage_test.py 2KB
standard.py 2KB
__init__.py 2KB
global_reactor.py 2KB
bond.py 2KB
get_vlan_test.py 2KB
get_vlan_interfaces_test.py 2KB
compliance_test_case.py 2KB
set_interface_state_test.py 2KB
qfx_copper.py 2KB
共 171 条
- 1
- 2
资源评论
挣扎的蓝藻
- 粉丝: 14w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于javaweb的网上拍卖系统,采用Spring + SpringMvc+Mysql + Hibernate+ JSP技术
- polygon-mumbai
- Chrome代理 switchyOmega
- GVC-全球价值链参与地位指数,基于ICIO表,(Wang等 2017a)计算方法
- 易语言ADS指纹浏览器管理工具
- 易语言奇易模块5.3.6
- cad定制家具平面图工具-(FG)门板覆盖柜体
- asp.net 原生js代码及HTML实现多文件分片上传功能(自定义上传文件大小、文件上传类型)
- whl@pip install pyaudio ERROR: Failed building wheel for pyaudio
- Constantsfd密钥和权限集合.kt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功