Class: ProxyAPI::RemoteExecutionSSH

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

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ RemoteExecutionSSH

Returns a new instance of RemoteExecutionSSH.



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

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

Instance Method Details

#drop_from_known_hosts(hostname) ⇒ Object



14
15
16
17
18
# File 'app/lib/proxy_api/remote_execution_ssh.rb', line 14

def drop_from_known_hosts(hostname)
  delete('known_hosts/' + hostname)
rescue => e
  raise ProxyException.new(url, e, N_('Unable to remove host from known hosts'))
end

#pubkeyObject



8
9
10
11
12
# File 'app/lib/proxy_api/remote_execution_ssh.rb', line 8

def pubkey
  get('pubkey').strip
rescue => e
  raise ProxyException.new(url, e, N_('Unable to fetch public key'))
end