users@glassfish.java.net

Re: Improving asadmin interactive mode

From: Lloyd L Chambers <Lloyd.Chambers_at_Sun.COM>
Date: Thu, 13 Jul 2006 13:00:22 -0700

Jane,

First, I think that interactive mode should be the default. Anyone
writing a script could add --nointeract or something like that. An
environment variable could be used to avoid backward-compatibility
issues.

Here is how I see your example working. User input is in bold.

asadmin> create-jdbc-resource --interactive my_jdbc_resource
Required option '--connectionpoolid' has not been specified.
Required option '--user' has not been specified.
Required option '--passwordfile' has not been specified.

You will now be prompted for required values.
Enter '?' or 'help' for assistance.

Enter value for option '--user' [admin]> <RETURN>
Enter the password for user 'admin' > ?
Enter the password specific to the administrative user 'admin' (not
the master password).

Enter the password for user 'admin' > *******

Enter value for option '--connectionpoolid' [test-pool]> ?
Available values are {'test-pool', 'default-pool', 'my-pool' }.

Enter value for option '--connectionpoolid' [test-pool]> <RETURN>

create-jdbc-resource --user admin --connectionpoolid test-pool
my_jdbc_resource
Execute this command? [y ] > <RETURN>

Created JDBC resource 'my_jdbc_resource' successfully.



On Jul 10, 2006, at 4:49 PM, Jane Young-Lau wrote:

> Hi All,
>
> I'd like to solicit your opinion on how CLI (asadmin) prompts for
> options.
>
> Currently, if --interactive is true, asadmin would prompt for the
> user and password. It does not prompt for the required options.
>
> For example, let's take create-jdbc-resource command:
> >asadmin create-jdbc-resource --interactive jdbc_resource
> CLI014 connectionpoolid is a required option.
>
> Though --interactive is true, the command fails since it requires
> that you enter --connectionpoolid option on the command line. If
> you provide the --connectionpoolid option, the command will prompt
> the user for the user and password:
> >asadmin create-jdbc-resource --interactive --connectionpoolid
> testPool jdbc_resource
> Please enter the admin user name>admin
> Please enter the admin password>
> Command create-jdbc-resource executed successfully.
>
> The user and password options are prompted since I have not login'd
> to the domain using "asadmin login" command.
>
> Would you like to see that asadmin commands also prompt for the
> required options as well as the user/password options? Would this
> be a feature well received? Keep in mind that asadmin is mainly
> use for scripting.
>
> I'd like to know the following:
> YES - adding prompting of required options benefits the usability
> of asadmin
> NO - stay status quo. prompting of user/password is good enough
> Other suggestions?
>
> Let me know your opinion.
>
> Thank you,
> Jane
>
>