Class: Arp
- Inherits:
-
Object
- Object
- Arp
- Defined in:
- lib/cnos-rbapi/arp.rb
Overview
The Arp class provides a class implementation and methods for managing the ARP on the node. This class presents an abstraction
Constant Summary collapse
- @@cfg =
'/nos/api/cfg/arp'
Class Method Summary collapse
-
.get_arp_intf_prop(conn, intf) ⇒ Object
parameters: conn - connection object to the node.
-
.get_arp_prop_all(conn) ⇒ Object
parameters: conn - connection object to the node.
-
.get_arp_sys_prop(conn) ⇒ Object
parameters: conn - connection object to the node.
-
.set_arp_intf_prop(conn, intf, params) ⇒ Object
return: JSON response.
-
.set_arp_sys_prop(conn, params) ⇒ Object
return: JSON response.
Class Method Details
.get_arp_intf_prop(conn, intf) ⇒ Object
parameters:
conn - connection object to the node
return: JSON response
81 82 83 84 85 86 87 |
# File 'lib/cnos-rbapi/arp.rb', line 81 def self.get_arp_intf_prop(conn, intf) temp = intf.dup temp.sub! '/', '%2F' url = form_url(conn, @@cfg + '_interface/' + temp) hdr = form_hdr(conn) Rest.get(conn, url, hdr) end |
.get_arp_prop_all(conn) ⇒ Object
parameters:
conn - connection object to the node
return: JSON response
48 49 50 51 52 |
# File 'lib/cnos-rbapi/arp.rb', line 48 def self.get_arp_prop_all(conn) url = form_url(conn, @@cfg + '_interface') hdr = form_hdr(conn) Rest.get(conn, url, hdr) end |
.get_arp_sys_prop(conn) ⇒ Object
parameters:
conn - connection object to the node
return: JSON response
35 36 37 38 39 |
# File 'lib/cnos-rbapi/arp.rb', line 35 def self.get_arp_sys_prop(conn) url = form_url(conn, @@cfg) hdr = form_hdr(conn) Rest.get(conn, url, hdr) end |
.set_arp_intf_prop(conn, intf, params) ⇒ Object
return: JSON response
104 105 106 107 108 109 110 111 |
# File 'lib/cnos-rbapi/arp.rb', line 104 def self.set_arp_intf_prop(conn, intf, params) temp = intf.dup temp.sub! '/', '%2F' url = form_url(conn, @@cfg + '_interface/' + temp) hdr = form_hdr(conn) params = params.to_json Rest.put(conn, url, hdr, params) end |
.set_arp_sys_prop(conn, params) ⇒ Object
return: JSON response
67 68 69 70 71 72 |
# File 'lib/cnos-rbapi/arp.rb', line 67 def self.set_arp_sys_prop(conn, params) url = form_url(conn, @@cfg) hdr = form_hdr(conn) params = params.to_json Rest.put(conn, url, hdr, params) end |