Sha256: 91691fcbdcc6c26eb3c7d8f66991f3a8d78d74d7fe90e9fee61f1cd4c9d54452

Contents?: true

Size: 817 Bytes

Versions: 240

Compression:

Stored size: 817 Bytes

Contents

require 'json'

class Puppet::Network::HTTP::API::Master::V3::Environments
  def initialize(env_loader)
    @env_loader = env_loader
  end

  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

  private

  def timeout(env)
    ttl = @env_loader.get_conf(env.name).environment_timeout
    if ttl == Float::INFINITY
      "unlimited"
    else
      ttl
    end
  end

end

Version data entries

240 entries across 240 versions & 3 rubygems

Version Path
puppet-retrospec-1.8.0 vendor/pup410/lib/puppet/network/http/api/master/v3/environments.rb
puppet-retrospec-1.7.0 vendor/pup410/lib/puppet/network/http/api/master/v3/environments.rb
puppet-5.3.7 lib/puppet/network/http/api/master/v3/environments.rb
puppet-5.3.7-x86-mingw32 lib/puppet/network/http/api/master/v3/environments.rb
puppet-5.3.7-x64-mingw32 lib/puppet/network/http/api/master/v3/environments.rb
puppet-5.3.7-universal-darwin lib/puppet/network/http/api/master/v3/environments.rb
puppet-4.10.12 lib/puppet/network/http/api/master/v3/environments.rb
puppet-4.10.12-x86-mingw32 lib/puppet/network/http/api/master/v3/environments.rb
puppet-4.10.12-x64-mingw32 lib/puppet/network/http/api/master/v3/environments.rb
puppet-4.10.12-universal-darwin lib/puppet/network/http/api/master/v3/environments.rb
bolt-0.20.3 vendored/puppet/lib/puppet/network/http/api/master/v3/environments.rb
bolt-0.20.2 vendored/puppet/lib/puppet/network/http/api/master/v3/environments.rb
bolt-0.19.1 vendored/puppet/lib/puppet/network/http/api/master/v3/environments.rb
puppet-4.10.11 lib/puppet/network/http/api/master/v3/environments.rb
puppet-4.10.11-x86-mingw32 lib/puppet/network/http/api/master/v3/environments.rb
puppet-4.10.11-x64-mingw32 lib/puppet/network/http/api/master/v3/environments.rb
puppet-4.10.11-universal-darwin lib/puppet/network/http/api/master/v3/environments.rb
puppet-5.3.6 lib/puppet/network/http/api/master/v3/environments.rb
puppet-5.3.6-x86-mingw32 lib/puppet/network/http/api/master/v3/environments.rb
puppet-5.3.6-x64-mingw32 lib/puppet/network/http/api/master/v3/environments.rb