Class: Uv::Proxmox::Connection
- Inherits:
-
Object
- Object
- Uv::Proxmox::Connection
- Defined in:
- lib/uv_proxmox/connection.rb
Instance Attribute Summary collapse
-
#ip_address ⇒ Object
Returns the value of attribute ip_address.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
- #execute(cmd) ⇒ Object
-
#initialize ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize ⇒ Connection
Returns a new instance of Connection.
14 15 16 |
# File 'lib/uv_proxmox/connection.rb', line 14 def initialize end |
Instance Attribute Details
#ip_address ⇒ Object
Returns the value of attribute ip_address.
8 9 10 |
# File 'lib/uv_proxmox/connection.rb', line 8 def ip_address @ip_address end |
#password ⇒ Object
Returns the value of attribute password.
10 11 12 |
# File 'lib/uv_proxmox/connection.rb', line 10 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
11 12 13 |
# File 'lib/uv_proxmox/connection.rb', line 11 def port @port end |
#user ⇒ Object
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 |