Name | Date | Size | |
---|---|---|---|
.. | 23-Aug-2016 | 4 KiB | |
__init__.py | 23-Aug-2016 | 0 | |
client_lib/ | 23-Aug-2016 | 4 KiB | |
commands.py | 23-Aug-2016 | 5.9 KiB | |
commands_unittest.py | 23-Aug-2016 | 4.6 KiB | |
common.py | 23-Aug-2016 | 361 | |
common_util.py | 23-Aug-2016 | 3 KiB | |
common_util_unittest.py | 23-Aug-2016 | 2.7 KiB | |
constants.py | 23-Aug-2016 | 344 | |
devices.py | 23-Aug-2016 | 7.3 KiB | |
devices_unittest.py | 23-Aug-2016 | 3.5 KiB | |
fail_control.py | 23-Aug-2016 | 1.5 KiB | |
fake_gcd_helper.py | 23-Aug-2016 | 1.6 KiB | |
fake_oauth.py | 23-Aug-2016 | 385 | |
meta_handler.py | 23-Aug-2016 | 787 | |
oauth.py | 23-Aug-2016 | 3.7 KiB | |
README | 23-Aug-2016 | 1.2 KiB | |
registration_tickets.py | 23-Aug-2016 | 7.4 KiB | |
registration_tickets_unittest.py | 23-Aug-2016 | 4.7 KiB | |
resource_delegate.py | 23-Aug-2016 | 4 KiB | |
resource_method.py | 23-Aug-2016 | 1.9 KiB | |
resource_method_unittest.py | 23-Aug-2016 | 2.2 KiB | |
server.py | 23-Aug-2016 | 3.8 KiB | |
server_errors.py | 23-Aug-2016 | 654 |
README
1# Copyright 2014 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5A simple web service used by Buffet to test interactions with a 6device server. Implements basic functionality for registration, device commands 7and state changes. 8 9To start the test server yourself, run server.py. Otherwise, server.py exposes 10start_server/stop_server methods. 11 12To test locally: 13./server.py 14 15# Register a device. 16curl -X POST -d "" http://localhost:8080/registrationTickets 17curl -X PATCH -d '{"userEmail": "me"}' -H "Authorization: Bearer 1/TEST-ME" \ 18 http://localhost:8080/registrationTickets/<id> 19curl -X POST -d "" \ 20 http://localhost:8080/registrationTickets/<id>/finalize 21 22# List devices 23curl -X GET -d "" http://localhost:8080/devices 24 25# Send your device a command. 26curl -X POST -d '{"base": { "Reboot": {}}' http://localhost:8080/devices\ 27 ?deviceId=<device_id> 28 29# Update the status of your command 30curl -X PATCH -d '{"state": "done"}' http://localhost:8080/devices/\ 31 <command_id> 32 33# You can also use the client library avaiable @ client_lib. 34# Check out client_lib_test to see how you can use the API. 35