HP CloudSystem Matrix/Matrix Operating Environment 7.2 Integration Interfaces API and CLI Operations Reference Guide

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.
109