Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created October 17, 2015 01:54
Show Gist options
  • Save anonymous/1f1759b7b039c6db29de to your computer and use it in GitHub Desktop.
Save anonymous/1f1759b7b039c6db29de to your computer and use it in GitHub Desktop.
@client = RightApi::Client.new(:email => email, :password => password, :account_id => accountn, :timeout => nil)
s = {}
allClouds = @client.clouds.index
allClouds.each do |cloud|
puts "Cloud: " + cloud.name
cloud.instances.index(:view =>'full').each do |inst|
if inst.show.state === "operational"
a = 0
inst.security_groups.each do |sec|
a+=1
s = {inst.name => {'secHref'+ a.to_s => sec['href']}}
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment