Executing Jython scripts
The following table describes the adapter request elements for executing Jython scripts.
Adapter request elements for executing Jython scripts
Element | Definition | Required |
---|---|---|
<command> | Contains the name of the Jython script to execute | Yes |
<user-role> | Specifies the user role for executing the Jython script | No |
The following figure shows a sample adapter request for executing a Jython script:
<bladelogic-request>
<request-data>
<command executable-type="jython">depotgrp_getdbkey_args.jy</command>
</request-data>
</bladelogic-request>
The following figure illustrates the adapter response for the Jython script:
<bladelogic-response>
<metadata>
<status>success</status>
</metadata>
<targets-output>
<target-output>
<metadata>
<os-id>Windows 2003</os-id>
<os-version>5.2</os-version>
<os-arch>x86</os-arch>
<status>success</status>
</metadata>
<commands-output>
<command-output>
<metadata>
<command>C:\"Program Files"\BladeLogic\OM\bin\bljython.bat c:\demo\depotgrp_getdbkey_args.jy"</command>
<line-count>1</line-count>
<execution-milliseconds>4843</execution-milliseconds>
<exit-code>0</exit-code>
<status>success</status>
</metadata>
<output>
<line index="1">DBKey:SBLGroupKey:1000002</line>
</output>
</command-output>
</commands-output>
</target-output>
</targets-output>
</bladelogic-response>
The following figure illustrates another sample adapter request for executing a Jython script:
<bladelogic-request>
<command executable-type="jython" timeout-secs="300" script-directory="/data/">test.jy</command>
</bladelogic-request>
The following figure shows the adapter response for the Jython script execution:
<bladelogic-response>
<metadata>
<status>success</status>
</metadata>
<targets-output>
<target-output>
<metadata>
<os-id>Linux</os-id>
<os-version>2.6.9-67.ELsmp</os-version>
<os-arch>i386</os-arch>
<status>success</status>
</metadata>
<commands-output>
<command-output>
<metadata>
<command>/opt/bmc/BladeLogic/8.0/NSH/bin/bljython "/data1/test.jy"</command>
<line-count>1</line-count>
<execution-milliseconds>32</execution-milliseconds>
<exit-code>0</exit-code>
<status>success</status>
</metadata>
<output>
<line index="1">ASP2</line>
</output>
</command-output>
</commands-output>
</target-output>
</targets-output>
</bladelogic-response>