Class: PEClient::Resource::PuppetDB::MetadataV1

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

Overview

PuppetDB’s metadata API endpoints can be used to retrieve version information and the server time from the PuppetDB server.

Constant Summary collapse

BASE_PATH =

The base path for PuppetDB Metadata v1 endpoints.

"#{PuppetDB::BASE_PATH}/meta/v1".freeze

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

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

Instance Method Details

#server_timeHash

Used to retrieve the server time from the PuppetDB server.



45
46
47
# File 'lib/pe_client/resources/puppet_db/metadata.v1.rb', line 45

def server_time
  @client.get "#{BASE_PATH}/server-time"
end

#version(latest: false) ⇒ Hash

The version endpoint can be used to retrieve version information from the PuppetDB server.

Parameters:

  • latest (Boolean) (defaults to: false)

Returns:

  • (Hash)

See Also:



36
37
38
# File 'lib/pe_client/resources/puppet_db/metadata.v1.rb', line 36

def version(latest: false)
  @client.get latest ? "#{BASE_PATH}/version/latest" : "#{BASE_PATH}/version"
end