Class: Igmp
- Inherits:
-
Object
- Object
- Igmp
- Defined in:
- lib/cnos-rbapi/igmp.rb
Overview
The Igmp class provides a class implementation and methods for managing the IGMP on the node. This class presents an abstraction
Constant Summary collapse
- @@cfg =
'/nos/api/cfg/igmp'
Class Method Summary collapse
-
.get_igmp_snoop_prop(conn) ⇒ Object
parameters: conn - connection object to the node.
-
.get_igmp_vlan_prop(conn, vlan_id) ⇒ Object
parameters: conn - connection object to the node vlan_id - VLAN number.
-
.set_igmp_snoop_prop(conn, params) ⇒ Object
parameters: conn - connection object to the node params - dictionary that requires the following format of key-value pairs { “ena_igmp_snoop”: “<ena_igmp_snoop>” } description - ena_igmp_ snoop :Enables IGMP snooping globally on all VLANs; one of yes (default), no.
-
.set_igmp_vlan_prop(conn, vlan_id, params) ⇒ Object
parameters: conn - connection object to the node vlan_id - VLAN number params - dictionary that requires the following format of key-value pairs { “vlan_id”: “<vlan_id>”, “ena_igmp_snoop”: “<ena_igmp_snoop>”, “fast_leave”: “<fast_leave>”, “query_interval”: “<query_interval>”, “version”: “<version>”, } description - vlan_id :VLAN number.Note: The VLAN must exist.
Class Method Details
.get_igmp_snoop_prop(conn) ⇒ Object
parameters:
conn - connection object to the node
return: JSON response
35 36 37 38 39 |
# File 'lib/cnos-rbapi/igmp.rb', line 35 def self.get_igmp_snoop_prop(conn) url = form_url(conn, @@cfg + '/snoop') hdr = form_hdr(conn) Rest.get(conn, url, hdr) end |
.get_igmp_vlan_prop(conn, vlan_id) ⇒ Object
parameters:
conn - connection object to the node
vlan_id - VLAN number
return: JSON response
75 76 77 78 79 80 81 |
# File 'lib/cnos-rbapi/igmp.rb', line 75 def self.get_igmp_vlan_prop(conn, vlan_id) temp = @@cfg.dup temp.sub! 'igmp', 'mc_vlan/' + vlan_id.to_s url = form_url(conn, temp) hdr = form_hdr(conn) Rest.get(conn, url, hdr) end |
.set_igmp_snoop_prop(conn, params) ⇒ Object
parameters:
conn - connection object to the node
params - dictionary that requires the following format of key-value pairs
{
"ena_igmp_snoop": "<ena_igmp_snoop>"
}
description -
ena_igmp_ snoop :Enables IGMP snooping globally on all VLANs; one of yes
(default), no.
If disabled globally, IGMP snooping is disabled on all VLANs,
regardless of the per‐VLAN setting of IGMP snooping. If IGMP
snooping is enabled globally, the per‐VLAN setting of IGMP
snooping takes effect.
return: JSON response
60 61 62 63 64 65 |
# File 'lib/cnos-rbapi/igmp.rb', line 60 def self.set_igmp_snoop_prop(conn, params) url = form_url(conn, @@cfg + '/snoop') hdr = form_hdr(conn) params = params.to_json Rest.put(conn, url, hdr, params) end |
.set_igmp_vlan_prop(conn, vlan_id, params) ⇒ Object
parameters:
conn - connection object to the node
vlan_id - VLAN number
params - dictionary that requires the following format of key-value pairs
{
"vlan_id": "<vlan_id>",
"ena_igmp_snoop": "<ena_igmp_snoop>",
"fast_leave": "<fast_leave>",
"query_interval": "<query_interval>",
"version": "<version>",
}
description -
vlan_id :VLAN number.Note: The VLAN must exist.
ena_igmp_snoop :(Optional) Whether to enable IGMP snooping on a VLAN; one of
yes, no. Default value: yes.
fast_leave :One of yes, no. Default value: no.
query_interval :(Optional) IGMP query interval, in seconds; an integer from
1‐18000. Default value: 125.
version :(Optional) IGMP Snooping version number; one of 2, 3. Default
value: 3
return: JSON response
108 109 110 111 112 113 114 115 |
# File 'lib/cnos-rbapi/igmp.rb', line 108 def self.set_igmp_vlan_prop(conn, vlan_id, params) temp = @@cfg.dup temp.sub! 'igmp', 'mc_vlan/' + vlan_id.to_s url = form_url(conn, temp) hdr = form_hdr(conn) params = params.to_json Rest.put(conn, url, hdr, params) end |