• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

client_lib/23-Nov-2023-667465

READMED23-Nov-20231.2 KiB3526

__init__.pyD23-Nov-20230 10

commands.pyD23-Nov-20235.9 KiB162107

commands_unittest.pyD23-Nov-20234.6 KiB12691

common.pyD23-Nov-2023361 115

common_util.pyD23-Nov-20233 KiB9166

common_util_unittest.pyD23-Nov-20232.7 KiB8955

constants.pyD23-Nov-2023344 114

devices.pyD23-Nov-20237.3 KiB201144

devices_unittest.pyD23-Nov-20233.5 KiB9663

fail_control.pyD23-Nov-20231.5 KiB4934

fake_gcd_helper.pyD23-Nov-20231.6 KiB5335

fake_oauth.pyD23-Nov-2023385 125

meta_handler.pyD23-Nov-2023787 3116

oauth.pyD23-Nov-20233.7 KiB10273

registration_tickets.pyD23-Nov-20237.4 KiB205146

registration_tickets_unittest.pyD23-Nov-20234.7 KiB12890

resource_delegate.pyD23-Nov-20234 KiB11773

resource_method.pyD23-Nov-20231.9 KiB6341

resource_method_unittest.pyD23-Nov-20232.2 KiB6943

server.pyD23-Nov-20233.8 KiB11794

server_errors.pyD23-Nov-2023654 1911

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