Class: Puppet::HTTP::Service::Puppetserver Private

Inherits:
Puppet::HTTP::Service show all
Defined in:
lib/puppet/http/service/puppetserver.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

The puppetserver service.

Constant Summary

Constants inherited from Puppet::HTTP::Service

EXCLUDED_FORMATS, SERVICE_NAMES

Instance Attribute Summary

Attributes inherited from Puppet::HTTP::Service

#url

Instance Method Summary collapse

Methods inherited from Puppet::HTTP::Service

#connect, create_service, valid_name?, #with_base_url

Constructor Details

#initialize(client, session, server, port) ⇒ Puppetserver

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Puppetserver.

Parameters:

  • client (Puppet::HTTP::Client)
  • session (Puppet::HTTP::Session)
  • server (String)

    If an explicit server is given, create a service using that server. If server is nil, the default value is used to create the service.

  • port (Integer)

    If an explicit port is given, create a service using that port. If port is nil, the default value is used to create the service.



16
17
18
19
# File 'lib/puppet/http/service/puppetserver.rb', line 16

def initialize(client, session, server, port)
  url = build_url('', server || Puppet[:server], port || Puppet[:serverport])
  super(client, session, url)
end

Instance Method Details

#get_simple_status(ssl_context: nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Request the puppetserver’s simple status

the connection.

Parameters:

Returns:

  • Puppet::HTTP::Response The HTTP response



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/puppet/http/service/puppetserver.rb', line 28

def get_simple_status(ssl_context: nil)
  response = @client.get(
    with_base_url("/status/v1/simple/master"),
    headers: add_puppet_headers({}),
    options: {ssl_context: ssl_context}
  )

  process_response(response)

  [response, response.body.to_s]
end