Class: PEClient::Resource::NodeClassifierV1::Nodes

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

Overview

Use the nodes endpoints to retrieve records about nodes that have checked into the node classifier.

Constant Summary collapse

BASE_PATH =

The base path for Node Classifier API v1 nodes endpoints.

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

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

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

Instance Method Details

#get(node: nil, limit: nil, offset: nil) ⇒ Hash

Retrieve check-in history for all nodes or a specific node that have checked in with the node classifier.

Parameters:

  • node (String) (defaults to: nil)

    The name of a specific node to retrieve check-in history for. If nil, retrieves check-in history for all nodes.

  • limit (Integer) (defaults to: nil)

    The maximum number of check-in records to retrieve. Cannot be used with the node parameter.

  • offset (Integer) (defaults to: nil)

    The number of check-in records to skip before starting to return results. Cannot be used with the node parameter.

Returns:

  • (Hash)


39
40
41
42
43
44
45
# File 'lib/pe_client/resources/node_classifier.v1/nodes.rb', line 39

def get(node: nil, limit: nil, offset: nil)
  if node
    @client.get "#{BASE_PATH}/#{node}"
  else
    @client.get BASE_PATH, params: {limit:, offset:}.compact
  end
end