Generating WebSphere administrative commands to assist in developing Jython scripts

Use the WebSphere® Administration Command assist tool to generate WebSphere administrative (wsadmin) commands for Jython scripting language as you interact with the WebSphere Administrative Console. When you perform server operations in the WebSphere Administrative Console, the WebSphere Administration Command assist tool captures and displays the wsadmin commands issued. You can transfer the output from the WebSphere Administration Command view directly to a text editor, such as the Jython editor, enabling you to develop Jython scripts based on actual console actions.

The columns in the WebSphere Administration Command view displays details about the generated wsadmin command:

Table 1. Columns of the WebSphere Administration Command view
Column Description
Description Displays a message identifier for WAS followed by the wsadmin method issued.

The message identifier can be either 8 or 9 characters in length and has the form: CCCC1234X, where CCCC is a four character alphabetic component or application identifier, 1234 is a four character numeric identifier used to identify the specific message for that component and X is an optional alphabetic severity indicator. (I=Informational, W=Warning, E=Error). For details on the message reference on a particular message identifer, search on the message identifer in the WAS Information Center.

Command Displays the wsadmin object, method and the actual values pass into the parameter when the command is issued.
Time The date and timestamp of when the command is issued in the Administrative console.
User The user ID logged into the Administrative console session.

Restriction:

Prerequisite

To generate wsadmin commands as you interact with the WebSphere Administrative console:

  1. Enable the command assistance notification option in the WebSphere administrative console:

    1. Open the workbench of the product. For example, the

      IBM® Rational® Software Delivery Platform.

    2. In the Servers view, right-click the server and select

      Administration | Run administrative console. The Administrative Client logon window opens in the Web Browser view.

    3. If the server is secured, specify the user ID and password to access the administration console.

    4. On the left-pane, expand

      Applications | Enterprise Applications

    5. Scroll to the right of the Enterprise Application page and under the

      Command Assistance section click the

      View administrative scripting command for last action link.

    6. Expand

      Preferences.

    7. Select the

      Enable command assistance notifications check box. Click

      Apply.

  2. In the Servers view, right-click the server and select

    Administration | WebSphere administration command assist. The WebSphere Administration Command view opens.

  3. In the

    Select Server to Monitor list , specify the servers with a check mark that you want the tool to monitor as you interact with its Administrative console. The

    Select Server to Monitor list is available in the toolbar of the WebSphere Administration Command view.

    Restriction: The server you want to monitor needs to be started, started in profile or debug mode. The server is disabled for selection in the

    Select Server to Monitor list when the server is stopped.

  4. (Optional) If you want to prevent the Console view from displaying on the workbench each time standard output or error is displayed, select

    Windows | Preferences | Run/Debug | Console. Clear the

    Show when program writes to standard out and

    Show when program writes to standard error check boxes. Click

    Apply | OK.

  5. Perform your server operations in the Administrative console. As you interact with the Administrative console, the WebSphere Administration Command view is populated with wsadmin commands for Jython.

    1. To run the Administrative console within the workbench, in the Servers view, right-click the server and select

      Administration | Run administrative console.

  6. (Optional) If you want to keep track of a particular command or a set of commands in the WebSphere Administrative Command view, use the

    Scroll Lock feature.

    1. In the WebSphere Administrative Command view, select a command or a set of commands (SHIFT + Arrow keys).

    2. In the toolbar WebSphere Administrative Command view, select the

      Scroll Lock button. The Scroll Lock feature highlights any selected commands and keeps the first selected command within the WebSphere Administration Command view while you issue additional server operations in the Administrative console.

  7. (Optional) If you want to see the wsadmin object, method and the actual values pass into the parameter when the command is issued. select and hover the command in the WebSphere Administration Command view. A floating window appears that contains the documentation for the wsadmin method.

  8. (Optional) If you want to see additional help documentation on a wsadmin object, right-click the command in the WebSphere Administration Command view and select

    wsadmin Command Help (or in the toolbar click the

    View Online Help button). The browser displays the wsadmin object documentation for the selected command. The documentation is provided by the WebSphere Information Center.

  9. To transfer the wsadmin commands generated in the WebSphere Administration Command view to the Jython script:

    1. Open the Jython script you want to insert the generated wsadmin commands.

      Restriction: The Jython script requires to be open in a text editor within the workbench for the transfer to occur successfully. The text editor recommended is the Jython editor.

    2. In the text editor, place the cursor to the position where you want to insert the generated wsadmin command.

    3. In the WebSphere Administration Command, right-click the command and select

      Insert (or in the toolbar click the

      Insert to Editor button).

      Tip: You can transfer multiple commands into the text editor by selecting multiple commands (SHIFT + Arrow key), right-click the commands in the WebSphere Administration Command view and select

      Insert.

  10. (Optional) If you want to remove commands from the WebSphere Administration Command view, right-click the command and select

    Remove (or in the toolbar click the

    Remove Command button).