Skip to content

Instantly share code, notes, and snippets.

@ftntming
Forked from gustavoapolinario/wildfly-cli
Created September 30, 2022 01:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ftntming/50b2df816f0fd3652205eb2f6f7ca2f5 to your computer and use it in GitHub Desktop.
Save ftntming/50b2df816f0fd3652205eb2f6f7ca2f5 to your computer and use it in GitHub Desktop.
wildfly-cli / jboss-cli
wildfly-cli / jboss-cli common commands
# Connect into wildfly/jboss cli (only with wildfly up)
$JBOSS_HOME/bin/jboss-cli.sh --connect
# Wildfly cli offline
$JBOSS_HOME/bin/jboss-cli.sh --commands="embed-server,$COMMAND,stop-embedded-server"
# Commands:
/system-property=VAR_NAME:add(value=VAR_VALUE)
eg: /system-property=DB_IP:add(value=$DB_IP)
# Commands to descovery how to use
cd $DIR
eg: cd /subsystem=undertow
# Show all items in currenct location
ls
# Show resources from this location
:read-resource
eg: /subsystem=undertow:read-resource
# Show resources from this location recursive
:read-resource(recursive=true)
eg: /subsystem=undertow:read-resource(recursive=true)
# Show resource description
:read-resource-description(operations=true)
# Show operations permitted
:read-operation-names
# Show environments
/core-service=server-environment:read-resource(recursive=true,include-runtime=true)
# Execute expression
:resolve-expression(expression=$CMD)
eg: /:resolve-expression(expression=${DB_IP})
eg: /:resolve-expression(expression=${env.SO_ENVIRONMENT})
# Read Attr
:read-attribute(name=ATTR_NAME)
eg: /host=HOST_NAME/server:read-attribute(name=server-group)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment