Class: Fog::Vcloud::MockDataClasses::MockNetwork
- Inherits:
-
Base
- Object
- Hash
- Base
- Fog::Vcloud::MockDataClasses::MockNetwork
show all
- Defined in:
- lib/fog/vcloud/mock_data_classes.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
376
377
378
|
# File 'lib/fog/vcloud/mock_data_classes.rb', line 376
def address
subnet_ips.first
end
|
#broadcast ⇒ Object
380
381
382
|
# File 'lib/fog/vcloud/mock_data_classes.rb', line 380
def broadcast
subnet_ips.last
end
|
#dns ⇒ Object
345
346
347
|
# File 'lib/fog/vcloud/mock_data_classes.rb', line 345
def dns
"8.8.8.8"
end
|
#extensions ⇒ Object
359
360
361
|
# File 'lib/fog/vcloud/mock_data_classes.rb', line 359
def extensions
@extensions ||= MockNetworkExtensions.new({}, self)
end
|
#features ⇒ Object
349
350
351
352
353
|
# File 'lib/fog/vcloud/mock_data_classes.rb', line 349
def features
[
{ :type => :FenceMode, :value => "isolated" }
]
end
|
#gateway ⇒ Object
337
338
339
|
# File 'lib/fog/vcloud/mock_data_classes.rb', line 337
def gateway
self[:gateway] || subnet_ips[1]
end
|
#ip_collection ⇒ Object
355
356
357
|
# File 'lib/fog/vcloud/mock_data_classes.rb', line 355
def ip_collection
@ip_collection ||= MockNetworkIps.new({}, self)
end
|
#name ⇒ Object
329
330
331
|
# File 'lib/fog/vcloud/mock_data_classes.rb', line 329
def name
self[:name] || subnet
end
|
#netmask ⇒ Object
341
342
343
|
# File 'lib/fog/vcloud/mock_data_classes.rb', line 341
def netmask
self[:netmask] || subnet_ipaddr.mask
end
|
#random_ip ⇒ Object
363
364
365
|
# File 'lib/fog/vcloud/mock_data_classes.rb', line 363
def random_ip
usable_subnet_ips[rand(usable_subnet_ips.length)]
end
|
#rnat ⇒ Object
for TM eCloud. should probably be a subclass
368
369
370
|
# File 'lib/fog/vcloud/mock_data_classes.rb', line 368
def rnat
self[:rnat]
end
|
#subnet ⇒ Object
333
334
335
|
# File 'lib/fog/vcloud/mock_data_classes.rb', line 333
def subnet
self[:subnet]
end
|
#usable_subnet_ips ⇒ Object
372
373
374
|
# File 'lib/fog/vcloud/mock_data_classes.rb', line 372
def usable_subnet_ips
subnet_ips[3..-2]
end
|