Class: NetconfNode

Inherits:
Node
  • Object
show all
Defined in:
lib/controller/netconf_node.rb

Direct Known Subclasses

VRouter5600

Instance Attribute Summary collapse

Attributes inherited from Node

#name

Instance Method Summary collapse

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.

Raises:



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

#ipObject (readonly)

Returns the value of attribute ip.



33
34
35
# File 'lib/controller/netconf_node.rb', line 33

def ip
  @ip
end

#passwordObject (readonly)

Returns the value of attribute password.



33
34
35
# File 'lib/controller/netconf_node.rb', line 33

def password
  @password
end

#portObject (readonly)

Returns the value of attribute port.



33
34
35
# File 'lib/controller/netconf_node.rb', line 33

def port
  @port
end

#tcp_onlyObject (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

#usernameObject (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_hashObject



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