SlideShare a Scribd company logo
1 of 13
PyEZ
Nitin Kumar nitinkr@juniper.net
• Remote device management and "fact" gathering
• Troubleshooting, Audit and Reporting
• Operational data
• Configuration data
• Configuration Management
• Unstructured config snippets and templates
• Structured abstractions
• Generalized utilities for file-system, software-upgrade, secure file copy (scp), etc.
• RPC Meta-Programming
• "PyEZ” is meant to address all aspects for quickly and easily building network tools.
Junos PyEZ is a micro framework for Python that enables you to remotely manage and
automate devices running Junos OS
Junos and Python – Make it Easy (PyEZ)
Why Python?
• excellent for beginners, yet superb for experts
• highly scalable, suitable for large projects as well as small ones
• portable, cross-platform
• easily extensible
• object-oriented
• Automatic memory management
• simple yet elegant
• powerful standard libs
• wealth of 3rd party packages
What is Jinja2
Jinja2 is a widely used templating engine for Python.
Design and implementation is intuitive
Template inheritance
Allows you to build a base “skeleton” template that contains all the
common elements of your site and defines blocks that child
templates can override.
Easy to debug
Line numbers of exceptions directly point to the correct line in the
template.
Execution is very fast
Widely adopted
Jinja2 example
# Template
interfaces {
{% for item in interfaces %}
{{ item }} {
description "{{ description }}";
unit 0 {
family {{ family }};
}
} {% endfor %}
}
protocols {
mpls {
{% for item in interfaces %}
interface {{ item }};
{% endfor %}
}
}
interfaces {
ge-1/0/1 {
description "MPLS
interface";
unit 0 {
family mpls;
}
}
ge-1/0/2 {
description "MPLS
interface";
unit 0 {
family mpls;
}
}
}
protocols {
mpls {
interface ge-1/0/1;
data= {
'interfaces': ['ge-1/0/1', 'ge-1/0/2’],
'description': 'MPLS interface',
'family': 'mpls'
}
YAML
{
'interfaces': ['ge-1/0/1', 'ge-1/0/2’],
'description': 'MPLS interface',
'family': 'mpls'
}
Python data
---
interfaces:
- ge-1/0/1
- ge-1/0/2
description: 'MPLS interface'
family: mpls
YAML
• YAML is a human readable mechanism for storing data that is easily mapped
to common data types.
• It supports hierarchical structures
• Whitespace delimited (like Python) so files have consistent look.
• Program language agnostic – supported by most.
Python Shell Python script
IT
Frameworks
Custom
Applications
ncclient
junos-pyez
• Junos specific
• Abstraction Layer
• micro-framework
• NETCONF transport only
• Vendor Agnostic
• No abstractions
• Native Python data types (hash/list)
• Junos specific not required
• XML not required
open-source, Juniper
open-source, Community
interactive simple → complex
LAYERED APPROACH
Secure TCP/IP connections via
SSHv2 (RFC4742)
XML
NETCONF XML
PROTOCOL
(RFC4741)
Management System
Python script to configure
device
User is encapsulated of backend activities like XML processing.
Different protocol involved in communication and other
processing.
Security Routing Switching
Junos PyEZ
1. Python framework with easy learning curve
2. Works with any Junos device running 11.4 or later
3. Operational and Configuration Data/Management
4. Generalized utilities for file-system, software-upgrade, scp
5. Community supported
Top 5 reasons for PyEZ
* Based on queries posted by their employees on Google Group
PyEZ users*
PyEZ success stories
BGP Flow Specification
Newrelic performance analysis
Diagnose LAG health LLDP network topology
YouTube: https://www.youtube.com/user/JuniperNetworks/search?query=pyez
Wiki: https://techwiki.juniper.net/Automation_Scripting/Junos_PyEZ
API Docs: http://junos-pyez.readthedocs.org/
Forum: http://groups.google.com/group/junos-python-ez
GitHub: http://github.com/Juniper/py-junos-eznc/
Google Group: https://groups.google.com/forum/#!forum/junos-python-ez
Resources
Demo

More Related Content

Similar to PyEZ

Oracle Database Appliance - RAC in a box Some strings attached
Oracle Database Appliance - RAC in a box Some strings attached Oracle Database Appliance - RAC in a box Some strings attached
Oracle Database Appliance - RAC in a box Some strings attached
Fuad Arshad
 

Similar to PyEZ (20)

Java Web Services
Java Web ServicesJava Web Services
Java Web Services
 
xml and xhtml.pptx
xml and xhtml.pptxxml and xhtml.pptx
xml and xhtml.pptx
 
Linux Desktop Automation
Linux Desktop AutomationLinux Desktop Automation
Linux Desktop Automation
 
Edge Computing and 5G - SDN/NFV London meetup
Edge Computing and 5G - SDN/NFV London meetupEdge Computing and 5G - SDN/NFV London meetup
Edge Computing and 5G - SDN/NFV London meetup
 
Introduction to Puppet - SpringPeople
Introduction to Puppet - SpringPeopleIntroduction to Puppet - SpringPeople
Introduction to Puppet - SpringPeople
 
A Networking View for the DevOps Crew: SDN
A Networking View for the DevOps Crew: SDNA Networking View for the DevOps Crew: SDN
A Networking View for the DevOps Crew: SDN
 
Django è pronto per l'Enterprise
Django è pronto per l'EnterpriseDjango è pronto per l'Enterprise
Django è pronto per l'Enterprise
 
Using SAS GRID v 9 with Isilon F810
Using SAS GRID v 9 with Isilon F810Using SAS GRID v 9 with Isilon F810
Using SAS GRID v 9 with Isilon F810
 
DEVNET-1152 OpenDaylight YANG Model Overview and Tools
DEVNET-1152	OpenDaylight YANG Model Overview and ToolsDEVNET-1152	OpenDaylight YANG Model Overview and Tools
DEVNET-1152 OpenDaylight YANG Model Overview and Tools
 
Intro to XML in libraries
Intro to XML in librariesIntro to XML in libraries
Intro to XML in libraries
 
Getting Started with Splunk Breakout Session
Getting Started with Splunk Breakout SessionGetting Started with Splunk Breakout Session
Getting Started with Splunk Breakout Session
 
From leading IoT Protocols to Python Dashboarding_final
From leading IoT Protocols to Python Dashboarding_finalFrom leading IoT Protocols to Python Dashboarding_final
From leading IoT Protocols to Python Dashboarding_final
 
NextGenML
NextGenML NextGenML
NextGenML
 
Linux Assignment 3
Linux Assignment 3Linux Assignment 3
Linux Assignment 3
 
Oracle Database Appliance - RAC in a box Some strings attached
Oracle Database Appliance - RAC in a box Some strings attached Oracle Database Appliance - RAC in a box Some strings attached
Oracle Database Appliance - RAC in a box Some strings attached
 
Puppet for Junos
Puppet for JunosPuppet for Junos
Puppet for Junos
 
Netflix Open Source Meetup Season 3 Episode 2
Netflix Open Source Meetup Season 3 Episode 2Netflix Open Source Meetup Season 3 Episode 2
Netflix Open Source Meetup Season 3 Episode 2
 
NetflixOSS Meetup season 3 episode 2
NetflixOSS Meetup season 3 episode 2NetflixOSS Meetup season 3 episode 2
NetflixOSS Meetup season 3 episode 2
 
Complex Er[jl]ang Processing with StreamBase
Complex Er[jl]ang Processing with StreamBaseComplex Er[jl]ang Processing with StreamBase
Complex Er[jl]ang Processing with StreamBase
 
STIX Patterning: Viva la revolución!
STIX Patterning: Viva la revolución!STIX Patterning: Viva la revolución!
STIX Patterning: Viva la revolución!
 

Recently uploaded

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
chumtiyababu
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 

Recently uploaded (20)

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 

PyEZ

  • 2. • Remote device management and "fact" gathering • Troubleshooting, Audit and Reporting • Operational data • Configuration data • Configuration Management • Unstructured config snippets and templates • Structured abstractions • Generalized utilities for file-system, software-upgrade, secure file copy (scp), etc. • RPC Meta-Programming • "PyEZ” is meant to address all aspects for quickly and easily building network tools. Junos PyEZ is a micro framework for Python that enables you to remotely manage and automate devices running Junos OS Junos and Python – Make it Easy (PyEZ)
  • 3. Why Python? • excellent for beginners, yet superb for experts • highly scalable, suitable for large projects as well as small ones • portable, cross-platform • easily extensible • object-oriented • Automatic memory management • simple yet elegant • powerful standard libs • wealth of 3rd party packages
  • 4. What is Jinja2 Jinja2 is a widely used templating engine for Python. Design and implementation is intuitive Template inheritance Allows you to build a base “skeleton” template that contains all the common elements of your site and defines blocks that child templates can override. Easy to debug Line numbers of exceptions directly point to the correct line in the template. Execution is very fast Widely adopted
  • 5. Jinja2 example # Template interfaces { {% for item in interfaces %} {{ item }} { description "{{ description }}"; unit 0 { family {{ family }}; } } {% endfor %} } protocols { mpls { {% for item in interfaces %} interface {{ item }}; {% endfor %} } } interfaces { ge-1/0/1 { description "MPLS interface"; unit 0 { family mpls; } } ge-1/0/2 { description "MPLS interface"; unit 0 { family mpls; } } } protocols { mpls { interface ge-1/0/1; data= { 'interfaces': ['ge-1/0/1', 'ge-1/0/2’], 'description': 'MPLS interface', 'family': 'mpls' }
  • 6. YAML { 'interfaces': ['ge-1/0/1', 'ge-1/0/2’], 'description': 'MPLS interface', 'family': 'mpls' } Python data --- interfaces: - ge-1/0/1 - ge-1/0/2 description: 'MPLS interface' family: mpls YAML • YAML is a human readable mechanism for storing data that is easily mapped to common data types. • It supports hierarchical structures • Whitespace delimited (like Python) so files have consistent look. • Program language agnostic – supported by most.
  • 7. Python Shell Python script IT Frameworks Custom Applications ncclient junos-pyez • Junos specific • Abstraction Layer • micro-framework • NETCONF transport only • Vendor Agnostic • No abstractions • Native Python data types (hash/list) • Junos specific not required • XML not required open-source, Juniper open-source, Community interactive simple → complex LAYERED APPROACH
  • 8. Secure TCP/IP connections via SSHv2 (RFC4742) XML NETCONF XML PROTOCOL (RFC4741) Management System Python script to configure device User is encapsulated of backend activities like XML processing. Different protocol involved in communication and other processing. Security Routing Switching Junos PyEZ
  • 9. 1. Python framework with easy learning curve 2. Works with any Junos device running 11.4 or later 3. Operational and Configuration Data/Management 4. Generalized utilities for file-system, software-upgrade, scp 5. Community supported Top 5 reasons for PyEZ
  • 10. * Based on queries posted by their employees on Google Group PyEZ users*
  • 11. PyEZ success stories BGP Flow Specification Newrelic performance analysis Diagnose LAG health LLDP network topology
  • 12. YouTube: https://www.youtube.com/user/JuniperNetworks/search?query=pyez Wiki: https://techwiki.juniper.net/Automation_Scripting/Junos_PyEZ API Docs: http://junos-pyez.readthedocs.org/ Forum: http://groups.google.com/group/junos-python-ez GitHub: http://github.com/Juniper/py-junos-eznc/ Google Group: https://groups.google.com/forum/#!forum/junos-python-ez Resources
  • 13. Demo

Editor's Notes

  1. Junos PyEZ is designed to provide the capabilities that a user would have on the Junos OS command-line interface (CLI) in an environment built for automation tasks. Junos PyEZ does not require extensive knowledge of Junos OS or the Junos XML APIs. It also enables you to manage devices running Junos OS using the familiarity of Python. Python enrich-ness of inbuilt & 3rd party modules enables user to develop huge set of application and frameworks Junos PyEZ enables you to perform specific operational and configuration tasks on devices running Junos OS and also provide utilities such as file system, software upgrade, scp etc
  2. These are some of the feature which makes Python a gem. Hence Python outstands from other programming languages.
  3. YAML is a human friendly data serialization standard for many programming languages. We can define python data types like list, dictionary in normal text format using YAML.
  4. Need to cite URL for ncclient.
  5. All Juons devices support XML rpcs over NETCONF APIs. Juniper follows single Junos even with different set of platform like security, Routing and switching PyEZ leverages this and hence support any boxes with Junos as the OS.
  6. Earlier we talked a bit about Python with Junos PyEZ, PyEz is a Python library to remotely manage/automate Junos devices. One of the biggest benefits of Python with Junos PyEz is that the user is NOT required: (a) to be a "Software Programmer™", (b) have sophisticated knowledge of Junos, or (c) have a complex understanding of the Junos XML API. This is beneficial to the software side as well as to the networking side. The PyEz library was built for two types of users: For "Non-Programmers" - PyEz was designed as a Power Shell This means the engineers that currently lean more toward a networking discipline, can use the native Python shell on their management server (laptop, tablet, phone, etc.) as their point-of-control for remotely managing Junos devices. The Python shell is an interactive environment (and feels similar to a device CLI due to it ability to provide instant feedback), that provides the necessary means to perform common automation tasks, such as conditional testing, for-loops, macros, and templates. These building blocks are similar enough to other "shell" environments, like Bash, to enable you to use the Python shell as a power-tool, rather than a programming language. From the Python shell a user can manage Junos devices using native hash tables, arrays, etc. rather than device-specific Junos XML or resorting to 'screen scraping‘, AKA TCL or Expect scripts, against the actual Junos CLI. Also, this is environment lends it self easily to your first scripts simply by adding “Dot P Y” to a set of commands you have tested. For "Programmers" – PyEz Open and Extensible There is a growing interest and need to automate the network infrastructure into larger IT systems. To do so, traditional software programmers, DevOps, "hackers", etc. need an abstraction library of code to further those activities. Junos PyEZ is designed for extensibility so that the programmer can quickly and easily add new widgets to the library in support of their specific project requirements. There is no need to "wait on the vendor" to provide new functionality. Junos PyEZ is not specifically tied to any version of Junos or any Junos product family.
  7. These are some of our happy customers using PyEZ extensively.
  8. BGP Flow Specification with help thwarting Distributed Denial of Service (DDoS) attacks our customer Newrelic kuses PyEZ to now the performance, resource utilization, and health of network devices in order to help prevent outages, troubleshoot issues, and perform network planning Mapping an entire network topology into a diagram is a tedious task and might take hours and various licensed tools to be done manually. This app is developed on top of PyEZ to have a Web Tool for LLDP network visualization. This tool represents the LLDP networks in terms of bidirectional network graph diagrams showing various connections and interfaces between the devices and giving a high level overview of the network. An APP to monitor the health of your LAG bundles. Link Aggregation Groups (LAG) are widely deployed by customers in their networks for improved bandwidth and availability. LAG child links can be faulty and troubleshooting is hard. Dr.LAG app helps to diagnose the health of LAG bundles.