This repository has been archived by the owner on Apr 15, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added cURL commands to instrument RS buckets in a demo script
- Loading branch information
1 parent
9c5ebac
commit 1cda3fd
Showing
4 changed files
with
72 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/sh | ||
|
||
# Create a cfr-bot with a dummy password for local testing | ||
SERVER=http://localhost:8888/v1 | ||
|
||
curl -X PUT ${SERVER}/accounts/cfr-bot \ | ||
-d '{"data": {"password": "botpass"}}' \ | ||
-H 'Content-Type:application/json' | ||
|
||
BASIC_AUTH=cfr-bot:botpass | ||
|
||
# Create 3 collections | ||
# * main/cfr-models | ||
# * main/cfr-experiment | ||
# * main/cfr-control | ||
|
||
curl -X PUT ${SERVER}/buckets/main/collections/cfr-models \ | ||
-H 'Content-Type:application/json' \ | ||
-u ${BASIC_AUTH} | ||
|
||
curl -X PUT ${SERVER}/buckets/main/collections/cfr-experiment \ | ||
-H 'Content-Type:application/json' \ | ||
-u ${BASIC_AUTH} | ||
|
||
curl -X PUT ${SERVER}/buckets/main/collections/cfr-control \ | ||
-H 'Content-Type:application/json' \ | ||
-u ${BASIC_AUTH} | ||
|
||
# Add the bot to editor role for 3 collections: | ||
# * main/cfr-models | ||
# * main/cfr-experiment | ||
# * main/cfr-control | ||
|
||
curl -X PATCH $SERVER/buckets/main/groups/cfr-models-editors \ | ||
-H 'Content-Type:application/json-patch+json' \ | ||
-d '[{ "op": "add", "path": "/data/members/0", "value": "account:cfr-bot" }]' \ | ||
-u ${BASIC_AUTH} | ||
|
||
curl -X PATCH $SERVER/buckets/main/groups/cfr-experiment-editors \ | ||
-H 'Content-Type:application/json-patch+json' \ | ||
-d '[{ "op": "add", "path": "/data/members/0", "value": "account:cfr-bot" }]' \ | ||
-u ${BASIC_AUTH} | ||
|
||
curl -X PATCH $SERVER/buckets/main/groups/cfr-control-editors \ | ||
-H 'Content-Type:application/json-patch+json' \ | ||
-d '[{ "op": "add", "path": "/data/members/0", "value": "account:cfr-bot" }]' \ | ||
-u ${BASIC_AUTH} | ||
|
||
# Add the bot to reviewer role for 3 collections: | ||
# * main/cfr-models | ||
# * main/cfr-experiment | ||
# * main/cfr-control | ||
|
||
curl -X PATCH $SERVER/buckets/main/groups/cfr-models-reviewers \ | ||
-H 'Content-Type:application/json-patch+json' \ | ||
-d '[{ "op": "add", "path": "/data/members/0", "value": "account:cfr-bot" }]' \ | ||
-u ${BASIC_AUTH} | ||
curl -X PATCH $SERVER/buckets/main/groups/cfr-experiment-reviewers \ | ||
-H 'Content-Type:application/json-patch+json' \ | ||
-d '[{ "op": "add", "path": "/data/members/0", "value": "account:cfr-bot" }]' \ | ||
-u ${BASIC_AUTH} | ||
curl -X PATCH $SERVER/buckets/main/groups/cfr-control-reviewers \ | ||
-H 'Content-Type:application/json-patch+json' \ | ||
-d '[{ "op": "add", "path": "/data/members/0", "value": "account:cfr-bot" }]' \ | ||
-u ${BASIC_AUTH} | ||
|
||
# Generate some dummy data in the cfr-models bucket | ||
|
||
curl -X PUT ${SERVER}/buckets/main-workspace/collections/cfr-experiment/records/5ba22305-6a9e-4f2b-beee-0a0a84d44708 \ | ||
-H 'Content-Type:application/json' \ | ||
-d "{\"data\": {\"property\": 321.1}}" \ | ||
-u ${BASIC_AUTH} --verbose |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.