Class: VlanIntf
- Inherits:
-
Object
- Object
- VlanIntf
- Defined in:
- lib/cnos-rbapi/vlan_intf.rb
Constant Summary collapse
- @@cfg =
'/nos/api/cfg/vlan_interface'
Class Method Summary collapse
-
.get_all_vlan_intf(conn) ⇒ Object
parameters: conn - connection object to the node.
-
.get_vlan_prop_intf(conn, vlan_intf) ⇒ Object
parameters: conn - connection object to the node vlan_intf - Interface .
-
.update_vlan_intf(conn, vlan_intf, params) ⇒ Object
parameters: conn - connection object to the node params - dictionary that requires the following format of key-value pairs {.
Class Method Details
.get_all_vlan_intf(conn) ⇒ Object
parameters:
conn - connection object to the node
return: JSON response
34 35 36 37 38 |
# File 'lib/cnos-rbapi/vlan_intf.rb', line 34 def self.get_all_vlan_intf(conn) url = form_url(conn, @@cfg) hdr = form_hdr(conn) Rest.get(conn, url, hdr) end |
.get_vlan_prop_intf(conn, vlan_intf) ⇒ Object
parameters:
conn - connection object to the node
vlan_intf - Interface
return: JSON response
48 49 50 51 52 53 54 |
# File 'lib/cnos-rbapi/vlan_intf.rb', line 48 def self.get_vlan_prop_intf(conn, vlan_intf) temp = vlan_intf.dup temp.sub! '/', '%2F' url = form_url(conn, @@cfg + '/' + temp) hdr = form_hdr(conn) Rest.get(conn, url, hdr) end |
.update_vlan_intf(conn, vlan_intf, params) ⇒ Object
parameters:
conn - connection object to the node
params - dictionary that requires the following format of key-value pairs
{
"if_name": "<if_name>",
79 80 81 82 83 84 85 86 |
# File 'lib/cnos-rbapi/vlan_intf.rb', line 79 def self.update_vlan_intf(conn, vlan_intf, params) temp = vlan_intf.dup temp.sub! '/', '%2F' url = form_url(conn, @@cfg + '/' + temp) hdr = form_hdr(conn) params = params.to_json Rest.put(conn, url, hdr, params) end |