Skip to content

Commit

Permalink
Update readme to match a single tool
Browse files Browse the repository at this point in the history
  • Loading branch information
farshidtz authored Jun 19, 2020
1 parent 301943c commit c3aea4d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions events/2020.06.Online/tools/directory-sync/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
This directory contains tools to periodically sync TDs of wot-testing events with an instance of [LinkSmart Thing Directory](../../prototypes/linksmart.md).
This directory contains scripts to periodically sync TDs of wot-testing events with an instance of [LinkSmart Thing Directory](../../prototypes/linksmart.md).

The script recursively looks for `.jsonld` files and submits them to the directory. If the submission fails with Bad Request status, the script makes another query for explicit validation of the TD (GET `/validation`) and prints the results.
## Python Script
The Python script recursively looks for `.jsonld` files and submits them to the directory. If the submission fails with Bad Request status, the script makes another query for explicit validation of the TD (GET `/validation`) and prints the results.

The directory uses the TD's `id` as the resource id during registration and follow-up updates (PUT `/td/{id}`). TDs that have no `id` are always created as a new resource using a POST request (POST `/td`) which responds with a system-generated ID in response Location header. For updates on TDs without `id`, an overlapping registration will exist in the directory until it gets purged some time after the validity period set as TTL.
It uses the TD's `id` as the resource id during registration and follow-up updates (PUT `/td/{id}`). TDs that have no `id` are always created as a new resource using a POST request (POST `/td`) which responds with a system-generated ID in response Location header. For updates on TDs without `id`, an overlapping registration will exist in the directory until it gets purged some time after the validity period set as TTL.

# Run
#### Run
Dependencies: Python 3, `requests`
Pass arguments as environment variables:
```bash
Expand All @@ -15,6 +16,7 @@ where:
* `AUTHORIZATION` is the authorization header
* `TTL` is the ttl value injected inside the TD, to indicate the lifetime of TD in seconds inside the directory

## Github Actions
An example Github Actions workflow to sync periodically is available in [2020.06.Online.yml](2020.06.Online.yml)

The Github Actions workflow is live [here](https://github.com/farshidtz/wot-testing-directory-sync/runs)

0 comments on commit c3aea4d

Please sign in to comment.