Skip to content
This repository has been archived by the owner on Feb 21, 2018. It is now read-only.
Puerto Pablo edited this page Aug 24, 2017 · 2 revisions

Welcome to the api-db wiki!

This API is deployed through a Docker container, the Docker image producing specific container is build by the Dockerfile.

Build dedicated Docker image (in the main folder) :

docker build -t ictapi .

Run API mounting main folder to /usr/src/app and exposed port 5000 on the host (in the main folder) :

docker run -it --rm -v $(pwd):/usr/src/app -p 5000:5000 ictapi

It should spit out (maybe with some FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS):

- Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)

- Restarting with stat

- Debugger is active!

- Debugger PIN: 170-658-094

Then if you want to test the API (on an other terminal)

Create CHP model http POST :5000/models/ name="chp" tool="ModelicaFMU" wrap="wrap_chp.py"

Create HP model http POST :5000/models/ name="heatpump" tool="ModelicaFMU" wrap="wrap_heatpump.py"

Instantiate CHP node named chp_q0 from CHP model http POST :5000/nodes/ name="chp_q0" model_name="chp"

Instantiate CHP node named chp_q1 from CHP model http POST :5000/nodes/ name="chp_q1" model_name="chp"

Instantiate HP node named hp_lake from HP model http POST :5000/nodes/ name="hp_lake" model_name="heatpump"

You can then list all the nodes http :5000/nodes

Clone this wiki locally