Class: Fog::Compute::Gridscale::Templates

Inherits:
PagingCollection show all
Defined in:
lib/fog/compute/gridscale/models/templates.rb

Instance Method Summary collapse

Methods inherited from PagingCollection

#next_page, #previous_page

Instance Method Details

#all(filters = {}) ⇒ Object



9
10
11
12
13
# File 'lib/fog/compute/gridscale/models/templates.rb', line 9

def all(filters={})
  data = service.templates_get(filters)
  droplets = data.body["templates"].values
  load(droplets)
end

#get(object_uuid) ⇒ Object



15
16
17
18
19
20
# File 'lib/fog/compute/gridscale/models/templates.rb', line 15

def get(object_uuid)
  template = service.template_get(object_uuid).body['template']
  new(template) if template
rescue Fog::Errors::NotFound
  nil
end