Skip to content

Instantly share code, notes, and snippets.

View stevenbryen's full-sized avatar

Steve Bryen stevenbryen

View GitHub Profile
@stevenbryen
stevenbryen / gist:3775710
Created September 24, 2012 12:27
Simple Ruby interface for vCenter Orchestrator (5.1 RESTful API)
# A simple example of calling the VCO 5.1 REST API using Ruby. This example uses the HTTParty Gem
# to POST some XML to the new RESTful API. There are two examples (more coming) which are:
# getWorkflow(id) - This will return a workflow with a given workflow ID, HTTParty will allow you to access the response
# using the syntax response["inputParameters"] for example.
# executeWorkflow(id, inputxml) - This will allow you to execute a Workflow via the API. I was unable to get a workflow
# to execute using a hash input, so i opted for the ugly xml string option. I think this might be to do with the namespace
# I will hopefully have this as a simple hash very soon but for now it accepts the raw xml as a string.
@stevenbryen
stevenbryen / vco_interface.rb
Created June 16, 2012 21:47
Simple Ruby Interface for vCenter Orchestrator
class VCO
#Require the Following Ruby Gems
require "rubygems"
require "savon"
require "ostruct"
#Set the Attributes
attr_writer :vcoHostName, :username, :password
def executeWfl(workflowName, workflowInputs)