From fbb8cbc9f36975c4a414c9485347515d16f42333 Mon Sep 17 00:00:00 2001 From: FxQnLr Date: Mon, 15 Apr 2024 21:04:58 +0200 Subject: Added register docs to README --- README.md | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 03779a1..cf536c4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ # webol - ## Config Default `config.toml`: ```toml @@ -12,9 +11,7 @@ timeoffset = 0 # i8 method = "none" # "none"|"key" secret = "" # String ``` - ## Docker - minimal `docker-compose.yaml`: ```yaml services: @@ -27,3 +24,38 @@ services: - ./logs:/logs network_mode: host ``` +## Register Device +A device is registered with a PUT request to the server with a JSON representation of the device as payload. +| field | description | example | +|--------------|------------------------------------------------------------------------|-------------------| +| server-ip | ip of the webol server, including its port | webol.local:7229 | +| secret | secret set in the server settings | password | +| device-id | any string, "name" of the device | foo | +| mac-address | mac address of the device | 12:34:56:AB:CD:EF | +| broadcast-ip | broadcast ip of the network, including the port Wake-on-Lan listens on | 10.0.1.255:7 | +| device-ip | (**optional**) ip of the device, used for ping feature | 10.0.1.47 | + +Examples using curl with and without authentification enabled on the server. +### With Authentification +```sh +curl -X PUT http:///device \ + -H 'Authorization: ' \ + -H 'Content-Type: application/json' \ + -d '{ + "id": "", + "mac": "", + "broadcast_addr": "", + "ip": "" + }' +``` +### Without Authentification +```sh +curl -X PUT http:///device \ + -H 'Content-Type: application/json' \ + -d '{ + "id": "", + "mac": "", + "broadcast_addr": "", + "ip": "" + }' +``` -- cgit v1.2.3 From 7876dd605a8e4b595436035a87a5151be187c01d Mon Sep 17 00:00:00 2001 From: FxQnLr Date: Mon, 15 Apr 2024 21:09:16 +0200 Subject: Added Usage (start request) to README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index cf536c4..e84d646 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ services: - ./logs:/logs network_mode: host ``` +# Usage ## Register Device A device is registered with a PUT request to the server with a JSON representation of the device as payload. | field | description | example | @@ -59,3 +60,8 @@ curl -X PUT http:///device \ "ip": "" }' ``` +## Start Device +The easiest way to start a device is using a GET request with its id: +```sh +curl http:///start/ +``` \ No newline at end of file -- cgit v1.2.3