Name: ruby-junos-ez-srx
Owner: Juniper Networks
Description: Ruby libraries support Junos automation via NETCONF - "SRX library"
Created: 2013-04-04 11:50:33.0
Updated: 2017-04-07 21:57:17.0
Pushed: 2013-08-19 14:10:09.0
Size: 260
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
NOTE: Work in progress - not yet in RubyGems.org
A collection of Ruby classes to make Junos SRX automation Easy. This library supports the following resources:
For more information about each topic, please refer to the README_xyz.md files.
ire 'pry'
ire 'yaml'
ire 'net/netconf/jnpr'
ire 'junos-ez/stdlib'
ire 'junos-ez/srx'
gin information for NETCONF session
n = { :target => 'vsrx', :username => 'jeremy', :password => 'jeremy1', }
reate a NETCONF object to manage the device and open the connection ...
= Netconf::SSH.new( login )
out.print "Connecting to device #{login[:target]} ... "
.open
out.puts "OK!"
ow bind providers to the device object.
he 'Junos::Ez::Provider' must be first before all others
his provider will setup the device 'facts'. The other providers
llow you to define the instance variables; so this example
s using 'l1_ports' and 'ip_ports', but you could name them
hat you like, yo!
s::Ez::Provider( ndev )
s::Ez::L1ports::Provider( ndev, :l1_ports )
s::Ez::IPports::Provider( ndev, :ip_ports )
s::Ez::SRX::Zones::Provider( ndev, :zones )
s::Ez::SRX::Policies::Provider( ndev, :policies )
rop into interactive mode to play around ... let's look
t what the device has for facts ...
ndev.facts.list
ndev.facts.catalog
ndev.fact :version
ow look at specific providers like the zones and policies
ndev.zones.list
ndev.zones.catalog
ing.pry
.close
BSD-2, See LICENSE file