Class: PEClient::Resource::RBACV1::Disclaimer

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

Overview

Use these endpoints to modify the disclaimer text that appears on the Puppet Enterprise (PE) console login page.

Constant Summary collapse

BASE_PATH =

The base path for RBAC API v1 Disclaimer endpoints.

"#{RBACV1::BASE_PATH}/config/disclaimer".freeze
COMMAND_BASE_PATH =

The base path for RBAC API v1 Disclaimer command endpoints.

"#{RBACV1::BASE_PATH}/command/config".freeze

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

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

Instance Method Details

#getHash

Retrieve the current disclaimer text, as specified by #set. This endpoint does not retrieve the contents of any disclaimer.txt file.

Returns:

  • (Hash)


36
37
38
# File 'lib/pe_client/resources/rbac.v1/disclaimer.rb', line 36

def get
  @client.get(BASE_PATH)
end

#removeHash

Remove the disclaimer text set through POST /command/config/set-disclaimer.

Returns:

  • (Hash)

    If the request is successful, the response body is empty.



52
53
54
# File 'lib/pe_client/resources/rbac.v1/disclaimer.rb', line 52

def remove
  @client.post "#{COMMAND_BASE_PATH}/remove-disclaimer"
end

#set(disclaimer) ⇒ Hash

Change the disclaimer text that is on the PE console login page.

Parameters:

  • disclaimer (String)

Returns:

  • (Hash)

    If the request is successful, the response body is empty.



45
46
47
# File 'lib/pe_client/resources/rbac.v1/disclaimer.rb', line 45

def set(disclaimer)
  @client.post "#{COMMAND_BASE_PATH}/set-disclaimer", body: {disclaimer:}
end