Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 2.17 KB

README.md

File metadata and controls

51 lines (33 loc) · 2.17 KB

RestToOPCUAServer

Converts a Rest API to an OPC UA Server that calls the REST API every second

Requirements

Python 3.7

UAExpert or any other OPC UA Client https://www.unified-automation.com/de/produkte/entwicklerwerkzeuge/uaexpert.html

Install

git clone https://github.com/upohl/RestToOPCUAServer.git

cd RestToOPCUAServer

pip install requirements.txt

Examples

Starts OPC UA Server on default port 4840 and calls default rest url (http://api.open-notify.org/iss-now.json) every second

python resttoopcuaserver.py

Starts OPC UA Server on port 4841 and calls default rest url (http://api.open-notify.org/iss-now.json) every second

python resttoopcuaserver.py -p 4841

Starts OPC UA Server on default port 4840 and delimter ":"

python resttoopcuaserver.py -d :

Starts OPC UA Server on default port 4840 and default rest url http://api.open-notify.org/iss-now.json every 5 seconds

python resttoopcuaserver.py -c 5

Starts OPC UA Server on default port 4840 and rest url https://api.coincap.io/v2/assets/bitcoin

python resttoopcuaserver.py -u https://api.coincap.io/v2/assets/bitcoin

Starts OPC UA Server on port 4841, delimter '.' and rest url https://api.coincap.io/v2/assets/bitcoin every 5 seconds

python resttoopcuaserver.py -p 4841 -d . -u https://api.coincap.io/v2/assets/bitcoin -c 5

Starts OPC UA Server on default port 4840, and rest url https://postman-echo.com/basic-auth with username "postman" and password "password"

python resttoopcuaserver.py --url https://postman-echo.com/basic-auth --username postman --password password

Starts OPC UA Server on default port 4840, and rest url with apikey https://notexisting.com/?key=dsfhusdhfisd78z789sdf

ATTENTION: URL and APIKEY are not EXITING. Only for documentation purpose. python resttoopcuaserver.py --url https://notexisting.com/?key=dsfhusdhfisd78z789sdf

Screenshot of OPC UA CLient UAExpert Browsing the Example

Screenshot of OPC UA CLient UAExpert Browsing the Example

Public APIs

Currently GET API Calls without Authentication are supported without adapting the code https://github.com/public-apis/public-apis