Skip to content

Instantly share code, notes, and snippets.

@stevie-chambers
stevie-chambers / nx1k.rb
Created October 30, 2011 21:00
Basic Ruby interface to the Nexus 1000V
class NX1K
require 'net/ssh'
attr_writer :host, :user, :pwd
def send(xml)
session = Net::SSH.start(@host, @user, :password => @pwd, :timeout => 10, :verbose => :debug) do |session|
channel = session.open_channel do |channel|
channel.subsystem("xmlagent") do |xmlagent, success|
xmlagent.on_data do |xmlagent, data|