Module: Devices
- Included in:
- DashboardAPI
- Defined in:
- lib/devices.rb
Overview
Devices section of the Meraki Dashboard API
Instance Method Summary collapse
-
#claim_device_into_network(network_id, options) ⇒ Integer
Claim a single device into a network.
-
#get_device_uplink_stats(network_id, device_serial) ⇒ Array
Uplink information for a specified device.
-
#get_single_device(network_id, device_serial) ⇒ Hash
Device information for a specified device.
-
#list_devices_in_network(network_id) ⇒ Array
List all devices in a given network.
-
#remove_device_from_network(network_id, device_serial) ⇒ Integer
Remove a single device from a network.
-
#update_device_attributes(network_id, device_serial, options) ⇒ Hash
Update a single devices attributes.
Instance Method Details
#claim_device_into_network(network_id, options) ⇒ Integer
Claim a single device into a network
44 45 46 47 48 |
# File 'lib/devices.rb', line 44 def claim_device_into_network(network_id, ) raise 'Options were not passed as a Hash' if !.is_a?(Hash) self.make_api_call("/networks/#{network_id}/devices/claim", 'POST', ) end |
#get_device_uplink_stats(network_id, device_serial) ⇒ Array
Uplink information for a specified device
24 25 26 |
# File 'lib/devices.rb', line 24 def get_device_uplink_stats(network_id, device_serial) self.make_api_call("/networks/#{network_id}/devices/#{device_serial}/uplink", 'GET') end |
#get_single_device(network_id, device_serial) ⇒ Hash
Device information for a specified device
16 17 18 |
# File 'lib/devices.rb', line 16 def get_single_device(network_id, device_serial) self.make_api_call("/networks/#{network_id}/devices/#{device_serial}", 'GET') end |
#list_devices_in_network(network_id) ⇒ Array
List all devices in a given network
7 8 9 |
# File 'lib/devices.rb', line 7 def list_devices_in_network(network_id) self.make_api_call("/networks/#{network_id}/devices", 'GET') end |
#remove_device_from_network(network_id, device_serial) ⇒ Integer
Remove a single device from a network
54 55 56 |
# File 'lib/devices.rb', line 54 def remove_device_from_network(network_id, device_serial) self.make_api_call("/networks/#{network_id}/devices/#{device_serial}/remove", 'POST') end |
#update_device_attributes(network_id, device_serial, options) ⇒ Hash
Update a single devices attributes
34 35 36 37 38 |
# File 'lib/devices.rb', line 34 def update_device_attributes(network_id, device_serial, ) raise 'Options were not passed as a Hash' if !.is_a?(Hash) self.make_api_call("/networks/#{network_id}/devices/#{device_serial}", 'PUT', ) end |