From b4d8068530b94b2cc7a0cbd397b029fc8d9fcd68 Mon Sep 17 00:00:00 2001 From: Ernst Widerberg Date: Tue, 1 Mar 2022 14:21:14 +0100 Subject: Update README, do-as for collector's new https location --- README.md | 10 +++++----- do-as | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d39b006..c2f1325 100644 --- a/README.md +++ b/README.md @@ -63,23 +63,23 @@ adding some observations. First, get a JWT for the default user `usr`: Then we use the JWT to add an observation (defined in `example_data.json`): - curl -s --data-binary @example_data.json -H "Authorization: Bearer $JWT" http://localhost:80/sc/v0/add + curl -s --data-binary @example_data.json -H "Authorization: Bearer $JWT" https://localhost:1443/sc/v0/add Try retreiving all observations permitted by our JWT: - curl -s -H "Authorization: Bearer $JWT" http://localhost:80/sc/v0/get | json_pp -json_opt utf8,pretty + curl -s -H "Authorization: Bearer $JWT" https://localhost:1443/sc/v0/get | json_pp -json_opt utf8,pretty We might also filter the data: - curl -s -H "Authorization: Bearer $JWT" http://localhost:80/sc/v0/get?port=111 | json_pp -json_opt utf8,pretty + curl -s -H "Authorization: Bearer $JWT" https://localhost:1443/sc/v0/get?port=111 | json_pp -json_opt utf8,pretty Believe it or not, but we can also get a single observation by looking up its key (_id): - curl -s -H "Authorization: Bearer $JWT" http://localhost:80/sc/v0/get/1633633714355 | json_pp -json_opt utf8,pretty + curl -s -H "Authorization: Bearer $JWT" https://localhost:1443/sc/v0/get/1633633714355 | json_pp -json_opt utf8,pretty We can also limit the number of results and skip N results forward with the parameters limit and skip: - curl -s -H "Authorization: Bearer $JWT" 'http://localhost:80/sc/v0/get?limit=5&skip=2' | json_pp -json_opt utf8,pretty + curl -s -H "Authorization: Bearer $JWT" 'https://localhost:1443/sc/v0/get?limit=5&skip=2' | json_pp -json_opt utf8,pretty ## Tips and tricks diff --git a/do-as b/do-as index 8d5cdaa..87c5a72 100755 --- a/do-as +++ b/do-as @@ -14,4 +14,4 @@ shift shift JWT=$(curl http://localhost:8000/api/v1.0/auth -X POST -p -u "$USER:pwd" | jq -r .access_token) -curl -s -H "Authorization: Bearer $JWT" http://localhost:80/sc/v0/$CMD "$@" +curl -s -H "Authorization: Bearer $JWT" https://localhost:1443/sc/v0/$CMD "$@" -- cgit v1.1