Class: PEClient::Resource::NodeClassifierV1::Rules

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

Overview

Use the rules endpoint to translate a node group rule condition into PuppetDB query syntax.

Constant Summary collapse

BASE_PATH =

The base path for Node Classifier API v1 rules endpoints.

"#{NodeClassifierV1::BASE_PATH}/rules".freeze

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

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

Instance Method Details

#translate(format: nil) ⇒ Hash

Translate a node group rule condition into PuppetDB query syntax.

Parameters:

  • format (String) (defaults to: nil)

    Optional format parameter to change the response format. The default value is “nodes”. If you specify format: “inventory”, the response returns classifier rules in a compatible dot notation format, instead of the PuppetDB AST format.

Returns:

  • (Hash)


36
37
38
# File 'lib/pe_client/resources/node_classifier.v1/rules.rb', line 36

def translate(format: nil)
  @client.get "#{BASE_PATH}/translate", params: {format:}.compact
end