Python-based command line tools for accessing a WebCTRL server via its WSDL interface
Python Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
EXAMPLES
README
__init__.py
build_project.sh
wc_getReport.py
wc_getTrend.py
wc_getValue.py
wc_monitor.py
wc_query.py

README

Python-based command line tools for accessing a WebCTRL server via its WSDL interface

Prerequisits
------------

1) Python 2.7
2) In order to use the WSDL API you need to download and install the SUDS python package
    Download suds-0.4.tar.gz here: https://pypi.python.org/pypi/suds
	Install via command line: $ sudo pip install suds-0.4.tar.gz
3) If you don't want to execute the scripts from within an IDE (e.g. Pycharm) you could install 
    pythoninstaller to build the tools: $ sudo pip install pyinstaller

Building the tools
------------------

webctrl$ ./build_project.sh

The executables wc_* can be found in ./bin

Add the bin directory to the PATH environment variable (in your ~/.bashrc) in order to be able to
execute the wc_* commands everywhere:
export PATH="$PATH:/path/to/webctrl/bin"

Running the tools
-----------------

e.g.: webctrl$ ./dist/wc_query/wc_query

Use -h or --help with all tools in order to find out more about how to use them.

Short explanation of each tool
------------------------------

wc_query : Query the paths and devices starting from /trees/geographic

wc_getReport : Retrieve a report for a directory or a specific device

wc_getValue : Retrieve the current value of a device

wc_getTrend : Retrieve data and date for a given time period and device

wc_monitor : Monitor a specific controller; every time the value changes time and value are displayed

Usage of the tools in another python script
-------------------------------------------

Analogous to the command line usage

./wc_query -u wsdl -n '/trees/geographic' -url 'https://webctrl.rz-berlin.mpg.de'

wc_query can be used as follows in another python script, say, ~/test.py:

import wc_query
myDictonary = {'username':'wsdl', 'password':'seife', 'node':'/trees/geographic', 'url':'https://webctrl.rz-berlin.mpg.de'}
wc_query.main(myDictonary)

To be able to import the wc_* tools append to the PYTHONPATH the webctrl directory. There are two possible ways:
    1) Set the PYTHONPATH environment variable in the shell in which you run your python script that uses the tool(s):
        export PYTHONPATH="$PYTHONPATH:/path/to/webctrl"
    2) Set the python path inside the python script before the import statement:
        sys.path.append('/path/to/webctrl')