Class: NetconfNode
Overview
Class that represents a NetconfNode
Direct Known Subclasses
Instance Attribute Summary collapse
-
#ip ⇒ Object
readonly
String : IP address for NETCONF protocol of NETCONF device.
-
#password ⇒ Object
readonly
String : Admin password for logon NETCONF device.
-
#port ⇒ Object
readonly
String : Port number of the NETCONF protocol.
-
#tcp_only ⇒ Object
readonly
Boolean : True if only TCP is used to communicate with NETCONF device.
-
#username ⇒ Object
readonly
String : Admin userid for logon to NETCONF device.
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
controller-
Controller : The controller object through which NETCONF device is to be accessed.
-
#to_hash ⇒ Object
:nodoc:.
Constructor Details
#initialize(controller: nil, name: nil, ip_addr: nil, port_number: nil, admin_name: nil, admin_password: nil, tcp_only: false) ⇒ NetconfNode
controller-
Controller : The controller object through which NETCONF device is to be accessed.
name-
String : The name of the NETCONF node. e.g. vrouter
ip_addr-
String : IP address for NETCONF protocol of NETCONF device. e.g. 172.22.11.44
port_number-
String : Port number of the NETCONF protocol. e.g. 830
admin_name-
String : Admin userid for logon to NETCONF device. e.g. vyatta
admin_password-
String : Admin password for logon NETCONF device. e.g. vyatta
tcp_only-
Boolean : True if only TCP is used to communicate with NETCONF device.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/controller/netconf_node.rb', line 59 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)
String : IP address for NETCONF protocol of NETCONF device. e.g. 172.22.11.44
40 41 42 |
# File 'lib/controller/netconf_node.rb', line 40 def ip @ip end |
#password ⇒ Object (readonly)
String : Admin password for logon NETCONF device. e.g. vyatta
46 47 48 |
# File 'lib/controller/netconf_node.rb', line 46 def password @password end |
#port ⇒ Object (readonly)
String : Port number of the NETCONF protocol. e.g. 830
42 43 44 |
# File 'lib/controller/netconf_node.rb', line 42 def port @port end |
#tcp_only ⇒ Object (readonly)
Boolean : True if only TCP is used to communicate with NETCONF device.
48 49 50 |
# File 'lib/controller/netconf_node.rb', line 48 def tcp_only @tcp_only end |
#username ⇒ Object (readonly)
String : Admin userid for logon to NETCONF device. e.g. vyatta
44 45 46 |
# File 'lib/controller/netconf_node.rb', line 44 def username @username end |
Instance Method Details
#to_hash ⇒ Object
:nodoc:
75 76 77 78 |
# File 'lib/controller/netconf_node.rb', line 75 def to_hash #:nodoc: {:controller => @controller.to_hash, :name => @name, :ip_addr => @ip, :port_num => @port, :admin_name => @username, :admin_password => @password} end |