Class: Fog::Ecloud::MockDataClasses::MockNetwork

Inherits:
Base
  • Object
show all
Defined in:
lib/fog/compute/ecloud.rb

Instance Method Summary collapse

Methods inherited from Base

#_parent, base_url, #base_url, base_url=, #first, #href, #initialize, #inspect, #last

Constructor Details

This class inherits a constructor from Fog::Ecloud::MockDataClasses::Base

Instance Method Details

#addressObject



408
409
410
# File 'lib/fog/compute/ecloud.rb', line 408

def address
  subnet_ips.first
end

#broadcastObject



412
413
414
# File 'lib/fog/compute/ecloud.rb', line 412

def broadcast
  subnet_ips.last
end

#dnsObject



377
378
379
# File 'lib/fog/compute/ecloud.rb', line 377

def dns
  "8.8.8.8"
end

#extensionsObject



391
392
393
# File 'lib/fog/compute/ecloud.rb', line 391

def extensions
  @extensions ||= MockNetworkExtensions.new({}, self)
end

#featuresObject



381
382
383
384
385
# File 'lib/fog/compute/ecloud.rb', line 381

def features
  [
   { :type => :FenceMode, :value => "isolated" }
  ]
end

#gatewayObject



369
370
371
# File 'lib/fog/compute/ecloud.rb', line 369

def gateway
  self[:gateway] || subnet_ips[1]
end

#ip_collectionObject



387
388
389
# File 'lib/fog/compute/ecloud.rb', line 387

def ip_collection
  @ip_collection ||= MockNetworkIps.new({}, self)
end

#nameObject



361
362
363
# File 'lib/fog/compute/ecloud.rb', line 361

def name
  self[:name] || subnet
end

#netmaskObject



373
374
375
# File 'lib/fog/compute/ecloud.rb', line 373

def netmask
  self[:netmask] || subnet_ipaddr.mask
end

#random_ipObject



395
396
397
# File 'lib/fog/compute/ecloud.rb', line 395

def random_ip
  usable_subnet_ips[rand(usable_subnet_ips.length)]
end

#rnatObject

for TM eCloud. should probably be a subclass



400
401
402
# File 'lib/fog/compute/ecloud.rb', line 400

def rnat
  self[:rnat]
end

#subnetObject



365
366
367
# File 'lib/fog/compute/ecloud.rb', line 365

def subnet
  self[:subnet]
end

#usable_subnet_ipsObject



404
405
406
# File 'lib/fog/compute/ecloud.rb', line 404

def usable_subnet_ips
  subnet_ips[3..-2]
end