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