Module: Devices
- Included in:
- DashboardAPI
- Defined in:
- lib/devices.rb
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
42 43 44 45 46 |
# File 'lib/devices.rb', line 42 def claim_device_into_network(network_id, ) raise 'Options were not passed as a Hash' if !.is_a?(Hash) = {:body => } 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
22 23 24 |
# File 'lib/devices.rb', line 22 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
14 15 16 |
# File 'lib/devices.rb', line 14 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
5 6 7 |
# File 'lib/devices.rb', line 5 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
52 53 54 |
# File 'lib/devices.rb', line 52 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
32 33 34 35 36 |
# File 'lib/devices.rb', line 32 def update_device_attributes(network_id, device_serial, ) raise 'Options were not passed as a Hash' if !.is_a?(Hash) = {:body => } self.make_api_call("/networks/#{network_id}/devices/#{device_serial}", 'PUT', ) end |