Administrative command interactive mode environment


An admin command can be run in interactive mode by providing the -interactive option in the options string when invoking the command.

We can still provide other options, even when using the interactive option. The options values specified are applied to the command before the command data is displayed. Whether or not other options are specified, the wsadmin tool steps the user through the command to collect command information.

The general interactive flow sequence is:

  1. Collect user inputs for target object and parameters

  2. If the command does not include a step, the command execution menu displays to run or cancel the command.

  3. If the command includes a step, the menu to select the step displays. When all the required inputs are entered, the menu includes command execution.

  4. When a step is selected, if the step supports collection, then the menu to select an object in the collection displays and we can exit the step. If we exit the step, repeat steps 1-3.

  5. Collect user inputs for the selected step or for an object in the collection

  6. Repeat steps 4 and 5 if from the collection step menu

  7. Repeat steps 3-5 if from step selection menu

Depending on what input area is enabled by an admin command, we can go through part or all of the interactive flow sequence. If an administrative command is run in interactive mode, the syntax to run the command except for the deletion of collection object in batch mode is generated and logged as a WASX7278I message in both the interactive session and in the wsadmin trace file.

Collect user inputs for target object and parameters

The following interactive prompt is used to collect inputs for the Target object and Arguments input areas that are displayed in the command-specific help:

Command title

Command Description *target object title [current or default value]: *param1 title (param1 name) [choice1, choice2, ...]: [current/default value] param2 title (param2 name) [choice1, choice2, ...]: [current/default value] ...

This screen is usually the first interactive screen that is displayed when an admin command is invoked interactively unless the invoked command does not contain any target object and non-step command parameters. If a command does not have a target object, then the prompt for the target object is skipped. The number of parameters depends on the number of arguments in the Argument area of the command-specific help. If an input is required, then an asterisk (*) is placed in front of the title. The parameter name is displayed for information and is the name used to set this parameter in batch mode. If a parameter value is restricted to a set of values, then the valid choices are displayed. If current or default value is available, it is displayed. We can accept the existing value by pressing the Enter key. To add or change an existing value, enter a new value and click Enter.

Display command execution menu

If an admin command does not contain a step, we are presented with the following menu after collecting values for target object and parameters:

Command title

F (Finish) C (Cancel)

Select [F, C]: F

The Finish option runs the command and the Cancel option cancels the command. The default selection is F (Finish). This menu is the last menu that is displayed for a non-step command to exit interactive mode by either canceling or running the command.

Display command step selection and execution menu

If an admin command contains a step, the following menu is displayed after collecting values for target object and parameters:

Command title Command description
 -> *1. step1 title (step1 name)
     2. step2 title (step2 name)
    *3. step3 title (step3 name)
    (4. step4 title (step4 name))
     …
     n. stepn title (stepn name)

S (Select) N (Next) P (Previous) F (Finish) C (Cancel) H (Help)

Select [S, N, P, F, C, H]: S

The number of steps that is displayed in the menu depends on the administrative command. The step name is displayed for information and is the name used to set data in this step in batch mode.

The following notations are used to describe a step:

Use the menu, we can navigate through steps sequentially by selecting Previous or Next. Select selects the current step, Finish runs the command, Cancel cancels the command, and Help provides online help for the command. Not all menu choices are available. Previous is not available if the current step is the first step. Next is not available if the current step is the last step. Finish is not available if still steps are still missing required inputs. The default selection is S (Select) if the current step is a valid step and steps are missing required inputs. Default selection is F (Finish) if all the required input is provided for the steps.

For commands with steps, we can exit interactive mode on this menu by either canceling or running the command.

Display collection step menu

A step might or might not support collection. A collection refers to objects of the same type. In an admin command, a collection contains objects that have the same set of parameters. If a step that supports collection is selected, wsadmin displays the following menu to add and select an object in the collection:

Step title (step name)
    | key param1 title (key param1 name), key param2 title (key param2 name), ...
    ---------------------------------------------------------------------------
->  | object1 key param1 value, key param2 value, ...
   *| object2 key param1 value, key param2 value, ...
    ... key param1 title, key param2 title, ... must be provided to specify a row in batch row.

S (Select Row) N (Next) P (Previous) A (Add Row or Add Row Before) D (Delete Row) F (Finish) H (Help)

Select [S, N, P, A, D, F, H]: F

The number of objects that display in the menu depends on the command step. Key parameters are identified by the step to use to uniquely identify an object in a collection. Key parameter values are displayed to identify an object to select. As with the command step selection menu, an arrow (->) is used to indicate the current object position, and a asterisk (*) is used to indicate that required input is missing in the object.

Use the menu to navigate through objects sequentially by selecting Previous or Next. Select Row selects the current object, Add Row adds a new object, Add Row Before adds a new object before the current object, Delete Row deletes the current object, Finish returns control back to the step selection and execution menu, and Help provides on-line help for the step. Not all menu choices are available. Previous is not available if there is no object in the collection or the first object is the current object. Next is not available if there is no object in the collection or the last object is the current object. Select Row is available only if there is a current object. Add Row is provided only if there is no object in the collection and the step supports new object to be added. Add Row Before is provided if the step supports new object to be added and there are existing objects in the collection. Delete Row is provided only if there is a current object and the step supports an object to be deleted. Finish is not available if there are still objects missing required inputs. Default selection is A (Add Row) when there is no object in the collection and the step supports objects to be added. Default selection is S (Select Row) if there is a current object and there are still objects missing required inputs. Default selection is F (Finish) if there is no required input missing in any object.

Collect user inputs for parameters of a collection object

After a collection object is selected, the parameter value for each parameter is prompted sequentially as shown in the following example:

*param1 title (param1 name) [choice1, choice2, ...]: [current/default value]  param2 title (param2 name) [choice1, choice2, ...]: [current/default value]
...

The number of parameters depends on the number of arguments in the Argument area of the command step-specific help. The same asterisk (*) notation is used to denote a required parameter. If a parameter value is restricted to a set of values, then the valid choices are displayed. If the current or default value is available, it is displayed. For each writable parameter, we can accept the existing value by pressing Enter. To add or change an existing value, enter a new value and press Enter. For a read-only parameter, the parameter and its value are displayed. You will not be given the prompt to modify its value. After you go through all of the parameters, wsadmin returns to the collection step menu.

Collect user inputs for non-collection step

This step has two parts. The first part displays the current or default parameter values for the selected step, as shown in the following example:

Step title (step name)

*param1 title (param1 name) [choice1, choice2, ...]: [current/default value]  param2 title (param2 name) [choice1, choice2, ...]: [current/default value]
...

Select [C (Cancel), E (Edit)]: [E]

No prompting is included in this part. Instead, this part is more like a help function providing parameter information on the selected step. The number of parameters depends on the number of arguments in the argument area of the command step specific help. The asterisk (*) notation denotes a required parameter. If a parameter value is restricted to a set of values, then the valid choices will be displayed. If the current or default value is available, it is displayed. We can choose to cancel the step or continue to the next part to provide parameter inputs. The default selection is Edit. Because it is possible that we are seeing default values assigned to a new piece of data not yet set in the step, we can accept the default selection to continue to the next part. Otherwise, if no data exists in the selected step, selecting Cancel does not result in creating the data.

If we accept the default Edit selection, collect user inputs for parameters sequentially just like Collect user inputs for parameters of a collection object.

*param1 title (param1 name) [choice1, choice2, ...]: [current/default value]  param2 title (param2 name) [choice1, choice2, ...]: [current/default value]
...

For each writable parameter, we can accept the existing value by pressing Enter. To add or change an existing value, enter a new value and then press Enter. For a read-only parameter, the parameter and its value are displayed. You will not be given the prompt to modify the value of the parameter. As soon as you step through all the parameters, wsadmin will lead you back to the command step selection and execution menu.



 

Related tasks


Invoking an admin command in interactive mode