Class: NetconfNode
Direct Known Subclasses
Instance Attribute Summary collapse
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#tcp_only ⇒ Object
readonly
Returns the value of attribute tcp_only.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(controller: nil, name: nil, ip_addr: nil, port_number: nil, admin_name: nil, admin_password: nil, tcp_only: false) ⇒ NetconfNode
constructor
A new instance of NetconfNode.
- #to_hash ⇒ Object
Constructor Details
#initialize(controller: nil, name: nil, ip_addr: nil, port_number: nil, admin_name: nil, admin_password: nil, tcp_only: false) ⇒ NetconfNode
Returns a new instance of NetconfNode.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/controller/netconf_node.rb', line 35 def initialize(controller: nil, name: nil, ip_addr: nil, port_number: nil, admin_name: nil, admin_password: nil, tcp_only: false) super(controller: controller, name: name) raise ArgumentError, "IP Address (ip_addr) required" unless ip_addr raise ArgumentError, "Port Number (port_number) required" unless port_number raise ArgumentError, "Admin Username (admin_name) required" unless admin_name raise ArgumentError, "Admin Password (admin_password) required" unless admin_password @ip = ip_addr @port = port_number @username = admin_name @password = admin_password @tcp_only = tcp_only end |
Instance Attribute Details
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
33 34 35 |
# File 'lib/controller/netconf_node.rb', line 33 def ip @ip end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
33 34 35 |
# File 'lib/controller/netconf_node.rb', line 33 def password @password end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
33 34 35 |
# File 'lib/controller/netconf_node.rb', line 33 def port @port end |
#tcp_only ⇒ Object (readonly)
Returns the value of attribute tcp_only.
33 34 35 |
# File 'lib/controller/netconf_node.rb', line 33 def tcp_only @tcp_only end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
33 34 35 |
# File 'lib/controller/netconf_node.rb', line 33 def username @username end |
Instance Method Details
#to_hash ⇒ Object
51 52 53 54 |
# File 'lib/controller/netconf_node.rb', line 51 def to_hash {:controller => @controller.to_hash, :name => @name, :ip_addr => @ip, :port_num => @port, :admin_name => @username, :admin_password => @password} end |