Module: ForemanChef::SmartProxyExtensions
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/models/foreman_chef/smart_proxy_extensions.rb
Instance Method Summary collapse
- #delete_client(fqdn) ⇒ Object
- #delete_node(fqdn) ⇒ Object
- #show_client(fqdn) ⇒ Object
-
#show_node(fqdn) ⇒ Object
create or overwrite instance methods…
Instance Method Details
#delete_client(fqdn) ⇒ Object
30 31 32 33 34 35 36 |
# File 'app/models/foreman_chef/smart_proxy_extensions.rb', line 30 def delete_client(fqdn) begin reply = ProxyAPI::ForemanChef::ChefProxy.new(:url => url).delete_client(fqdn) JSON.parse(reply) #rescue RestClient:: end end |
#delete_node(fqdn) ⇒ Object
14 15 16 17 18 19 20 |
# File 'app/models/foreman_chef/smart_proxy_extensions.rb', line 14 def delete_node(fqdn) begin reply = ProxyAPI::ForemanChef::ChefProxy.new(:url => url).delete_node(fqdn) JSON.parse(reply) #rescue RestClient:: end end |
#show_client(fqdn) ⇒ Object
22 23 24 25 26 27 28 |
# File 'app/models/foreman_chef/smart_proxy_extensions.rb', line 22 def show_client(fqdn) reply = ProxyAPI::ForemanChef::ChefProxy.new(:url => url).show_client(fqdn) JSON.parse(reply) rescue RestClient::ResourceNotFound Foreman::Logging.logger('foreman_chef').debug "Client '#{fqdn}' not found" return false end |
#show_node(fqdn) ⇒ Object
create or overwrite instance methods…
6 7 8 9 10 11 12 |
# File 'app/models/foreman_chef/smart_proxy_extensions.rb', line 6 def show_node(fqdn) reply = ProxyAPI::ForemanChef::ChefProxy.new(:url => url).show_node(fqdn) JSON.parse(reply) rescue RestClient::ResourceNotFound Foreman::Logging.logger('foreman_chef').debug "Node '#{fqdn}' not found" return false end |