Class: Fog::Ecloud::MockDataClasses::MockNetwork
- Inherits:
-
Base
- Object
- Hash
- Base
- Fog::Ecloud::MockDataClasses::MockNetwork
show all
- Defined in:
- lib/rackspace-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
Methods inherited from Hash
#symbolize_keys!
Instance Method Details
#address ⇒ Object
377
378
379
|
# File 'lib/rackspace-fog/ecloud/mock_data_classes.rb', line 377
def address
subnet_ips.first
end
|
#broadcast ⇒ Object
381
382
383
|
# File 'lib/rackspace-fog/ecloud/mock_data_classes.rb', line 381
def broadcast
subnet_ips.last
end
|
#dns ⇒ Object
346
347
348
|
# File 'lib/rackspace-fog/ecloud/mock_data_classes.rb', line 346
def dns
"8.8.8.8"
end
|
#extensions ⇒ Object
360
361
362
|
# File 'lib/rackspace-fog/ecloud/mock_data_classes.rb', line 360
def extensions
@extensions ||= MockNetworkExtensions.new({}, self)
end
|
#features ⇒ Object
350
351
352
353
354
|
# File 'lib/rackspace-fog/ecloud/mock_data_classes.rb', line 350
def features
[
{ :type => :FenceMode, :value => "isolated" }
]
end
|
#gateway ⇒ Object
338
339
340
|
# File 'lib/rackspace-fog/ecloud/mock_data_classes.rb', line 338
def gateway
self[:gateway] || subnet_ips[1]
end
|
#ip_collection ⇒ Object
356
357
358
|
# File 'lib/rackspace-fog/ecloud/mock_data_classes.rb', line 356
def ip_collection
@ip_collection ||= MockNetworkIps.new({}, self)
end
|
#name ⇒ Object
330
331
332
|
# File 'lib/rackspace-fog/ecloud/mock_data_classes.rb', line 330
def name
self[:name] || subnet
end
|
#netmask ⇒ Object
342
343
344
|
# File 'lib/rackspace-fog/ecloud/mock_data_classes.rb', line 342
def netmask
self[:netmask] || subnet_ipaddr.mask
end
|
#random_ip ⇒ Object
364
365
366
|
# File 'lib/rackspace-fog/ecloud/mock_data_classes.rb', line 364
def random_ip
usable_subnet_ips[rand(usable_subnet_ips.length)]
end
|
#rnat ⇒ Object
for TM eCloud. should probably be a subclass
369
370
371
|
# File 'lib/rackspace-fog/ecloud/mock_data_classes.rb', line 369
def rnat
self[:rnat]
end
|
#subnet ⇒ Object
334
335
336
|
# File 'lib/rackspace-fog/ecloud/mock_data_classes.rb', line 334
def subnet
self[:subnet]
end
|
#usable_subnet_ips ⇒ Object
373
374
375
|
# File 'lib/rackspace-fog/ecloud/mock_data_classes.rb', line 373
def usable_subnet_ips
subnet_ips[3..-2]
end
|