Akash 6ff770a214 Run TestRun on Local system functionality. 3 years ago
..
app 6ff770a214 Run TestRun on Local system functionality. 3 years ago
tests 1fd35d4a04 datafiles: tests 3 years ago
.dockerignore 334eb052b2 initial v0.1 3 years ago
Dockerfile 579c3a2063 docker env for tests and services 3 years ago
Dockerfile.dev 579c3a2063 docker env for tests and services 3 years ago
Readme.md 444cbe6bc3 BAANGT -> baangt 3 years ago
app.py 334eb052b2 initial v0.1 3 years ago
config.py ad25cb1f0c testrun call summary 3 years ago
requirements.txt 334eb052b2 initial v0.1 3 years ago
runservice.dev.sh 579c3a2063 docker env for tests and services 3 years ago
runservice.sh 334eb052b2 initial v0.1 3 years ago
set_uploads.py 334eb052b2 initial v0.1 3 years ago

Readme.md

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