Class: Uv::Proxmox::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/uv_proxmox/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConnection

Returns a new instance of Connection.



14
15
16
# File 'lib/uv_proxmox/connection.rb', line 14

def initialize
  
end

Instance Attribute Details

#ip_addressObject

Returns the value of attribute ip_address.



8
9
10
# File 'lib/uv_proxmox/connection.rb', line 8

def ip_address
  @ip_address
end

#passwordObject

Returns the value of attribute password.



10
11
12
# File 'lib/uv_proxmox/connection.rb', line 10

def password
  @password
end

#portObject

Returns the value of attribute port.



11
12
13
# File 'lib/uv_proxmox/connection.rb', line 11

def port
  @port
end

#userObject

Returns the value of attribute user.



9
10
11
# File 'lib/uv_proxmox/connection.rb', line 9

def user
  @user
end

Instance Method Details

#execute(cmd) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/uv_proxmox/connection.rb', line 18

def execute(cmd)
  Net::SSH.start(self.ip_address, self.user, :password => self.password, :port => self.port) do |ssh|
    @command_output = ssh.exec!(cmd)
  end
  
  return @command_output
end