Class: Fog::Ecloud::MockDataClasses::MockNetwork
- Inherits:
-
Base
- Object
- Hash
- Base
- Fog::Ecloud::MockDataClasses::MockNetwork
show all
- Defined in:
- lib/fog/ecloud/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
375
376
377
|
# File 'lib/fog/ecloud/mock_data_classes.rb', line 375
def address
subnet_ips.first
end
|
#broadcast ⇒ Object
379
380
381
|
# File 'lib/fog/ecloud/mock_data_classes.rb', line 379
def broadcast
subnet_ips.last
end
|
#dns ⇒ Object
344
345
346
|
# File 'lib/fog/ecloud/mock_data_classes.rb', line 344
def dns
"8.8.8.8"
end
|
#extensions ⇒ Object
358
359
360
|
# File 'lib/fog/ecloud/mock_data_classes.rb', line 358
def extensions
@extensions ||= MockNetworkExtensions.new({}, self)
end
|
#features ⇒ Object
348
349
350
351
352
|
# File 'lib/fog/ecloud/mock_data_classes.rb', line 348
def features
[
{ :type => :FenceMode, :value => "isolated" }
]
end
|
#gateway ⇒ Object
336
337
338
|
# File 'lib/fog/ecloud/mock_data_classes.rb', line 336
def gateway
self[:gateway] || subnet_ips[1]
end
|
#ip_collection ⇒ Object
354
355
356
|
# File 'lib/fog/ecloud/mock_data_classes.rb', line 354
def ip_collection
@ip_collection ||= MockNetworkIps.new({}, self)
end
|
#name ⇒ Object
328
329
330
|
# File 'lib/fog/ecloud/mock_data_classes.rb', line 328
def name
self[:name] || subnet
end
|
#netmask ⇒ Object
340
341
342
|
# File 'lib/fog/ecloud/mock_data_classes.rb', line 340
def netmask
self[:netmask] || subnet_ipaddr.mask_string
end
|
#random_ip ⇒ Object
362
363
364
|
# File 'lib/fog/ecloud/mock_data_classes.rb', line 362
def random_ip
usable_subnet_ips[rand(usable_subnet_ips.length)]
end
|
#rnat ⇒ Object
for TM eCloud. should probably be a subclass
367
368
369
|
# File 'lib/fog/ecloud/mock_data_classes.rb', line 367
def rnat
self[:rnat]
end
|
#subnet ⇒ Object
332
333
334
|
# File 'lib/fog/ecloud/mock_data_classes.rb', line 332
def subnet
self[:subnet]
end
|
#usable_subnet_ips ⇒ Object
371
372
373
|
# File 'lib/fog/ecloud/mock_data_classes.rb', line 371
def usable_subnet_ips
subnet_ips[3..-2]
end
|