Class: PEClient::Resource::NodeInventoryV1
- Inherits:
-
BaseWithPort
- Object
- BaseWithPort
- PEClient::Resource::NodeInventoryV1
- Defined in:
- lib/pe_client/resources/node_inventory.v1.rb
Overview
Puppet Enterprise Node inventory API v1
Constant Summary collapse
- BASE_PATH =
Base path for the Node Inventory API v1
"/inventory/v1"- PORT =
Default Node Inventory API Port
8143
Instance Method Summary collapse
-
#connections(certnames: [], sensitive: false, extract: []) ⇒ Hash
List all the connections entries in the inventory database or request information about a specific connection.
-
#create_connections(certnames:, type:, parameters: {}, sensitive_parameters: {}, duplicates: "error") ⇒ Hash
Create a new connection entry in the node inventory service database.
-
#delete_connections(certnames) ⇒ Hash
Remove specified certnames from all associated connection entries in the inventory service database.
Methods inherited from BaseWithPort
Constructor Details
This class inherits a constructor from PEClient::Resource::BaseWithPort
Instance Method Details
#connections(certnames: [], sensitive: false, extract: []) ⇒ Hash
List all the connections entries in the inventory database or request information about a specific connection.
44 45 46 47 48 49 50 |
# File 'lib/pe_client/resources/node_inventory.v1.rb', line 44 def connections(certnames: [], sensitive: false, extract: []) body = {} body[:certnames] = certnames unless certnames.empty? body[:sensitive] = sensitive if sensitive body[:extract] = extract unless extract.empty? @client.post "#{BASE_PATH}/query/connections", body: end |
#create_connections(certnames:, type:, parameters: {}, sensitive_parameters: {}, duplicates: "error") ⇒ Hash
Create a new connection entry in the node inventory service database.
68 69 70 |
# File 'lib/pe_client/resources/node_inventory.v1.rb', line 68 def create_connections(certnames:, type:, parameters: {}, sensitive_parameters: {}, duplicates: "error") @client.post "#{BASE_PATH}/command/create-connection", body: {certnames:, type:, parameters:, sensitive_parameters:, duplicates:} end |
#delete_connections(certnames) ⇒ Hash
Remove specified certnames from all associated connection entries in the inventory service database. In PuppetDB, removed certnames are replaced with preserve: false.
78 79 80 |
# File 'lib/pe_client/resources/node_inventory.v1.rb', line 78 def delete_connections(certnames) @client.post "#{BASE_PATH}/command/delete-connection", body: {certnames:} end |