HP Matrix Operating Environment Software manual Sample Python Client

Models: Matrix Operating Environment Software

1 111
Download 111 pages 21.04 Kb
Page 96
Image 96

14 Sample Python Client

The following sample client was developed in Python 2.7.2 with the use of open source libraries. It provides the user with a UI to query the chargeback API and returns the report in a formatted PDF.

To create the sample client environment:

Download and install Python 2.7 from python.org

Download and install Suds, a lightweight SOAP python client for consuming web services, from https://fedorahosted.org/suds/

Download and install the Reportlab Toolkit, a Python library for creating reports in PDF, from http://www.reportlab.com/software/opensource/

Create a directory called ChargebackSample/root

Save connection.py and reports.py in /root/chargeback

Save GUI.py in /root/GUI

Save reports_file.py in /root/reports

Execute the sample as:

>python GUI.py

Figure 6 Sample client UI

Known limitations in the sample:

Only the first page of each report is returned.

The report is filtered by one tenant name (organization ID) or one billing code.

It is not possible to use ‘OR’ to filter reports.

The output path must exist, otherwise the sample will throw an exception.

96 Sample Python Client

Page 96
Image 96
HP Matrix Operating Environment Software manual Sample Python Client