The DIF web service interface can be used to create on-demand reports. A web request can be made using a browser to the DIF web interface. DTS has tested the online report generation interface on the following PC browsers:
- Microsoft Internet Explorer
- Google Chrome
- Mozilla Firefox
- Apple Safari
For example, the following link can be used at the DTS development site to request a TS7700 online replication report that will be displayed in the browser:
http://mp3000:12/XML:rexx+rmon+t77sp6
Online Report Overview
The DIF web service interface can be used to create on-demand reports. A
web request can be made using a browser to the DIF web interface. For
this example, the request runs a Rexx routine called rmon with one
parameter: T77SP6. The rmon Rexx routine is located in a
partitioned dataset member allocated to the DIFPARMLIB DD statement in the DIF started task.
The rmon routine parses its arguments and constructs a DIF command to
create a Monitor started task that uses the MONRUNM execution JCL. A sample
of the Rexx logic and commands follows:
PARSE ARG MEM P
MEM = STRIP(MEM,'T')
P = STRIP(P,'T')
CMD="E OSJOB MONRUNM TCP NOPING"
CMD=CMD "*P='FILES=*,XML,PNAME="||MEM||","||P||"'"
QUEUE CMD
The goal of the rmon Rexx routine is to construct the DIF command that
creates a Monitor started task using the MONRUNM execution JCL. The
MONRUNM proc should reside in a system procedure library (for example, a
sample copy is in the DTS.R61.SLyyddd.SAMPLIB dataset). Technically, the
Rexx routine is not required, but it greatly simplifies the URL required for the web
request.
E OSJOB MONRUNM TCP NOPING *P='FILES=*,XML,PNAME=T77SP6,P'
The MONRUNM started task runs the T77SP6 monitor job and
returns the XML records to the browser. The monitor started task uses exactly the same
Monitor request as the Point-in-Time HNODE Grid call used in the TS7700
ISPF interface. Both the started task and the ISPF request produce records about the current
replication status of the grids. The ISPF application converts the records to an ISPF table
for the TSO user.
T77SP6 member specifies the name of a stylesheet member used to transform
the XML data into HTML for display. The html transformation is requested by the
xml-stylesheet processing instruction and uses XSLT.Example XML data returned by the monitor (excerpt):
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="XSL-DL+HTML+T77SP6$"?>
<root>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="R1">
<xs:complexType>
<xs:sequence>
<xs:element name="MACHINE_SERIAL" type="xs:string"/>
<xs:element name="IMED_COPY_QUEUE" type="xs:string"/>
<xs:element name="DEF_COPY_QUEUE" type="xs:string"/>
<xs:element name="ACTIVE_COPY" type="xs:string"/>
<xs:element name="V-LINK_STATE" type="xs:string"/>
<xs:element name="DATA_INTO" type="xs:string"/>
<xs:element name="DATA_FROM" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<R1>
<MACHINE_SERIAL>78-H2523</MACHINE_SERIAL>
<IMED_COPY_QUEUE>0</IMED_COPY_QUEUE>
<DEF_COPY_QUEUE>0</DEF_COPY_QUEUE>
<ACTIVE_COPY>0</ACTIVE_COPY>
<V-LINK_STATE>OK</V-LINK_STATE>
<DATA_INTO>0</DATA_INTO>
<DATA_FROM>0</DATA_FROM>
</R1>
<R1>
<MACHINE_SERIAL>78-H2525</MACHINE_SERIAL>
<IMED_COPY_QUEUE>0</IMED_COPY_QUEUE>
<DEF_COPY_QUEUE>0</DEF_COPY_QUEUE>
<ACTIVE_COPY>0</ACTIVE_COPY>
<V-LINK_STATE>OK</V-LINK_STATE>
<DATA_INTO>0</DATA_INTO>
<DATA_FROM>4</DATA_FROM>
</R1>
...
</root>
Once the PC browser receives the XML data returned by the DIF web
request, the browser processes the xml-stylesheet processing instruction and makes a second
web request to obtain the T77SP6$ stylesheet (from the HTML DD statement in
the DIF started task). By default the HTML DD statement points to the
same DTS.R61.RPTLIB dataset that contains the DDBLM monitor job used to
create the XML data.
The T77SP6$ stylesheet used for the XML-to-HTML transformation
(excerpt):
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<table border="1">
<tr bgcolor="#9acd32">
<th>Cluster</th>
<th>IMED Copy Q</th>
<th>DEF Copy Q</th>
<th>Active Copy</th>
<th>Data In</th>
<th>Data Out</th>
</tr>
<xsl:for-each select="root/R1">
<tr>
<td><xsl:value-of select="MACHINE_SERIAL"/></td>
<td><xsl:value-of select="IMED_COPY_QUEUE"/></td>
<td><xsl:value-of select="DEF_COPY_QUEUE"/></td>
<td><xsl:value-of select="ACTIVE_COPY"/></td>
<td><xsl:value-of select="DATA_INTO"/></td>
<td><xsl:value-of select="DATA_FROM"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Once the browser has transformed the XML dataset to HTML, the page is displayed for the user:
|
|