Class: ProxyAPI::ForemanChef::ChefProxy

Inherits:
Object
  • Object
show all
Defined in:
app/lib/proxy_api/foreman_chef/chef_proxy.rb

Defined Under Namespace

Classes: Client, Node

Constant Summary collapse

PREFIX =
'chef'

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ ChefProxy

Returns a new instance of ChefProxy.



20
21
22
# File 'app/lib/proxy_api/foreman_chef/chef_proxy.rb', line 20

def initialize(args)
  @args = args
end

Instance Method Details

#delete_client(key) ⇒ Object

Deletes a Chef Client entry

key

: String containing the hostname

Returns : Boolean status



48
49
50
# File 'app/lib/proxy_api/foreman_chef/chef_proxy.rb', line 48

def delete_client(key)
  Client.new(@args).send(:delete, key)
end

#delete_node(key) ⇒ Object

Deletes a Chef Node entry

key

: String containing the hostname

Returns : Boolean status



34
35
36
# File 'app/lib/proxy_api/foreman_chef/chef_proxy.rb', line 34

def delete_node(key)
  Node.new(@args).send(:delete, key)
end

#show_client(key) ⇒ Object

Shows a Chef Client entry

key

: String containing the hostname

Returns : Hash representation of host on chef server



41
42
43
# File 'app/lib/proxy_api/foreman_chef/chef_proxy.rb', line 41

def show_client(key)
  Client.new(@args).send(:get, key)
end

#show_node(key) ⇒ Object

Shows a Chef Node entry

key

: String containing the hostname

Returns : Hash representation of host on chef server



27
28
29
# File 'app/lib/proxy_api/foreman_chef/chef_proxy.rb', line 27

def show_node(key)
  Node.new(@args).send(:get, key)
end