Class: Fog::Terremark::Shared::Servers

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/terremark/models/shared/servers.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) all



22
23
24
25
26
27
28
# File 'lib/fog/terremark/models/shared/servers.rb', line 22

def all
  data = []
  service.get_vdc(vdc_id).body['ResourceEntities'].select do |entity|
      data << service.servers.get(entity["href"].split('/').last)
  end
  data
end

- (Object) get(server_id)



30
31
32
33
34
35
36
# File 'lib/fog/terremark/models/shared/servers.rb', line 30

def get(server_id)
  if server_id
    new(service.get_vapp(server_id).body)
  else
    nil
  end
end

- (Object) vdc_id



38
39
40
# File 'lib/fog/terremark/models/shared/servers.rb', line 38

def vdc_id
  @vdc_id ||= service.default_vdc_id
end