dev@glassfish.java.net

Re: target as option or operand?

From: Jane Young <jane.young_at_oracle.com>
Date: Fri, 25 Jun 2010 16:28:15 -0700

In v2, all the list-* commands take target as operand.

e.g.
*list-components [--terse=false] [--echo=false] [--interactive=true]
[--host localhost] [--port 4848|4849] [--secure | -s] [--user
admin_user] [--passwordfile filename] [--type
application|ejb|web|connector|webservice|extension] [target (Default
server)]*

list-jmsdest [--terse=false] [--echo=false] [--interactive=true] [--host
localhost] [--port 4848|4849] [--secure | -s] [--user admin_user]
[--passwordfile file_name] [--desttype|-T topic|queue] [target (Default
server)]

list-jdbc-resources"
classname="com.sun.enterprise.cli.commands.GenericCommand"
numberofoperands="?" usage-text="list-jdbc-resources [--terse=false]
[--echo=false] [--interactive=true] [--host localhost] [--port
4848|4849] [--secure | -s] [--user admin_user] [--passwordfile
file_name] [target (Default server)]"

list-connector-resources"
classname="com.sun.enterprise.cli.commands.GenericCommand"
numberofoperands="?" usage-text="list-connector-resources
[--terse=false] [--echo=false] [--interactive=true] [--host localhost]
[--port 4848|4849] [--secure | -s] [--user admin_user] [--passwordfile
file_name] [target(Default server)]"

list-custom-resources"
classname="com.sun.enterprise.cli.commands.GenericCommand"
numberofoperands="?" usage-text="list-custom-resources [--terse=false]
[--echo=false] [--interactive=true] [--host localhost] [--port
4848|4849] [--secure | -s] [--user admin_user] [--passwordfile
file_name] [target(Default server)]
*
list-jndi-resources"
classname="com.sun.enterprise.cli.commands.GenericCommand"
numberofoperands="?" usage-text="list-jndi-resources [--terse=false]
[--echo=false] [--interactive=true] [--host localhost] [--port
4848|4849] [--secure | -s] [--user admin_user] [--passwordfile
file_name] [target(Default server)]*

list-persistence-resources"
classname="com.sun.enterprise.cli.commands.GenericCommand"
numberofoperands="?" usage-text="list-persistence-resources
[--terse=false] [--echo=false] [--interactive=true] [--host localhost]
[--port 4848|4849] [--secure | -s] [--user admin_user] [--passwordfile
file_name] [target(Default server)]

list-javamail-resources"
classname="com.sun.enterprise.cli.commands.GenericCommand"
numberofoperands="?" usage-text="list-javamail-resources [--terse=false]
[--echo=false] [--interactive=true] [--host localhost] [--port
4848|4849] [--secure | -s] [--user admin_user] [--passwordfile
file_name] [target(Default server)]

etc...

This is an incompatibility bug in v3.1

Jane


Bill Shannon wrote:
> Someone with more history should probably answer as to whether there
> was an original design here. It's always felt to me like it was random.
>
> The closest I've been able to come up with is that --target is just
> a qualifier to what you're doing, but you're operating on something
> else. When the target is an operand (e.g., create/start/stop-instance,
> create/start/stop-cluster, etc.), it's actually the thing you're
> operating on.
>
> But that doesn't explain the many "list" commands that take a target
> as an operand. I would've expected the operand to be the name(s)
> of the things you're listing.
>
>
> Cheng Fang wrote on 06/25/10 03:15 PM:
>> I noticed some commands take target operand, and others take target
>> options. What's the rules for providing target value?
>>
>> For ex:
>>
>> asadmin list-components --target cluster1 (Failed as option)
>> Invalid option: --target
>>
>> asadmin list-components cluster1 (Passed as operand)
>> Command list-components executed successfully on server instance
>> instance1
>> Command list-components executed successfully on server instance
>> instance2
>>
>> (The doc says for list-components, the target operand is deprecated and
>> ignored. But it turns out it's still significant)
>>
>>
>> asadmin list-jndi-resources --target cluster1 (Passed as option)
>> Command list-jndi-resources executed successfully on server instance
>> instance1
>> Command list-jndi-resources executed successfully on server instance
>> instance2
>>
>> asadmin list-jndi-resources cluster1 (Failed as operand)
>> Command list-jndi-resources does not accept any operands
>>
>> Thanks,
>> -cheng
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>