class VlanIntf
The VlanIntf
class provides a class implementation and methods for managing the Vlan
Interfaces on the node. This class presents an abstraction
Public Class Methods
get_all_vlan_intf(conn)
click to toggle source
This API gets VLAN properties of all Ethernet interfaces.
parameters: conn - connection object to the node return: JSON response
# 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)
click to toggle source
This API gets VLAN properties of an Ethernet Interface.
parameters: conn - connection object to the node vlan_intf - Interface return: JSON response
# 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)
click to toggle source
This API updates properties of a Lag
.
parameters: conn - connection object to the node params - dictionary that requires the following format of key-value pairs { "if_name": "<if_name>", “bridgeport_mode”: “<bridgeport_mode>” “pvid”: "<pvid>", “vlans”: ["<vlan_id>"] } description - if_name :Ethernet interface name (String).Note: The Ethernet interface must exist. bridgeport_ mode :Bridge port mode; one of access, trunk pvid :Native VLAN for a port (the access VLAN for access ports or the native VLAN for trunk ports); an integer from 1‐3999. Default value: 1. vlans :(Optional) VLAN memberships; all, none, or an integer from 1‐3999. return: JSON response
# 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