Thanks to visit codestin.com
Credit goes to github.com

Skip to content

dtembe/netpalm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

netpalm_log

why netpalm?

netpalm is a ReST API into your dusty old network devices, netpalm makes it easy to push and pull network state from your apps. netpalm can abstract and render structured data both inbound and outbound to your network devices native telnet, SSH, NETCONF or RESTCONF interface. netpalm leverages popular napalm, netmiko, ncclient and requests library's for network device communication, these powerful libs supprt a vast number of vendors and OS

netpalm features

  • Speaks ReST & JSON to your app and CLI over SSH or Telnet or NETCONF/RESTCONF to your network devices
  • Built in multi-level abstraction interface for service modeling of Create, Retrieve, Delete methods
  • Ability to write your own service templates
  • Supports pre and post checks accross CLI devices, config only deployed on pre check pass
  • Per device async task queuing (Ensure you dont overload your VTY's) or Pooled async processes
  • Large amount of supported multivendor devices ( cheers to the netmiko & napalm & ncclient lads )
  • TextFSM for parsing/structuring device data (includes ntc-templates)
  • Jinja2 for model driven deployments of config onto devices accross napalm, netmiko and ncclient
  • Automated download and installation of TextFSM templates from http://textfsm.nornir.tech online TextFSM development tool
  • ReST based Webhook w/ args & the ability for you to BYO webhooks
  • Execute ANY python script as async via the ReST API and includes passing in of parameters
  • Supports on the fly changes to async queue strategy for a device ( either per device pinned queues or pooled queues )
  • OpenAPI / SwaggerUI docs inbuilt via the default route
  • Large online postman collection of examples
  • Horizontal container based scale out architecture supported by each component
  • Automatically generates a JSON schema for any Jinja2 Template
  • Can render NETCONF XML responses into JSON on the fly
  • Can render Jinja2 templates only if required via the API

concepts

netpalm acts as a ReST broker for NAPALM, Netmiko, NCCLIENT or a Python Script. It uses TextFSM or Jinja2 to model and transform both ingress and egress data if required. You make an API call to netpalm and it will establish a queue to your device and start sending configuration

netpalm concept

using netpalm examples

getconfig method

netpalm eg1

check response

netpalm eg2

getconfig method with textfsm arg

netpalm also supports all arguments for the transport libs, simply pass them in as below

netpalm eg3

check response

netpalm eg4

rapid template development and deployment

netpalm is integrated into http://textfsm.nornir.tech so you can ingest your templates with ease

netpalm auto ingest

API documentation

netpalm comes with a postman collection and an OpenAPI based API with swagger ui netpalm swagger

container installation

ensure you first have docker installed

sudo apt-get install docker.io
sudo apt-get install docker-compose

clone in netpalm

git clone https://github.com/tbotnz/netpalm.git
cd netpalm

build container

sudo docker-compose up -d --build

import the postman collection, set the ip addresses to that of your docker host and off you go (default netpalm port is 9000)

http://$(yourdockerhost):9000

scaling

netpalm containers can be scaled out/in as required, define how many containers are required of each type

docker-compose scale netpalm-controller=1 netpalm-worker-pinned=2 netpalm-worker-fifo=3

configuring netpalm

edit the config.json file too set params as required

{
    "api_key": "2a84465a-cf38-46b2-9d86-b84Q7d57f288",
    "api_key_name" : "x-api-key",
    "cookie_domain" : "netpalm.local",
    "listen_port": 9000,
    "listen_ip":"0.0.0.0",
    "gunicorn_workers":3,
    "redis_task_ttl":500,
    "redis_task_timeout":500,
    "redis_server":"redis",
    "redis_port":6379,
    "redis_core_q":"process",
    "redis_fifo_q":"fifo",
    "redis_queue_store":"netpalm_queue_store",
    "pinned_process_per_node":100,
    "fifo_process_per_node":10,
    "txtfsm_index_file":"backend/plugins/ntc-templates/index",
    "txtfsm_template_server":"http://textfsm.nornir.tech",
    "custom_scripts":"backend/plugins/custom_scripts/",
    "jinja2_config_templates":"backend/plugins/jinja2_templates/",
    "jinja2_service_templates":"backend/plugins/service_templates/",
    "self_api_call_timeout":15
}

public cloud instance

There is a public instance of netpalm available below

useful netpalm resources

netpalm getting started blog:

netpalm slack channel

#netpalm on networktocode.slack.com

license

All code belongs to that of its respective owners

About

ReST based network device broker

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 85.8%
  • CSS 8.3%
  • Python 5.9%