I filed this under rails projects, but it's really just some ruby code...
I set a goal for myself to become familiar with the vCloud Director APIs using REST. Mainly to see how long it would take me to automate my first task and prove to myself I can do it. Well, I'm pleased to say that it's alot easier than I thought. I had a new vCloud Director instance installed on Monday, and by Wednesday morning I was just finishing up my code. So within 2 days I was doing some automation tasks and it really wasn't that hard. It gave me a chance to work directly with the API using the rest-client and nokogiri gems. A total of 200+ lines of ruby code all together
This will create a new Organization based on the parameters specified in the XML. Relies on the new_org.xml.
2nd. NewOrgVDCandServices.rb (not completely working)
This will create a new Organization VDC based on parameters specified at the beginning of the Script. It also uses 3 XML files for the POST input parameters. After the Organization vDC is created, then deploy a vShield Edge Gateway appliance to the newly created OrgVDC. Wait 120 seconds after deployment, then configure 2 new services are created on the Gateway appliance:
- A default firewall rule to allow all internal traffic to pass to anything external
- A SNAT rule to allow internal traffic to speak on a NATed address externally.