Monitoring has become an interesting topic around DataPower. As number of boxes are growing in a company, it become important that a easy to use user-interface should be available to monitor DataPower.
ITCAM is one solution that IBM gives but few companies don't want to buy ITCAM, It does lot of thing but has very few option of customization. For example, if a admin wants to know all services running in DataPower with backend details assuming that they understand the filesystem, they can't do it. Other kind of tools available or mentioned in developerworks are using SOMA that calls DataPower and collect reports/statistics. Tools written outside DataPower box use Java or some other programming code to make SOMA call to DataPower. but that require extra infrastructure to run that tool. It also has problem that now anyone who understands SOMA can create any request and will try to capture the information from DataPower which they're not supposed to know.
Appliance Reporting API is no different except it's creating and running SOMA in DataPower and each request is associated with a HTTP GET URL which makes it easy to use API. APIs has become popular so I thought lets put an API let Admins to use it the way they want. They can use in SoapUI, Postman Chrome Plugin or a HTML page.
Appliance Reporting API that runs in DataPower and just accessible via HTTP URL. It doesn't allow anyone to do anything else outside provided by API though it's still using SOMA. Plus because its running in DataPower, it can use DataPower extension functions/flle-system to create any statistics/report requested. For example, I created one reports which tells all certificates available in DataPower will their details like CN/exprityDate/CA etc. We can find Cert names using SOMA but to find detail about each of those cert, we need cert-detail() extension function.
Each report belongs to a XSL file attached to URI. So adding a new report is just matter of created a new XSL and associate it with URI.
I'm just attaching one sample XSL file.
<!-- Get Query Parameters -->
<xsl:message dp:priority="debug">domain '<xsl:value-of select="$domain"/>'</xsl:message>
<!-- Get the names of all Certs used -->
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:man="http://www.datapower.com/schemas/management">
<xsl:message dp:priority="debug">getCertNames '<xsl:copy-of select="$getCertNames"/>'</xsl:message>
<!-- Calling SOMA and get the Response -->
<xsl:variable name="getCertNamesResponse" select="dp:soap-call('https://127.0.0.1:5550/service/mgmt/current',$getCertNames/*,'SelfCerXSLT_SSLProfile',0,'',$httpHeaders/*)"/>
<xsl:message dp:priority="debug">getCertNamesResponse '<xsl:value-of select="$getCertNamesResponse"/>'</xsl:message>
<xsl:variable name="certAlice" select="./@name"/>
<xsl:if test="string-length($cert-data/Error) > 0">
<xsl:if test="string-length($cert-data/Error) = 0">
<xsl:value-of select="'All Ok'"/>
(If you need any more information related to same, please email me on email@example.com)