Class: PEClient::Resource::PuppetAdminV1
- Inherits:
-
BaseWithPort
- Object
- BaseWithPort
- PEClient::Resource::PuppetAdminV1
- Defined in:
- lib/pe_client/resources/puppet_admin.v1.rb
Overview
Deleting environment caches created by a primary server. Deleting the Puppet Server pool of JRuby instances.
Constant Summary collapse
- BASE_PATH =
The base path for Puppet Admin API v1 endpoints.
"/puppet-admin-api/v1"- PORT =
Default Puppet Admin API Port
8140
Instance Method Summary collapse
-
#environment_cache(environment: nil) ⇒ Hash
When using directory environments, Puppet Server caches the data it loads from disk for each environment.
-
#jruby_pool ⇒ Hash
Puppet Server contains a pool of JRuby instances.
-
#jruby_thread_dump ⇒ Hash
Retrieve a Ruby thread dump for each JRuby instance registered to the pool.
Methods inherited from BaseWithPort
Constructor Details
This class inherits a constructor from PEClient::Resource::BaseWithPort
Instance Method Details
#environment_cache(environment: nil) ⇒ Hash
When using directory environments, Puppet Server caches the data it loads from disk for each environment. This endpoint is for clearing this cache
40 41 42 |
# File 'lib/pe_client/resources/puppet_admin.v1.rb', line 40 def environment_cache(environment: nil) @client.delete "#{BASE_PATH}/environment-cache", params: {environment:}.compact end |
#jruby_pool ⇒ Hash
Puppet Server contains a pool of JRuby instances. This will remove all of the existing JRuby interpreters from the pool, allowing the memory occupied by these interpreters to be reclaimed by the JVM’s garbage collector. The pool will then be refilled with new JRuby instances, each of which will load the latest Ruby code and related resources from disk.
49 50 51 |
# File 'lib/pe_client/resources/puppet_admin.v1.rb', line 49 def jruby_pool @client.delete "#{BASE_PATH}/jruby-pool" end |
#jruby_thread_dump ⇒ Hash
Retrieve a Ruby thread dump for each JRuby instance registered to the pool. The thread dump provides a backtrace through the Ruby code that each instance is executing and is useful for diagnosing instances that have stalled or are otherwise unresponsive.
57 58 59 |
# File 'lib/pe_client/resources/puppet_admin.v1.rb', line 57 def jruby_thread_dump @client.get "#{BASE_PATH}/jruby-pool/thread-dump" end |