Class: Fog::Compute::GoGrid::Images

Inherits:
Fog::Collection
  • Object
show all
Defined in:
lib/fog/go_grid/models/compute/images.rb

Instance Method Summary collapse

Instance Method Details

#allObject



12
13
14
15
16
17
18
# File 'lib/fog/go_grid/models/compute/images.rb', line 12

def all
  data = service.grid_image_list.body['list']
  load(data)
  if server
    self.replace(self.select {|image| image.server_id == server.id})
  end
end

#get(image_id) ⇒ Object



20
21
22
23
24
25
# File 'lib/fog/go_grid/models/compute/images.rb', line 20

def get(image_id)
  response = service.grid_image_get.body['list'][image_id]
  new(data)
rescue Fog::Compute::GoGrid::NotFound
  nil
end