class Arp

The Arp class provides a class implementation and methods for managing the ARP on the node. This class presents an abstraction

Public Class Methods

get_arp_intf_prop(conn, intf) click to toggle source

This API gets the ARP properties of one interface.

parameters:
conn - connection object to the node

return: JSON response
# 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) click to toggle source

This API gets the ARP properties of all interfaces.

parameters:
conn - connection object to the node

return: JSON response
# 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) click to toggle source

This API gets the ARP properties of the system.

parameters:
conn - connection object to the node

return: JSON response
# 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) click to toggle source

This API updates the ARP properties of one interface.

parameters:
conn - connection object to the node
params - dictionary that requires the following format of key-value pairs
             {
               "if_name": "<if_name>",
               “ageout_time” : “<ageout_time>”
             }
description -
if_name     :IP interface name (String).Note: The interface must exist.
ageout_time :The global ARP entry age‐out time, in seconds; an integer from 60‐28800.  Default value: 1500 seconds. 

return: JSON response
# 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) click to toggle source

This API updates the ARP properties of the system.

parameters:
conn - connection object to the node
params - dictionary that requires the following format of key-value pairs
             {
               “ageout_time” : “<ageout_time>”
             }
description -
ageout_time :The global ARP entry age‐out time, in seconds; an integer from 60‐28800.  Default value: 1500 seconds. 

return: JSON response
# 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