class Puppet::Network::HTTP::API

Constants

Master

Public Class Methods

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