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

#allObject



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

#get(server_id) ⇒ Object



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

#vdc_idObject



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

def vdc_id
  @vdc_id ||= service.default_vdc_id
end