1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/rackspace/models/orchestration/templates.rb
2014-12-12 14:22:07 -05:00

31 lines
773 B
Ruby

require 'fog/rackspace/models/orchestration/template'
module Fog
module Rackspace
class Orchestration
class Templates < Fog::Collection
model Fog::Rackspace::Orchestration::Template
def get(obj)
data = if obj.is_a?(Stack)
service.get_stack_template(obj).body
else
service.show_resource_template(obj.resource_name).body
end
new(data)
rescue Fog::Rackspace::Orchestration::NotFound
nil
end
def validate(options={})
data = service.validate_template(options).body
temp = new
temp.parameters = data['Parameters']
temp.description = data['Description']
temp
end
end
end
end
end