Module: VLANs
- Included in:
- DashboardAPI
- Defined in:
- lib/vlans.rb
Overview
VLANs section of the Meraki Dashboard API
Instance Method Summary collapse
-
#add_vlan(network_id, options) ⇒ Hash
Add a single VLAN to a network.
-
#delete_vlan(network_id, vlan_id) ⇒ Integer
Delete a single vlan.
-
#list_vlans(network_id) ⇒ Array
Returns a list of the configured VLANs in a Dashboard network.
-
#return_vlan(network_id, vlan_id) ⇒ Hash
Return a single configured VLAN for a network.
-
#update_vlan(network_id, vlan_id, options) ⇒ Hash
Update the attributes for a single VLAN.
Instance Method Details
#add_vlan(network_id, options) ⇒ Hash
Add a single VLAN to a network
24 25 26 27 28 |
# File 'lib/vlans.rb', line 24 def add_vlan(network_id, ) raise 'Options were not passed as a Hash' if !.is_a?(Hash) self.make_api_call("/networks/#{network_id}/vlans", 'POST', ) end |
#delete_vlan(network_id, vlan_id) ⇒ Integer
Delete a single vlan
46 47 48 |
# File 'lib/vlans.rb', line 46 def delete_vlan(network_id, vlan_id) self.make_api_call("/networks/#{network_id}/vlans/#{vlan_id}", 'DELETE') end |
#list_vlans(network_id) ⇒ Array
Returns a list of the configured VLANs in a Dashboard network
7 8 9 |
# File 'lib/vlans.rb', line 7 def list_vlans(network_id) self.make_api_call("/networks/#{network_id}/vlans", 'GET') end |
#return_vlan(network_id, vlan_id) ⇒ Hash
Return a single configured VLAN for a network
15 16 17 |
# File 'lib/vlans.rb', line 15 def return_vlan(network_id, vlan_id) self.make_api_call("/networks/#{network_id}/vlans/#{vlan_id}", 'GET') end |
#update_vlan(network_id, vlan_id, options) ⇒ Hash
Update the attributes for a single VLAN
36 37 38 39 40 |
# File 'lib/vlans.rb', line 36 def update_vlan(network_id, vlan_id, ) raise 'Options were not passed as a Hash' if !.is_a?(Hash) self.make_api_call("/networks/#{network_id}/vlans/#{vlan_id}", 'PUT', ) end |