fluke/devops-service/db/mongo/models/stack/stack_aws.rb
Tim Lianov 03dc3d8d99 v3
2018-04-04 22:44:39 +03:00

32 lines
844 B
Ruby

require 'db/mongo/models/stack/stack_base'
module Devops
module Model
class StackAws < StackBase
def initialize attrs={}
super
self.provider = 'aws'
end
def update_in_cloud!(params)
parameters = params.keep_if do |key|
%w(Parameters TemplateURL Capabilities).include?(key)
end
provider_instance.update_stack(self, parameters)
end
# We should improve this functionality: stack will be rollbacked
# if there are errors during stack_template changing, so we should track
# that process and persist changes only in case of success.
def change_stack_template!(stack_template)
self.stack_template = stack_template
update_in_cloud!('TemplateUrl' => stack_template_model.template_url)
save
end
end
end
end