Apr 30, 2018

Comparison of CLI commands between GlassFish and WildFly



GlassFishWildFly
List all available commandsasadmin list-commandsjboss-cli.sh -c "help --commands"
Display help infoasadmin --helpjboss-cli.sh --help
Check versionasadmin versionjboss-cli.sh version
Start server or domainasadmin start-domainstandalone.sh, or domain.sh
Stop server or domainasadmin stop-domainjboss-cli.sh -c :shutdown
Restart server or domainasadmin restart-domainjboss-cli.sh -c ":shutdown(restart=true)"
Start in debug modeasadmin start-domain -d
asadmin start-domain --debug
standalone.sh --debug
Deploy an app with CLIasadmin deploy ~/test.warjboss-cli.sh -c "deploy ~/test.war"
Undeploy the test.war appasadmin undeploy testjboss-cli.sh -c "undeploy test.war"
List deployed appsasadmin list-applications
asadmin list-components
asadmin list-applications -l
asadmin list-components --long
jboss-cli.sh -c deploy
jboss-cli.sh -c undeploy
jboss-cli.sh -c "deploy -l"
jboss-cli.sh -c "undeploy -l"
jboss-cli.sh -c "ls deploy"
Add a server system propertyasadmin create-jvm-options -Dbuzz="This is i88.ca"jboss-cli.sh
-c "/system-property=buzz:add(value='This\ is\ i88.ca')"
List all server system propertiesasadmin list-jvm-optionsjboss-cli.sh -c "/system-property=*:read-resource"
Create a string or primitive JNDI resourceasadmin create-custom-resource
--restype=java.lang.Boolean
--factoryclass=
org.glassfish.resources.custom.factory.PrimitivesAndStringFactory
--property value=true resource/flag
jboss-cli.sh -c
"/subsystem=naming/binding=
java\:global\/env\/flag:add(
binding-type=simple, type=boolean, value=true)"
List datasourcesasadmin list-jdbc-resourcesjboss-cli.sh -c
"/subsystem=datasources:read-resource-description"
Create datasource using the default db configasadmin create-jdbc-resource --connectionpoolid DerbyPool jdbc/testjboss-cli.sh -c "data-source add --name=test-ds --jndi-name=java\:jboss\/datasources\/test-ds --driver-name=h2 --connection-url=jdbc\:h2\:mem\:test;DB_CLOSE_DELAY\=-1"

jboss-cli.sh -c "data-source enable --name=test-ds"
Delete a datasourceasadmin delete-jdbc-resource jdbc/testjboss-cli.sh -c "data-source remove --name=test-ds"
Batch processing based on file inputasadmin multimode --file /tmp/glassfish-cli-commands.txtjboss-cli.sh -c "batch --file=/tmp/jboss-cli-commands.txt"