Skip to content
This repository has been archived by the owner on Apr 15, 2021. It is now read-only.

Commit

Permalink
added cURL commands to instrument RS buckets in a demo script
Browse files Browse the repository at this point in the history
  • Loading branch information
crankycoder committed Nov 29, 2019
1 parent 9c5ebac commit 1cda3fd
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 26 deletions.
72 changes: 72 additions & 0 deletions scripts/bot_signoff.sh
@@ -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
9 changes: 0 additions & 9 deletions scripts/create-bucket.sh

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/read_remote_settings.sh

This file was deleted.

13 changes: 0 additions & 13 deletions scripts/write_exp_bucket.sh

This file was deleted.

0 comments on commit 1cda3fd

Please sign in to comment.