-
Notifications
You must be signed in to change notification settings - Fork 100
Workflow notes
Rudolph Pienaar edited this page Apr 3, 2017
·
5 revisions
This page describes a simple workflow in the ChRIS Ultron backend system. The workflow consists of getting a list of plugins, calling a 'simplefs' plugin, checking its status, calling a 'simpleds' plugin on this 'simplefs' output, and checking status.
We assume that the django and pman services are running on localhost (or 10.17.24.163) and listening on ports 8000 and 5010 respectively.
Note: your mileage may vary! Adjust the following where/as necessary for your local setup. These notes are accurate for Rudolph's setup!
First, source the python virtual environment
export WORKON_HOME=~/src/python-env
source /usr/local/bin/virtualenvwrapper.sh
and workon
the relevant project:
workon chris_env
cd ~/src/ChRIS_ultron_backend/chris_backend
manage.py runserver localhost:8000
pman --rawmode 1 --http --port 5010 --listeners 12
purl --auth chris:chris1234 \
--content-type application/vnd.collection+json \
--verb GET \
--raw --jsonwrapper template \
--http localhost:8000/api/v1/ \
--quiet | underscore print --color
purl --auth chris:chris1234 \
--content-type application/vnd.collection+json \
--verb GET \
--raw --jsonwrapper template \
--http 10.17.24.163:8000/api/v1/plugins/instances/90/ \
--quiet | underscore print --color
#0. GET plugin list
purl --auth chris:chris1234 \
--content-type application/vnd.collection+json \
--verb GET \
--raw --jsonwrapper template \
--http 10.17.24.163:8000/api/v1/plugins/ \
--quiet | underscore print --color
# 1. Call a 'simplefs' plugin
purl --auth chris:chris1234 \
--content-type application/vnd.collection+json \
--verb POST \
--raw --jsonwrapper template \
--http 10.17.24.163:8000/api/v1/plugins/1/instances/ \
--msg \
'{
"data": [{ "name": "dir",
"value": "/home"}]
}' --quiet | underscore print --color
# 2. Check status
purl --auth chris:chris1234 \
--content-type application/vnd.collection+json \
--verb GET \
--raw --jsonwrapper template \
--http 10.17.24.163:8000/api/v1/plugins/instances/399/ \
--quiet | underscore print --color
# 3. Call a 'simpleds' plugin on 'simplefs' output
purl --auth chris:chris1234 \
--content-type application/vnd.collection+json \
--verb POST \
--raw --jsonwrapper template \
--http 10.17.24.163:8000/api/v1/plugins/5/instances/ \
--msg \
'{
"data": [{ "name": "prefix", "value": "test-"},
{ "name": "sleepLength", "value": "30"},
{ "name": "previous_id", "value": "401"}]
}' --quiet | underscore print --color
# 4. Check status
purl --auth chris:chris1234 \
--content-type application/vnd.collection+json \
--verb GET \
--raw --jsonwrapper template \
--http 10.17.24.163:8000/api/v1/plugins/instances/404/ \
--quiet | underscore print --color