Class: PEClient::Resource::PuppetDB::MetadataV1
- 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
-
#server_time ⇒ Hash
Used to retrieve the server time from the PuppetDB server.
-
#version(latest: false) ⇒ Hash
The version endpoint can be used to retrieve version information from the PuppetDB server.
Methods inherited from Base
Constructor Details
This class inherits a constructor from PEClient::Resource::Base
Instance Method Details
#server_time ⇒ Hash
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.
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 |