sudo docker compose up -d
For updating the docker image use the command:
sudo docker compose up -d --build
http://127.0.0.1:8018/v1.1/docs
pip install httpx
Inside app/test_main.py file insert yours IP address at line 13:
pgpool = await asyncpg.create_pool(dsn='postgresql://admin:admin@<IP_ADDRESS>:55432/istsos_test')
cd /app
pytest
TBD
docker compose up -d
if not exists load DB schema 'sensorthings' & functions from \database\istsos_schema.sql
docker compose kill -s SIGUSR1 postgrest
http://127.0.0.1:8018/v1.1/docs
http://127.0.0.1:8018/v1.1/Observations?as_of_system_time=2023-04-23T15:56:16.123000%2B02:00 http://127.0.0.1:8018/v1.1/Observations
http://localhost:3000/Thing? select= id, name, Location(*), Datastream( id, name, unitOfMeasurement, ObservedProperty( name ), Observation( result,phenomenonTime ) ) &limit=1000 &properties-%3E%3Emodel=eq.TS-100 &Datastream.Observation.order=phenomenonTime.desc &Datastream.Observation.limit=1
/v1.1/Things? $select=id,name,description,properties &$top=1000 &$filter=properties/type eq 'station' &$expand= Locations, Datastreams( $select= id,name,unitOfMeasurement ;$expand= ObservedProperty($select=name), Observations( $select=result,phenomenonTime ;$orderby=phenomenonTime desc ;$top=1 ) )
Run the following commands:
cd fastapi/app/v1
uvicorn get_datastream:app --reload
In the browser type "IP:port"//datastreams/1
You can also check using : http://127.0.0.1:8000/docs
Change the host IP address in the script as per your docker IP in get_datastream.py file.
When you build the docker the script will automatically clear the database and add the static and dynamic values as per config.yaml file.
For disabling addtion of the synthetic data to database
inside the .env
change the variable dummy_data to False
HOSTNAME=http://localhost:8018/v1.1/
dummy_data=False #True/False When True database table will be cleared and populated with synthetic data