Class: Stf::Client
Instance Method Summary collapse
- #add_adb_public_key(adbkeypub) ⇒ Object
- #add_device(serial) ⇒ Object
- #get_device(serial) ⇒ Object
- #get_devices ⇒ Object
- #get_user ⇒ Object
- #get_user_devices ⇒ Object
-
#initialize(base_url, token) ⇒ Client
constructor
A new instance of Client.
- #remove_device(serial) ⇒ Object
- #start_debug(serial) ⇒ Object
- #stop_debug(serial) ⇒ Object
Methods included from Log
Constructor Details
#initialize(base_url, token) ⇒ Client
Returns a new instance of Client.
13 14 15 16 |
# File 'lib/stf/client.rb', line 13 def initialize(base_url, token) @base_url = base_url @token = token end |
Instance Method Details
#add_adb_public_key(adbkeypub) ⇒ Object
43 44 45 46 |
# File 'lib/stf/client.rb', line 43 def add_adb_public_key(adbkeypub) response = execute '/api/v1/user/adbPublicKeys', Net::HTTP::Post, { publickey: adbkeypub }.to_json response.success end |
#add_device(serial) ⇒ Object
38 39 40 41 |
# File 'lib/stf/client.rb', line 38 def add_device(serial) response = execute '/api/v1/user/devices', Net::HTTP::Post, { serial: serial }.to_json response.success end |
#get_device(serial) ⇒ Object
23 24 25 26 |
# File 'lib/stf/client.rb', line 23 def get_device(serial) response = execute "/api/v1/devices/#{serial}", Net::HTTP::Get response.device end |
#get_devices ⇒ Object
18 19 20 21 |
# File 'lib/stf/client.rb', line 18 def get_devices response = execute '/api/v1/devices', Net::HTTP::Get response.devices end |
#get_user ⇒ Object
28 29 30 31 |
# File 'lib/stf/client.rb', line 28 def get_user response = execute '/api/v1/user', Net::HTTP::Get response.user end |
#get_user_devices ⇒ Object
33 34 35 36 |
# File 'lib/stf/client.rb', line 33 def get_user_devices response = execute '/api/v1/user/devices', Net::HTTP::Get response.devices end |
#remove_device(serial) ⇒ Object
48 49 50 51 |
# File 'lib/stf/client.rb', line 48 def remove_device(serial) response = execute "/api/v1/user/devices/#{serial}", Net::HTTP::Delete response.success end |
#start_debug(serial) ⇒ Object
53 54 55 56 |
# File 'lib/stf/client.rb', line 53 def start_debug(serial) response = execute "/api/v1/user/devices/#{serial}/remoteConnect", Net::HTTP::Post response end |
#stop_debug(serial) ⇒ Object
58 59 60 61 |
# File 'lib/stf/client.rb', line 58 def stop_debug(serial) response = execute "/api/v1/user/devices/#{serial}/remoteConnect", Net::HTTP::Delete response.success end |