Sha256: 61f3ab98f5f0469dac3871e3ebe64e6581e70ae9baf6b5319ca14d43b43dc7ae

Contents?: true

Size: 765 Bytes

Versions: 22

Compression:

Stored size: 765 Bytes

Contents

require 'rubygems'
require 'abiquo'
require 'pp'

auth = Abiquo::BasicAuth.new('Abiquo', 'admin', 'admin')
api = Abiquo::Resource('http://as-testing.bcn.abiquo.com:8080/api', auth)

#
# Create a new Rack
#
puts "Creating rack 'myrack01'..."
api.datacenters.first.racks.create :name => 'myrack01'

#
# Iterate over all the racks and print the rack name
#
puts "Listing racks.."
api.datacenters.first.racks.each do |rack|
  pp rack.name
end

#
# Iterate over all the racks and print the rack name
#
puts "Listing racks..."
api.datacenters.first.racks.each do |rack|
  pp rack.name
end

#
# Delete the rack myrack01
# 
# NOT SUPPORTED IN ABIQUO1.6
#
#puts "Deleting rack 'myrack01'..."
#api.datacenters.first.racks.each do |r|
#  r.delete if r.name == 'myrack01'
#end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
abiquo-etk-0.6.4 vendor/abiquo-0.1.2/examples/rack_resource.rb
abiquo-etk-0.6.3 vendor/abiquo-0.1.2/examples/rack_resource.rb
abiquo-etk-0.6.2 vendor/abiquo-0.1.2/examples/rack_resource.rb
abiquo-etk-0.6.1 vendor/abiquo-0.1.2/examples/rack_resource.rb
abiquo-etk-0.5.8 vendor/api_ruby_client/examples/rack_resource.rb
abiquo-etk-0.5.3 vendor/api_ruby_client/examples/rack_resource.rb
abiquo-etk-0.4.42 vendor/api_ruby_client/examples/rack_resource.rb
abiquo-etk-0.4.33 vendor/api_ruby_client/examples/rack_resource.rb
abiquo-etk-0.4.32 vendor/api_ruby_client/examples/rack_resource.rb
abiquo-etk-0.4.29 vendor/api_ruby_client/examples/rack_resource.rb
abiquo-etk-0.4.25 vendor/api_ruby_client/examples/rack_resource.rb
abiquo-etk-0.4.24 vendor/api_ruby_client/examples/rack_resource.rb
abiquo-etk-0.4.23 vendor/api_ruby_client/examples/rack_resource.rb
abiquo-etk-0.4.22 vendor/api_ruby_client/examples/rack_resource.rb
abiquo-etk-0.4.20 vendor/api_ruby_client/examples/rack_resource.rb
abiquo-etk-0.4.19 vendor/api_ruby_client/examples/rack_resource.rb
abiquo-etk-0.4.18 vendor/api_ruby_client/examples/rack_resource.rb
abiquo-etk-0.4.17 vendor/api_ruby_client/examples/rack_resource.rb
abiquo-etk-0.4.16 vendor/api_ruby_client/examples/rack_resource.rb
abiquo-etk-0.4.15 vendor/api_ruby_client/examples/rack_resource.rb