just creating some POST operations for vCloud Director
Ruby
Latest commit bb5a5c1 Jan 16, 2015 @kacole2 cleanup
Permalink
Failed to load latest commit information.
1NewOrg.rb
2NewOrgVDC.rb
3NewOrgVDCNetwork.rb
README.md
_config.yml
new_org.xml
new_orgvdc.xml
new_vdc_network.xml
new_vshield_edge.xml
new_vshield_edge_services.xml
provision_vapp.rb
provision_vapp_clean.rb
provision_vapp_fog.rb

README.md

Ruby scripts that show how to interact with the vCloud API

This will automatically create a new vCloud organisation + VDC, VShield Edge and VCD Network It will also create the default SNAT rule and Allow all outbound Firewall rule.

Setup for Windows

  • Head to http://rubyinstaller.org/downloads/ and download the 32bit ruby 1.9.3 installer for windows
  • Install it, when you get to the screen asking for a destination install folder, tick the "add ruby to path" and "associate rb files" tickboxes

Now open a fresh command prompt to get the new environment variables

  • run -> gem install rest-client
  • run -> gem install nokogiri

That will get you the two required Gems that these scripts lean on

  • run the scripts as per the section at the bottom of this file

Setup for Mac OSX

Plenty of ways to tackle this, i went with:

  • Install Xcode command line tools, open a terminal on your mac, then type "git" or "gcc" it will propmt you to download and install the tool-chain
  • Head over to homebrew and install that (http://brew.sh)
  • Head over to RVM (ruby version manager) and grba that (http://rvm.io)
  • Pull down a later version of ruby and create a new gemset with RVM if you want, but not strictly needed

  • Open a new terminal and run -> gem install rest-client

  • Also run -> gem install nokogiri

Ok that is pretty much it, clone this repo, change director into it and run the scripts below

How to run the scripts

  1. Edit the config file (_config.yml) enter your username and password and desired organization name
  2. Run ruby .\1NewOrg.rb
  3. Run ruby .\2NewOrgVDC.rb
  4. Run ruby .\3NewOrgVDCNetwork.rb

NOTE: you might need to run script 3 a few times if it throws a 400 error, seems that vCloud takes a while to be ready for a vDC network creation after deploying a new edge.