Introduction to
REST & vCloud Air APIs with Ruby

by: Kendrick Coleman


follow along at http://kendrickcoleman.com/slides/vcloudapi

Well... You Should

OK... why?

  • Ops => DevOps
  • 48 clicks == 48 potential mistakes
  • your value can only increase

vCloud Air

  • It's a cloud, atleast
    • big resume builder. aws, digital ocean, gce
  • It's VMware
    • hooks already built-in and you're familiar

free trial at vcloud.vmware.com

Ideas for using vCloud Air API

  • Allow outside services to talk
    • configuration management (puppet, chef, salt, ansible)
    • remote cloud monitoring
    • internal cloud portal provisioning
    • cloud bursting (i hate that word)
    • dr
    • dynamic network changes
    • cmdb
    • resource consumption

vCloud API

the documentation is your friend

vCloud API

all in XML :(


200 OK
Content-Type: application/vnd.vmware.vcloud.org+xml
...

   
   
   
   
   Example Corp’s Primary Organization

					

tools required to parse XML such as nokogiri, nori, oga

can use something like crack to do XML => JSON formatting when using tools like crack, understand things are possible to break.

Today's Work

all ruby files are at github.com/kacole/vcloud-director_scripts
seriosuly outdated readme, i apologize in advance

we will follow Hello vCloud: A Simplified RESTful Workflow

  • Log In To the Compute Service in vCloud Air Virtual Private Cloud OnDemand
  • Find a Catalog and a VDC
  • Retrieve the Contents of a Catalog
  • Retrieve a Catalog Item
  • Retrieve D eployment Information From the VDC
  • Deploy the vApp
  • Log Out

ruby is my programming language of choice so we will see how to use the rest-client gem for REST calls, nori gem for parsing XML, then fog to see an easier implementation.

lets start hacking!

Building a Rails App

vcloudairvms.cfapps.io

Thank You

Kendrick Coleman