API server implementation for the SQA-as-a-Service (SQAaaS) platform.
The SQAaaS API implementation follows an API First strategy, where changes in the specification are subsequently coded.
The SQAaaS API specification is maintained in a separate repository.
Whenever the specification changes the code is generated by the OpenAPI Generator project. The SQAaaS API uses Python's Connexion library on top of aiohttp.
The generator does not modify the set of files maintained in the .openapi-generator-ignore.
- Python 3.9.2+
- Dependencies: requirements.txt
To run the API server, please execute the following from the root directory:
$ pip3 install .
$ sqaaas_api_server --help
usage: sqaaas_api_server [-h] [-c CONFIG_FILE] [-p PORT] [-d]
SQAaaS API server.
optional arguments:
-h, --help show this help message and exit
-c CONFIG_FILE, --config CONFIG_FILE
Main configuration file (default: /etc/sqaaas/sqaaas.ini). For a complete example, please check </usr/local/lib/python3.8/dist-packages/etc/sqaaas.ini.sample>
-p PORT, --port PORT Port number to be used when exposing the API server (default: 8080)
-d, --debug Set DEBUG log level
In order to run successfully, the SQAaaS API server requires the presence of a general configuration file, by default in /etc/sqaaas/sqaaas.ini
. The Python package is distributed with a sample configuration (sqaaas.ini.sample
).
Assuming the default port 8080 is used, use Swagger UI by opening your browser to here:
http://localhost:8080/v1/ui/
The SQAaaS OpenAPI definition can be accessed through:
http://localhost:8080/v1/openapi.json
Different SQAaaS API server versions will be made available as Docker images through Docker Hub site.
The following command will execute the given version of the SQAaaS API server container, having the required files in the my-sqaaas-api-environ
folder:
$ docker run -v <my-sqaaas-api-environ>:/etc/sqaaas -t eoscsynergy/sqaaas-api-server:<version>
Within the root path, execute:
$ pip3 install -e .
To launch the integration tests, use pytest:
sudo pip install -r test-requirements.txt
pytest
In the root path of the current repository, execute:
$ docker build -t eoscsynergy/sqaaas-api-server:<version> -f docker/Dockerfile .
This software has been developed within the EOSC-Synergy project that has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement number 857647.