class Puppet::Network::HTTP::API
Constants
- Master
Public Class Methods
master_routes()
click to toggle source
# File lib/puppet/network/http/api.rb 36 def self.master_routes 37 server_routes 38 end
not_found()
click to toggle source
# File lib/puppet/network/http/api.rb 4 def self.not_found 5 Puppet::Network::HTTP::Route. 6 path(/.*/). 7 any(lambda do |req, res| 8 raise Puppet::Network::HTTP::Error::HTTPNotFoundError.new("No route for #{req.method} #{req.path}", Puppet::Network::HTTP::Issues::HANDLER_NOT_FOUND) 9 end) 10 end
not_found_upgrade()
click to toggle source
# File lib/puppet/network/http/api.rb 12 def self.not_found_upgrade 13 Puppet::Network::HTTP::Route. 14 path(/.*/). 15 any(lambda do |req, res| 16 raise Puppet::Network::HTTP::Error::HTTPNotFoundError.new("Error: Invalid URL - Puppet expects requests that conform to the " + 17 "/puppet and /puppet-ca APIs.\n\n" + 18 "Note that Puppet 3 agents aren't compatible with this version; if you're " + 19 "running Puppet 3, you must either upgrade your agents to match the server " + 20 "or point them to a server running Puppet 3.\n\n" + 21 "Server Info:\n" + 22 " Puppet version: #{Puppet.version}\n" + 23 " Supported /puppet API versions: #{Puppet::Network::HTTP::SERVER_URL_VERSIONS}\n", 24 Puppet::Network::HTTP::Issues::HANDLER_NOT_FOUND) 25 end) 26 end
server_routes()
click to toggle source
# File lib/puppet/network/http/api.rb 28 def self.server_routes 29 server_prefix = Regexp.new("^#{Puppet::Network::HTTP::SERVER_URL_PREFIX}/") 30 Puppet::Network::HTTP::Route.path(server_prefix). 31 any. 32 chain(Puppet::Network::HTTP::API::Server::V3.routes, 33 Puppet::Network::HTTP::API.not_found) 34 end