2014-05-08 15:34:26 +04:00
|
|
|
require "json"
|
|
|
|
|
require "routes/v2.0/base_routes"
|
|
|
|
|
require "providers/provider_factory"
|
2014-07-08 11:48:23 +04:00
|
|
|
require "commands/bootstrap_templates"
|
2014-05-08 15:34:26 +04:00
|
|
|
|
|
|
|
|
module Version2_0
|
|
|
|
|
class BootstrapTemplatesRoutes < BaseRoutes
|
|
|
|
|
|
2014-07-08 11:48:23 +04:00
|
|
|
include BootstrapTemplatesCommands
|
|
|
|
|
|
2014-05-08 15:34:26 +04:00
|
|
|
def initialize wrapper
|
|
|
|
|
super wrapper
|
|
|
|
|
puts "Bootstrap templates routes initialized"
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# Get list of available bootstrap templates
|
|
|
|
|
#
|
|
|
|
|
# * *Request*
|
|
|
|
|
# - method : GET
|
|
|
|
|
# - headers :
|
|
|
|
|
# - Accept: application/json
|
|
|
|
|
#
|
|
|
|
|
# * *Returns* : array of strings
|
|
|
|
|
# [
|
|
|
|
|
# "omnibus"
|
|
|
|
|
# ]
|
|
|
|
|
get "/templates" do
|
|
|
|
|
check_headers :accept
|
|
|
|
|
check_privileges("templates", "r")
|
2014-07-08 11:48:23 +04:00
|
|
|
json get_templates
|
2014-05-08 15:34:26 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|