I'm working on a Ruby gem called UCSAPI. This is a blog post on ViewYonder about it and how to get it (really easy). Early days, just some basic stuff in there for now... worth a lookie tho'
Easy access to the Cisco UCS API via the Ruby UCSAPI Module Here's what you can do so far... I'm working on going deeper on each object (e.g. into computeBlade) and wider to cover more objects (e.g. lsServer) and more methods (e.g. config changes and listening).
Last login: Thu Sep 30 21:52:06 on ttys001
13:20:08 ~ $ irb
>> require 'UCSAPI'
=> true
>> include UCSAPI
=> Object
>> ucspe = UCSM.new( :url => 'http://192.168.1.66/nuova', :inName => 'config', :inPassword => 'config')
...output removed..
>> ucspe.fabric
..dumps two fabric objects out, which look ugly on a blog...
>> ucspe.fabric.each { |fabric| puts fabric.oobIfIp }
192.168.1.66
0.0.0.0
>> ucspe.chassis.each { |chassis| puts chassis.dn + " is managed by Fabric " + chassis.managingInst }
sys/chassis-1 is managed by Fabric A
sys/chassis-2 is managed by Fabric A
sys/chassis-3 is managed by Fabric A
>> ucspe.fan( :fabric => 'A' ).each { |fan| puts fan.serial + " is " + fan.operState }
Chassis-2A is operable
Chassis-1A is operable
>> ucspe.psu( :chassis => 1).each { |psu| puts psu.dn + " voltage is " + psu.voltage }
sys/chassis-1/psu-4 voltage is ok
sys/chassis-1/psu-3 voltage is ok
sys/chassis-1/psu-2 voltage is ok
sys/chassis-1/psu-1 voltage is ok