fluke/devops-service/routes/v2.0/bootstrap_templates.rb

38 lines
842 B
Ruby
Raw Normal View History

2014-05-08 15:34:26 +04:00
require "json"
require "providers/provider_factory"
2014-07-08 11:48:23 +04:00
require "commands/bootstrap_templates"
2014-05-08 15:34:26 +04:00
2014-12-15 14:26:54 +03:00
module Devops
module Version2_0
module Core
module BootstrapTemplatesRoutes
2014-05-08 15:34:26 +04:00
2014-12-15 14:26:54 +03:00
extend BootstrapTemplatesCommands
2014-07-08 11:48:23 +04:00
2014-12-15 14:26:54 +03:00
def self.registered(app)
2014-05-08 15:34:26 +04:00
2014-12-15 14:26:54 +03:00
# Get list of available bootstrap templates
#
# * *Request*
# - method : GET
# - headers :
# - Accept: application/json
#
# * *Returns* : array of strings
# [
# "omnibus"
# ]
app.get "/templates" do
check_headers :accept
check_privileges("templates", "r")
json BootstrapTemplatesRoutes.get_templates
end
puts "Bootstrap templates routes initialized"
end
2014-05-08 15:34:26 +04:00
2014-12-15 14:26:54 +03:00
end
end
2014-05-08 15:34:26 +04:00
end
end