Module: Switchports
- Included in:
- DashboardAPI
- Defined in:
- lib/switchports.rb
Overview
Switchports section of the Meraki Dashboard API
Instance Method Summary collapse
-
#get_single_switch_port(device_serial, port_number) ⇒ Hash
Get configuration for a single switch port.
-
#get_switch_ports(device_serial) ⇒ Array
Get configuration for all switchports on a given switch.
-
#update_switchport(device_serial, port_number, options) ⇒ Hash
Update the attributes for a given switchport.
Instance Method Details
#get_single_switch_port(device_serial, port_number) ⇒ Hash
Get configuration for a single switch port
15 16 17 18 |
# File 'lib/switchports.rb', line 15 def get_single_switch_port(device_serial, port_number) raise 'Invalid switchport provided' unless port_number.is_a?(Integer) self.make_api_call("/devices/#{device_serial}/switchPorts/#{port_number}", 'GET') end |
#get_switch_ports(device_serial) ⇒ Array
Get configuration for all switchports on a given switch
7 8 9 |
# File 'lib/switchports.rb', line 7 def get_switch_ports(device_serial) self.make_api_call("/devices/#{device_serial}/switchPorts", 'GET') end |
#update_switchport(device_serial, port_number, options) ⇒ Hash
Update the attributes for a given switchport
26 27 28 29 30 31 32 |
# File 'lib/switchports.rb', line 26 def update_switchport(device_serial, port_number, ) raise 'Options were not passed as a Hash' if !.is_a?(Hash) raise 'Invalid switchport provided' unless port_number.is_a?(Integer) self.make_api_call("/devices/#{device_serial}/switchPorts/#{port_number}", 'PUT', ) end |