Class: ProxyAPI::Spacewalk

Inherits:
Resource
  • Object
show all
Defined in:
app/lib/proxy_api/spacewalk.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Spacewalk

Returns a new instance of Spacewalk.



3
4
5
6
# File 'app/lib/proxy_api/spacewalk.rb', line 3

def initialize(args)
  @url = args[:url] + '/spacewalk'
  super args
end

Instance Method Details

#delete_host(hostname) ⇒ Object



8
9
10
11
12
13
14
15
# File 'app/lib/proxy_api/spacewalk.rb', line 8

def delete_host(hostname)
  raise Foreman::Exception, 'Missing hostname.' if hostname.blank?
  parse(delete("host/#{hostname}"))
rescue RestClient::ResourceNotFound
  true
rescue StandardError => e
  raise ProxyException.new(url, e, N_('Unable to delete spacewalk host object for %s') % hostname)
end