Bionet Api provides programmatic access to an instance of bionet node via a proxy server. The api provides a set of functions for performing queries, retrieving datasets, creating data objects, session authentication and more. Api access is provided for python and javascript.
License: AGPLv3
Copyright 2018 BioBricks Foundation
git clone https://github.com/biobricks/bionet-api
Note: you might want to use your system's built in method for installing the latest version of nodejs rather than using nvm.
# install nvm
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
# install node
nvm install --lts
The following is for Debian/Ubuntu based distros only. Instructions for many popular distros available here.
curl -sL https://deb.nodesource.com/setup_6.x > /tmp/node_setup
# look at /tmp/node_setup and ensure that the script does what's expected
sudo -E bash /tmp/node_setup
sudo apt install nodejs
# install node packages
cd bionet-api/
npm install
Run the following commands from bionet-api:
Connect to server and login as user, listen for requests on port 8088:
node ./src/bionetProxyServer -protocol=https -host=endylab.stanford.edu -listen=8088 -username=xxxx -password=xxxx
Generate host configuration file
node ./src/bionetProxyServer -genHostConfig -protocol=https -host=endylab.stanford.edu -username=xxxx -password=xxxx >config.json
Connect to server via token, listen for requests on port 8088:
node ./src/bionetProxyServer -hostConfig=config.json -listen=8088
Upload batch of virtuals, create physical instances and place into container (note: replace container_id with actual id)
node ./src/bionetProxyServer -hostConfig=config.json -import_file=./tests/bulkUploadTest1.csv -import_format=csv \
-upload_method=virtual_to_physical -upload_container=container_id
Run javascript bionet api example - connects directly to bionet node:
node ./examples/javascript/bionetApiExample.js -hostConfig=./config.json
Run javascript bionet api proxy example - connects to bionet node via proxy server:
node ./examples/javascript/bionetProxyClientExample.js
Run python bionet api example - connects to bionet node via proxy server:
python3 ./examples/python/bionetApiExample.py