Readme.md 2.7 KB

baangt Data Files

baangt Data Files is intended to store, renew, and retrieve baangt data files. The service could be achieved via HTTP requests. It provides the following end-points:

  • a home view with a form for uploading a DataFile
  • several API end-points

Environmental Variables

You may use the following environmental variables to configure the baangt Data Files:

Variable Default Value Description
SECRET_KEY secret!key The secret key of the app
UPLOAD_FOLDER uploads Directory within the app to store the DataFiles

Set-up

Before starting the baangt Data Files application you need to:

  • install the required python packages from requirements.txt
  • define UPLOAD_FOLDER
  • run set_uploads.py to create a directory that will be a file storage for baangt DataFiles
pip install -r requirements.txt
export UPLOAD_FOLDER=[path_to_uploads_in_app]
python set_uploads.py

Run Service

Please use a Python WSGI Server to run the baangt Data Files application.
The application name is app
For example, to run the service with gunicorn use:

gunicorn -b :8000 --access-logfile access.log --error-logfile error.log app:app

API Reference

Store a new Data File

POST http://[HOST]/save
Requested files
dataFile: XLSX file comprising *baangt* test data
Response
STATUS CODE: 200 OK
JSON: 
{
  "uuid": "FILE_UUID"
}

Renew a Data File

POST http://[HOST]/update/{uuid}
URI parameters
uuid: UUID of the Data File to be renewed
Requested files
dataFile: XLSX file comprising *baangt* test data
Response
STATUS CODE: 200 OK
JSON: 
{
  "uuid": "FILE_UUID"
}

Retrieve a Data File

GET http://[HOST]/get/{uuid}
URI parameters
uuid: UUID of the Data File to be retrieved
Response
STATUS CODE: 200 OK
RAW: requested Data File

Store Testrun Execution Files

POST http://[HOST]/upload/{uuid}
URI parameters
uuid: UUID of the Testrun Execution the files to be assocoated with
Requested files
logfile: *baangt* Testrun execution logfile
outfile: XLSX file comprising *baangt* Testrun results 
Response
STATUS CODE: 200 OK
JSON: 
{
  "uuid": "TESTRUN_EXECUTION_UUID",
  "files": {
  	"logfile": "OK",
  	"outfile": "OK"
  }
}

Retrieve Testrun Execution File

GET http://[HOST]/get/{uuid}/{file}
URI parameters
uuid: UUID of the Testrun Execution
file: the specification of the file to be retrieved (possible values: logfile, outfile)
Response
STATUS CODE: 200 OK
RAW: requested Data File