Red Hat Training

A Red Hat training course is available for Red Hat Fuse

Chapter 5. Managing SwitchYard with JBoss Management CLI

5.1. About the Management Command Line Interface (CLI)

The Management Command Line Interface (CLI) is a command line administration tool for JBoss EAP 6.
Use the Management CLI to start and stop servers, deploy and undeploy applications, configure system settings, and perform other administrative tasks. Operations can be performed in batch mode, allowing multiple tasks to be run as a group.

5.2. Launch the Management CLI

Procedure 5.1. Launch CLI in Linux or Microsoft Windows Server

    • Launch the CLI in Linux

      Run the EAP_HOME/bin/jboss-cli.sh file by entering the following at a command line:
      $ EAP_HOME/bin/jboss-cli.sh
    • Launch the CLI in Microsoft Windows Server

      Run the EAP_HOME\bin\jboss-cli.bat file by double-clicking it, or by entering the following at a command line:
      C:\>EAP_HOME\bin\jboss-cli.bat

5.3. Quit the Management CLI

From the Management CLI, enter the quit command:
[domain@localhost:9999 /] quit

5.4. Connect to a Managed Server Instance Using the Management CLI

Procedure 5.2. Connect to a Managed Server Instance

  • Run the connect command

    From the Management CLI, enter the connect command:
    [disconnected /] connect
    Connected to domain controller at localhost:9999
    • Alternatively, to connect to a managed server when starting the Management CLI on a Linux system, use the --connect parameter:
      $ EAP_HOME/bin/jboss-cli.sh --connect
    • The --connect parameter can be used to specify the host and port of the server. To connect to the address 192.168.0.1 with the port value 9999 the following would apply:
      $ EAP_HOME/bin/jboss-cli.sh --connect --controller=192.168.0.1:9999

5.5. Deploy an Application in a Standalone Server Using the Management CLI

Procedure 5.3. Deploy an Application in a Standalone Server

  • Run the deploy command

    From the Management CLI, enter the deploy command with the path to the application deployment.
    [standalone@localhost:9999 /] deploy /path/to/test-application.war
    Note that a successful deploy does not produce any output to the CLI.
Result

The specified application is now deployed in the standalone server.

5.6. Undeploy an Application in a Standalone Server Using the Management CLI

Procedure 5.4. Undeploy an Application in a Standalone Server

By default the undeploy command will undeploy and delete the deployment content from a standalone instance of JBoss EAP. To retain the deployment content, add the parameter --keep-content.
  • Run the undeploy command

    To undeploy the application and delete the deployment content, enter the Management CLI undeploy command with the filename of the application deployment.
    [standalone@localhost:9999 /] undeploy test-application.war
    To undeploy the application, but retain the deployment content, enter the Management CLI undeploy command with the filename of the application deployment and the parameter --keep-content.
    [standalone@localhost:9999 /] undeploy test-application.war --keep-content
Result

The specified application is now undeployed. Note that the undeploy command does not produce any output to the Management CLI if it is successful.

5.7. Management CLI commands for SwitchYard

Note

This chapter contains information for standalone mode only, as JBoss Fuse Service Works 6.0 does not support JBoss EAP run in domain mode.
There are commands that are available for SwitchYard. To access the commands you first have to operate in the SwitchYard subsystem.
Ensure that you have started the Management CLI and connected to it.
The Management CLI employs tab completion in two ways:
  • By completing partially entered commands if there is enough entered for it to be unique.
  • By presenting a list of options if a unique result cannot be found, or if the command is missing.
If you enter the following command and press tab, you will get a list of operations available for the SwitchYard subsystem.
[standalone@localhost:9999 /] /subsystem=switchyard:
The available operations for the SwitchYard subsystem are:

Table 5.1. JBoss EAP Management CLI operations available for SwitchYard subsystem

Operation Name Function
get-version
This will show the version of SwitchYard currently running on the JBoss EAP instance.
list-applications
This shows a list of the SwitchYard applications currently running on the JBoss EAP instance.
list-references
Lists the references used for SwitchYard applications currently running on the JBoss EAP instance.
read-application
This lists the details for SwitchYard applications running on the JBoss EAP instance.
read-references
Lists the references used by SwitchYard applications running on the JBoss EAP instance.
read-service
Lists the services and details used by SwitchYard applications running on the JBoss EAP instance.
reset-metrics
Reset the message metrics for the SwitchYard subsystem.
show-metrics
List the message metrics for the SwitchYard subsystem.
start-gateway
Start the gateway for a SwitchYard service.
stop-gateway
Stop the gateway for a SwitchYard service.
update-throttling
Update message throttling for a SwitchYard service.
stop-gateway
Stop the gateway for a SwitchYard service.
uses-artifacts
Lists the artifacts used throughout the SwitchYard subsystem.
Enter the operations in the following format, replacing operation-name with one of the operation names from the list above:
[standalone@localhost:9999 /] /subsystem=switchyard:operation-name
The response will vary depending on the operation entered.

Note

For more information about the JBoss EAP Management CLI, see the Red Hat JBoss Enterprise Application Platform 6.1 Administration and Configuration Guide