Sha256: 35d9a888f3c4081596c4f3fda15bb7e4bef459faca052f3ded90ea0a0021f797

Contents?: true

Size: 1.32 KB

Versions: 18

Compression:

Stored size: 1.32 KB

Contents

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

auth = Abiquo::BasicAuth.new('Abiquo', 'admin', 'xabiquo')
api = Abiquo::Resource('http://abiquo-server-ip:8080/api', auth)


#
# Create a DataCenter
#
#puts "Creating DC1 in BCN..."
api.datacenters.create :name => 'DC1', :location => 'BCN'

#
# Create Remote Services
# 
api.datacenters.first.remoteServices.create :type => 'VIRTUAL_FACTORY', :uri => 'http://localhost:8080/virtualfactory'
api.datacenters.first.remoteServices.create :type => 'STORAGE_SYSTEM_MONITOR', :uri => 'http://localhost:8080/ssm'
api.datacenters.first.remoteServices.create :type => 'VIRTUAL_SYSTEM_MONITOR', :uri => 'http://localhost:8080/vsm'
api.datacenters.first.remoteServices.create :type => 'NODE_COLLECTOR', :uri => 'http://localhost:8080/nodecollector'
api.datacenters.first.remoteServices.create :type => 'APPLIANCE_MANAGER', :uri => 'http://localhost:8080/am'
api.datacenters.first.remoteServices.create :type => 'DHCP_SERVICE', :uri => 'http://localhost:7911'
api.datacenters.first.remoteServices.create :type => 'BPM_SERVICE', :uri => 'http://localhost:7911'

#
# 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

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
abiquo-etk-0.5.8 vendor/api_ruby_client/examples/create_dc_and_hv.rb
abiquo-etk-0.5.3 vendor/api_ruby_client/examples/create_dc_and_hv.rb
abiquo-etk-0.4.42 vendor/api_ruby_client/examples/create_dc_and_hv.rb
abiquo-etk-0.4.33 vendor/api_ruby_client/examples/create_dc_and_hv.rb
abiquo-etk-0.4.32 vendor/api_ruby_client/examples/create_dc_and_hv.rb
abiquo-etk-0.4.29 vendor/api_ruby_client/examples/create_dc_and_hv.rb
abiquo-etk-0.4.25 vendor/api_ruby_client/examples/create_dc_and_hv.rb
abiquo-etk-0.4.24 vendor/api_ruby_client/examples/create_dc_and_hv.rb
abiquo-etk-0.4.23 vendor/api_ruby_client/examples/create_dc_and_hv.rb
abiquo-etk-0.4.22 vendor/api_ruby_client/examples/create_dc_and_hv.rb
abiquo-etk-0.4.20 vendor/api_ruby_client/examples/create_dc_and_hv.rb
abiquo-etk-0.4.19 vendor/api_ruby_client/examples/create_dc_and_hv.rb
abiquo-etk-0.4.18 vendor/api_ruby_client/examples/create_dc_and_hv.rb
abiquo-etk-0.4.17 vendor/api_ruby_client/examples/create_dc_and_hv.rb
abiquo-etk-0.4.16 vendor/api_ruby_client/examples/create_dc_and_hv.rb
abiquo-etk-0.4.15 vendor/api_ruby_client/examples/create_dc_and_hv.rb
abiquo-etk-0.4.14 vendor/api_ruby_client/examples/create_dc_and_hv.rb
abiquo-etk-0.4.13 vendor/api_ruby_client/examples/create_dc_and_hv.rb