require 'db/mongo/models/stack_template/stack_template_factory' require "app/api2/parsers/stack_template" require_relative "request_handler" module Devops module API2_0 module Handler class StackTemplate < RequestHandler set_parser Devops::API2_0::Parser::StackTemplateParser def stack_templates Devops::Db.connector.stack_templates end def stack_templates_for_provider provider Devops::Db.connector.stack_templates(provider) end def create_stack_template body = parser.create template_model = Model::StackTemplateFactory.create(body['provider'], body) Devops::Db.connector.stack_template_insert(template_model) template_model end def get_stack_template id Devops::Db.connector.stack_template(id) end def delete_stack_template id Devops::Db.connector.stack_template_delete id end end end end end