mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
28 lines
715 B
Ruby
28 lines
715 B
Ruby
require 'fog/core/collection'
|
|
require 'fog/glesys/models/compute/template'
|
|
|
|
module Fog
|
|
module Compute
|
|
class Glesys
|
|
|
|
class Templates < Fog::Collection
|
|
|
|
model Fog::Glesys::Compute::Template
|
|
|
|
def all
|
|
request = service.template_list.body
|
|
templates = request['response']['templates']
|
|
|
|
# Only select OpenVZ and Xen platforms
|
|
# Glesys only offers Xen and OpenVZ but they have other platforms in the list
|
|
templates = templates.select do |platform, templates|
|
|
%w|openvz xen|.include?(platform.downcase)
|
|
end.collect{|platform, templates| templates}.flatten
|
|
|
|
load(templates)
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|
|
end
|