Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
client_lib/ | 03-May-2024 | - | 659 | 457 | ||
README | D | 03-May-2024 | 1.2 KiB | 35 | 26 | |
__init__.py | D | 03-May-2024 | 0 | 1 | 0 | |
commands.py | D | 03-May-2024 | 5.9 KiB | 162 | 107 | |
commands_unittest.py | D | 03-May-2024 | 4.6 KiB | 128 | 93 | |
common.py | D | 03-May-2024 | 361 | 11 | 5 | |
common_util.py | D | 03-May-2024 | 3 KiB | 91 | 66 | |
common_util_unittest.py | D | 03-May-2024 | 2.7 KiB | 89 | 55 | |
constants.py | D | 03-May-2024 | 344 | 11 | 4 | |
devices.py | D | 03-May-2024 | 7.3 KiB | 201 | 144 | |
devices_unittest.py | D | 03-May-2024 | 3.5 KiB | 98 | 65 | |
fail_control.py | D | 03-May-2024 | 1.5 KiB | 49 | 34 | |
fake_gcd_helper.py | D | 03-May-2024 | 1.6 KiB | 53 | 35 | |
fake_oauth.py | D | 03-May-2024 | 385 | 12 | 5 | |
meta_handler.py | D | 03-May-2024 | 787 | 31 | 16 | |
oauth.py | D | 03-May-2024 | 3.7 KiB | 102 | 73 | |
registration_tickets.py | D | 03-May-2024 | 7.4 KiB | 205 | 146 | |
registration_tickets_unittest.py | D | 03-May-2024 | 4.7 KiB | 134 | 94 | |
resource_delegate.py | D | 03-May-2024 | 4 KiB | 117 | 73 | |
resource_method.py | D | 03-May-2024 | 1.9 KiB | 63 | 41 | |
resource_method_unittest.py | D | 03-May-2024 | 2.2 KiB | 74 | 46 | |
server.py | D | 03-May-2024 | 3.8 KiB | 117 | 94 | |
server_errors.py | D | 03-May-2024 | 654 | 19 | 11 |
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