Class: Fog::Ecloud::MockDataClasses::MockNetwork
- Inherits:
-
Base
- Object
- Hash
- Base
- Fog::Ecloud::MockDataClasses::MockNetwork
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
Instance Method Details
#address ⇒ Object
408
409
410
|
# File 'lib/fog/compute/ecloud.rb', line 408
def address
subnet_ips.first
end
|
#broadcast ⇒ Object
412
413
414
|
# File 'lib/fog/compute/ecloud.rb', line 412
def broadcast
subnet_ips.last
end
|
#dns ⇒ Object
377
378
379
|
# File 'lib/fog/compute/ecloud.rb', line 377
def dns
"8.8.8.8"
end
|
#extensions ⇒ Object
391
392
393
|
# File 'lib/fog/compute/ecloud.rb', line 391
def extensions
@extensions ||= MockNetworkExtensions.new({}, self)
end
|
#features ⇒ Object
381
382
383
384
385
|
# File 'lib/fog/compute/ecloud.rb', line 381
def features
[
{ :type => :FenceMode, :value => "isolated" }
]
end
|
#gateway ⇒ Object
369
370
371
|
# File 'lib/fog/compute/ecloud.rb', line 369
def gateway
self[:gateway] || subnet_ips[1]
end
|
#ip_collection ⇒ Object
387
388
389
|
# File 'lib/fog/compute/ecloud.rb', line 387
def ip_collection
@ip_collection ||= MockNetworkIps.new({}, self)
end
|
#name ⇒ Object
361
362
363
|
# File 'lib/fog/compute/ecloud.rb', line 361
def name
self[:name] || subnet
end
|
#netmask ⇒ Object
373
374
375
|
# File 'lib/fog/compute/ecloud.rb', line 373
def netmask
self[:netmask] || subnet_ipaddr.mask
end
|
#random_ip ⇒ Object
395
396
397
|
# File 'lib/fog/compute/ecloud.rb', line 395
def random_ip
usable_subnet_ips[rand(usable_subnet_ips.length)]
end
|
#rnat ⇒ Object
for TM eCloud. should probably be a subclass
400
401
402
|
# File 'lib/fog/compute/ecloud.rb', line 400
def rnat
self[:rnat]
end
|
#subnet ⇒ Object
365
366
367
|
# File 'lib/fog/compute/ecloud.rb', line 365
def subnet
self[:subnet]
end
|
#usable_subnet_ips ⇒ Object
404
405
406
|
# File 'lib/fog/compute/ecloud.rb', line 404
def usable_subnet_ips
subnet_ips[3..-2]
end
|