Class: PEClient::Resource::StatusV1

Inherits:
Base
  • Object
show all
Defined in:
lib/pe_client/resources/status.v1.rb

Overview

You can use the status API to check the health of Puppet Enterprise (PE) components and services. It is useful for automatically monitoring your infrastructure, removing unhealthy service instances from a load-balanced pool, checking configuration values, or troubleshooting issues in PE.

Constant Summary collapse

BASE_PATH =

The base path for Status API v1 endpoints.

"/status/v1"
CONSOLE_SERVICES_PORT =

Default Console Services Status API Port

4433
PUPPET_SERVER_PORT =

Default Puppet Server Status API Port

8140
ORCHESTRATOR_PORT =

Default Orchestrator Status API Port

8143
PUPPETDB_PORT =

Default PuppetDB Status API Port

8081

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from PEClient::Resource::Base

Instance Method Details

#console_services(service_name: nil, level: nil, timeout: nil) ⇒ Hash

The services endpoints provide machine-consumable information about running services. They are intended for scripting and integration with other services.

Parameters:

  • level (String) (defaults to: nil)

    How thorough of a check to run. Set to “critical”, “debug”, or “info”. The default is “info”.

  • timeout (Integer) (defaults to: nil)

    Specified in seconds. The default is 30.

  • service_name (String) (defaults to: nil)

    The name of the service to retrieve information for. Available services include:

    - "activity-service"
    - "classifier-service"
    - "rbac-service"
    

Returns:

  • (Hash)


60
61
62
# File 'lib/pe_client/resources/status.v1.rb', line 60

def console_services(service_name: nil, level: nil, timeout: nil)
  services :console_services, service_name:, level:, timeout:
end

#console_simple(service_name: nil) ⇒ String

The status service plaintext endpoints are intended for load balancers that don’t support JSON parsing or parameter setting. These endpoints return simple string bodies (either the service’s state or a simple error message) and a relevant status code.

Parameters:

  • service_name (String) (defaults to: nil)

    The name of the service to retrieve information for. Available services include:

    - "activity-service"
    - "classifier-service"
    - "rbac-service"
    

Returns:

  • (String)


107
108
109
# File 'lib/pe_client/resources/status.v1.rb', line 107

def console_simple(service_name: nil)
  simple :console_services, service_name:
end

#orchestrator_services(service_name: nil, level: nil, timeout: nil) ⇒ Hash

The services endpoints provide machine-consumable information about running services. They are intended for scripting and integration with other services.

Parameters:

  • level (String) (defaults to: nil)

    How thorough of a check to run. Set to “critical”, “debug”, or “info”. The default is “info”.

  • timeout (Integer) (defaults to: nil)

    Specified in seconds. The default is 30.

  • service_name (String) (defaults to: nil)

    The name of the service to retrieve information for. Available services include:

    - "broker-service" (primary server only)
    - "orchestrator-service"
    

Returns:

  • (Hash)


81
82
83
# File 'lib/pe_client/resources/status.v1.rb', line 81

def orchestrator_services(service_name: nil, level: nil, timeout: nil)
  services :orchestrator, service_name:, level:, timeout:
end

#orchestrator_simple(service_name: nil) ⇒ String

The status service plaintext endpoints are intended for load balancers that don’t support JSON parsing or parameter setting. These endpoints return simple string bodies (either the service’s state or a simple error message) and a relevant status code.

Parameters:

  • service_name (String) (defaults to: nil)

    The name of the service to retrieve information for. Available services include:

    - "broker-service" (primary server only)
    - "orchestrator-service"
    

Returns:

  • (String)


128
129
130
# File 'lib/pe_client/resources/status.v1.rb', line 128

def orchestrator_simple(service_name: nil)
  simple :orchestrator, service_name:
end

#pe_jruby_metrics(level: "debug") ⇒ Hash

Returns information about the JRuby pools from which Puppet Server fulfills agent requests.

Parameters:

  • level (String) (defaults to: "debug")

Returns:

  • (Hash)


146
147
148
# File 'lib/pe_client/resources/status.v1.rb', line 146

def pe_jruby_metrics(level: "debug")
  services :puppet_server, service_name: "pe-jruby-metrics", level:
end

#pe_master(level: "debug") ⇒ Hash

Returns information about the routes that agents use to connect to the primary server.

Parameters:

  • level (String) (defaults to: "debug")

Returns:

  • (Hash)


155
156
157
# File 'lib/pe_client/resources/status.v1.rb', line 155

def pe_master(level: "debug")
  services :puppet_server, service_name: "pe-master", level:
end

#pe_puppet_profiler(level: "debug") ⇒ Hash

Returns statistics about catalog compilation. You can use this data to discover which functions or resources are consuming the most resources or are most frequently used.

Parameters:

  • level (String) (defaults to: "debug")

Returns:

  • (Hash)


165
166
167
# File 'lib/pe_client/resources/status.v1.rb', line 165

def pe_puppet_profiler(level: "debug")
  services :puppet_server, service_name: "pe-puppet-profiler", level:
end

#puppet_server_services(service_name: nil, level: nil, timeout: nil) ⇒ Hash

The services endpoints provide machine-consumable information about running services. They are intended for scripting and integration with other services.

Parameters:

  • level (String) (defaults to: nil)

    How thorough of a check to run. Set to “critical”, “debug”, or “info”. The default is “info”.

  • timeout (Integer) (defaults to: nil)

    Specified in seconds. The default is 30.

  • service_name (String) (defaults to: nil)

    The name of the service to retrieve information for. Available services include:

    - "broker-service" (compilers only)
    - "code-manager-service"
    - "server" (Puppet Server)
    

Returns:

  • (Hash)


71
72
73
# File 'lib/pe_client/resources/status.v1.rb', line 71

def puppet_server_services(service_name: nil, level: nil, timeout: nil)
  services :puppet_server, service_name:, level:, timeout:
end

#puppet_server_simple(service_name: nil) ⇒ String

The status service plaintext endpoints are intended for load balancers that don’t support JSON parsing or parameter setting. These endpoints return simple string bodies (either the service’s state or a simple error message) and a relevant status code.

Parameters:

  • service_name (String) (defaults to: nil)

    The name of the service to retrieve information for. Available services include:

    - "broker-service" (compilers only)
    - "code-manager-service"
    - "server" (Puppet Server)
    

Returns:

  • (String)


118
119
120
# File 'lib/pe_client/resources/status.v1.rb', line 118

def puppet_server_simple(service_name: nil)
  simple :puppet_server, service_name:
end

#puppetdb_services(service_name: nil, level: nil, timeout: nil) ⇒ Hash

The services endpoints provide machine-consumable information about running services. They are intended for scripting and integration with other services.

Parameters:

  • level (String) (defaults to: nil)

    How thorough of a check to run. Set to “critical”, “debug”, or “info”. The default is “info”.

  • timeout (Integer) (defaults to: nil)

    Specified in seconds. The default is 30.

  • service_name (String) (defaults to: nil)

    The name of the service to retrieve information for. Available services include:

    - "puppetdb-service"
    

Returns:

  • (Hash)


90
91
92
# File 'lib/pe_client/resources/status.v1.rb', line 90

def puppetdb_services(service_name: nil, level: nil, timeout: nil)
  services :puppetdb, service_name:, level:, timeout:
end

#puppetdb_simple(service_name: nil) ⇒ String

The status service plaintext endpoints are intended for load balancers that don’t support JSON parsing or parameter setting. These endpoints return simple string bodies (either the service’s state or a simple error message) and a relevant status code.

Parameters:

  • service_name (String) (defaults to: nil)

    The name of the service to retrieve information for. Available services include:

    - "puppetdb-service"
    

Returns:

  • (String)


137
138
139
# File 'lib/pe_client/resources/status.v1.rb', line 137

def puppetdb_simple(service_name: nil)
  simple :puppetdb, service_name:
end