Yesterday, I built out a small ViPR instance in my home lab using Virtual Isilon to start messing with the APIs. I wasn't really planning on showing this particular API because I'm wanting to play with a different set of APIs, but I figured I would take the time and show a ruby example of using the ViPR REST API. REST is awesome. Flat out. I spent part of yesterday trying to decipher the vSphere APIs with Rbvmomi and got completely lost. REST is BEST.
This ruby script is pretty simple. We are going to use the rest-client and JSON gems to fetch some information and parse it. The script will log in, spit out information about every vCenter instance, display host information for each vCenter instance, and display ViPR Service Statistics. I don't have anything configured just yet for storage, but the ViPR REST API is incredibly easy to use.Add a comment