Class: Fog::Compute::RackspaceV2::VirtualInterfaces

Inherits:
Fog::Collection
  • Object
show all
Defined in:
lib/fog/rackspace/models/compute_v2/virtual_interfaces.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#serverObject

Returns the value of attribute server



11
12
13
# File 'lib/fog/rackspace/models/compute_v2/virtual_interfaces.rb', line 11

def server
  @server
end

Instance Method Details

#allFog::Compute::RackspaceV2::Servers

Note:

Fog's current implementation only returns 1000 servers

Note:

The filter parameter on the method is just to maintain compatability with other providers that support filtering.

Returns list of virtual interfaces for a server



31
32
33
34
35
36
37
38
# File 'lib/fog/rackspace/models/compute_v2/virtual_interfaces.rb', line 31

def all
  raise "Please access this collection via Server#virtual_interfaces" unless self.server

  data = service.list_virtual_interfaces(server.id).body['virtual_interfaces']
  objects = load(data)
  objects.each {|obj| obj.attributes[:server] = self.server}
  objects
end

#new(attributes = {}) ⇒ Object



40
41
42
# File 'lib/fog/rackspace/models/compute_v2/virtual_interfaces.rb', line 40

def new(attributes = {})
  super({ :server => server }.merge(attributes))
end