This merge requests adds a new recipe to README.md. It shows how to post data to a REST API. The script is modified from code we wrote to post data to the SensorThingsAPI.
To test
This is not a code change, so the purpose of the merge review is to see if there can be improvements to the wording. However, the script does work if you want to test it.
Spin up an ElasticSearch container docker run -d --rm --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:7.9.2
Create a file called db.py that creates a DbParams class called ORACLE_DB which corresponds to the BGS development database
Save the example code as copy_samples.py
Replace "samples" in the select query with the Oracle dictionary of your choice
Increase the time range in the __name__ == "__main__" block
Setup the Oracle drivers and password
Run python copy_samples.py
You can modify the logging levels in the bottom block and see how they affect the output.
Description
This merge requests adds a new recipe to README.md. It shows how to post data to a REST API. The script is modified from code we wrote to post data to the SensorThingsAPI.
To test
This is not a code change, so the purpose of the merge review is to see if there can be improvements to the wording. However, the script does work if you want to test it.
docker run -d --rm --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:7.9.2
db.py
that creates a DbParams class called ORACLE_DB which corresponds to the BGS development databasecopy_samples.py
__name__ == "__main__"
blockpython copy_samples.py
You can modify the logging levels in the bottom block and see how they affect the output.
Check results: