class Puppet::Network::HTTP::API::V2::Environments

Public Instance Methods

call(request, response) click to toggle source
# File lib/puppet/network/http/api/v2/environments.rb, line 8
def call(request, response)
  response.respond_with(200, "application/json", JSON.dump({
    "search_paths" => @env_loader.search_paths,
    "environments" => Hash[@env_loader.list.collect do |env|
      [env.name, {
        "settings" => {
          "modulepath" => env.full_modulepath,
          "manifest" => env.manifest,
          "environment_timeout" => timeout(env),
          "config_version" => env.config_version || '',
        }
      }]
    end]
  }))
end

Public Class Methods

new(env_loader) click to toggle source
# File lib/puppet/network/http/api/v2/environments.rb, line 4
def initialize(env_loader)
  @env_loader = env_loader
end