Skip to content
/ BETYdb-YABA Public template
forked from PecanProject/BETYdb-YABA

Yet Another BETYdb API (for metadata upload)

License

Notifications You must be signed in to change notification settings

saurabh1969/BETYdb-YABA

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BETYdb-YABA

Codacy Badge

Yet Another BETYdb API (for metadata upload)

Setup BETYdb

Following commands can be used to initialize the database to be used with YABA development.

docker-compose up -d postgres
docker-compose run --rm bety initialize
docker-compose run --rm bety sync

Running the App

Bring up container for YABA-API

docker-compose up -d yaba_api

Running the App (without initialization and synchronization of bety)

Bring up the containers at once

Once initialization and synchronization of bety database is done,the below command can be directly used to start the app.(Skip the "Setup BETYdb" step)

# Bring up full stack
docker-compose up

How to hit the endpoints

Following endpoints can be used to upload Metadata to respective tables in bety.

Experiments: (to experiments table):

curl -F "fileName=@input_files/experiments.csv"   \
     http://localhost:5001/yaba/v1/experiments?username=guestuser

Sites: (to sites table)

curl -F "[email protected]"   \
     -F "shp_file=@input_files/S8_two_row_polys.shp"  \
     -F "dbf_file=@input_files/S8_two_row_polys.dbf"  \
     -F "prj_file=@input_files/S8_two_row_polys.prj"  \
     -F "shx_file=@input_files/S8_two_row_polys.shx"  \
     http://localhost:5001/yaba/v1/sites

Treatments: (to treatments table)

curl -F "fileName=@input_files/treatments.csv"   \
     http://localhost:5001/yaba/v1/treatments?username=guestuser

Cultivars: (to cultivars table)

curl -F "fileName=@input_files/cultivars.csv"   \
     http://localhost:5001/yaba/v1/cultivars

Citations: (to citations table)

curl -F "fileName=@input_files/citations.csv"   \
     http://localhost:5001/yaba/v1/citations?username=guestuser

Experiments_sites: (to experiments_sites table)

curl -F "fileName=@input_files/experiments_sites.csv"   \
     http://localhost:5001/yaba/v1/experiments_sites

Experiments_treatments: (to experiments_treatments table)

curl -F "fileName=@input_files/experiments_treatments.csv"   \
     http://localhost:5001/yaba/v1/experiments_treatments

Sites_cultivars: (to sites_cultivars table)

curl -F "fileName=@input_files/sites_cultivars.csv"   \
     http://localhost:5001/yaba/v1/sites_cultivars

Citations_sites: (to citations_sites table)

curl -F "fileName=@input_files/citations_sites.csv"   \
     http://localhost:5001/yaba/v1/citations_sites

About

Yet Another BETYdb API (for metadata upload)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 76.9%
  • HTML 22.4%
  • Dockerfile 0.7%